Lines Matching refs:qdisc
34 struct rtnl_qdisc *qdisc; in qdisc_msg_parser() local
37 if (!(qdisc = rtnl_qdisc_alloc())) in qdisc_msg_parser()
40 if ((err = rtnl_tc_msg_parse(n, TC_CAST(qdisc))) < 0) in qdisc_msg_parser()
43 err = pp->pp_cb(OBJ_CAST(qdisc), pp); in qdisc_msg_parser()
45 rtnl_qdisc_put(qdisc); in qdisc_msg_parser()
77 void rtnl_qdisc_put(struct rtnl_qdisc *qdisc) in rtnl_qdisc_put() argument
79 nl_object_put((struct nl_object *) qdisc); in rtnl_qdisc_put()
89 static int build_qdisc_msg(struct rtnl_qdisc *qdisc, int type, int flags, in build_qdisc_msg() argument
92 if (!(qdisc->ce_mask & TCA_ATTR_IFINDEX)) { in build_qdisc_msg()
97 return rtnl_tc_msg_build(TC_CAST(qdisc), type, flags, result); in build_qdisc_msg()
114 int rtnl_qdisc_build_add_request(struct rtnl_qdisc *qdisc, int flags, in rtnl_qdisc_build_add_request() argument
117 if (!(qdisc->ce_mask & (TCA_ATTR_HANDLE | TCA_ATTR_PARENT))) { in rtnl_qdisc_build_add_request()
122 return build_qdisc_msg(qdisc, RTM_NEWQDISC, flags, result); in rtnl_qdisc_build_add_request()
162 int rtnl_qdisc_add(struct nl_sock *sk, struct rtnl_qdisc *qdisc, int flags) in rtnl_qdisc_add() argument
167 if ((err = rtnl_qdisc_build_add_request(qdisc, flags, &msg)) < 0) in rtnl_qdisc_add()
188 int rtnl_qdisc_build_update_request(struct rtnl_qdisc *qdisc, in rtnl_qdisc_build_update_request() argument
198 if (!(qdisc->ce_mask & TCA_ATTR_IFINDEX)) { in rtnl_qdisc_build_update_request()
203 if (!(qdisc->ce_mask & (TCA_ATTR_HANDLE | TCA_ATTR_PARENT))) { in rtnl_qdisc_build_update_request()
208 rtnl_tc_set_ifindex(TC_CAST(new), qdisc->q_ifindex); in rtnl_qdisc_build_update_request()
210 if (qdisc->ce_mask & TCA_ATTR_HANDLE) in rtnl_qdisc_build_update_request()
211 rtnl_tc_set_handle(TC_CAST(new), qdisc->q_handle); in rtnl_qdisc_build_update_request()
213 if (qdisc->ce_mask & TCA_ATTR_PARENT) in rtnl_qdisc_build_update_request()
214 rtnl_tc_set_parent(TC_CAST(new), qdisc->q_parent); in rtnl_qdisc_build_update_request()
247 int rtnl_qdisc_update(struct nl_sock *sk, struct rtnl_qdisc *qdisc, in rtnl_qdisc_update() argument
253 err = rtnl_qdisc_build_update_request(qdisc, new, flags, &msg); in rtnl_qdisc_update()
273 int rtnl_qdisc_build_delete_request(struct rtnl_qdisc *qdisc, in rtnl_qdisc_build_delete_request() argument
280 if ((qdisc->ce_mask & required) != required) { in rtnl_qdisc_build_delete_request()
291 tchdr.tcm_ifindex = qdisc->q_ifindex; in rtnl_qdisc_build_delete_request()
292 tchdr.tcm_parent = qdisc->q_parent; in rtnl_qdisc_build_delete_request()
294 if (qdisc->ce_mask & TCA_ATTR_HANDLE) in rtnl_qdisc_build_delete_request()
295 tchdr.tcm_handle = qdisc->q_handle; in rtnl_qdisc_build_delete_request()
300 if (qdisc->ce_mask & TCA_ATTR_KIND) in rtnl_qdisc_build_delete_request()
301 NLA_PUT_STRING(msg, TCA_KIND, qdisc->q_kind); in rtnl_qdisc_build_delete_request()
340 int rtnl_qdisc_delete(struct nl_sock *sk, struct rtnl_qdisc *qdisc) in rtnl_qdisc_delete() argument
345 if ((err = rtnl_qdisc_build_delete_request(qdisc, &msg)) < 0) in rtnl_qdisc_delete()
450 void rtnl_qdisc_foreach_child(struct rtnl_qdisc *qdisc, struct nl_cache *cache, in rtnl_qdisc_foreach_child() argument
459 rtnl_tc_set_parent(TC_CAST(filter), qdisc->q_handle); in rtnl_qdisc_foreach_child()
460 rtnl_tc_set_ifindex(TC_CAST(filter), qdisc->q_ifindex); in rtnl_qdisc_foreach_child()
461 rtnl_tc_set_kind(TC_CAST(filter), qdisc->q_kind); in rtnl_qdisc_foreach_child()
474 void rtnl_qdisc_foreach_cls(struct rtnl_qdisc *qdisc, struct nl_cache *cache, in rtnl_qdisc_foreach_cls() argument
482 rtnl_tc_set_ifindex(TC_CAST(filter), qdisc->q_ifindex); in rtnl_qdisc_foreach_cls()
483 rtnl_tc_set_parent(TC_CAST(filter), qdisc->q_parent); in rtnl_qdisc_foreach_cls()
496 int rtnl_qdisc_build_change_request(struct rtnl_qdisc *qdisc, in rtnl_qdisc_build_change_request() argument
500 return rtnl_qdisc_build_update_request(qdisc, new, NLM_F_REPLACE, in rtnl_qdisc_build_change_request()
511 int rtnl_qdisc_change(struct nl_sock *sk, struct rtnl_qdisc *qdisc, in rtnl_qdisc_change() argument
514 return rtnl_qdisc_update(sk, qdisc, new, NLM_F_REPLACE); in rtnl_qdisc_change()
521 struct rtnl_qdisc *qdisc = (struct rtnl_qdisc *) tc; in qdisc_dump_details() local
523 nl_dump(p, "refcnt %u ", qdisc->q_info); in qdisc_dump_details()