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);
351 struct table_algo *ta; in rollback_added_entries() local
360 ta = tc->ta; in rollback_added_entries()
361 ta_buf_sz = ta->ta_buf_size; in rollback_added_entries()
372 error = ta->add(tc->astate, tinfo, ptei, v, &num); in rollback_added_entries()
378 error = ta->prepare_del(ch, ptei, vv); in rollback_added_entries()
380 error = ta->del(tc->astate, tinfo, ptei, vv, &num); in rollback_added_entries()
394 prepare_batch_buffer(struct ip_fw_chain *ch, struct table_algo *ta, in prepare_batch_buffer() argument
403 ta_buf_sz = ta->ta_buf_size; in prepare_batch_buffer()
426 ta->prepare_add(ch, ptei, v) : ta->prepare_del(ch, ptei, v); in prepare_batch_buffer()
446 flush_batch_buffer(struct ip_fw_chain *ch, struct table_algo *ta, in flush_batch_buffer() argument
455 ta_buf_sz = ta->ta_buf_size; in flush_batch_buffer()
461 ta->flush_entry(ch, ptei, v); in flush_batch_buffer()
472 ta->flush_entry(ch, &tei[i], v); in flush_batch_buffer()
546 struct table_algo *ta; in add_table_entry() local
555 ta = NULL; in add_table_entry()
564 flush_batch_buffer(ch, ta, tei, count, rollback, in add_table_entry()
567 ta = NULL; in add_table_entry()
576 ta = tc->ta; in add_table_entry()
584 ts.ta = ta; in add_table_entry()
594 error = prepare_batch_buffer(ch, ta, tei, count, OP_ADD, &ta_buf_m); in add_table_entry()
637 ta = tc->ta; in add_table_entry()
644 for (i = 0; i < count; i++, v += ta->ta_buf_size) { in add_table_entry()
657 error = ta->add(tc->astate, KIDX_TO_TI(ch, kidx), in add_table_entry()
701 flush_batch_buffer(ch, ta, tei, count, rollback, ta_buf_m, ta_buf); in add_table_entry()
716 struct table_algo *ta; in del_table_entry() local
732 ta = tc->ta; in del_table_entry()
738 error = prepare_batch_buffer(ch, ta, tei, count, OP_DEL, &ta_buf_m); in del_table_entry()
751 if (ta != tc->ta) { in del_table_entry()
763 for (i = 0; i < count; i++, v += ta->ta_buf_size) { in del_table_entry()
766 error = ta->del(tc->astate, KIDX_TO_TI(ch, kidx), ptei, v, in del_table_entry()
791 flush_batch_buffer(ch, ta, tei, count, 0, ta_buf_m, ta_buf); in del_table_entry()
814 struct table_algo *ta; in check_table_space() local
822 ta = tc->ta; in check_table_space()
823 if (ta->need_modify == NULL) in check_table_space()
836 if (ta->need_modify(tc->astate, ti, count, &pflags) == 0) { in check_table_space()
847 error = ta->prepare_mod(ta_buf, &pflags); in check_table_space()
862 ta->flush_mod(ta_buf); in check_table_space()
868 if (ta->need_modify(tc->astate, ti, count, &pflags) == 0) { in check_table_space()
875 ta->flush_mod(ta_buf); in check_table_space()
879 error = ta->fill_mod(tc->astate, ti, ta_buf, &pflags); in check_table_space()
883 ta->modify(tc->astate, ti, ta_buf, pflags); in check_table_space()
888 ta->flush_mod(ta_buf); in check_table_space()
1034 struct table_algo *ta; in find_table_entry() local
1063 ta = NULL; in find_table_entry()
1076 ta = tc->ta; in find_table_entry()
1078 if (ta->find_tentry == NULL) in find_table_entry()
1081 error = ta->find_tentry(tc->astate, kti, tent); in find_table_entry()
1150 struct table_algo *ta; in flush_table() local
1178 ta = tc->ta; in flush_table()
1180 if ((ta->flags & TA_FLAG_READONLY) != 0) { in flush_table()
1185 if (ta->print_config != NULL) { in flush_table()
1186 ta->print_config(tc->astate, KIDX_TO_TI(ch, tc->no.kidx), in flush_table()
1200 ta->destroy(astate_new, &ti_new); in flush_table()
1208 error = ta->init(ch, &astate_new, &ti_new, pstate, tflags); in flush_table()
1250 if (ta->change_ti != NULL) in flush_table()
1251 ta->change_ti(tc->astate, &tablestate[kidx]); in flush_table()
1256 ipfw_unref_table_values(ch, tc, ta, astate_old, &ti_old); in flush_table()
1262 ta->destroy(astate_old, &ti_old); in flush_table()
1329 struct table_algo *ta; in swap_tables() local
1369 if (((tc_a->ta->flags | tc_b->ta->flags) & TA_FLAG_READONLY) != 0) { in swap_tables()
1381 ta = tc_a->ta; in swap_tables()
1388 tc_a->ta = tc_b->ta; in swap_tables()
1393 tc_b->ta = ta; in swap_tables()
1403 if (tc_a->ta->change_ti != NULL) in swap_tables()
1404 tc_a->ta->change_ti(tc_a->astate, &tablestate[tc_a->no.kidx]); in swap_tables()
1405 if (tc_b->ta->change_ti != NULL) in swap_tables()
1406 tc_b->ta->change_ti(tc_b->astate, &tablestate[tc_b->no.kidx]); in swap_tables()
1450 ipfw_unref_table_values(ch, tc, tc->ta, tc->astate, &tc->ti_copy); in destroy_table()
1522 if (tc == NULL || tc->ta->change_ti == NULL) in ipfw_resize_tables()
1525 tc->ta->change_ti(tc->astate, ti); in ipfw_resize_tables()
1721 if ((tc->ta->flags & TA_FLAG_READONLY) != 0) { in modify_table()
1803 struct table_algo *ta; in create_table_internal() local
1808 ta = find_table_algo(CHAIN_TO_TCFG(ch), ti, aname); in create_table_internal()
1809 if (ta == NULL) in create_table_internal()
1812 tc = alloc_table_config(ch, ti, ta, aname, i->tflags); in create_table_internal()
1818 if (ta->flags & TA_FLAG_READONLY) in create_table_internal()
1964 struct table_algo *ta; in table_get_count() local
1968 ta = tc->ta; in table_get_count()
1971 if ((ta->flags & TA_FLAG_READONLY) == 0) in table_get_count()
1975 if ((ta->flags & TA_FLAG_EXTCOUNTER) != 0) in table_get_count()
1976 return (ta->get_count(tc->astate, ti)); in table_get_count()
1980 ta->foreach(tc->astate, ti, count_ext_entries, &da); in table_get_count()
1993 struct table_algo *ta; in export_table_info() local
2008 ta = tc->ta; in export_table_info()
2009 if (ta->print_config != NULL) { in export_table_info()
2011 ta->print_config(tc->astate, ti, i->algoname, in export_table_info()
2014 strlcpy(i->algoname, ta->name, sizeof(i->algoname)); in export_table_info()
2016 if (ta->dump_tinfo != NULL) { in export_table_info()
2017 ta->dump_tinfo(tc->astate, ti, &i->ta_info); in export_table_info()
2097 struct table_algo *ta; in dump_table_v1() local
2136 ta = tc->ta; in dump_table_v1()
2138 ta->foreach(tc->astate, da.ti, dump_table_tentry, &da); in dump_table_v1()
2152 struct table_algo *ta; in dump_table_tentry() local
2160 ta = tc->ta; in dump_table_tentry()
2171 error = ta->dump_tentry(tc->astate, da->ti, e, tent); in dump_table_tentry()
2192 struct table_algo *ta; in prepare_table_tentry() local
2198 ta = tc->ta; in prepare_table_tentry()
2200 error = ta->dump_tentry(tc->astate, da->ti, e, &da->tent); in prepare_table_tentry()
2218 struct table_algo *ta; in ipfw_foreach_table_tentry() local
2227 ta = tc->ta; in ipfw_foreach_table_tentry()
2236 ta->foreach(tc->astate, da.ti, prepare_table_tentry, &da); in ipfw_foreach_table_tentry()
2254 struct table_algo *ta; in find_table_algo() local
2274 ta = tcfg->algo[i]; in find_table_algo()
2284 l = strlen(ta->name); in find_table_algo()
2285 if (strncmp(name, ta->name, l) != 0) in find_table_algo()
2290 if (ti->type != 0 && ti->type != ta->type) in find_table_algo()
2292 return (ta); in find_table_algo()
2305 ipfw_add_table_algo(struct ip_fw_chain *ch, struct table_algo *ta, size_t size, in ipfw_add_table_algo() argument
2316 sz = roundup2(ta->ta_buf_size, sizeof(void *)); in ipfw_add_table_algo()
2320 KASSERT(ta->type <= IPFW_TABLE_MAXTYPE,("Increase IPFW_TABLE_MAXTYPE")); in ipfw_add_table_algo()
2324 memcpy(ta_new, ta, size); in ipfw_add_table_algo()
2352 struct table_algo *ta; in ipfw_del_table_algo() local
2359 ta = tcfg->algo[idx]; in ipfw_del_table_algo()
2360 KASSERT(ta != NULL, ("algo idx %d is NULL", idx)); in ipfw_del_table_algo()
2362 if (tcfg->def_algo[ta->type] == ta) in ipfw_del_table_algo()
2363 tcfg->def_algo[ta->type] = NULL; in ipfw_del_table_algo()
2365 free(ta, M_IPFW); in ipfw_del_table_algo()
2383 struct table_algo *ta; in list_table_algo() local
2411 ta = tcfg->algo[n]; in list_table_algo()
2412 strlcpy(i->algoname, ta->name, sizeof(i->algoname)); in list_table_algo()
2413 i->type = ta->type; in list_table_algo()
2414 i->refcnt = ta->refcnt; in list_table_algo()
2849 struct table_algo *ta, char *aname, uint8_t tflags) in alloc_table_config() argument
2873 tc->no.subtype = ta->type; in alloc_table_config()
2876 tc->ta = ta; in alloc_table_config()
2882 error = ta->init(ch, &tc->astate, &tc->ti_copy, aname, tflags); in alloc_table_config()
2905 tc->ta->destroy(tc->astate, &tc->ti_copy); in free_table_config()
2931 if (tc->ta->change_ti != NULL) in link_table()
2932 tc->ta->change_ti(tc->astate, ti); in link_table()
2935 tc->ta->refcnt++; in link_table()
2960 tc->ta->refcnt--; in unlink_table()
2963 if (tc->ta->change_ti != NULL) in unlink_table()
2964 tc->ta->change_ti(tc->astate, NULL); in unlink_table()