• Home
  • Raw
  • Download

Lines Matching refs:link

55 	uint32_t   link;  member
74 static int ipgre_alloc(struct rtnl_link *link) in ipgre_alloc() argument
78 if (link->l_info) in ipgre_alloc()
79 memset(link->l_info, 0, sizeof(*ipgre)); in ipgre_alloc()
85 link->l_info = ipgre; in ipgre_alloc()
91 static int ipgre_parse(struct rtnl_link *link, struct nlattr *data, in ipgre_parse() argument
104 err = ipgre_alloc(link); in ipgre_parse()
108 ipgre = link->l_info; in ipgre_parse()
111 ipgre->link = nla_get_u32(tb[IFLA_GRE_LINK]); in ipgre_parse()
166 static int ipgre_put_attrs(struct nl_msg *msg, struct rtnl_link *link) in ipgre_put_attrs() argument
168 struct ipgre_info *ipgre = link->l_info; in ipgre_put_attrs()
176 NLA_PUT_U32(msg, IFLA_GRE_LINK, ipgre->link); in ipgre_put_attrs()
212 static void ipgre_free(struct rtnl_link *link) in ipgre_free() argument
214 struct ipgre_info *ipgre = link->l_info; in ipgre_free()
217 link->l_info = NULL; in ipgre_free()
220 static void ipgre_dump_line(struct rtnl_link *link, struct nl_dump_params *p) in ipgre_dump_line() argument
222 nl_dump(p, "ipgre : %s", link->l_name); in ipgre_dump_line()
225 static void ipgre_dump_details(struct rtnl_link *link, struct nl_dump_params *p) in ipgre_dump_details() argument
227 struct ipgre_info *ipgre = link->l_info; in ipgre_dump_details()
235 parent = link_lookup(link->ce_cache, ipgre->link); in ipgre_dump_details()
242 nl_dump_line(p, "%u\n", ipgre->link); in ipgre_dump_details()
365 #define IS_IPGRE_LINK_ASSERT(link) \ argument
366 if ((link)->l_info_ops != &ipgre_info_ops && \
367 (link)->l_info_ops != &ipgretap_info_ops) { \
374 struct rtnl_link *link; in rtnl_link_ipgre_alloc() local
377 link = rtnl_link_alloc(); in rtnl_link_ipgre_alloc()
378 if (!link) in rtnl_link_ipgre_alloc()
381 err = rtnl_link_set_type(link, "gre"); in rtnl_link_ipgre_alloc()
383 rtnl_link_put(link); in rtnl_link_ipgre_alloc()
387 return link; in rtnl_link_ipgre_alloc()
396 int rtnl_link_is_ipgre(struct rtnl_link *link) in rtnl_link_is_ipgre() argument
398 return link->l_info_ops && !strcmp(link->l_info_ops->io_name, "gre"); in rtnl_link_is_ipgre()
411 struct rtnl_link *link; in rtnl_link_ipgre_add() local
414 link = rtnl_link_ipgre_alloc(); in rtnl_link_ipgre_add()
415 if (!link) in rtnl_link_ipgre_add()
419 rtnl_link_set_name(link, name); in rtnl_link_ipgre_add()
421 err = rtnl_link_add(sk, link, NLM_F_CREATE); in rtnl_link_ipgre_add()
422 rtnl_link_put(link); in rtnl_link_ipgre_add()
429 struct rtnl_link *link; in rtnl_link_ipgretap_alloc() local
432 link = rtnl_link_alloc(); in rtnl_link_ipgretap_alloc()
433 if (!link) in rtnl_link_ipgretap_alloc()
436 err = rtnl_link_set_type(link, "gretap"); in rtnl_link_ipgretap_alloc()
438 rtnl_link_put(link); in rtnl_link_ipgretap_alloc()
442 return link; in rtnl_link_ipgretap_alloc()
451 int rtnl_link_is_ipgretap(struct rtnl_link *link) in rtnl_link_is_ipgretap() argument
453 return link->l_info_ops && !strcmp(link->l_info_ops->io_name, "gretap"); in rtnl_link_is_ipgretap()
465 struct rtnl_link *link; in rtnl_link_ipgretap_add() local
468 link = rtnl_link_ipgretap_alloc(); in rtnl_link_ipgretap_add()
469 if (!link) in rtnl_link_ipgretap_add()
473 rtnl_link_set_name(link, name); in rtnl_link_ipgretap_add()
475 err = rtnl_link_add(sk, link, NLM_F_CREATE); in rtnl_link_ipgretap_add()
476 rtnl_link_put(link); in rtnl_link_ipgretap_add()
488 int rtnl_link_ipgre_set_link(struct rtnl_link *link, uint32_t index) in rtnl_link_ipgre_set_link() argument
490 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_set_link()
492 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_set_link()
494 ipgre->link = index; in rtnl_link_ipgre_set_link()
506 uint32_t rtnl_link_ipgre_get_link(struct rtnl_link *link) in rtnl_link_ipgre_get_link() argument
508 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_get_link()
510 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_get_link()
512 return ipgre->link; in rtnl_link_ipgre_get_link()
522 int rtnl_link_ipgre_set_iflags(struct rtnl_link *link, uint16_t iflags) in rtnl_link_ipgre_set_iflags() argument
524 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_set_iflags()
526 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_set_iflags()
540 uint16_t rtnl_link_ipgre_get_iflags(struct rtnl_link *link) in rtnl_link_ipgre_get_iflags() argument
542 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_get_iflags()
544 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_get_iflags()
556 int rtnl_link_ipgre_set_oflags(struct rtnl_link *link, uint16_t oflags) in rtnl_link_ipgre_set_oflags() argument
558 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_set_oflags()
560 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_set_oflags()
574 uint16_t rtnl_link_ipgre_get_oflags(struct rtnl_link *link) in rtnl_link_ipgre_get_oflags() argument
576 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_get_oflags()
578 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_get_oflags()
590 int rtnl_link_ipgre_set_ikey(struct rtnl_link *link, uint32_t ikey) in rtnl_link_ipgre_set_ikey() argument
592 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_set_ikey()
594 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_set_ikey()
608 uint32_t rtnl_link_ipgre_get_ikey(struct rtnl_link *link) in rtnl_link_ipgre_get_ikey() argument
610 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_get_ikey()
612 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_get_ikey()
624 int rtnl_link_ipgre_set_okey(struct rtnl_link *link, uint32_t okey) in rtnl_link_ipgre_set_okey() argument
626 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_set_okey()
628 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_set_okey()
642 uint32_t rtnl_link_ipgre_get_okey(struct rtnl_link *link) in rtnl_link_ipgre_get_okey() argument
644 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_get_okey()
646 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_get_okey()
658 int rtnl_link_ipgre_set_local(struct rtnl_link *link, uint32_t addr) in rtnl_link_ipgre_set_local() argument
660 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_set_local()
662 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_set_local()
676 uint32_t rtnl_link_ipgre_get_local(struct rtnl_link *link) in rtnl_link_ipgre_get_local() argument
678 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_get_local()
680 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_get_local()
692 int rtnl_link_ipgre_set_remote(struct rtnl_link *link, uint32_t remote) in rtnl_link_ipgre_set_remote() argument
694 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_set_remote()
696 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_set_remote()
710 uint32_t rtnl_link_ipgre_get_remote(struct rtnl_link *link) in rtnl_link_ipgre_get_remote() argument
712 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_get_remote()
714 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_get_remote()
726 int rtnl_link_ipgre_set_ttl(struct rtnl_link *link, uint8_t ttl) in rtnl_link_ipgre_set_ttl() argument
728 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_set_ttl()
730 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_set_ttl()
744 uint8_t rtnl_link_ipgre_get_ttl(struct rtnl_link *link) in rtnl_link_ipgre_get_ttl() argument
746 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_get_ttl()
748 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_get_ttl()
760 int rtnl_link_ipgre_set_tos(struct rtnl_link *link, uint8_t tos) in rtnl_link_ipgre_set_tos() argument
762 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_set_tos()
764 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_set_tos()
778 uint8_t rtnl_link_ipgre_get_tos(struct rtnl_link *link) in rtnl_link_ipgre_get_tos() argument
780 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_get_tos()
782 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_get_tos()
794 int rtnl_link_ipgre_set_pmtudisc(struct rtnl_link *link, uint8_t pmtudisc) in rtnl_link_ipgre_set_pmtudisc() argument
796 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_set_pmtudisc()
798 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_set_pmtudisc()
812 uint8_t rtnl_link_ipgre_get_pmtudisc(struct rtnl_link *link) in rtnl_link_ipgre_get_pmtudisc() argument
814 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_get_pmtudisc()
816 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_get_pmtudisc()
823 uint8_t rtnl_link_get_pmtudisc(struct rtnl_link *link);
825 uint8_t rtnl_link_get_pmtudisc(struct rtnl_link *link) in rtnl_link_get_pmtudisc() argument
829 return rtnl_link_ipgre_get_pmtudisc (link); in rtnl_link_get_pmtudisc()