Lines Matching refs:cls
34 struct rtnl_cls *cls = (struct rtnl_cls *) obj; in cls_free_data() local
37 tca_free_data((struct rtnl_tca *) cls); in cls_free_data()
39 cops = rtnl_cls_lookup_ops(cls); in cls_free_data()
41 cops->co_free_data(cls); in cls_free_data()
43 nl_data_free(cls->c_subdata); in cls_free_data()
74 struct rtnl_cls *cls = (struct rtnl_cls *) obj; in cls_dump_line() local
77 tca_dump_line((struct rtnl_tca *) cls, "cls", p); in cls_dump_line()
79 nl_dump(p, " prio %u protocol %s", cls->c_prio, in cls_dump_line()
80 nl_ether_proto2str(cls->c_protocol, buf, sizeof(buf))); in cls_dump_line()
82 cops = rtnl_cls_lookup_ops(cls); in cls_dump_line()
84 cops->co_dump[NL_DUMP_LINE](cls, p); in cls_dump_line()
90 struct rtnl_cls *cls = (struct rtnl_cls *) obj; in cls_dump_details() local
94 tca_dump_details((struct rtnl_tca *) cls, p); in cls_dump_details()
96 cops = rtnl_cls_lookup_ops(cls); in cls_dump_details()
98 cops->co_dump[NL_DUMP_DETAILS](cls, p); in cls_dump_details()
105 struct rtnl_cls *cls = (struct rtnl_cls *) obj; in cls_dump_stats() local
109 tca_dump_stats((struct rtnl_tca *) cls, p); in cls_dump_stats()
112 cops = rtnl_cls_lookup_ops(cls); in cls_dump_stats()
114 cops->co_dump[NL_DUMP_STATS](cls, p); in cls_dump_stats()
127 void rtnl_cls_put(struct rtnl_cls *cls) in rtnl_cls_put() argument
129 nl_object_put((struct nl_object *) cls); in rtnl_cls_put()
145 int rtnl_cls_get_ifindex(struct rtnl_cls *cls) in rtnl_cls_get_ifindex() argument
147 return cls->c_ifindex; in rtnl_cls_get_ifindex()
160 uint32_t rtnl_cls_get_parent(struct rtnl_cls *cls) in rtnl_cls_get_parent() argument
162 return cls->c_parent; in rtnl_cls_get_parent()
165 int rtnl_cls_set_kind(struct rtnl_cls *cls, const char *kind) in rtnl_cls_set_kind() argument
167 if (cls->ce_mask & TCA_ATTR_KIND) in rtnl_cls_set_kind()
170 tca_set_kind((struct rtnl_tca *) cls, kind); in rtnl_cls_set_kind()
173 rtnl_cls_data(cls); in rtnl_cls_set_kind()
178 struct rtnl_cls_ops *rtnl_cls_get_ops(struct rtnl_cls *cls) in rtnl_cls_get_ops() argument
180 return cls->c_ops; in rtnl_cls_get_ops()
183 void rtnl_cls_set_prio(struct rtnl_cls *cls, uint16_t prio) in rtnl_cls_set_prio() argument
185 cls->c_prio = prio; in rtnl_cls_set_prio()
186 cls->ce_mask |= CLS_ATTR_PRIO; in rtnl_cls_set_prio()
189 uint16_t rtnl_cls_get_prio(struct rtnl_cls *cls) in rtnl_cls_get_prio() argument
191 if (cls->ce_mask & CLS_ATTR_PRIO) in rtnl_cls_get_prio()
192 return cls->c_prio; in rtnl_cls_get_prio()
197 void rtnl_cls_set_protocol(struct rtnl_cls *cls, uint16_t protocol) in rtnl_cls_set_protocol() argument
199 cls->c_protocol = protocol; in rtnl_cls_set_protocol()
200 cls->ce_mask |= CLS_ATTR_PROTOCOL; in rtnl_cls_set_protocol()
203 uint16_t rtnl_cls_get_protocol(struct rtnl_cls *cls) in rtnl_cls_get_protocol() argument
205 if (cls->ce_mask & CLS_ATTR_PROTOCOL) in rtnl_cls_get_protocol()
206 return cls->c_protocol; in rtnl_cls_get_protocol()
211 void *rtnl_cls_data(struct rtnl_cls *cls) in rtnl_cls_data() argument
213 if (!cls->c_subdata) { in rtnl_cls_data()
214 struct rtnl_cls_ops *ops = cls->c_ops; in rtnl_cls_data()
217 if (!cls->c_kind[0]) in rtnl_cls_data()
220 ops = __rtnl_cls_lookup_ops(cls->c_kind); in rtnl_cls_data()
224 cls->c_ops = ops; in rtnl_cls_data()
230 if (!(cls->c_subdata = nl_data_alloc(NULL, ops->co_size))) in rtnl_cls_data()
234 return nl_data_get(cls->c_subdata); in rtnl_cls_data()