Lines Matching defs:cb
138 struct cdnr_block *cb;
162 cb = acc_classify(&top->tc_classifier, m, af);
163 if (cb != NULL)
164 tca = &cb->cb_action;
196 cb = tca->tca_next;
197 tca = (*cb->cb_input)(cb, &pktinfo);
224 struct cdnr_block *cb;
226 cb = (struct cdnr_block *)handle;
227 if (handle != ALIGN(cb))
230 if (cb == NULL || cb->cb_handle != handle)
232 return (cb);
236 cdnr_cb2handle(cb)
237 struct cdnr_block *cb;
239 return (cb->cb_handle);
249 struct cdnr_block *cb;
272 cb = malloc(size, M_DEVBUF, M_WAITOK);
273 if (cb == NULL)
275 bzero(cb, size);
277 cb->cb_len = size;
278 cb->cb_type = type;
279 cb->cb_ref = 0;
280 cb->cb_handle = (u_long)cb;
282 cb->cb_top = (struct top_cdnr *)cb;
284 cb->cb_top = top;
291 cb->cb_action.tca_code = TCACODE_NEXT;
292 cb->cb_action.tca_next = cb;
293 cb->cb_input = input_func;
295 cb->cb_action.tca_code = TCACODE_NONE;
299 LIST_INSERT_HEAD(&top->tc_elements, cb, cb_next);
301 return ((void *)cb);
308 struct cdnr_block *cb = cblock;
311 acc_discard_filters(&cb->cb_top->tc_classifier, cb, 0);
314 if (cb->cb_top != cblock)
315 LIST_REMOVE(cb, cb_next);
317 free(cb, M_DEVBUF);
324 generic_element_destroy(cb)
325 struct cdnr_block *cb;
329 switch (cb->cb_type) {
331 error = top_destroy((struct top_cdnr *)cb);
334 error = element_destroy(cb);
337 error = tbm_destroy((struct tbmeter *)cb);
340 error = trtcm_destroy((struct trtcm *)cb);
343 error = tswtcm_destroy((struct tswtcm *)cb);
382 struct cdnr_block *cb;
386 cb = cdnr_handle2cb(ktca->tca_handle);
387 if (cb == NULL) {
392 ktca->tca_next = cb;
393 cb->cb_ref++;
404 struct cdnr_block *cb;
407 cb = tca->tca_next;
408 if (cb == NULL)
410 cb->cb_ref--;
442 struct cdnr_block *cb;
451 while ((cb = LIST_FIRST(&top->tc_elements)) != NULL) {
452 while (cb != NULL && cb->cb_ref > 0)
453 cb = LIST_NEXT(cb, cb_next);
454 if (cb != NULL)
455 generic_element_destroy(cb);
482 struct cdnr_block *cb;
487 if ((cb = cdnr_cballoc(top, TCETYPE_ELEMENT, NULL)) == NULL)
490 tca_import_action(&cb->cb_action, action);
492 return (cb);
496 element_destroy(cb)
497 struct cdnr_block *cb;
499 if (cb->cb_ref > 0)
502 tca_invalidate_action(&cb->cb_action);
504 cdnr_cbdestroy(cb);
576 tbm_input(cb, pktinfo)
577 struct cdnr_block *cb;
580 struct tbmeter *tbm = (struct tbmeter *)cb;
674 trtcm_input(cb, pktinfo)
675 struct cdnr_block *cb;
678 struct trtcm *tcm = (struct trtcm *)cb;
804 tswtcm_input(cb, pktinfo)
805 struct cdnr_block *cb;
808 struct tswtcm *tsw = (struct tswtcm *)cb;
903 struct cdnr_block *cb;
908 cb = element_create(top, &ap->action);
909 if (cb == NULL)
912 ap->cdnr_handle = cdnr_cb2handle(cb);
921 struct cdnr_block *cb;
926 if ((cb = cdnr_handle2cb(ap->cdnr_handle)) == NULL)
929 if (cb->cb_type != TCETYPE_ELEMENT)
930 return generic_element_destroy(cb);
932 return element_destroy(cb);
940 struct cdnr_block *cb;
945 if ((cb = cdnr_handle2cb(ap->cdnr_handle)) == NULL)
949 cb, &ap->filter_handle);
1051 struct cdnr_block *cb;
1053 if ((cb = cdnr_handle2cb(ap->cdnr_handle)) == NULL)
1056 if (cb->cb_type == TCETYPE_TRTCM) {
1057 struct trtcm *tcm = (struct trtcm *)cb;
1062 } else if (cb->cb_type == TCETYPE_TSWTCM) {
1063 struct tswtcm *tsw = (struct tswtcm *)cb;
1126 struct cdnr_block *cb;
1147 LIST_FOREACH(cb, &top->tc_elements, cb_next) {
1154 tce.tce_handle = cb->cb_handle;
1155 tce.tce_type = cb->cb_type;
1156 switch (cb->cb_type) {
1158 tbm = (struct tbmeter *)cb;
1163 tcm = (struct trtcm *)cb;
1169 tsw = (struct tswtcm *)cb;