Lines Matching refs:table_ctx
90 struct ipfw3_table_context *table_ctx; in table_create_dispatch() local
94 table_ctx = ctx->table_ctx; in table_create_dispatch()
95 table_ctx += id; in table_create_dispatch()
96 table_ctx->type = ioc_table->type; in table_create_dispatch()
97 table_ctx->count = 0; in table_create_dispatch()
98 strlcpy(table_ctx->name , ioc_table->name, IPFW_TABLE_NAME_LEN); in table_create_dispatch()
99 if (table_ctx->type == 1) { in table_create_dispatch()
100 rn_inithead(&table_ctx->mask, NULL, 0); in table_create_dispatch()
101 rn_inithead(&table_ctx->node, table_ctx->mask, in table_create_dispatch()
103 } else if (table_ctx->type == 2) { in table_create_dispatch()
104 rn_inithead(&table_ctx->mask, NULL, 0); in table_create_dispatch()
105 rn_inithead(&table_ctx->node, table_ctx->mask, in table_create_dispatch()
123 struct ipfw3_table_context *table_ctx; in table_delete_dispatch() local
126 table_ctx = ctx->table_ctx; in table_delete_dispatch()
127 table_ctx += ioc_tbl->id; in table_delete_dispatch()
128 table_ctx->count = 0; in table_delete_dispatch()
130 rn_flush(table_ctx->node, flush_table_entry); in table_delete_dispatch()
132 table_ctx->type = 0; in table_delete_dispatch()
142 struct ipfw3_table_context *table_ctx; in table_append_dispatch() local
148 table_ctx = ctx->table_ctx; in table_append_dispatch()
149 table_ctx += ioc_tbl->id; in table_append_dispatch()
150 if (table_ctx->type != ioc_tbl->type) in table_append_dispatch()
153 if (table_ctx->type == 1) { in table_append_dispatch()
156 rnh = table_ctx->node; in table_append_dispatch()
170 table_ctx->count++; in table_append_dispatch()
171 } else if (table_ctx->type == 2) { in table_append_dispatch()
174 rnh = table_ctx->node; in table_append_dispatch()
183 table_ctx->count++; in table_append_dispatch()
196 struct ipfw3_table_context *table_ctx; in table_remove_dispatch() local
204 table_ctx = ctx->table_ctx; in table_remove_dispatch()
205 table_ctx += ioc_tbl->id; in table_remove_dispatch()
206 if (table_ctx->type != ioc_tbl->type) in table_remove_dispatch()
209 rnh = table_ctx->node; in table_remove_dispatch()
220 table_ctx->count--; in table_remove_dispatch()
239 struct ipfw3_table_context *table_ctx; in table_flush_dispatch() local
243 table_ctx = ctx->table_ctx; in table_flush_dispatch()
244 table_ctx += ioc_tbl->id; in table_flush_dispatch()
245 rnh = table_ctx->node; in table_flush_dispatch()
246 table_ctx->count = 0; in table_flush_dispatch()
261 struct ipfw3_table_context *table_ctx; in table_rename_dispatch() local
264 table_ctx = ctx->table_ctx; in table_rename_dispatch()
265 table_ctx += ioc_tbl->id; in table_rename_dispatch()
266 strlcpy(table_ctx->name, ioc_tbl->name, IPFW_TABLE_NAME_LEN); in table_rename_dispatch()
277 struct ipfw3_table_context *table_ctx = ctx->table_ctx; in ip_fw3_ctl_table_list() local
288 for (i = 0; i < IPFW_TABLES_MAX; i++, ioc_table++, table_ctx++) { in ip_fw3_ctl_table_list()
290 ioc_table->type = table_ctx->type; in ip_fw3_ctl_table_list()
291 ioc_table->count = table_ctx->count; in ip_fw3_ctl_table_list()
292 strlcpy(ioc_table->name, table_ctx->name, IPFW_TABLE_NAME_LEN); in ip_fw3_ctl_table_list()
371 struct ipfw3_table_context *table_ctx; in ip_fw3_ctl_table_show() local
378 table_ctx = ctx->table_ctx; in ip_fw3_ctl_table_show()
379 table_ctx += *id; in ip_fw3_ctl_table_show()
380 if (table_ctx->type == 1) { in ip_fw3_ctl_table_show()
381 size = table_ctx->count * sizeof(struct ipfw_ioc_table_ip_entry) + in ip_fw3_ctl_table_show()
391 tbl->type = table_ctx->type; in ip_fw3_ctl_table_show()
392 strlcpy(tbl->name, table_ctx->name, IPFW_TABLE_NAME_LEN); in ip_fw3_ctl_table_show()
393 rnh = table_ctx->node; in ip_fw3_ctl_table_show()
398 } else if (table_ctx->type == 2) { in ip_fw3_ctl_table_show()
399 size = table_ctx->count * sizeof(struct ipfw_ioc_table_mac_entry) + in ip_fw3_ctl_table_show()
409 tbl->type = table_ctx->type; in ip_fw3_ctl_table_show()
410 strlcpy(tbl->name, table_ctx->name, IPFW_TABLE_NAME_LEN); in ip_fw3_ctl_table_show()
411 rnh = table_ctx->node; in ip_fw3_ctl_table_show()
427 struct ipfw3_table_context *table_ctx; in ip_fw3_ctl_table_test() local
432 table_ctx = ctx->table_ctx; in ip_fw3_ctl_table_test()
433 table_ctx += tbl->id; in ip_fw3_ctl_table_test()
435 if (table_ctx->type != tbl->type) in ip_fw3_ctl_table_test()
438 rnh = table_ctx->node; in ip_fw3_ctl_table_test()
570 ctx->table_ctx = kmalloc(sizeof(struct ipfw3_table_context) * IPFW_TABLES_MAX, in ip_fw3_table_init_dispatch()
578 struct ipfw3_table_context *table_ctx, *tmp_table; in ip_fw3_table_fini_dispatch() local
580 table_ctx = fw3_ctx[mycpuid]->table_ctx; in ip_fw3_table_fini_dispatch()
581 tmp_table = table_ctx; in ip_fw3_table_fini_dispatch()
582 for (id = 0; id < IPFW_TABLES_MAX; id++, table_ctx++) { in ip_fw3_table_fini_dispatch()
583 rn_flush(table_ctx->node, flush_table_entry); in ip_fw3_table_fini_dispatch()