Lines Matching full:link

2  * lib/route/link/sit.c        SIT Link Info
13 * @ingroup link
15 * sit link module
18 * \b Link Type Name: "sit"
31 #include <netlink/route/link/sit.h>
32 #include <netlink-private/route/link/api.h>
55 uint32_t link; member
80 static int sit_alloc(struct rtnl_link *link) in sit_alloc() argument
84 if (link->l_info) in sit_alloc()
85 memset(link->l_info, 0, sizeof(*sit)); in sit_alloc()
91 link->l_info = sit; in sit_alloc()
97 static int sit_parse(struct rtnl_link *link, struct nlattr *data, in sit_parse() argument
104 NL_DBG(3, "Parsing SIT link info\n"); in sit_parse()
110 err = sit_alloc(link); in sit_parse()
114 sit = link->l_info; in sit_parse()
117 sit->link = nla_get_u32(tb[IFLA_IPTUN_LINK]); in sit_parse()
183 static int sit_put_attrs(struct nl_msg *msg, struct rtnl_link *link) in sit_put_attrs() argument
185 struct sit_info *sit = link->l_info; in sit_put_attrs()
193 NLA_PUT_U32(msg, IFLA_IPTUN_LINK, sit->link); in sit_put_attrs()
235 static void sit_free(struct rtnl_link *link) in sit_free() argument
237 struct sit_info *sit = link->l_info; in sit_free()
240 link->l_info = NULL; in sit_free()
243 static void sit_dump_line(struct rtnl_link *link, struct nl_dump_params *p) in sit_dump_line() argument
245 nl_dump(p, "sit : %s", link->l_name); in sit_dump_line()
248 static void sit_dump_details(struct rtnl_link *link, struct nl_dump_params *p) in sit_dump_details() argument
250 struct sit_info *sit = link->l_info; in sit_dump_details()
255 nl_dump(p, " link "); in sit_dump_details()
258 parent = link_lookup(link->ce_cache, sit->link); in sit_dump_details()
265 nl_dump_line(p, "%u\n", sit->link); in sit_dump_details()
365 #define IS_SIT_LINK_ASSERT(link, sit) \ argument
368 const struct rtnl_link *_link = (link); \
370 APPBUG("Link is not a sit link. set type \"sit\" first."); \
378 struct rtnl_link *link; in rtnl_link_sit_alloc() local
381 link = rtnl_link_alloc(); in rtnl_link_sit_alloc()
382 if (!link) in rtnl_link_sit_alloc()
385 err = rtnl_link_set_type(link, "sit"); in rtnl_link_sit_alloc()
387 rtnl_link_put(link); in rtnl_link_sit_alloc()
391 return link; in rtnl_link_sit_alloc()
395 * Check if link is a SIT link
396 * @arg link Link object
398 * @return True if link is a SIT link, otherwise false is returned.
400 int rtnl_link_is_sit(struct rtnl_link *link) in rtnl_link_is_sit() argument
402 return link->l_info_ops && !strcmp(link->l_info_ops->io_name, "sit"); in rtnl_link_is_sit()
415 struct rtnl_link *link; in rtnl_link_sit_add() local
418 link = rtnl_link_sit_alloc(); in rtnl_link_sit_add()
419 if (!link) in rtnl_link_sit_add()
423 rtnl_link_set_name(link, name); in rtnl_link_sit_add()
425 err = rtnl_link_add(sk, link, NLM_F_CREATE); in rtnl_link_sit_add()
426 rtnl_link_put(link); in rtnl_link_sit_add()
433 * @arg link Link object
438 int rtnl_link_sit_set_link(struct rtnl_link *link, uint32_t index) in rtnl_link_sit_set_link() argument
440 IS_SIT_LINK_ASSERT(link, sit); in rtnl_link_sit_set_link()
442 sit->link = index; in rtnl_link_sit_set_link()
450 * @arg link Link object
454 uint32_t rtnl_link_sit_get_link(struct rtnl_link *link) in rtnl_link_sit_get_link() argument
456 IS_SIT_LINK_ASSERT(link, sit); in rtnl_link_sit_get_link()
458 return sit->link; in rtnl_link_sit_get_link()
463 * @arg link Link object
468 int rtnl_link_sit_set_local(struct rtnl_link *link, uint32_t addr) in rtnl_link_sit_set_local() argument
470 IS_SIT_LINK_ASSERT(link, sit); in rtnl_link_sit_set_local()
480 * @arg link Link object
484 uint32_t rtnl_link_sit_get_local(struct rtnl_link *link) in rtnl_link_sit_get_local() argument
486 IS_SIT_LINK_ASSERT(link, sit); in rtnl_link_sit_get_local()
493 * @arg link Link object
498 int rtnl_link_sit_set_remote(struct rtnl_link *link, uint32_t addr) in rtnl_link_sit_set_remote() argument
500 IS_SIT_LINK_ASSERT(link, sit); in rtnl_link_sit_set_remote()
510 * @arg link Link object
514 uint32_t rtnl_link_sit_get_remote(struct rtnl_link *link) in rtnl_link_sit_get_remote() argument
516 IS_SIT_LINK_ASSERT(link, sit); in rtnl_link_sit_get_remote()
523 * @arg link Link object
528 int rtnl_link_sit_set_ttl(struct rtnl_link *link, uint8_t ttl) in rtnl_link_sit_set_ttl() argument
530 IS_SIT_LINK_ASSERT(link, sit); in rtnl_link_sit_set_ttl()
540 * @arg link Link object
544 uint8_t rtnl_link_sit_get_ttl(struct rtnl_link *link) in rtnl_link_sit_get_ttl() argument
546 IS_SIT_LINK_ASSERT(link, sit); in rtnl_link_sit_get_ttl()
553 * @arg link Link object
558 int rtnl_link_sit_set_tos(struct rtnl_link *link, uint8_t tos) in rtnl_link_sit_set_tos() argument
560 IS_SIT_LINK_ASSERT(link, sit); in rtnl_link_sit_set_tos()
570 * @arg link Link object
574 uint8_t rtnl_link_sit_get_tos(struct rtnl_link *link) in rtnl_link_sit_get_tos() argument
576 IS_SIT_LINK_ASSERT(link, sit); in rtnl_link_sit_get_tos()
583 * @arg link Link object
588 int rtnl_link_sit_set_pmtudisc(struct rtnl_link *link, uint8_t pmtudisc) in rtnl_link_sit_set_pmtudisc() argument
590 IS_SIT_LINK_ASSERT(link, sit); in rtnl_link_sit_set_pmtudisc()
600 * @arg link Link object
604 uint8_t rtnl_link_sit_get_pmtudisc(struct rtnl_link *link) in rtnl_link_sit_get_pmtudisc() argument
606 IS_SIT_LINK_ASSERT(link, sit); in rtnl_link_sit_get_pmtudisc()
613 * @arg link Link object
618 int rtnl_link_sit_set_flags(struct rtnl_link *link, uint16_t flags) in rtnl_link_sit_set_flags() argument
620 IS_SIT_LINK_ASSERT(link, sit); in rtnl_link_sit_set_flags()
630 * @arg link Link object
634 uint16_t rtnl_link_sit_get_flags(struct rtnl_link *link) in rtnl_link_sit_get_flags() argument
636 IS_SIT_LINK_ASSERT(link, sit); in rtnl_link_sit_get_flags()
643 * @arg link Link object
648 int rtnl_link_sit_set_proto(struct rtnl_link *link, uint8_t proto) in rtnl_link_sit_set_proto() argument
650 IS_SIT_LINK_ASSERT(link, sit); in rtnl_link_sit_set_proto()
660 * @arg link Link object
664 uint8_t rtnl_link_sit_get_proto(struct rtnl_link *link) in rtnl_link_sit_get_proto() argument
666 IS_SIT_LINK_ASSERT(link, sit); in rtnl_link_sit_get_proto()
673 * @arg link Link object
678 int rtnl_link_sit_set_ip6rd_prefix(struct rtnl_link *link, const struct in6_addr *prefix) in rtnl_link_sit_set_ip6rd_prefix() argument
680 IS_SIT_LINK_ASSERT(link, sit); in rtnl_link_sit_set_ip6rd_prefix()
689 * @arg link Link object
695 int rtnl_link_sit_get_ip6rd_prefix(const struct rtnl_link *link, struct in6_addr *prefix) in rtnl_link_sit_get_ip6rd_prefix() argument
697 IS_SIT_LINK_ASSERT(link, sit); in rtnl_link_sit_get_ip6rd_prefix()
709 * @arg link Link object
714 int rtnl_link_sit_set_ip6rd_prefixlen(struct rtnl_link *link, uint16_t prefixlen) in rtnl_link_sit_set_ip6rd_prefixlen() argument
716 IS_SIT_LINK_ASSERT(link, sit); in rtnl_link_sit_set_ip6rd_prefixlen()
725 * @arg link Link object
731 int rtnl_link_sit_get_ip6rd_prefixlen(struct rtnl_link *link, uint16_t *prefixlen) in rtnl_link_sit_get_ip6rd_prefixlen() argument
733 IS_SIT_LINK_ASSERT(link, sit); in rtnl_link_sit_get_ip6rd_prefixlen()
745 * @arg link Link object
750 int rtnl_link_sit_set_ip6rd_relay_prefix(struct rtnl_link *link, uint32_t prefix) in rtnl_link_sit_set_ip6rd_relay_prefix() argument
752 IS_SIT_LINK_ASSERT(link, sit); in rtnl_link_sit_set_ip6rd_relay_prefix()
761 * @arg link Link object
767 int rtnl_link_sit_get_ip6rd_relay_prefix(const struct rtnl_link *link, uint32_t *prefix) in rtnl_link_sit_get_ip6rd_relay_prefix() argument
769 IS_SIT_LINK_ASSERT(link, sit); in rtnl_link_sit_get_ip6rd_relay_prefix()
781 * @arg link Link object
786 int rtnl_link_sit_set_ip6rd_relay_prefixlen(struct rtnl_link *link, uint16_t prefixlen) in rtnl_link_sit_set_ip6rd_relay_prefixlen() argument
788 IS_SIT_LINK_ASSERT(link, sit); in rtnl_link_sit_set_ip6rd_relay_prefixlen()
797 * @arg link Link object
803 int rtnl_link_sit_get_ip6rd_relay_prefixlen(struct rtnl_link *link, uint16_t *prefixlen) in rtnl_link_sit_get_ip6rd_relay_prefixlen() argument
805 IS_SIT_LINK_ASSERT(link, sit); in rtnl_link_sit_get_ip6rd_relay_prefixlen()