#define DIR_TO   0  /* address1 --> address2 */
#define DIR_BOTH 1  /* address1 <-> address2 */
#define DIR_FROM 2  /* address1 <-- address2 */

struct address_filter {
  u_short level;       /* 0 = IP, 1 = DLC */
  char address1[64];   /* ASCII src address */
  char address2[64];   /* ASCII dst address */
  char name1[64];      /* ASCII name of address 1 */
  char name2[64];      /* ASCII name of address 2 */
  u_short direction;   /* DIR_TO, DIR_BOTH */
  u_short include;     /* 0 = exclude, 1 = include  */
  u_short and;         /* 0 = OFF, 1 = AND , 2 = OR */
};

struct filter {
  u_long protocol;    /* bitmask */
  struct address_filter addr[2];
  u_short port;
};

extern u_short D_Src_Port, D_Dst_Port;
extern char D_Src_Host[], D_Dst_Host[], D_Proto[];

extern struct filter Filter;
extern char Fstr[];		/* the ASCII filter string fed to parse() */

#define PROTO(x)  ( Filter.protocol & (1<<x) )

/* PROTOCOLS for filter */
#define PROTO_ALL  0
#define PROTO_IP   1
#define PROTO_ARP  2
#define PROTO_RARP 3
#define PROTO_ICMP 4
#define PROTO_UDP  5
#define PROTO_TCP  6
#define NUM_PROTOS 7	/* total number of protocols including ALL */


















syntax highlighted by Code2HTML, v. 0.9.1