Changeset View
Changeset View
Standalone View
Standalone View
sbin/ipfw/tables.c
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
static int table_do_swap(ipfw_obj_header *oh, char *second); | static int table_do_swap(ipfw_obj_header *oh, char *second); | ||||
static void table_create(ipfw_obj_header *oh, int ac, char *av[]); | static void table_create(ipfw_obj_header *oh, int ac, char *av[]); | ||||
static void table_modify(ipfw_obj_header *oh, int ac, char *av[]); | static void table_modify(ipfw_obj_header *oh, int ac, char *av[]); | ||||
static void table_lookup(ipfw_obj_header *oh, int ac, char *av[]); | static void table_lookup(ipfw_obj_header *oh, int ac, char *av[]); | ||||
static void table_lock(ipfw_obj_header *oh, int lock); | static void table_lock(ipfw_obj_header *oh, int lock); | ||||
static int table_swap(ipfw_obj_header *oh, char *second); | static int table_swap(ipfw_obj_header *oh, char *second); | ||||
static int table_get_info(ipfw_obj_header *oh, ipfw_xtable_info *i); | static int table_get_info(ipfw_obj_header *oh, ipfw_xtable_info *i); | ||||
static int table_show_info(ipfw_xtable_info *i, void *arg); | static int table_show_info(ipfw_xtable_info *i, void *arg); | ||||
static void table_fill_ntlv(ipfw_obj_ntlv *ntlv, const char *name, | |||||
uint32_t set, uint16_t uidx); | |||||
static int table_flush_one(ipfw_xtable_info *i, void *arg); | static int table_flush_one(ipfw_xtable_info *i, void *arg); | ||||
static int table_show_one(ipfw_xtable_info *i, void *arg); | static int table_show_one(ipfw_xtable_info *i, void *arg); | ||||
static int table_do_get_list(ipfw_xtable_info *i, ipfw_obj_header **poh); | static int table_do_get_list(ipfw_xtable_info *i, ipfw_obj_header **poh); | ||||
static void table_show_list(ipfw_obj_header *oh, int need_header); | static void table_show_list(ipfw_obj_header *oh, int need_header); | ||||
static void table_show_entry(ipfw_xtable_info *i, ipfw_obj_tentry *tent); | static void table_show_entry(ipfw_xtable_info *i, ipfw_obj_tentry *tent); | ||||
static void tentry_fill_key(ipfw_obj_header *oh, ipfw_obj_tentry *tent, | static void tentry_fill_key(ipfw_obj_header *oh, ipfw_obj_tentry *tent, | ||||
▲ Show 20 Lines • Show All 209 Lines • ▼ Show 20 Lines | case TOK_LIST: | ||||
break; | break; | ||||
case TOK_LOOKUP: | case TOK_LOOKUP: | ||||
ac--; av++; | ac--; av++; | ||||
table_lookup(&oh, ac, av); | table_lookup(&oh, ac, av); | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
static void | void | ||||
table_fill_ntlv(ipfw_obj_ntlv *ntlv, const char *name, uint32_t set, | table_fill_ntlv(ipfw_obj_ntlv *ntlv, const char *name, uint8_t set, | ||||
uint16_t uidx) | uint16_t uidx) | ||||
{ | { | ||||
ntlv->head.type = IPFW_TLV_TBL_NAME; | ntlv->head.type = IPFW_TLV_TBL_NAME; | ||||
ntlv->head.length = sizeof(ipfw_obj_ntlv); | ntlv->head.length = sizeof(ipfw_obj_ntlv); | ||||
ntlv->idx = uidx; | ntlv->idx = uidx; | ||||
ntlv->set = set; | ntlv->set = set; | ||||
strlcpy(ntlv->name, name, sizeof(ntlv->name)); | strlcpy(ntlv->name, name, sizeof(ntlv->name)); | ||||
▲ Show 20 Lines • Show All 1,704 Lines • Show Last 20 Lines |