Lines Matching full:link
2 * lib/route/link/macvlan.c MACVLAN Link Info
13 * @ingroup link
15 * MAC-based Virtual LAN link module
18 * \b Link Type Name: "macvlan"
31 #include <netlink-private/route/link/api.h>
32 #include <netlink/route/link/macvlan.h>
54 static int macvlan_alloc(struct rtnl_link *link) in macvlan_alloc() argument
61 link->l_info = mvi; in macvlan_alloc()
66 static int macvlan_parse(struct rtnl_link *link, struct nlattr *data, in macvlan_parse() argument
73 NL_DBG(3, "Parsing MACVLAN link info"); in macvlan_parse()
78 if ((err = macvlan_alloc(link)) < 0) in macvlan_parse()
81 mvi = link->l_info; in macvlan_parse()
98 static void macvlan_free(struct rtnl_link *link) in macvlan_free() argument
100 free(link->l_info); in macvlan_free()
101 link->l_info = NULL; in macvlan_free()
104 static void macvlan_dump(struct rtnl_link *link, struct nl_dump_params *p) in macvlan_dump() argument
107 struct macvlan_info *mvi = link->l_info; in macvlan_dump()
138 static int macvlan_put_attrs(struct nl_msg *msg, struct rtnl_link *link) in macvlan_put_attrs() argument
140 struct macvlan_info *mvi = link->l_info; in macvlan_put_attrs()
173 #define IS_MACVLAN_LINK_ASSERT(link) \ argument
174 if ((link)->l_info_ops != &macvlan_info_ops) { \
175 APPBUG("Link is not a macvlan link. set type \"macvlan\" first."); \
186 * Allocate link object of type MACVLAN
188 * @return Allocated link object or NULL.
192 struct rtnl_link *link; in rtnl_link_macvlan_alloc() local
195 if (!(link = rtnl_link_alloc())) in rtnl_link_macvlan_alloc()
198 if ((err = rtnl_link_set_type(link, "macvlan")) < 0) { in rtnl_link_macvlan_alloc()
199 rtnl_link_put(link); in rtnl_link_macvlan_alloc()
203 return link; in rtnl_link_macvlan_alloc()
207 * Check if link is a MACVLAN link
208 * @arg link Link object
210 * @return True if link is a MACVLAN link, otherwise false is returned.
212 int rtnl_link_is_macvlan(struct rtnl_link *link) in rtnl_link_is_macvlan() argument
214 return link->l_info_ops && !strcmp(link->l_info_ops->io_name, "macvlan"); in rtnl_link_is_macvlan()
219 * @arg link Link object
224 int rtnl_link_macvlan_set_mode(struct rtnl_link *link, uint32_t mode) in rtnl_link_macvlan_set_mode() argument
226 struct macvlan_info *mvi = link->l_info; in rtnl_link_macvlan_set_mode()
228 IS_MACVLAN_LINK_ASSERT(link); in rtnl_link_macvlan_set_mode()
238 * @arg link Link object
242 uint32_t rtnl_link_macvlan_get_mode(struct rtnl_link *link) in rtnl_link_macvlan_get_mode() argument
244 struct macvlan_info *mvi = link->l_info; in rtnl_link_macvlan_get_mode()
246 IS_MACVLAN_LINK_ASSERT(link); in rtnl_link_macvlan_get_mode()
256 * @arg link Link object
261 int rtnl_link_macvlan_set_flags(struct rtnl_link *link, uint16_t flags) in rtnl_link_macvlan_set_flags() argument
263 struct macvlan_info *mvi = link->l_info; in rtnl_link_macvlan_set_flags()
265 IS_MACVLAN_LINK_ASSERT(link); in rtnl_link_macvlan_set_flags()
275 * @arg link Link object
283 int rtnl_link_macvlan_unset_flags(struct rtnl_link *link, uint16_t flags) in rtnl_link_macvlan_unset_flags() argument
285 struct macvlan_info *mvi = link->l_info; in rtnl_link_macvlan_unset_flags()
287 IS_MACVLAN_LINK_ASSERT(link); in rtnl_link_macvlan_unset_flags()
297 * @arg link Link object
301 uint16_t rtnl_link_macvlan_get_flags(struct rtnl_link *link) in rtnl_link_macvlan_get_flags() argument
303 struct macvlan_info *mvi = link->l_info; in rtnl_link_macvlan_get_flags()
305 IS_MACVLAN_LINK_ASSERT(link); in rtnl_link_macvlan_get_flags()