Variables | |
| struct nl_object_ops | class_obj_ops |
Allocation/Freeing | |
|
| |
| struct rtnl_class * | rtnl_class_alloc (void) |
| void | rtnl_class_put (struct rtnl_class *class) |
Leaf Qdisc | |
|
| |
| struct rtnl_qdisc * | rtnl_class_leaf_qdisc (struct rtnl_class *class, struct nl_cache *cache) |
| Lookup the leaf qdisc of a class. | |
Iterators | |
|
| |
| void | rtnl_class_foreach_child (struct rtnl_class *class, struct nl_cache *cache, void(*cb)(struct nl_object *, void *), void *arg) |
| Call a callback for each child of a class. | |
| void | rtnl_class_foreach_cls (struct rtnl_class *class, struct nl_cache *cache, void(*cb)(struct nl_object *, void *), void *arg) |
| Call a callback for each classifier attached to the class. | |
Attributes | |
|
| |
| void | rtnl_class_set_ifindex (struct rtnl_class *class, int ifindex) |
| int | rtnl_class_get_ifindex (struct rtnl_class *class) |
| void | rtnl_class_set_handle (struct rtnl_class *class, uint32_t handle) |
| uint32_t | rtnl_class_get_handle (struct rtnl_class *class) |
| void | rtnl_class_set_parent (struct rtnl_class *class, uint32_t parent) |
| uint32_t | rtnl_class_get_parent (struct rtnl_class *class) |
| void | rtnl_class_set_kind (struct rtnl_class *class, const char *name) |
| char * | rtnl_class_get_kind (struct rtnl_class *class) |
| uint64_t | rtnl_class_get_stat (struct rtnl_class *class, enum rtnl_tc_stats_id id) |
| struct rtnl_qdisc* rtnl_class_leaf_qdisc | ( | struct rtnl_class * | class, | |
| struct nl_cache * | cache | |||
| ) | [read] |
| class | the parent class | |
| cache | a qdisc cache including at laest all qdiscs of the interface the specified class is attached to |
Definition at line 145 of file class_obj.c.
References rtnl_qdisc_get_by_parent().
00147 { 00148 struct rtnl_qdisc *leaf; 00149 00150 if (!class->c_info) 00151 return NULL; 00152 00153 leaf = rtnl_qdisc_get_by_parent(cache, class->c_ifindex, 00154 class->c_handle); 00155 if (!leaf || leaf->q_handle != class->c_info) 00156 return NULL; 00157 00158 return leaf; 00159 }
| void rtnl_class_foreach_child | ( | struct rtnl_class * | class, | |
| struct nl_cache * | cache, | |||
| void(*)(struct nl_object *, void *) | cb, | |||
| void * | arg | |||
| ) |
| class | the parent class | |
| cache | a class cache including all classes of the interface the specified class is attached to | |
| cb | callback function | |
| arg | argument to be passed to callback function |
Definition at line 177 of file class_obj.c.
References nl_cache_foreach_filter().
00179 { 00180 struct rtnl_class *filter; 00181 00182 filter = rtnl_class_alloc(); 00183 if (!filter) 00184 return; 00185 00186 rtnl_class_set_parent(filter, class->c_handle); 00187 rtnl_class_set_ifindex(filter, class->c_ifindex); 00188 rtnl_class_set_kind(filter, class->c_kind); 00189 00190 nl_cache_foreach_filter(cache, (struct nl_object *) filter, cb, arg); 00191 rtnl_class_put(filter); 00192 }
| void rtnl_class_foreach_cls | ( | struct rtnl_class * | class, | |
| struct nl_cache * | cache, | |||
| void(*)(struct nl_object *, void *) | cb, | |||
| void * | arg | |||
| ) |
| class | the parent class | |
| cache | a filter cache including at least all the filters attached to the specified class | |
| cb | callback function | |
| arg | argument to be passed to callback function |
Definition at line 202 of file class_obj.c.
References nl_cache_foreach_filter().
00204 { 00205 struct rtnl_cls *filter; 00206 00207 filter = rtnl_cls_alloc(); 00208 if (!filter) 00209 return; 00210 00211 rtnl_cls_set_ifindex(filter, class->c_ifindex); 00212 rtnl_cls_set_parent(filter, class->c_parent); 00213 00214 nl_cache_foreach_filter(cache, (struct nl_object *) filter, cb, arg); 00215 rtnl_cls_put(filter); 00216 }
| struct nl_object_ops class_obj_ops |
{
.oo_name = "route/class",
.oo_size = sizeof(struct rtnl_class),
.oo_free_data = class_free_data,
.oo_clone = class_clone,
.oo_dump[NL_DUMP_BRIEF] = class_dump_brief,
.oo_dump[NL_DUMP_FULL] = class_dump_full,
.oo_dump[NL_DUMP_STATS] = class_dump_stats,
.oo_compare = tca_compare,
.oo_id_attrs = (TCA_ATTR_IFINDEX | TCA_ATTR_HANDLE),
}
Definition at line 275 of file class_obj.c.
1.6.1