libnl 1.1.4
Variables

Variables

struct nl_object_ops cls_obj_ops
 

Allocation/Freeing

struct rtnl_cls * rtnl_cls_alloc (void)
 
void rtnl_cls_put (struct rtnl_cls *cls)
 

Attributes

void rtnl_cls_set_ifindex (struct rtnl_cls *f, int ifindex)
 
void rtnl_cls_set_handle (struct rtnl_cls *f, uint32_t handle)
 
void rtnl_cls_set_parent (struct rtnl_cls *f, uint32_t parent)
 
void rtnl_cls_set_kind (struct rtnl_cls *f, const char *kind)
 
void rtnl_cls_set_prio (struct rtnl_cls *cls, int prio)
 
int rtnl_cls_get_prio (struct rtnl_cls *cls)
 
void rtnl_cls_set_protocol (struct rtnl_cls *cls, int protocol)
 
int rtnl_cls_get_protocol (struct rtnl_cls *cls)
 

Detailed Description

Function Documentation

◆ rtnl_cls_alloc()

struct rtnl_cls * rtnl_cls_alloc ( void  )

Definition at line 122 of file cls_obj.c.

123{
124 return (struct rtnl_cls *) nl_object_alloc(&cls_obj_ops);
125}
struct nl_object * nl_object_alloc(struct nl_object_ops *ops)
Allocate a new object of kind specified by the operations handle.
Definition: object.c:42

◆ rtnl_cls_put()

void rtnl_cls_put ( struct rtnl_cls *  cls)

Definition at line 127 of file cls_obj.c.

128{
129 nl_object_put((struct nl_object *) cls);
130}
void nl_object_put(struct nl_object *obj)
Release a reference from an object.
Definition: object.c:178

◆ rtnl_cls_set_ifindex()

void rtnl_cls_set_ifindex ( struct rtnl_cls *  f,
int  ifindex 
)

Definition at line 140 of file cls_obj.c.

141{
142 tca_set_ifindex((struct rtnl_tca *) f, ifindex);
143}

◆ rtnl_cls_set_handle()

void rtnl_cls_set_handle ( struct rtnl_cls *  f,
uint32_t  handle 
)

Definition at line 145 of file cls_obj.c.

146{
147 tca_set_handle((struct rtnl_tca *) f, handle);
148}

◆ rtnl_cls_set_parent()

void rtnl_cls_set_parent ( struct rtnl_cls *  f,
uint32_t  parent 
)

Definition at line 150 of file cls_obj.c.

151{
152 tca_set_parent((struct rtnl_tca *) f, parent);
153}

◆ rtnl_cls_set_kind()

void rtnl_cls_set_kind ( struct rtnl_cls *  f,
const char *  kind 
)

Definition at line 155 of file cls_obj.c.

156{
157 tca_set_kind((struct rtnl_tca *) f, kind);
158 f->c_ops = __rtnl_cls_lookup_ops(kind);
159}

◆ rtnl_cls_set_prio()

void rtnl_cls_set_prio ( struct rtnl_cls *  cls,
int  prio 
)

Definition at line 161 of file cls_obj.c.

162{
163 cls->c_prio = prio;
164 cls->ce_mask |= CLS_ATTR_PRIO;
165}

◆ rtnl_cls_get_prio()

int rtnl_cls_get_prio ( struct rtnl_cls *  cls)

Definition at line 167 of file cls_obj.c.

168{
169 if (cls->ce_mask & CLS_ATTR_PRIO)
170 return cls->c_prio;
171 else
172 return 0;
173}

◆ rtnl_cls_set_protocol()

void rtnl_cls_set_protocol ( struct rtnl_cls *  cls,
int  protocol 
)

Definition at line 175 of file cls_obj.c.

176{
177 cls->c_protocol = protocol;
178 cls->ce_mask |= CLS_ATTR_PROTOCOL;
179}

◆ rtnl_cls_get_protocol()

int rtnl_cls_get_protocol ( struct rtnl_cls *  cls)

Definition at line 181 of file cls_obj.c.

182{
183 if (cls->ce_mask & CLS_ATTR_PROTOCOL)
184 return cls->c_protocol;
185 else
186 return ETH_P_ALL;
187}

Variable Documentation

◆ cls_obj_ops

struct nl_object_ops cls_obj_ops
Initial value:
= {
.oo_name = "route/cls",
.oo_size = sizeof(struct rtnl_cls),
.oo_free_data = cls_free_data,
.oo_clone = cls_clone,
.oo_dump[NL_DUMP_BRIEF] = cls_dump_brief,
.oo_dump[NL_DUMP_FULL] = cls_dump_full,
.oo_dump[NL_DUMP_STATS] = cls_dump_stats,
.oo_compare = tca_compare,
.oo_id_attrs = (TCA_ATTR_IFINDEX | TCA_ATTR_HANDLE),
}
@ NL_DUMP_FULL
Dump all attributes but no statistics.
Definition: types.h:23
@ NL_DUMP_BRIEF
Dump object in a brief one-liner.
Definition: types.h:22
@ NL_DUMP_STATS
Dump all attributes including statistics.
Definition: types.h:24

Definition at line 191 of file cls_obj.c.