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

fw-pf.c File Reference

#include "config.h"
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
#include <net/pfvar.h>
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "dnet.h"

Go to the source code of this file.

Classes

struct  fw_handle

Defines

#define PFRA_ADDR(ra)   (ra)->addr
#define PFRA_ADDR(ra)   (ra)->mask

Functions

static void fr_to_pr (const struct fw_rule *fr, struct pf_rule *pr)
static int pr_to_fr (const struct pf_rule *pr, struct fw_rule *fr)
fw_tfw_open (void)
int fw_add (fw_t *fw, const struct fw_rule *rule)
int fw_delete (fw_t *fw, const struct fw_rule *rule)
int fw_loop (fw_t *fw, fw_handler callback, void *arg)
fw_tfw_close (fw_t *fw)


Define Documentation

#define PFRA_ADDR ra   )     (ra)->mask
 

Definition at line 64 of file fw-pf.c.

#define PFRA_ADDR ra   )     (ra)->addr
 

Definition at line 64 of file fw-pf.c.

Referenced by fr_to_pr(), and pr_to_fr().


Function Documentation

static void fr_to_pr const struct fw_rule fr,
struct pf_rule *  pr
[static]
 

Definition at line 72 of file fw-pf.c.

References addr::addr_bits, addr_btom(), fw_rule::fw_device, fw_rule::fw_dir, FW_DIR_IN, fw_rule::fw_dport, fw_rule::fw_dst, fw_rule::fw_op, FW_OP_ALLOW, fw_rule::fw_proto, fw_rule::fw_sport, fw_rule::fw_src, IP_ADDR_LEN, IP_PROTO_ICMP, IP_PROTO_TCP, IP_PROTO_UDP, memset, PFRA_ADDR, and strlcpy.

Referenced by fw_add(), and fw_delete().

int fw_add fw_t fw,
const struct fw_rule rule
 

Definition at line 199 of file fw-pf.c.

References errno, fr_to_pr(), memset, NULL, and pr_to_fr().

fw_t* fw_close fw_t fw  ) 
 

Definition at line 313 of file fw-pf.c.

References NULL.

int fw_delete fw_t fw,
const struct fw_rule rule
 

Definition at line 238 of file fw-pf.c.

References errno, fr_to_pr(), memset, NULL, and pr_to_fr().

int fw_loop fw_t fw,
fw_handler  callback,
void *  arg
 

Definition at line 282 of file fw-pf.c.

References max, memset, and pr_to_fr().

fw_t* fw_open void   ) 
 

Definition at line 187 of file fw-pf.c.

References fw_close(), and NULL.

static int pr_to_fr const struct pf_rule *  pr,
struct fw_rule fr
[static]
 

Definition at line 118 of file fw-pf.c.

References addr_mtob(), ADDR_TYPE_IP, FW_DIR_IN, FW_DIR_OUT, FW_OP_ALLOW, FW_OP_BLOCK, IP_ADDR_LEN, IP_PROTO_ICMP, IP_PROTO_TCP, IP_PROTO_UDP, memset, PFRA_ADDR, and strlcpy.

Referenced by fw_add(), fw_delete(), and fw_loop().


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