Home | History | Annotate | Download | only in route

Lines Matching defs:class

2  * lib/route/class.c            Queueing Classes
14 * @defgroup class Queueing Classes
22 #include <netlink/route/class.h>
23 #include <netlink/route/class-modules.h>
34 struct rtnl_class *class;
37 class = rtnl_class_alloc();
38 if (!class) {
42 class->ce_msgtype = n->nlmsg_type;
44 err = tca_msg_parser(n, (struct rtnl_tca *) class);
48 cops = rtnl_class_lookup_ops(class);
50 err = cops->co_msg_parser(class);
55 err = pp->pp_cb((struct nl_object *) class, pp);
57 rtnl_class_put(class);
78 static int class_build(struct rtnl_class *class, int type, int flags,
84 err = tca_build_msg((struct rtnl_tca *) class, type, flags, result);
88 cops = rtnl_class_lookup_ops(class);
92 opts = cops->co_get_opts(class);
108 * Build a netlink message to add a new class
109 * @arg class class to add
113 * Builds a new netlink message requesting an addition of a class.
123 int rtnl_class_build_add_request(struct rtnl_class *class, int flags,
126 return class_build(class, RTM_NEWTCLASS, NLM_F_CREATE | flags, result);
130 * Add a new class
132 * @arg class class to delete
144 int rtnl_class_add(struct nl_sock *sk, struct rtnl_class *class, int flags)
149 if ((err = rtnl_class_build_add_request(class, flags, &msg)) < 0)
160 int rtnl_class_build_delete_request(struct rtnl_class *class,
167 if ((class->ce_mask & required) != required)
175 tchdr.tcm_handle = class->c_handle;
176 tchdr.tcm_parent = class->c_parent;
177 tchdr.tcm_ifindex = class->c_ifindex;
188 * Delete a class
190 * @arg class class to delete
198 int rtnl_class_delete(struct nl_sock *sk, struct rtnl_class *class)
203 if ((err = rtnl_class_build_delete_request(class, &msg)) < 0)
222 * Build a class cache including all classes attached to the specified interface
254 * Look up class by its handle in the provided cache
255 * @arg cache class cache
256 * @arg ifindex interface the class is attached to
257 * @arg handle class handle
258 * @return pointer to class inside the cache or NULL if no match was found.
263 struct rtnl_class *class;
268 nl_list_for_each_entry(class, &cache->c_items, ce_list) {
269 if (class->c_handle == handle && class->c_ifindex == ifindex) {
270 nl_object_get((struct nl_object *) class);
271 return class;
280 .co_name = "route/class",