Lines Matching defs:top
129 * top level input function called from ip_input.
137 struct top_cdnr *top;
147 top = ifp->if_snd.altq_cdnr;
163 cb = acc_classify(&top->tc_classifier, m, af);
168 tca = &top->tc_block.cb_action;
171 PKTCNTR_ADD(&top->tc_cnts[tca->tca_code], pktinfo.pkt_len);
210 struct top_cdnr *top;
214 LIST_FOREACH(top, &tcb_list, tc_next)
215 if (top->tc_ifq->altq_ifp == ifp)
216 return top;
241 cdnr_cballoc(struct top_cdnr *top, int type, struct tc_action *(*input_func)(
275 if (top == NULL)
278 cb->cb_top = top;
291 /* if this isn't top, register the element to the top level cdnr */
292 if (top != NULL)
293 LIST_INSERT_HEAD(&top->tc_elements, cb, cb_next);
306 /* remove from the top level cdnr */
405 * top level traffic conditioner
410 struct top_cdnr *top;
412 if ((top = cdnr_cballoc(NULL, TCETYPE_TOP, NULL)) == NULL)
415 top->tc_ifq = ifq;
416 /* set default action for the top level conditioner */
417 top->tc_block.cb_action.tca_code = TCACODE_PASS;
419 LIST_INSERT_HEAD(&tcb_list, top, tc_next);
421 ifq->altq_cdnr = top;
423 return top;
427 top_destroy(struct top_cdnr *top)
431 if (ALTQ_IS_CNDTNING(top->tc_ifq))
432 ALTQ_CLEAR_CNDTNING(top->tc_ifq);
433 top->tc_ifq->altq_cdnr = NULL;
438 while ((cb = LIST_FIRST(&top->tc_elements)) != NULL) {
445 LIST_REMOVE(top, tc_next);
447 cdnr_cbdestroy(top);
451 LIST_FOREACH(top, &tcb_list, tc_next)
452 if (ALTQ_IS_CNDTNING(top->tc_ifq))
454 if (top == NULL)
465 element_create(struct top_cdnr *top, struct tc_action *action)
472 if ((cb = cdnr_cballoc(top, TCETYPE_ELEMENT, NULL)) == NULL)
520 tbm_create(struct top_cdnr *top, struct tb_profile *profile,
529 if ((tbm = cdnr_cballoc(top, TCETYPE_TBMETER,
591 trtcm_create(struct top_cdnr *top, struct tb_profile *cmtd_profile,
603 if ((tcm = cdnr_cballoc(top, TCETYPE_TRTCM,
714 tswtcm_create(struct top_cdnr *top, u_int32_t cmtd_rate, u_int32_t peak_rate,
725 if ((tsw = cdnr_cballoc(top, TCETYPE_TSWTCM,
839 struct top_cdnr *top;
847 if ((top = top_create(&ifp->if_snd)) == NULL)
855 struct top_cdnr *top;
857 if ((top = tcb_lookup(ifname)) == NULL)
860 return top_destroy(top);
866 struct top_cdnr *top;
869 if ((top = tcb_lookup(ap->iface.cdnr_ifname)) == NULL)
872 cb = element_create(top, &ap->action);
883 struct top_cdnr *top;
886 if ((top = tcb_lookup(ap->iface.cdnr_ifname)) == NULL)
901 struct top_cdnr *top;
904 if ((top = tcb_lookup(ap->iface.cdnr_ifname)) == NULL)
910 return acc_add_filter(&top->tc_classifier, &ap->filter,
917 struct top_cdnr *top;
919 if ((top = tcb_lookup(ap->iface.cdnr_ifname)) == NULL)
922 return acc_delete_filter(&top->tc_classifier, ap->filter_handle);
928 struct top_cdnr *top;
931 if ((top = tcb_lookup(ap->iface.cdnr_ifname)) == NULL)
934 tbm = tbm_create(top, &ap->profile, &ap->in_action, &ap->out_action);
972 struct top_cdnr *top;
975 if ((top = tcb_lookup(ap->iface.cdnr_ifname)) == NULL)
978 tcm = trtcm_create(top, &ap->cmtd_profile, &ap->peak_profile,
1032 struct top_cdnr *top;
1035 if ((top = tcb_lookup(ap->iface.cdnr_ifname)) == NULL)
1041 tsw = tswtcm_create(top, ap->cmtd_rate, ap->peak_rate,
1077 struct top_cdnr *top;
1085 if ((top = tcb_lookup(ap->iface.cdnr_ifname)) == NULL)
1089 (void)memcpy(ap->cnts, top->tc_cnts, sizeof(ap->cnts));
1099 LIST_FOREACH(cb, &top->tc_elements, cb_next) {
1165 struct top_cdnr *top;
1168 while ((top = LIST_FIRST(&tcb_list)) != NULL) {
1170 err = top_destroy(top);
1183 struct top_cdnr *top;
1215 if ((top = tcb_lookup(ifacep->cdnr_ifname)) == NULL) {
1223 ALTQ_SET_CNDTNING(top->tc_ifq);
1229 ALTQ_CLEAR_CNDTNING(top->tc_ifq);
1230 LIST_FOREACH(top, &tcb_list, tc_next)
1231 if (ALTQ_IS_CNDTNING(top->tc_ifq))
1233 if (top == NULL)