Lines Matching refs:ta

87 	struct table_algo	*ta;	/* Callbacks for given algo */
98 struct tid_info *ti, struct table_algo *ta, char *adata, uint8_t tflags);
354 struct table_algo *ta;
363 ta = tc->ta;
364 ta_buf_sz = ta->ta_buf_size;
376 error = ta->add(tc->astate, tinfo, ptei, v, &num);
382 error = ta->prepare_del(ch, ptei, vv);
384 error = ta->del(tc->astate, tinfo, ptei, vv, &num);
398 prepare_batch_buffer(struct ip_fw_chain *ch, struct table_algo *ta,
407 ta_buf_sz = ta->ta_buf_size;
431 ta->prepare_add(ch, ptei, v) : ta->prepare_del(ch, ptei, v);
451 flush_batch_buffer(struct ip_fw_chain *ch, struct table_algo *ta,
460 ta_buf_sz = ta->ta_buf_size;
466 ta->flush_entry(ch, ptei, v);
477 ta->flush_entry(ch, &tei[i], v);
552 struct table_algo *ta;
562 ta = NULL;
571 flush_batch_buffer(ch, ta, tei, count, rollback,
574 ta = NULL;
583 ta = tc->ta;
591 ts.ta = ta;
601 error = prepare_batch_buffer(ch, ta, tei, count, OP_ADD, &ta_buf_m);
644 ta = tc->ta;
651 for (i = 0; i < count; i++, v += ta->ta_buf_size) {
656 error = ta->add(tc->astate, KIDX_TO_TI(ch, kidx),
700 flush_batch_buffer(ch, ta, tei, count, rollback, ta_buf_m, ta_buf);
715 struct table_algo *ta;
732 ta = tc->ta;
738 error = prepare_batch_buffer(ch, ta, tei, count, OP_DEL, &ta_buf_m);
749 * (changed ta may be the result of table swap).
751 if (ta != tc->ta) {
763 for (i = 0; i < count; i++, v += ta->ta_buf_size) {
766 error = ta->del(tc->astate, KIDX_TO_TI(ch, kidx), ptei, v,
791 flush_batch_buffer(ch, ta, tei, count, 0, ta_buf_m, ta_buf);
814 struct table_algo *ta;
822 ta = tc->ta;
823 if (ta->need_modify == NULL)
836 if (ta->need_modify(tc->astate, ti, count, &pflags) == 0) {
847 error = ta->prepare_mod(ta_buf, &pflags);
863 ta->flush_mod(ta_buf);
869 if (ta->need_modify(tc->astate, ti, count, &pflags) == 0) {
876 ta->flush_mod(ta_buf);
880 error = ta->fill_mod(tc->astate, ti, ta_buf, &pflags);
884 ta->modify(tc->astate, ti, ta_buf, pflags);
889 ta->flush_mod(ta_buf);
1089 struct table_algo *ta;
1118 ta = NULL;
1131 ta = tc->ta;
1133 if (ta->find_tentry == NULL)
1136 error = ta->find_tentry(tc->astate, kti, tent);
1205 struct table_algo *ta;
1233 ta = tc->ta;
1235 if ((ta->flags & TA_FLAG_READONLY) != 0) {
1240 if (ta->print_config != NULL) {
1241 ta->print_config(tc->astate, KIDX_TO_TI(ch, tc->no.kidx),
1255 ta->destroy(astate_new, &ti_new);
1263 error = ta->init(ch, &astate_new, &ti_new, pstate, tflags);
1305 if (ta->change_ti != NULL)
1306 ta->change_ti(tc->astate, &tablestate[kidx]);
1311 ipfw_unref_table_values(ch, tc, ta, astate_old, &ti_old);
1317 ta->destroy(astate_old, &ti_old);
1372 * Note that referencing @tc won't protect tc->ta from change.
1384 struct table_algo *ta;
1424 if (((tc_a->ta->flags | tc_b->ta->flags) & TA_FLAG_READONLY) != 0) {
1436 ta = tc_a->ta;
1443 tc_a->ta = tc_b->ta;
1448 tc_b->ta = ta;
1458 if (tc_a->ta->change_ti != NULL)
1459 tc_a->ta->change_ti(tc_a->astate, &tablestate[tc_a->no.kidx]);
1460 if (tc_b->ta->change_ti != NULL)
1461 tc_b->ta->change_ti(tc_b->astate, &tablestate[tc_b->no.kidx]);
1505 ipfw_unref_table_values(ch, tc, tc->ta, tc->astate, &tc->ti_copy);
1594 if (tc == NULL || tc->ta->change_ti == NULL)
1597 tc->ta->change_ti(tc->astate, ti);
1793 if ((tc->ta->flags & TA_FLAG_READONLY) != 0) {
1875 struct table_algo *ta;
1880 ta = find_table_algo(CHAIN_TO_TCFG(ch), ti, aname);
1881 if (ta == NULL)
1884 tc = alloc_table_config(ch, ti, ta, aname, i->tflags);
1890 if (ta->flags & TA_FLAG_READONLY)
2038 struct table_algo *ta;
2042 ta = tc->ta;
2045 if ((ta->flags & TA_FLAG_READONLY) == 0)
2049 if ((ta->flags & TA_FLAG_EXTCOUNTER) != 0)
2050 return (ta->get_count(tc->astate, ti));
2054 ta->foreach(tc->astate, ti, count_ext_entries, &da);
2067 struct table_algo *ta;
2082 ta = tc->ta;
2083 if (ta->print_config != NULL) {
2085 ta->print_config(tc->astate, ti, i->algoname,
2088 strlcpy(i->algoname, ta->name, sizeof(i->algoname));
2090 if (ta->dump_tinfo != NULL) {
2091 ta->dump_tinfo(tc->astate, ti, &i->ta_info);
2171 struct table_algo *ta;
2211 ta = tc->ta;
2213 ta->foreach(tc->astate, da.ti, dump_table_tentry, &da);
2234 struct table_algo *ta;
2277 ta = tc->ta;
2279 ta->foreach(tc->astate, da.ti, dump_table_xentry, &da);
2351 struct table_algo *ta;
2359 ta = tc->ta;
2368 error = ta->dump_tentry(tc->astate, da->ti, e, &da->tent);
2388 struct table_algo *ta;
2396 ta = tc->ta;
2410 ta->foreach(tc->astate, da.ti, dump_table_entry, &da);
2424 struct table_algo *ta;
2432 ta = tc->ta;
2443 error = ta->dump_tentry(tc->astate, da->ti, e, tent);
2461 struct table_algo *ta;
2470 ta = tc->ta;
2481 error = ta->dump_tentry(tc->astate, da->ti, e, tent);
2510 struct table_algo *ta;
2516 ta = tc->ta;
2518 error = ta->dump_tentry(tc->astate, da->ti, e, &da->tent);
2536 struct table_algo *ta;
2545 ta = tc->ta;
2554 ta->foreach(tc->astate, da.ti, prepare_table_tentry, &da);
2572 struct table_algo *ta;
2592 ta = tcfg->algo[i];
2602 l = strlen(ta->name);
2603 if (strncmp(name, ta->name, l) != 0)
2608 if (ti->type != 0 && ti->type != ta->type)
2610 return (ta);
2617 * Register new table algo @ta.
2623 ipfw_add_table_algo(struct ip_fw_chain *ch, struct table_algo *ta, size_t size,
2634 sz = roundup2(ta->ta_buf_size, sizeof(void *));
2638 KASSERT(ta->type <= IPFW_TABLE_MAXTYPE,("Increase IPFW_TABLE_MAXTYPE"));
2642 memcpy(ta_new, ta, size);
2670 struct table_algo *ta;
2677 ta = tcfg->algo[idx];
2678 KASSERT(ta != NULL, ("algo idx %d is NULL", idx));
2680 if (tcfg->def_algo[ta->type] == ta)
2681 tcfg->def_algo[ta->type] = NULL;
2683 free(ta, M_IPFW);
2701 struct table_algo *ta;
2729 ta = tcfg->algo[n];
2730 strlcpy(i->algoname, ta->name, sizeof(i->algoname));
2731 i->type = ta->type;
2732 i->refcnt = ta->refcnt;
3158 struct table_algo *ta, char *aname, uint8_t tflags)
3182 tc->no.subtype = ta->type;
3185 tc->ta = ta;
3191 error = ta->init(ch, &tc->astate, &tc->ti_copy, aname, tflags);
3211 * We're using ta without any locking/referencing.
3214 tc->ta->destroy(tc->astate, &tc->ti_copy);
3240 if (tc->ta->change_ti != NULL)
3241 tc->ta->change_ti(tc->astate, ti);
3244 tc->ta->refcnt++;
3269 tc->ta->refcnt--;
3272 if (tc->ta->change_ti != NULL)
3273 tc->ta->change_ti(tc->astate, NULL);