• Home
  • Raw
  • Download

Lines Matching full:link

2  * lib/route/link/ipgre.c        IPGRE Link Info
13 * @ingroup link
15 * ipgre link module
18 * \b Link Type Name: "ipgre"
31 #include <netlink-private/route/link/api.h>
54 uint32_t link; member
73 static int ipgre_alloc(struct rtnl_link *link) in ipgre_alloc() argument
81 link->l_info = ipgre; in ipgre_alloc()
86 static int ipgre_parse(struct rtnl_link *link, struct nlattr *data, in ipgre_parse() argument
93 NL_DBG(3, "Parsing IPGRE link info"); in ipgre_parse()
99 err = ipgre_alloc(link); in ipgre_parse()
103 ipgre = link->l_info; in ipgre_parse()
106 ipgre->link = nla_get_u32(tb[IFLA_GRE_LINK]); in ipgre_parse()
161 static int ipgre_put_attrs(struct nl_msg *msg, struct rtnl_link *link) in ipgre_put_attrs() argument
163 struct ipgre_info *ipgre = link->l_info; in ipgre_put_attrs()
171 NLA_PUT_U32(msg, IFLA_GRE_LINK, ipgre->link); in ipgre_put_attrs()
207 static void ipgre_free(struct rtnl_link *link) in ipgre_free() argument
209 struct ipgre_info *ipgre = link->l_info; in ipgre_free()
212 link->l_info = NULL; in ipgre_free()
215 static void ipgre_dump_line(struct rtnl_link *link, struct nl_dump_params *p) in ipgre_dump_line() argument
217 nl_dump(p, "ipgre : %s", link->l_name); in ipgre_dump_line()
220 static void ipgre_dump_details(struct rtnl_link *link, struct nl_dump_params *p) in ipgre_dump_details() argument
222 struct ipgre_info *ipgre = link->l_info; in ipgre_dump_details()
226 nl_dump(p, " link "); in ipgre_dump_details()
227 name = rtnl_link_get_name(link); in ipgre_dump_details()
231 nl_dump_line(p, "%u\n", ipgre->link); in ipgre_dump_details()
320 #define IS_IPGRE_LINK_ASSERT(link) \ argument
321 if ((link)->l_info_ops != &ipgre_info_ops) { \
322 APPBUG("Link is not a ipgre link. set type \"gre\" first.");\
328 struct rtnl_link *link; in rtnl_link_ipgre_alloc() local
331 link = rtnl_link_alloc(); in rtnl_link_ipgre_alloc()
332 if (!link) in rtnl_link_ipgre_alloc()
335 err = rtnl_link_set_type(link, "gre"); in rtnl_link_ipgre_alloc()
337 rtnl_link_put(link); in rtnl_link_ipgre_alloc()
341 return link; in rtnl_link_ipgre_alloc()
345 * Check if link is a IPGRE link
346 * @arg link Link object
348 * @return True if link is a IPGRE link, otherwise 0 is returned.
350 int rtnl_link_is_ipgre(struct rtnl_link *link) in rtnl_link_is_ipgre() argument
352 return link->l_info_ops && !strcmp(link->l_info_ops->io_name, "gre"); in rtnl_link_is_ipgre()
364 struct rtnl_link *link; in rtnl_link_ipgre_add() local
367 link = rtnl_link_ipgre_alloc(); in rtnl_link_ipgre_add()
368 if (!link) in rtnl_link_ipgre_add()
372 rtnl_link_set_name(link, name); in rtnl_link_ipgre_add()
374 err = rtnl_link_add(sk, link, NLM_F_CREATE); in rtnl_link_ipgre_add()
375 rtnl_link_put(link); in rtnl_link_ipgre_add()
381 * @arg link Link object
386 int rtnl_link_ipgre_set_link(struct rtnl_link *link, uint32_t index) in rtnl_link_ipgre_set_link() argument
388 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_set_link()
390 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_set_link()
392 ipgre->link = index; in rtnl_link_ipgre_set_link()
400 * @arg link Link object
404 uint32_t rtnl_link_ipgre_get_link(struct rtnl_link *link) in rtnl_link_ipgre_get_link() argument
406 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_get_link()
408 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_get_link()
410 return ipgre->link; in rtnl_link_ipgre_get_link()
415 * @arg link Link object
420 int rtnl_link_ipgre_set_iflags(struct rtnl_link *link, uint16_t iflags) in rtnl_link_ipgre_set_iflags() argument
422 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_set_iflags()
424 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_set_iflags()
434 * @arg link Link object
438 uint16_t rtnl_link_ipgre_get_iflags(struct rtnl_link *link) in rtnl_link_ipgre_get_iflags() argument
440 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_get_iflags()
442 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_get_iflags()
449 * @arg link Link object
454 int rtnl_link_ipgre_set_oflags(struct rtnl_link *link, uint16_t oflags) in rtnl_link_ipgre_set_oflags() argument
456 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_set_oflags()
458 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_set_oflags()
468 * @arg link Link object
472 uint16_t rtnl_link_ipgre_get_oflags(struct rtnl_link *link) in rtnl_link_ipgre_get_oflags() argument
474 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_get_oflags()
476 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_get_oflags()
483 * @arg link Link object
488 int rtnl_link_ipgre_set_ikey(struct rtnl_link *link, uint32_t ikey) in rtnl_link_ipgre_set_ikey() argument
490 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_set_ikey()
492 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_set_ikey()
502 * @arg link Link object
506 uint32_t rtnl_link_ipgre_get_ikey(struct rtnl_link *link) in rtnl_link_ipgre_get_ikey() argument
508 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_get_ikey()
510 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_get_ikey()
517 * @arg link Link object
522 int rtnl_link_ipgre_set_okey(struct rtnl_link *link, uint32_t okey) in rtnl_link_ipgre_set_okey() argument
524 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_set_okey()
526 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_set_okey()
536 * @arg link Link object
540 uint32_t rtnl_link_ipgre_get_okey(struct rtnl_link *link) in rtnl_link_ipgre_get_okey() argument
542 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_get_okey()
544 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_get_okey()
551 * @arg link Link object
556 int rtnl_link_ipgre_set_local(struct rtnl_link *link, uint32_t addr) in rtnl_link_ipgre_set_local() argument
558 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_set_local()
560 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_set_local()
570 * @arg link Link object
574 uint32_t rtnl_link_ipgre_get_local(struct rtnl_link *link) in rtnl_link_ipgre_get_local() argument
576 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_get_local()
578 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_get_local()
585 * @arg link Link object
590 int rtnl_link_ipgre_set_remote(struct rtnl_link *link, uint32_t remote) in rtnl_link_ipgre_set_remote() argument
592 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_set_remote()
594 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_set_remote()
604 * @arg link Link object
608 uint32_t rtnl_link_ipgre_get_remote(struct rtnl_link *link) in rtnl_link_ipgre_get_remote() argument
610 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_get_remote()
612 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_get_remote()
619 * @arg link Link object
624 int rtnl_link_ipgre_set_ttl(struct rtnl_link *link, uint8_t ttl) in rtnl_link_ipgre_set_ttl() argument
626 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_set_ttl()
628 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_set_ttl()
638 * @arg link Link object
642 uint8_t rtnl_link_ipgre_get_ttl(struct rtnl_link *link) in rtnl_link_ipgre_get_ttl() argument
644 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_get_ttl()
646 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_get_ttl()
653 * @arg link Link object
658 int rtnl_link_ipgre_set_tos(struct rtnl_link *link, uint8_t tos) in rtnl_link_ipgre_set_tos() argument
660 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_set_tos()
662 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_set_tos()
672 * @arg link Link object
676 uint8_t rtnl_link_ipgre_get_tos(struct rtnl_link *link) in rtnl_link_ipgre_get_tos() argument
678 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_get_tos()
680 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_get_tos()
687 * @arg link Link object
692 int rtnl_link_ipgre_set_pmtudisc(struct rtnl_link *link, uint8_t pmtudisc) in rtnl_link_ipgre_set_pmtudisc() argument
694 struct ipgre_info *ipgre = link->l_info; in rtnl_link_ipgre_set_pmtudisc()
696 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_ipgre_set_pmtudisc()
706 * @arg link Link object
710 uint8_t rtnl_link_get_pmtudisc(struct rtnl_link *link) in rtnl_link_get_pmtudisc() argument
712 struct ipgre_info *ipgre = link->l_info; in rtnl_link_get_pmtudisc()
714 IS_IPGRE_LINK_ASSERT(link); in rtnl_link_get_pmtudisc()