Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

fw.h File Reference

Go to the source code of this file.

Defines

#define FW_OP_ALLOW   1
#define FW_OP_BLOCK   2
#define FW_DIR_IN   1
#define FW_DIR_OUT   2
#define fw_pack_rule(rule, dev, op, dir, p, s, d, sp1, sp2, dp1, dp2)

Typedefs

typedef fw_handle fw_t
typedef int(* fw_handler )(const struct fw_rule *rule, void *arg)

Functions

__BEGIN_DECLS fw_tfw_open (void)
int fw_add (fw_t *f, const struct fw_rule *rule)
int fw_delete (fw_t *f, const struct fw_rule *rule)
int fw_loop (fw_t *f, fw_handler callback, void *arg)
fw_tfw_close (fw_t *f)


Define Documentation

#define FW_DIR_IN   1
 

Definition at line 28 of file fw.h.

Referenced by arg_to_fr(), format_rule(), fr_to_fwc(), fr_to_ipfw(), fr_to_pr(), fwc_to_fr(), ipf_to_rule(), ipfw_to_fr(), parse_rule(), pr_to_fr(), print_rule(), and rule_to_ipf().

#define FW_DIR_OUT   2
 

Definition at line 29 of file fw.h.

Referenced by arg_to_fr(), fwc_to_fr(), ipf_to_rule(), ipfw_to_fr(), parse_rule(), and pr_to_fr().

#define FW_OP_ALLOW   1
 

Definition at line 25 of file fw.h.

Referenced by arg_to_fr(), format_rule(), fr_to_fwc(), fr_to_ipfw(), fr_to_pr(), fwc_to_fr(), ipf_to_rule(), ipfw_to_fr(), parse_rule(), pr_to_fr(), print_rule(), and rule_to_ipf().

#define FW_OP_BLOCK   2
 

Definition at line 26 of file fw.h.

Referenced by arg_to_fr(), fwc_to_fr(), ipf_to_rule(), ipfw_to_fr(), parse_rule(), and pr_to_fr().

#define fw_pack_rule rule,
dev,
op,
dir,
p,
s,
d,
sp1,
sp2,
dp1,
dp2   ) 
 

Value:

do {                                                                    \
        strlcpy((rule)->fw_device, dev, sizeof((rule)->fw_device));     \
        (rule)->fw_op = op; (rule)->fw_dir = dir;                       \
        (rule)->fw_proto = p;                                           \
        memmove(&(rule)->fw_src, &(s), sizeof((rule)->fw_src));         \
        memmove(&(rule)->fw_dst, &(d), sizeof((rule)->fw_dst));         \
        (rule)->fw_sport[0] = sp1; (rule)->fw_sport[1] = sp2;           \
        (rule)->fw_dport[0] = dp1; (rule)->fw_dport[1] = dp2;           \
} while (0)

Definition at line 31 of file fw.h.


Typedef Documentation

typedef int(* fw_handler)(const struct fw_rule *rule, void *arg)
 

Definition at line 44 of file fw.h.

typedef struct fw_handle fw_t
 

Definition at line 42 of file fw.h.


Function Documentation

int fw_add fw_t f,
const struct fw_rule rule
 

Definition at line 127 of file fw-ipchains.c.

References call_pipe(), format_rule(), MAX_RULE_LENGTH, and NULL.

Referenced by __pyx_f_4dnet_2fw_add(), and fw_main().

fw_t* fw_close fw_t f  ) 
 

Definition at line 219 of file fw-ipchains.c.

References NULL.

Referenced by __pyx_f_4dnet_2fw___dealloc__(), fw_main(), fw_open(), and START_TEST().

int fw_delete fw_t f,
const struct fw_rule rule
 

Definition at line 138 of file fw-ipchains.c.

References call_pipe(), errno, format_rule(), fw_rule::fw_device, MAX_RULE_LENGTH, memcmp(), NULL, parse_rule(), snprintf, and strsep().

Referenced by __pyx_f_4dnet_2fw_delete(), and fw_main().

int fw_loop fw_t f,
fw_handler  callback,
void *  arg
 

Definition at line 149 of file fw-ipchains.c.

References call_pipe(), fw_handle::ifinfo, MAX_RULE_LENGTH, NULL, parse_rule(), snprintf, and strsep().

Referenced by __pyx_f_4dnet_2fw_loop(), and fw_main().

__BEGIN_DECLS fw_t* fw_open void   ) 
 

Definition at line 115 of file fw-ipchains.c.

References _IP_ADAPTER_INFO::AdapterName, _IP_ADAPTER_INFO::ComboIndex, GetAdaptersInfo(), _IP_ADAPTER_INFO::Next, NULL, and _IP_ADAPTER_INFO::Type.

Referenced by __pyx_f_4dnet_2fw___init__(), fw_main(), and START_TEST().


Generated on Sun May 14 14:51:21 2006 by  doxygen 1.4.2