• Home
  • Raw
  • Download

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-private/route/link/api.h>
50 uint32_t link; member
67 static int sit_alloc(struct rtnl_link *link) in sit_alloc() argument
75 link->l_info = sit; in sit_alloc()
80 static int sit_parse(struct rtnl_link *link, struct nlattr *data, in sit_parse() argument
87 NL_DBG(3, "Parsing SIT link info"); in sit_parse()
93 err = sit_alloc(link); in sit_parse()
97 sit = link->l_info; in sit_parse()
100 sit->link = nla_get_u32(tb[IFLA_IPTUN_LINK]); in sit_parse()
145 static int sit_put_attrs(struct nl_msg *msg, struct rtnl_link *link) in sit_put_attrs() argument
147 struct sit_info *sit = link->l_info; in sit_put_attrs()
155 NLA_PUT_U32(msg, IFLA_IPTUN_LINK, sit->link); in sit_put_attrs()
185 static void sit_free(struct rtnl_link *link) in sit_free() argument
187 struct sit_info *sit = link->l_info; in sit_free()
190 link->l_info = NULL; in sit_free()
193 static void sit_dump_line(struct rtnl_link *link, struct nl_dump_params *p) in sit_dump_line() argument
195 nl_dump(p, "sit : %s", link->l_name); in sit_dump_line()
198 static void sit_dump_details(struct rtnl_link *link, struct nl_dump_params *p) in sit_dump_details() argument
200 struct sit_info *sit = link->l_info; in sit_dump_details()
204 nl_dump(p, " link "); in sit_dump_details()
205 name = rtnl_link_get_name(link); in sit_dump_details()
209 nl_dump_line(p, "%u\n", sit->link); in sit_dump_details()
283 #define IS_SIT_LINK_ASSERT(link) \ argument
284 if ((link)->l_info_ops != &sit_info_ops) { \
285 APPBUG("Link is not a sit link. set type \"sit\" first."); \
291 struct rtnl_link *link; in rtnl_link_sit_alloc() local
294 link = rtnl_link_alloc(); in rtnl_link_sit_alloc()
295 if (!link) in rtnl_link_sit_alloc()
298 err = rtnl_link_set_type(link, "sit"); in rtnl_link_sit_alloc()
300 rtnl_link_put(link); in rtnl_link_sit_alloc()
304 return link; in rtnl_link_sit_alloc()
308 * Check if link is a SIT link
309 * @arg link Link object
311 * @return True if link is a SIT link, otherwise false is returned.
313 int rtnl_link_is_sit(struct rtnl_link *link) in rtnl_link_is_sit() argument
315 return link->l_info_ops && !strcmp(link->l_info_ops->io_name, "sit"); in rtnl_link_is_sit()
328 struct rtnl_link *link; in rtnl_link_sit_add() local
331 link = rtnl_link_sit_alloc(); in rtnl_link_sit_add()
332 if (!link) in rtnl_link_sit_add()
336 rtnl_link_set_name(link, name); in rtnl_link_sit_add()
338 err = rtnl_link_add(sk, link, NLM_F_CREATE); in rtnl_link_sit_add()
339 rtnl_link_put(link); in rtnl_link_sit_add()
346 * @arg link Link object
351 int rtnl_link_sit_set_link(struct rtnl_link *link, uint32_t index) in rtnl_link_sit_set_link() argument
353 struct sit_info *sit = link->l_info; in rtnl_link_sit_set_link()
355 IS_SIT_LINK_ASSERT(link); in rtnl_link_sit_set_link()
357 sit->link = index; in rtnl_link_sit_set_link()
365 * @arg link Link object
369 uint32_t rtnl_link_sit_get_link(struct rtnl_link *link) in rtnl_link_sit_get_link() argument
371 struct sit_info *sit = link->l_info; in rtnl_link_sit_get_link()
373 IS_SIT_LINK_ASSERT(link); in rtnl_link_sit_get_link()
375 return sit->link; in rtnl_link_sit_get_link()
380 * @arg link Link object
385 int rtnl_link_sit_set_local(struct rtnl_link *link, uint32_t addr) in rtnl_link_sit_set_local() argument
387 struct sit_info *sit = link->l_info; in rtnl_link_sit_set_local()
389 IS_SIT_LINK_ASSERT(link); in rtnl_link_sit_set_local()
399 * @arg link Link object
403 uint32_t rtnl_link_sit_get_local(struct rtnl_link *link) in rtnl_link_sit_get_local() argument
405 struct sit_info *sit = link->l_info; in rtnl_link_sit_get_local()
407 IS_SIT_LINK_ASSERT(link); in rtnl_link_sit_get_local()
414 * @arg link Link object
419 int rtnl_link_sit_set_remote(struct rtnl_link *link, uint32_t addr) in rtnl_link_sit_set_remote() argument
421 struct sit_info *sit = link->l_info; in rtnl_link_sit_set_remote()
423 IS_SIT_LINK_ASSERT(link); in rtnl_link_sit_set_remote()
433 * @arg link Link object
437 uint32_t rtnl_link_sit_get_remote(struct rtnl_link *link) in rtnl_link_sit_get_remote() argument
439 struct sit_info *sit = link->l_info; in rtnl_link_sit_get_remote()
441 IS_SIT_LINK_ASSERT(link); in rtnl_link_sit_get_remote()
448 * @arg link Link object
453 int rtnl_link_sit_set_ttl(struct rtnl_link *link, uint8_t ttl) in rtnl_link_sit_set_ttl() argument
455 struct sit_info *sit = link->l_info; in rtnl_link_sit_set_ttl()
457 IS_SIT_LINK_ASSERT(link); in rtnl_link_sit_set_ttl()
467 * @arg link Link object
471 uint8_t rtnl_link_sit_get_ttl(struct rtnl_link *link) in rtnl_link_sit_get_ttl() argument
473 struct sit_info *sit = link->l_info; in rtnl_link_sit_get_ttl()
475 IS_SIT_LINK_ASSERT(link); in rtnl_link_sit_get_ttl()
482 * @arg link Link object
487 int rtnl_link_sit_set_tos(struct rtnl_link *link, uint8_t tos) in rtnl_link_sit_set_tos() argument
489 struct sit_info *sit = link->l_info; in rtnl_link_sit_set_tos()
491 IS_SIT_LINK_ASSERT(link); in rtnl_link_sit_set_tos()
501 * @arg link Link object
505 uint8_t rtnl_link_sit_get_tos(struct rtnl_link *link) in rtnl_link_sit_get_tos() argument
507 struct sit_info *sit = link->l_info; in rtnl_link_sit_get_tos()
509 IS_SIT_LINK_ASSERT(link); in rtnl_link_sit_get_tos()
516 * @arg link Link object
521 int rtnl_link_sit_set_pmtudisc(struct rtnl_link *link, uint8_t pmtudisc) in rtnl_link_sit_set_pmtudisc() argument
523 struct sit_info *sit = link->l_info; in rtnl_link_sit_set_pmtudisc()
525 IS_SIT_LINK_ASSERT(link); in rtnl_link_sit_set_pmtudisc()
535 * @arg link Link object
539 uint8_t rtnl_link_sit_get_pmtudisc(struct rtnl_link *link) in rtnl_link_sit_get_pmtudisc() argument
541 struct sit_info *sit = link->l_info; in rtnl_link_sit_get_pmtudisc()
543 IS_SIT_LINK_ASSERT(link); in rtnl_link_sit_get_pmtudisc()
550 * @arg link Link object
555 int rtnl_link_sit_set_flags(struct rtnl_link *link, uint16_t flags) in rtnl_link_sit_set_flags() argument
557 struct sit_info *sit = link->l_info; in rtnl_link_sit_set_flags()
559 IS_SIT_LINK_ASSERT(link); in rtnl_link_sit_set_flags()
569 * @arg link Link object
573 uint16_t rtnl_link_sit_get_flags(struct rtnl_link *link) in rtnl_link_sit_get_flags() argument
575 struct sit_info *sit = link->l_info; in rtnl_link_sit_get_flags()
577 IS_SIT_LINK_ASSERT(link); in rtnl_link_sit_get_flags()
584 * @arg link Link object
589 int rtnl_link_sit_set_proto(struct rtnl_link *link, uint8_t proto) in rtnl_link_sit_set_proto() argument
591 struct sit_info *sit = link->l_info; in rtnl_link_sit_set_proto()
593 IS_SIT_LINK_ASSERT(link); in rtnl_link_sit_set_proto()
603 * @arg link Link object
607 uint8_t rtnl_link_sit_get_proto(struct rtnl_link *link) in rtnl_link_sit_get_proto() argument
609 struct sit_info *sit = link->l_info; in rtnl_link_sit_get_proto()
611 IS_SIT_LINK_ASSERT(link); in rtnl_link_sit_get_proto()