• Home
  • Raw
  • Download

Lines Matching full:link

2  * lib/route/link/ip6tnl.c        IP6TNL Link Info
13 * @ingroup link
15 * ip6tnl link module
18 * \b Link Type Name: "ip6tnl"
31 #include <netlink-private/route/link/api.h>
52 uint32_t link; member
71 static int ip6_tnl_alloc(struct rtnl_link *link) in ip6_tnl_alloc() argument
79 link->l_info = ip6_tnl; in ip6_tnl_alloc()
84 static int ip6_tnl_parse(struct rtnl_link *link, struct nlattr *data, in ip6_tnl_parse() argument
91 NL_DBG(3, "Parsing IP6_TNL link info"); in ip6_tnl_parse()
97 err = ip6_tnl_alloc(link); in ip6_tnl_parse()
101 ip6_tnl = link->l_info; in ip6_tnl_parse()
104 ip6_tnl->link = nla_get_u32(tb[IFLA_IPTUN_LINK]); in ip6_tnl_parse()
154 static int ip6_tnl_put_attrs(struct nl_msg *msg, struct rtnl_link *link) in ip6_tnl_put_attrs() argument
156 struct ip6_tnl_info *ip6_tnl = link->l_info; in ip6_tnl_put_attrs()
164 NLA_PUT_U32(msg, IFLA_IPTUN_LINK, ip6_tnl->link); in ip6_tnl_put_attrs()
199 static void ip6_tnl_free(struct rtnl_link *link) in ip6_tnl_free() argument
201 struct ip6_tnl_info *ip6_tnl = link->l_info; in ip6_tnl_free()
204 link->l_info = NULL; in ip6_tnl_free()
207 static void ip6_tnl_dump_line(struct rtnl_link *link, struct nl_dump_params *p) in ip6_tnl_dump_line() argument
209 nl_dump(p, "ip6_tnl : %s", link->l_name); in ip6_tnl_dump_line()
212 static void ip6_tnl_dump_details(struct rtnl_link *link, struct nl_dump_params *p) in ip6_tnl_dump_details() argument
214 struct ip6_tnl_info *ip6_tnl = link->l_info; in ip6_tnl_dump_details()
218 nl_dump(p, " link "); in ip6_tnl_dump_details()
219 name = rtnl_link_get_name(link); in ip6_tnl_dump_details()
223 nl_dump_line(p, "%u\n", ip6_tnl->link); in ip6_tnl_dump_details()
309 #define IS_IP6_TNL_LINK_ASSERT(link)\ argument
310 if ((link)->l_info_ops != &ip6_tnl_info_ops) {\
311 APPBUG("Link is not a ip6_tnl link. set type \"ip6tnl\" first.");\
317 struct rtnl_link *link; in rtnl_link_ip6_tnl_alloc() local
320 link = rtnl_link_alloc(); in rtnl_link_ip6_tnl_alloc()
321 if (!link) in rtnl_link_ip6_tnl_alloc()
324 err = rtnl_link_set_type(link, "ip6tnl"); in rtnl_link_ip6_tnl_alloc()
326 rtnl_link_put(link); in rtnl_link_ip6_tnl_alloc()
330 return link; in rtnl_link_ip6_tnl_alloc()
334 * Check if link is a IP6_TNL link
335 * @arg link Link object
337 * @return True if link is a IP6_TNL link, otherwise false is returned.
339 int rtnl_link_is_ip6_tnl(struct rtnl_link *link) in rtnl_link_is_ip6_tnl() argument
341 return link->l_info_ops && !strcmp(link->l_info_ops->io_name, "ip6tnl"); in rtnl_link_is_ip6_tnl()
354 struct rtnl_link *link; in rtnl_link_ip6_tnl_add() local
357 link = rtnl_link_ip6_tnl_alloc(); in rtnl_link_ip6_tnl_add()
358 if (!link) in rtnl_link_ip6_tnl_add()
362 rtnl_link_set_name(link, name); in rtnl_link_ip6_tnl_add()
364 err = rtnl_link_add(sk, link, NLM_F_CREATE); in rtnl_link_ip6_tnl_add()
365 rtnl_link_put(link); in rtnl_link_ip6_tnl_add()
372 * @arg link Link object
377 int rtnl_link_ip6_tnl_set_link(struct rtnl_link *link, uint32_t index) in rtnl_link_ip6_tnl_set_link() argument
379 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_set_link()
381 IS_IP6_TNL_LINK_ASSERT(link); in rtnl_link_ip6_tnl_set_link()
383 ip6_tnl->link = index; in rtnl_link_ip6_tnl_set_link()
391 * @arg link Link object
395 uint32_t rtnl_link_ip6_tnl_get_link(struct rtnl_link *link) in rtnl_link_ip6_tnl_get_link() argument
397 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_get_link()
399 IS_IP6_TNL_LINK_ASSERT(link); in rtnl_link_ip6_tnl_get_link()
401 return ip6_tnl->link; in rtnl_link_ip6_tnl_get_link()
406 * @arg link Link object
411 int rtnl_link_ip6_tnl_set_local(struct rtnl_link *link, struct in6_addr *addr) in rtnl_link_ip6_tnl_set_local() argument
413 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_set_local()
415 IS_IP6_TNL_LINK_ASSERT(link); in rtnl_link_ip6_tnl_set_local()
425 * @arg link Link object
429 int rtnl_link_ip6_tnl_get_local(struct rtnl_link *link, struct in6_addr *addr) in rtnl_link_ip6_tnl_get_local() argument
431 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_get_local()
433 IS_IP6_TNL_LINK_ASSERT(link); in rtnl_link_ip6_tnl_get_local()
442 * @arg link Link object
447 int rtnl_link_ip6_tnl_set_remote(struct rtnl_link *link, struct in6_addr *addr) in rtnl_link_ip6_tnl_set_remote() argument
449 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_set_remote()
451 IS_IP6_TNL_LINK_ASSERT(link); in rtnl_link_ip6_tnl_set_remote()
461 * @arg link Link object
465 int rtnl_link_ip6_tnl_get_remote(struct rtnl_link *link, struct in6_addr *addr) in rtnl_link_ip6_tnl_get_remote() argument
467 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_get_remote()
469 IS_IP6_TNL_LINK_ASSERT(link); in rtnl_link_ip6_tnl_get_remote()
478 * @arg link Link object
483 int rtnl_link_ip6_tnl_set_ttl(struct rtnl_link *link, uint8_t ttl) in rtnl_link_ip6_tnl_set_ttl() argument
485 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_set_ttl()
487 IS_IP6_TNL_LINK_ASSERT(link); in rtnl_link_ip6_tnl_set_ttl()
497 * @arg link Link object
501 uint8_t rtnl_link_ip6_tnl_get_ttl(struct rtnl_link *link) in rtnl_link_ip6_tnl_get_ttl() argument
503 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_get_ttl()
505 IS_IP6_TNL_LINK_ASSERT(link); in rtnl_link_ip6_tnl_get_ttl()
512 * @arg link Link object
517 int rtnl_link_ip6_tnl_set_tos(struct rtnl_link *link, uint8_t tos) in rtnl_link_ip6_tnl_set_tos() argument
519 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_set_tos()
521 IS_IP6_TNL_LINK_ASSERT(link); in rtnl_link_ip6_tnl_set_tos()
531 * @arg link Link object
535 uint8_t rtnl_link_ip6_tnl_get_tos(struct rtnl_link *link) in rtnl_link_ip6_tnl_get_tos() argument
537 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_get_tos()
539 IS_IP6_TNL_LINK_ASSERT(link); in rtnl_link_ip6_tnl_get_tos()
546 * @arg link Link object
551 int rtnl_link_ip6_tnl_set_encaplimit(struct rtnl_link *link, uint8_t encap_limit) in rtnl_link_ip6_tnl_set_encaplimit() argument
553 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_set_encaplimit()
555 IS_IP6_TNL_LINK_ASSERT(link); in rtnl_link_ip6_tnl_set_encaplimit()
565 * @arg link Link object
569 uint8_t rtnl_link_ip6_tnl_get_encaplimit(struct rtnl_link *link) in rtnl_link_ip6_tnl_get_encaplimit() argument
571 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_get_encaplimit()
573 IS_IP6_TNL_LINK_ASSERT(link); in rtnl_link_ip6_tnl_get_encaplimit()
580 * @arg link Link object
585 int rtnl_link_ip6_tnl_set_flowinfo(struct rtnl_link *link, uint32_t flowinfo) in rtnl_link_ip6_tnl_set_flowinfo() argument
587 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_set_flowinfo()
589 IS_IP6_TNL_LINK_ASSERT(link); in rtnl_link_ip6_tnl_set_flowinfo()
599 * @arg link Link object
603 uint32_t rtnl_link_ip6_tnl_get_flowinfo(struct rtnl_link *link) in rtnl_link_ip6_tnl_get_flowinfo() argument
605 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_get_flowinfo()
607 IS_IP6_TNL_LINK_ASSERT(link); in rtnl_link_ip6_tnl_get_flowinfo()
614 * @arg link Link object
619 int rtnl_link_ip6_tnl_set_flags(struct rtnl_link *link, uint32_t flags) in rtnl_link_ip6_tnl_set_flags() argument
621 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_set_flags()
623 IS_IP6_TNL_LINK_ASSERT(link); in rtnl_link_ip6_tnl_set_flags()
633 * @arg link Link object
637 uint32_t rtnl_link_ip6_tnl_get_flags(struct rtnl_link *link) in rtnl_link_ip6_tnl_get_flags() argument
639 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_get_flags()
641 IS_IP6_TNL_LINK_ASSERT(link); in rtnl_link_ip6_tnl_get_flags()
648 * @arg link Link object
653 int rtnl_link_ip6_tnl_set_proto(struct rtnl_link *link, uint8_t proto) in rtnl_link_ip6_tnl_set_proto() argument
655 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_set_proto()
657 IS_IP6_TNL_LINK_ASSERT(link); in rtnl_link_ip6_tnl_set_proto()
667 * @arg link Link object
671 uint8_t rtnl_link_ip6_tnl_get_proto(struct rtnl_link *link) in rtnl_link_ip6_tnl_get_proto() argument
673 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_get_proto()
675 IS_IP6_TNL_LINK_ASSERT(link); in rtnl_link_ip6_tnl_get_proto()