Lines Matching full:link
2 * lib/route/link/vxlan.c VXLAN Link Info
13 * @ingroup link
15 * Virtual eXtensible Local Area Network link module
18 * \b Link Type Name: "vxlan"
31 #include <netlink-private/route/link/api.h>
32 #include <netlink/route/link/vxlan.h>
90 static int vxlan_alloc(struct rtnl_link *link) in vxlan_alloc() argument
97 link->l_info = vxi; in vxlan_alloc()
102 static int vxlan_parse(struct rtnl_link *link, struct nlattr *data, in vxlan_parse() argument
109 NL_DBG(3, "Parsing VXLAN link info"); in vxlan_parse()
114 if ((err = vxlan_alloc(link)) < 0) in vxlan_parse()
117 vxi = link->l_info; in vxlan_parse()
198 static void vxlan_free(struct rtnl_link *link) in vxlan_free() argument
200 struct vxlan_info *vxi = link->l_info; in vxlan_free()
203 link->l_info = NULL; in vxlan_free()
206 static void vxlan_dump_line(struct rtnl_link *link, struct nl_dump_params *p) in vxlan_dump_line() argument
208 struct vxlan_info *vxi = link->l_info; in vxlan_dump_line()
213 static void vxlan_dump_details(struct rtnl_link *link, struct nl_dump_params *p) in vxlan_dump_details() argument
215 struct vxlan_info *vxi = link->l_info; in vxlan_dump_details()
229 nl_dump(p, " link "); in vxlan_dump_details()
230 name = rtnl_link_get_name(link); in vxlan_dump_details()
341 static int vxlan_put_attrs(struct nl_msg *msg, struct rtnl_link *link) in vxlan_put_attrs() argument
343 struct vxlan_info *vxi = link->l_info; in vxlan_put_attrs()
413 #define IS_VXLAN_LINK_ASSERT(link) \ argument
414 if ((link)->l_info_ops != &vxlan_info_ops) { \
415 APPBUG("Link is not a vxlan link. set type \"vxlan\" first."); \
426 * Allocate link object of type VXLAN
428 * @return Allocated link object or NULL.
432 struct rtnl_link *link; in rtnl_link_vxlan_alloc() local
435 if (!(link = rtnl_link_alloc())) in rtnl_link_vxlan_alloc()
438 if ((err = rtnl_link_set_type(link, "vxlan")) < 0) { in rtnl_link_vxlan_alloc()
439 rtnl_link_put(link); in rtnl_link_vxlan_alloc()
443 return link; in rtnl_link_vxlan_alloc()
447 * Check if link is a VXLAN link
448 * @arg link Link object
450 * @return True if link is a VXLAN link, otherwise false is returned.
452 int rtnl_link_is_vxlan(struct rtnl_link *link) in rtnl_link_is_vxlan() argument
454 return link->l_info_ops && !strcmp(link->l_info_ops->io_name, "vxlan"); in rtnl_link_is_vxlan()
459 * @arg link Link object
464 int rtnl_link_vxlan_set_id(struct rtnl_link *link, uint32_t id) in rtnl_link_vxlan_set_id() argument
466 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_set_id()
468 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_set_id()
481 * @arg link Link object
486 int rtnl_link_vxlan_get_id(struct rtnl_link *link, uint32_t *id) in rtnl_link_vxlan_get_id() argument
488 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_get_id()
490 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_get_id()
505 * @arg link Link object
510 int rtnl_link_vxlan_set_group(struct rtnl_link *link, struct nl_addr *addr) in rtnl_link_vxlan_set_group() argument
512 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_set_group()
514 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_set_group()
529 * @arg link Link object
534 int rtnl_link_vxlan_get_group(struct rtnl_link *link, struct nl_addr **addr) in rtnl_link_vxlan_get_group() argument
536 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_get_group()
538 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_get_group()
553 * @arg link Link object
558 int rtnl_link_vxlan_set_link(struct rtnl_link *link, uint32_t index) in rtnl_link_vxlan_set_link() argument
560 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_set_link()
562 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_set_link()
572 * @arg link Link object
577 int rtnl_link_vxlan_get_link(struct rtnl_link *link, uint32_t *index) in rtnl_link_vxlan_get_link() argument
579 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_get_link()
581 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_get_link()
596 * @arg link Link object
601 int rtnl_link_vxlan_set_local(struct rtnl_link *link, struct nl_addr *addr) in rtnl_link_vxlan_set_local() argument
603 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_set_local()
605 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_set_local()
620 * @arg link Link object
625 int rtnl_link_vxlan_get_local(struct rtnl_link *link, struct nl_addr **addr) in rtnl_link_vxlan_get_local() argument
627 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_get_local()
629 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_get_local()
644 * @arg link Link object
649 int rtnl_link_vxlan_set_ttl(struct rtnl_link *link, uint8_t ttl) in rtnl_link_vxlan_set_ttl() argument
651 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_set_ttl()
653 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_set_ttl()
663 * @arg link Link object
667 int rtnl_link_vxlan_get_ttl(struct rtnl_link *link) in rtnl_link_vxlan_get_ttl() argument
669 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_get_ttl()
671 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_get_ttl()
681 * @arg link Link object
686 int rtnl_link_vxlan_set_tos(struct rtnl_link *link, uint8_t tos) in rtnl_link_vxlan_set_tos() argument
688 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_set_tos()
690 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_set_tos()
700 * @arg link Link object
704 int rtnl_link_vxlan_get_tos(struct rtnl_link *link) in rtnl_link_vxlan_get_tos() argument
706 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_get_tos()
708 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_get_tos()
718 * @arg link Link object
723 int rtnl_link_vxlan_set_learning(struct rtnl_link *link, uint8_t learning) in rtnl_link_vxlan_set_learning() argument
725 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_set_learning()
727 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_set_learning()
737 * @arg link Link object
741 int rtnl_link_vxlan_get_learning(struct rtnl_link *link) in rtnl_link_vxlan_get_learning() argument
743 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_get_learning()
745 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_get_learning()
755 * @arg link Link object
759 int rtnl_link_vxlan_enable_learning(struct rtnl_link *link) in rtnl_link_vxlan_enable_learning() argument
761 return rtnl_link_vxlan_set_learning(link, 1); in rtnl_link_vxlan_enable_learning()
766 * @arg link Link object
770 int rtnl_link_vxlan_disable_learning(struct rtnl_link *link) in rtnl_link_vxlan_disable_learning() argument
772 return rtnl_link_vxlan_set_learning(link, 0); in rtnl_link_vxlan_disable_learning()
777 * @arg link Link object
782 int rtnl_link_vxlan_set_ageing(struct rtnl_link *link, uint32_t expiry) in rtnl_link_vxlan_set_ageing() argument
784 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_set_ageing()
786 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_set_ageing()
796 * @arg link Link object
801 int rtnl_link_vxlan_get_ageing(struct rtnl_link *link, uint32_t *expiry) in rtnl_link_vxlan_get_ageing() argument
803 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_get_ageing()
805 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_get_ageing()
820 * @arg link Link object
825 int rtnl_link_vxlan_set_limit(struct rtnl_link *link, uint32_t limit) in rtnl_link_vxlan_set_limit() argument
827 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_set_limit()
829 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_set_limit()
839 * @arg link Link object
844 int rtnl_link_vxlan_get_limit(struct rtnl_link *link, uint32_t *limit) in rtnl_link_vxlan_get_limit() argument
846 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_get_limit()
848 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_get_limit()
863 * @arg link Link object
868 int rtnl_link_vxlan_set_port_range(struct rtnl_link *link, in rtnl_link_vxlan_set_port_range() argument
871 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_set_port_range()
873 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_set_port_range()
886 * @arg link Link object
891 int rtnl_link_vxlan_get_port_range(struct rtnl_link *link, in rtnl_link_vxlan_get_port_range() argument
894 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_get_port_range()
896 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_get_port_range()
911 * @arg link Link object
916 int rtnl_link_vxlan_set_proxy(struct rtnl_link *link, uint8_t proxy) in rtnl_link_vxlan_set_proxy() argument
918 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_set_proxy()
920 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_set_proxy()
930 * @arg link Link object
934 int rtnl_link_vxlan_get_proxy(struct rtnl_link *link) in rtnl_link_vxlan_get_proxy() argument
936 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_get_proxy()
938 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_get_proxy()
948 * @arg link Link object
952 int rtnl_link_vxlan_enable_proxy(struct rtnl_link *link) in rtnl_link_vxlan_enable_proxy() argument
954 return rtnl_link_vxlan_set_proxy(link, 1); in rtnl_link_vxlan_enable_proxy()
959 * @arg link Link object
963 int rtnl_link_vxlan_disable_proxy(struct rtnl_link *link) in rtnl_link_vxlan_disable_proxy() argument
965 return rtnl_link_vxlan_set_proxy(link, 0); in rtnl_link_vxlan_disable_proxy()
970 * @arg link Link object
975 int rtnl_link_vxlan_set_rsc(struct rtnl_link *link, uint8_t rsc) in rtnl_link_vxlan_set_rsc() argument
977 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_set_rsc()
979 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_set_rsc()
989 * @arg link Link object
993 int rtnl_link_vxlan_get_rsc(struct rtnl_link *link) in rtnl_link_vxlan_get_rsc() argument
995 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_get_rsc()
997 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_get_rsc()
1007 * @arg link Link object
1011 int rtnl_link_vxlan_enable_rsc(struct rtnl_link *link) in rtnl_link_vxlan_enable_rsc() argument
1013 return rtnl_link_vxlan_set_rsc(link, 1); in rtnl_link_vxlan_enable_rsc()
1018 * @arg link Link object
1022 int rtnl_link_vxlan_disable_rsc(struct rtnl_link *link) in rtnl_link_vxlan_disable_rsc() argument
1024 return rtnl_link_vxlan_set_rsc(link, 0); in rtnl_link_vxlan_disable_rsc()
1029 * @arg link Link object
1034 int rtnl_link_vxlan_set_l2miss(struct rtnl_link *link, uint8_t miss) in rtnl_link_vxlan_set_l2miss() argument
1036 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_set_l2miss()
1038 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_set_l2miss()
1048 * @arg link Link object
1052 int rtnl_link_vxlan_get_l2miss(struct rtnl_link *link) in rtnl_link_vxlan_get_l2miss() argument
1054 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_get_l2miss()
1056 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_get_l2miss()
1066 * @arg link Link object
1070 int rtnl_link_vxlan_enable_l2miss(struct rtnl_link *link) in rtnl_link_vxlan_enable_l2miss() argument
1072 return rtnl_link_vxlan_set_l2miss(link, 1); in rtnl_link_vxlan_enable_l2miss()
1077 * @arg link Link object
1081 int rtnl_link_vxlan_disable_l2miss(struct rtnl_link *link) in rtnl_link_vxlan_disable_l2miss() argument
1083 return rtnl_link_vxlan_set_l2miss(link, 0); in rtnl_link_vxlan_disable_l2miss()
1088 * @arg link Link object
1093 int rtnl_link_vxlan_set_l3miss(struct rtnl_link *link, uint8_t miss) in rtnl_link_vxlan_set_l3miss() argument
1095 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_set_l3miss()
1097 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_set_l3miss()
1107 * @arg link Link object
1111 int rtnl_link_vxlan_get_l3miss(struct rtnl_link *link) in rtnl_link_vxlan_get_l3miss() argument
1113 struct vxlan_info *vxi = link->l_info; in rtnl_link_vxlan_get_l3miss()
1115 IS_VXLAN_LINK_ASSERT(link); in rtnl_link_vxlan_get_l3miss()
1125 * @arg link Link object
1129 int rtnl_link_vxlan_enable_l3miss(struct rtnl_link *link) in rtnl_link_vxlan_enable_l3miss() argument
1131 return rtnl_link_vxlan_set_l3miss(link, 1); in rtnl_link_vxlan_enable_l3miss()
1136 * @arg link Link object
1140 int rtnl_link_vxlan_disable_l3miss(struct rtnl_link *link) in rtnl_link_vxlan_disable_l3miss() argument
1142 return rtnl_link_vxlan_set_l3miss(link, 0); in rtnl_link_vxlan_disable_l3miss()