Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/ip_fw.h
Show First 20 Lines • Show All 289 Lines • ▼ Show 20 Lines | enum ipfw_opcodes { /* arguments (4 byte each) */ | ||||
O_EXTERNAL_ACTION, /* arg1=id of external action handler */ | O_EXTERNAL_ACTION, /* arg1=id of external action handler */ | ||||
O_EXTERNAL_INSTANCE, /* arg1=id of eaction handler instance */ | O_EXTERNAL_INSTANCE, /* arg1=id of eaction handler instance */ | ||||
O_EXTERNAL_DATA, /* variable length data */ | O_EXTERNAL_DATA, /* variable length data */ | ||||
O_SKIP_ACTION, /* none */ | O_SKIP_ACTION, /* none */ | ||||
O_TCPMSS, /* arg1=MSS value */ | O_TCPMSS, /* arg1=MSS value */ | ||||
O_MAC_SRC_LOOKUP, /* arg1=table number, u32=value */ | |||||
O_MAC_DST_LOOKUP, /* arg1=table number, u32=value */ | |||||
O_LAST_OPCODE /* not an opcode! */ | O_LAST_OPCODE /* not an opcode! */ | ||||
}; | }; | ||||
/* | /* | ||||
* The extension header are filtered only for presence using a bit | * The extension header are filtered only for presence using a bit | ||||
* vector with a flag for each header. | * vector with a flag for each header. | ||||
*/ | */ | ||||
#define EXT_FRAGMENT 0x1 | #define EXT_FRAGMENT 0x1 | ||||
▲ Show 20 Lines • Show All 443 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* These are used for lookup tables. | * These are used for lookup tables. | ||||
*/ | */ | ||||
#define IPFW_TABLE_ADDR 1 /* Table for holding IPv4/IPv6 prefixes */ | #define IPFW_TABLE_ADDR 1 /* Table for holding IPv4/IPv6 prefixes */ | ||||
#define IPFW_TABLE_INTERFACE 2 /* Table for holding interface names */ | #define IPFW_TABLE_INTERFACE 2 /* Table for holding interface names */ | ||||
#define IPFW_TABLE_NUMBER 3 /* Table for holding ports/uid/gid/etc */ | #define IPFW_TABLE_NUMBER 3 /* Table for holding ports/uid/gid/etc */ | ||||
#define IPFW_TABLE_FLOW 4 /* Table for holding flow data */ | #define IPFW_TABLE_FLOW 4 /* Table for holding flow data */ | ||||
#define IPFW_TABLE_MAXTYPE 4 /* Maximum valid number */ | #define IPFW_TABLE_MAC 5 /* Table for holding mac address prefixes */ | ||||
#define IPFW_TABLE_MAXTYPE 5 /* Maximum valid number */ | |||||
#define IPFW_TABLE_CIDR IPFW_TABLE_ADDR /* compat */ | #define IPFW_TABLE_CIDR IPFW_TABLE_ADDR /* compat */ | ||||
/* Value types */ | /* Value types */ | ||||
#define IPFW_VTYPE_LEGACY 0xFFFFFFFF /* All data is filled in */ | #define IPFW_VTYPE_LEGACY 0xFFFFFFFF /* All data is filled in */ | ||||
#define IPFW_VTYPE_SKIPTO 0x00000001 /* skipto/call/callreturn */ | #define IPFW_VTYPE_SKIPTO 0x00000001 /* skipto/call/callreturn */ | ||||
#define IPFW_VTYPE_PIPE 0x00000002 /* pipe/queue */ | #define IPFW_VTYPE_PIPE 0x00000002 /* pipe/queue */ | ||||
#define IPFW_VTYPE_FIB 0x00000004 /* setfib */ | #define IPFW_VTYPE_FIB 0x00000004 /* setfib */ | ||||
#define IPFW_VTYPE_NAT 0x00000008 /* nat */ | #define IPFW_VTYPE_NAT 0x00000008 /* nat */ | ||||
#define IPFW_VTYPE_DSCP 0x00000010 /* dscp */ | #define IPFW_VTYPE_DSCP 0x00000010 /* dscp */ | ||||
#define IPFW_VTYPE_TAG 0x00000020 /* tag/untag */ | #define IPFW_VTYPE_TAG 0x00000020 /* tag/untag */ | ||||
#define IPFW_VTYPE_DIVERT 0x00000040 /* divert/tee */ | #define IPFW_VTYPE_DIVERT 0x00000040 /* divert/tee */ | ||||
#define IPFW_VTYPE_NETGRAPH 0x00000080 /* netgraph/ngtee */ | #define IPFW_VTYPE_NETGRAPH 0x00000080 /* netgraph/ngtee */ | ||||
#define IPFW_VTYPE_LIMIT 0x00000100 /* limit */ | #define IPFW_VTYPE_LIMIT 0x00000100 /* limit */ | ||||
#define IPFW_VTYPE_NH4 0x00000200 /* IPv4 nexthop */ | #define IPFW_VTYPE_NH4 0x00000200 /* IPv4 nexthop */ | ||||
#define IPFW_VTYPE_NH6 0x00000400 /* IPv6 nexthop */ | #define IPFW_VTYPE_NH6 0x00000400 /* IPv6 nexthop */ | ||||
/* MAC/InfiniBand/etc address length */ | |||||
#define L2_ADDR_LEN 20 | |||||
melifaro: That's a public header, please add IPFW_ prefix to the name (`IPFW_MAX_L2_ADDR_LEN` or… | |||||
typedef struct _ipfw_table_entry { | typedef struct _ipfw_table_entry { | ||||
in_addr_t addr; /* network address */ | in_addr_t addr; /* network address */ | ||||
u_int32_t value; /* value */ | u_int32_t value; /* value */ | ||||
u_int16_t tbl; /* table number */ | u_int16_t tbl; /* table number */ | ||||
u_int8_t masklen; /* mask length */ | u_int8_t masklen; /* mask length */ | ||||
} ipfw_table_entry; | } ipfw_table_entry; | ||||
typedef struct _ipfw_table_xentry { | typedef struct _ipfw_table_xentry { | ||||
▲ Show 20 Lines • Show All 111 Lines • ▼ Show 20 Lines | typedef struct _ipfw_obj_tentry { | ||||
uint16_t idx; /* Table name index */ | uint16_t idx; /* Table name index */ | ||||
uint16_t spare1; | uint16_t spare1; | ||||
union { | union { | ||||
/* Longest field needs to be aligned by 8-byte boundary */ | /* Longest field needs to be aligned by 8-byte boundary */ | ||||
struct in_addr addr; /* IPv4 address */ | struct in_addr addr; /* IPv4 address */ | ||||
uint32_t key; /* uid/gid/port */ | uint32_t key; /* uid/gid/port */ | ||||
struct in6_addr addr6; /* IPv6 address */ | struct in6_addr addr6; /* IPv6 address */ | ||||
char iface[IF_NAMESIZE]; /* interface name */ | char iface[IF_NAMESIZE]; /* interface name */ | ||||
u_char mac[L2_ADDR_LEN]; /* MAC address */ | |||||
struct tflow_entry flow; | struct tflow_entry flow; | ||||
} k; | } k; | ||||
union { | union { | ||||
ipfw_table_value value; /* value data */ | ipfw_table_value value; /* value data */ | ||||
uint32_t kidx; /* value kernel index */ | uint32_t kidx; /* value kernel index */ | ||||
} v; | } v; | ||||
} ipfw_obj_tentry; | } ipfw_obj_tentry; | ||||
#define IPFW_TF_UPDATE 0x01 /* Update record if exists */ | #define IPFW_TF_UPDATE 0x01 /* Update record if exists */ | ||||
▲ Show 20 Lines • Show All 160 Lines • Show Last 20 Lines |
That's a public header, please add IPFW_ prefix to the name (IPFW_MAX_L2_ADDR_LEN or IPFW_MAXL2SIZE or similar)? Otherwise it may classify with other similar definitions in other headers/programs.