Lines Matching refs:ta
86 struct table_algo *ta; /* Callbacks for given algo */ member
97 struct tid_info *ti, struct table_algo *ta, char *adata, uint8_t tflags);
352 struct table_algo *ta; in rollback_added_entries() local
361 ta = tc->ta; in rollback_added_entries()
362 ta_buf_sz = ta->ta_buf_size; in rollback_added_entries()
373 error = ta->add(tc->astate, tinfo, ptei, v, &num); in rollback_added_entries()
379 error = ta->prepare_del(ch, ptei, vv); in rollback_added_entries()
381 error = ta->del(tc->astate, tinfo, ptei, vv, &num); in rollback_added_entries()
395 prepare_batch_buffer(struct ip_fw_chain *ch, struct table_algo *ta, in prepare_batch_buffer() argument
404 ta_buf_sz = ta->ta_buf_size; in prepare_batch_buffer()
427 ta->prepare_add(ch, ptei, v) : ta->prepare_del(ch, ptei, v); in prepare_batch_buffer()
447 flush_batch_buffer(struct ip_fw_chain *ch, struct table_algo *ta, in flush_batch_buffer() argument
456 ta_buf_sz = ta->ta_buf_size; in flush_batch_buffer()
462 ta->flush_entry(ch, ptei, v); in flush_batch_buffer()
473 ta->flush_entry(ch, &tei[i], v); in flush_batch_buffer()
547 struct table_algo *ta; in add_table_entry() local
557 ta = NULL; in add_table_entry()
566 flush_batch_buffer(ch, ta, tei, count, rollback, in add_table_entry()
569 ta = NULL; in add_table_entry()
578 ta = tc->ta; in add_table_entry()
586 ts.ta = ta; in add_table_entry()
596 error = prepare_batch_buffer(ch, ta, tei, count, OP_ADD, &ta_buf_m); in add_table_entry()
639 ta = tc->ta; in add_table_entry()
646 for (i = 0; i < count; i++, v += ta->ta_buf_size) { in add_table_entry()
659 error = ta->add(tc->astate, KIDX_TO_TI(ch, kidx), in add_table_entry()
703 flush_batch_buffer(ch, ta, tei, count, rollback, ta_buf_m, ta_buf); in add_table_entry()
718 struct table_algo *ta; in del_table_entry() local
735 ta = tc->ta; in del_table_entry()
741 error = prepare_batch_buffer(ch, ta, tei, count, OP_DEL, &ta_buf_m); in del_table_entry()
754 if (ta != tc->ta) { in del_table_entry()
766 for (i = 0; i < count; i++, v += ta->ta_buf_size) { in del_table_entry()
769 error = ta->del(tc->astate, KIDX_TO_TI(ch, kidx), ptei, v, in del_table_entry()
794 flush_batch_buffer(ch, ta, tei, count, 0, ta_buf_m, ta_buf); in del_table_entry()
817 struct table_algo *ta; in check_table_space() local
825 ta = tc->ta; in check_table_space()
826 if (ta->need_modify == NULL) in check_table_space()
839 if (ta->need_modify(tc->astate, ti, count, &pflags) == 0) { in check_table_space()
850 error = ta->prepare_mod(ta_buf, &pflags); in check_table_space()
865 ta->flush_mod(ta_buf); in check_table_space()
871 if (ta->need_modify(tc->astate, ti, count, &pflags) == 0) { in check_table_space()
878 ta->flush_mod(ta_buf); in check_table_space()
882 error = ta->fill_mod(tc->astate, ti, ta_buf, &pflags); in check_table_space()
886 ta->modify(tc->astate, ti, ta_buf, pflags); in check_table_space()
891 ta->flush_mod(ta_buf); in check_table_space()
1091 struct table_algo *ta; in find_table_entry() local
1120 ta = NULL; in find_table_entry()
1133 ta = tc->ta; in find_table_entry()
1135 if (ta->find_tentry == NULL) in find_table_entry()
1138 error = ta->find_tentry(tc->astate, kti, tent); in find_table_entry()
1207 struct table_algo *ta; in flush_table() local
1235 ta = tc->ta; in flush_table()
1237 if ((ta->flags & TA_FLAG_READONLY) != 0) { in flush_table()
1242 if (ta->print_config != NULL) { in flush_table()
1243 ta->print_config(tc->astate, KIDX_TO_TI(ch, tc->no.kidx), in flush_table()
1257 ta->destroy(astate_new, &ti_new); in flush_table()
1265 error = ta->init(ch, &astate_new, &ti_new, pstate, tflags); in flush_table()
1307 if (ta->change_ti != NULL) in flush_table()
1308 ta->change_ti(tc->astate, &tablestate[kidx]); in flush_table()
1313 ipfw_unref_table_values(ch, tc, ta, astate_old, &ti_old); in flush_table()
1319 ta->destroy(astate_old, &ti_old); in flush_table()
1386 struct table_algo *ta; in swap_tables() local
1426 if (((tc_a->ta->flags | tc_b->ta->flags) & TA_FLAG_READONLY) != 0) { in swap_tables()
1438 ta = tc_a->ta; in swap_tables()
1445 tc_a->ta = tc_b->ta; in swap_tables()
1450 tc_b->ta = ta; in swap_tables()
1460 if (tc_a->ta->change_ti != NULL) in swap_tables()
1461 tc_a->ta->change_ti(tc_a->astate, &tablestate[tc_a->no.kidx]); in swap_tables()
1462 if (tc_b->ta->change_ti != NULL) in swap_tables()
1463 tc_b->ta->change_ti(tc_b->astate, &tablestate[tc_b->no.kidx]); in swap_tables()
1507 ipfw_unref_table_values(ch, tc, tc->ta, tc->astate, &tc->ti_copy); in destroy_table()
1595 if (tc == NULL || tc->ta->change_ti == NULL) in ipfw_resize_tables()
1598 tc->ta->change_ti(tc->astate, ti); in ipfw_resize_tables()
1794 if ((tc->ta->flags & TA_FLAG_READONLY) != 0) { in modify_table()
1876 struct table_algo *ta; in create_table_internal() local
1881 ta = find_table_algo(CHAIN_TO_TCFG(ch), ti, aname); in create_table_internal()
1882 if (ta == NULL) in create_table_internal()
1885 tc = alloc_table_config(ch, ti, ta, aname, i->tflags); in create_table_internal()
1891 if (ta->flags & TA_FLAG_READONLY) in create_table_internal()
2038 struct table_algo *ta; in table_get_count() local
2042 ta = tc->ta; in table_get_count()
2045 if ((ta->flags & TA_FLAG_READONLY) == 0) in table_get_count()
2049 if ((ta->flags & TA_FLAG_EXTCOUNTER) != 0) in table_get_count()
2050 return (ta->get_count(tc->astate, ti)); in table_get_count()
2054 ta->foreach(tc->astate, ti, count_ext_entries, &da); in table_get_count()
2067 struct table_algo *ta; in export_table_info() local
2082 ta = tc->ta; in export_table_info()
2083 if (ta->print_config != NULL) { in export_table_info()
2085 ta->print_config(tc->astate, ti, i->algoname, in export_table_info()
2088 strlcpy(i->algoname, ta->name, sizeof(i->algoname)); in export_table_info()
2090 if (ta->dump_tinfo != NULL) { in export_table_info()
2091 ta->dump_tinfo(tc->astate, ti, &i->ta_info); in export_table_info()
2171 struct table_algo *ta; in dump_table_v1() local
2210 ta = tc->ta; in dump_table_v1()
2212 ta->foreach(tc->astate, da.ti, dump_table_tentry, &da); in dump_table_v1()
2233 struct table_algo *ta; in dump_table_v0() local
2275 ta = tc->ta; in dump_table_v0()
2277 ta->foreach(tc->astate, da.ti, dump_table_xentry, &da); in dump_table_v0()
2349 struct table_algo *ta; in dump_table_entry() local
2357 ta = tc->ta; in dump_table_entry()
2366 error = ta->dump_tentry(tc->astate, da->ti, e, &da->tent); in dump_table_entry()
2386 struct table_algo *ta; in ipfw_dump_table_legacy() local
2394 ta = tc->ta; in ipfw_dump_table_legacy()
2408 ta->foreach(tc->astate, da.ti, dump_table_entry, &da); in ipfw_dump_table_legacy()
2422 struct table_algo *ta; in dump_table_tentry() local
2430 ta = tc->ta; in dump_table_tentry()
2441 error = ta->dump_tentry(tc->astate, da->ti, e, tent); in dump_table_tentry()
2459 struct table_algo *ta; in dump_table_xentry() local
2468 ta = tc->ta; in dump_table_xentry()
2479 error = ta->dump_tentry(tc->astate, da->ti, e, tent); in dump_table_xentry()
2508 struct table_algo *ta; in prepare_table_tentry() local
2514 ta = tc->ta; in prepare_table_tentry()
2516 error = ta->dump_tentry(tc->astate, da->ti, e, &da->tent); in prepare_table_tentry()
2534 struct table_algo *ta; in ipfw_foreach_table_tentry() local
2543 ta = tc->ta; in ipfw_foreach_table_tentry()
2552 ta->foreach(tc->astate, da.ti, prepare_table_tentry, &da); in ipfw_foreach_table_tentry()
2570 struct table_algo *ta; in find_table_algo() local
2590 ta = tcfg->algo[i]; in find_table_algo()
2600 l = strlen(ta->name); in find_table_algo()
2601 if (strncmp(name, ta->name, l) != 0) in find_table_algo()
2606 if (ti->type != 0 && ti->type != ta->type) in find_table_algo()
2608 return (ta); in find_table_algo()
2621 ipfw_add_table_algo(struct ip_fw_chain *ch, struct table_algo *ta, size_t size, in ipfw_add_table_algo() argument
2632 sz = roundup2(ta->ta_buf_size, sizeof(void *)); in ipfw_add_table_algo()
2636 KASSERT(ta->type <= IPFW_TABLE_MAXTYPE,("Increase IPFW_TABLE_MAXTYPE")); in ipfw_add_table_algo()
2640 memcpy(ta_new, ta, size); in ipfw_add_table_algo()
2668 struct table_algo *ta; in ipfw_del_table_algo() local
2675 ta = tcfg->algo[idx]; in ipfw_del_table_algo()
2676 KASSERT(ta != NULL, ("algo idx %d is NULL", idx)); in ipfw_del_table_algo()
2678 if (tcfg->def_algo[ta->type] == ta) in ipfw_del_table_algo()
2679 tcfg->def_algo[ta->type] = NULL; in ipfw_del_table_algo()
2681 free(ta, M_IPFW); in ipfw_del_table_algo()
2699 struct table_algo *ta; in list_table_algo() local
2727 ta = tcfg->algo[n]; in list_table_algo()
2728 strlcpy(i->algoname, ta->name, sizeof(i->algoname)); in list_table_algo()
2729 i->type = ta->type; in list_table_algo()
2730 i->refcnt = ta->refcnt; in list_table_algo()
3176 struct table_algo *ta, char *aname, uint8_t tflags) in alloc_table_config() argument
3200 tc->no.subtype = ta->type; in alloc_table_config()
3203 tc->ta = ta; in alloc_table_config()
3209 error = ta->init(ch, &tc->astate, &tc->ti_copy, aname, tflags); in alloc_table_config()
3232 tc->ta->destroy(tc->astate, &tc->ti_copy); in free_table_config()
3258 if (tc->ta->change_ti != NULL) in link_table()
3259 tc->ta->change_ti(tc->astate, ti); in link_table()
3262 tc->ta->refcnt++; in link_table()
3287 tc->ta->refcnt--; in unlink_table()
3290 if (tc->ta->change_ti != NULL) in unlink_table()
3291 tc->ta->change_ti(tc->astate, NULL); in unlink_table()