• Home
  • Raw
  • Download

Lines Matching full:link

2  * lib/route/link/vlan.c	VLAN Link Info
13 * @ingroup link
15 * Virtual LAN link module
18 * \b Link Type Name: "vlan"
31 #include <netlink-private/route/link/api.h>
32 #include <netlink/route/link/vlan.h>
66 static int vlan_alloc(struct rtnl_link *link) in vlan_alloc() argument
73 link->l_info = vi; in vlan_alloc()
78 static int vlan_parse(struct rtnl_link *link, struct nlattr *data, in vlan_parse() argument
85 NL_DBG(3, "Parsing VLAN link info"); in vlan_parse()
90 if ((err = vlan_alloc(link)) < 0) in vlan_parse()
93 vi = link->l_info; in vlan_parse()
169 static void vlan_free(struct rtnl_link *link) in vlan_free() argument
171 struct vlan_info *vi = link->l_info; in vlan_free()
179 link->l_info = NULL; in vlan_free()
182 static void vlan_dump_line(struct rtnl_link *link, struct nl_dump_params *p) in vlan_dump_line() argument
184 struct vlan_info *vi = link->l_info; in vlan_dump_line()
189 static void vlan_dump_details(struct rtnl_link *link, struct nl_dump_params *p) in vlan_dump_details() argument
191 struct vlan_info *vi = link->l_info; in vlan_dump_details()
265 static int vlan_put_attrs(struct nl_msg *msg, struct rtnl_link *link) in vlan_put_attrs() argument
267 struct vlan_info *vi = link->l_info; in vlan_put_attrs()
344 #define IS_VLAN_LINK_ASSERT(link) \ argument
345 if ((link)->l_info_ops != &vlan_info_ops) { \
346 APPBUG("Link is not a vlan link. set type \"vlan\" first."); \
357 * Allocate link object of type VLAN
359 * @return Allocated link object or NULL.
363 struct rtnl_link *link; in rtnl_link_vlan_alloc() local
366 if (!(link = rtnl_link_alloc())) in rtnl_link_vlan_alloc()
369 if ((err = rtnl_link_set_type(link, "vlan")) < 0) { in rtnl_link_vlan_alloc()
370 rtnl_link_put(link); in rtnl_link_vlan_alloc()
374 return link; in rtnl_link_vlan_alloc()
378 * Check if link is a VLAN link
379 * @arg link Link object
381 * @return True if link is a VLAN link, otherwise false is returned.
383 int rtnl_link_is_vlan(struct rtnl_link *link) in rtnl_link_is_vlan() argument
385 return link->l_info_ops && !strcmp(link->l_info_ops->io_name, "vlan"); in rtnl_link_is_vlan()
390 * @arg link Link object
395 int rtnl_link_vlan_set_id(struct rtnl_link *link, uint16_t id) in rtnl_link_vlan_set_id() argument
397 struct vlan_info *vi = link->l_info; in rtnl_link_vlan_set_id()
399 IS_VLAN_LINK_ASSERT(link); in rtnl_link_vlan_set_id()
409 * @arg link Link object
413 int rtnl_link_vlan_get_id(struct rtnl_link *link) in rtnl_link_vlan_get_id() argument
415 struct vlan_info *vi = link->l_info; in rtnl_link_vlan_get_id()
417 IS_VLAN_LINK_ASSERT(link); in rtnl_link_vlan_get_id()
427 * @arg link Link object
432 int rtnl_link_vlan_set_protocol(struct rtnl_link *link, uint16_t protocol) in rtnl_link_vlan_set_protocol() argument
434 struct vlan_info *vi = link->l_info; in rtnl_link_vlan_set_protocol()
436 IS_VLAN_LINK_ASSERT(link); in rtnl_link_vlan_set_protocol()
446 * @arg link Link object
450 int rtnl_link_vlan_get_protocol(struct rtnl_link *link) in rtnl_link_vlan_get_protocol() argument
452 struct vlan_info *vi = link->l_info; in rtnl_link_vlan_get_protocol()
454 IS_VLAN_LINK_ASSERT(link); in rtnl_link_vlan_get_protocol()
464 * @arg link Link object
469 int rtnl_link_vlan_set_flags(struct rtnl_link *link, unsigned int flags) in rtnl_link_vlan_set_flags() argument
471 struct vlan_info *vi = link->l_info; in rtnl_link_vlan_set_flags()
473 IS_VLAN_LINK_ASSERT(link); in rtnl_link_vlan_set_flags()
484 * @arg link Link object
489 int rtnl_link_vlan_unset_flags(struct rtnl_link *link, unsigned int flags) in rtnl_link_vlan_unset_flags() argument
491 struct vlan_info *vi = link->l_info; in rtnl_link_vlan_unset_flags()
493 IS_VLAN_LINK_ASSERT(link); in rtnl_link_vlan_unset_flags()
504 * @arg link Link object
508 int rtnl_link_vlan_get_flags(struct rtnl_link *link) in rtnl_link_vlan_get_flags() argument
510 struct vlan_info *vi = link->l_info; in rtnl_link_vlan_get_flags()
512 IS_VLAN_LINK_ASSERT(link); in rtnl_link_vlan_get_flags()
524 int rtnl_link_vlan_set_ingress_map(struct rtnl_link *link, int from, in rtnl_link_vlan_set_ingress_map() argument
527 struct vlan_info *vi = link->l_info; in rtnl_link_vlan_set_ingress_map()
529 IS_VLAN_LINK_ASSERT(link); in rtnl_link_vlan_set_ingress_map()
540 uint32_t *rtnl_link_vlan_get_ingress_map(struct rtnl_link *link) in rtnl_link_vlan_get_ingress_map() argument
542 struct vlan_info *vi = link->l_info; in rtnl_link_vlan_get_ingress_map()
544 if (link->l_info_ops != &vlan_info_ops || !link->l_info_ops) in rtnl_link_vlan_get_ingress_map()
553 int rtnl_link_vlan_set_egress_map(struct rtnl_link *link, uint32_t from, int to) in rtnl_link_vlan_set_egress_map() argument
555 struct vlan_info *vi = link->l_info; in rtnl_link_vlan_set_egress_map()
557 if (link->l_info_ops != &vlan_info_ops || !link->l_info_ops) in rtnl_link_vlan_set_egress_map()
583 struct vlan_map *rtnl_link_vlan_get_egress_map(struct rtnl_link *link, in rtnl_link_vlan_get_egress_map() argument
586 struct vlan_info *vi = link->l_info; in rtnl_link_vlan_get_egress_map()
588 if (link->l_info_ops != &vlan_info_ops || !link->l_info_ops) in rtnl_link_vlan_get_egress_map()