Lines Matching full:link

2  * lib/route/link/geneve.c      Geneve Link Info
11 * @ingroup link
16 * \b Link Type Name: "geneve"
27 #include <netlink-private/route/link/api.h>
28 #include <netlink/route/link/geneve.h>
76 static int geneve_alloc(struct rtnl_link *link) in geneve_alloc() argument
80 if (link->l_info) in geneve_alloc()
81 memset(link->l_info, 0, sizeof(*geneve)); in geneve_alloc()
85 link->l_info = geneve; in geneve_alloc()
91 static int geneve_parse(struct rtnl_link *link, struct nlattr *data, in geneve_parse() argument
98 NL_DBG(3, "Parsing Geneve link info\n"); in geneve_parse()
104 err = geneve_alloc(link); in geneve_parse()
108 geneve = link->l_info; in geneve_parse()
169 static void geneve_free(struct rtnl_link *link) in geneve_free() argument
171 struct geneve_info *geneve = link->l_info; in geneve_free()
174 link->l_info = NULL; in geneve_free()
177 static void geneve_dump_line(struct rtnl_link *link, struct nl_dump_params *p) in geneve_dump_line() argument
179 struct geneve_info *geneve = link->l_info; in geneve_dump_line()
184 static void geneve_dump_details(struct rtnl_link *link, struct nl_dump_params *p) in geneve_dump_details() argument
186 struct geneve_info *geneve = link->l_info; in geneve_dump_details()
274 static int geneve_put_attrs(struct nl_msg *msg, struct rtnl_link *link) in geneve_put_attrs() argument
276 struct geneve_info *geneve = link->l_info; in geneve_put_attrs()
339 #define IS_GENEVE_LINK_ASSERT(link) \ argument
340 if ((link)->l_info_ops != &geneve_info_ops) { \
341 APPBUG("Link is not a geneve link. set type \"geneve\" first."); \
352 * Allocate link object of type Geneve
354 * @return Allocated link object or NULL.
358 struct rtnl_link *link; in rtnl_link_geneve_alloc() local
361 if (!(link = rtnl_link_alloc())) in rtnl_link_geneve_alloc()
364 if ((err = rtnl_link_set_type(link, "geneve")) < 0) { in rtnl_link_geneve_alloc()
365 rtnl_link_put(link); in rtnl_link_geneve_alloc()
369 return link; in rtnl_link_geneve_alloc()
373 * Check if link is a Geneve link
374 * @arg link Link object
376 * @return True if link is a Geneve link, otherwisee false is returned.
378 int rtnl_link_is_geneve(struct rtnl_link *link) in rtnl_link_is_geneve() argument
380 return link->l_info_ops && !strcmp(link->l_info_ops->io_name, "geneve"); in rtnl_link_is_geneve()
385 * @arg link Link object
390 int rtnl_link_geneve_set_id(struct rtnl_link *link, uint32_t id) in rtnl_link_geneve_set_id() argument
392 struct geneve_info *geneve = link->l_info; in rtnl_link_geneve_set_id()
394 IS_GENEVE_LINK_ASSERT(link); in rtnl_link_geneve_set_id()
407 * @arg link Link object
412 int rtnl_link_geneve_get_id(struct rtnl_link *link, uint32_t *id) in rtnl_link_geneve_get_id() argument
414 struct geneve_info *geneve = link->l_info; in rtnl_link_geneve_get_id()
416 IS_GENEVE_LINK_ASSERT(link); in rtnl_link_geneve_get_id()
431 * @arg link Link object
436 int rtnl_link_geneve_set_remote(struct rtnl_link *link, struct nl_addr *addr) in rtnl_link_geneve_set_remote() argument
438 struct geneve_info *geneve = link->l_info; in rtnl_link_geneve_set_remote()
440 IS_GENEVE_LINK_ASSERT(link); in rtnl_link_geneve_set_remote()
462 * @arg link Link object
467 int rtnl_link_geneve_get_remote(struct rtnl_link *link, struct nl_addr **addr) in rtnl_link_geneve_get_remote() argument
469 struct geneve_info *geneve = link->l_info; in rtnl_link_geneve_get_remote()
471 IS_GENEVE_LINK_ASSERT(link); in rtnl_link_geneve_get_remote()
488 * @arg link Link object
493 int rtnl_link_geneve_set_ttl(struct rtnl_link *link, uint8_t ttl) in rtnl_link_geneve_set_ttl() argument
495 struct geneve_info *geneve = link->l_info; in rtnl_link_geneve_set_ttl()
497 IS_GENEVE_LINK_ASSERT(link); in rtnl_link_geneve_set_ttl()
507 * @arg link Link object
511 int rtnl_link_geneve_get_ttl(struct rtnl_link *link) in rtnl_link_geneve_get_ttl() argument
513 struct geneve_info *geneve = link->l_info; in rtnl_link_geneve_get_ttl()
515 IS_GENEVE_LINK_ASSERT(link); in rtnl_link_geneve_get_ttl()
525 * @arg link Link object
530 int rtnl_link_geneve_set_tos(struct rtnl_link *link, uint8_t tos) in rtnl_link_geneve_set_tos() argument
532 struct geneve_info *geneve = link->l_info; in rtnl_link_geneve_set_tos()
534 IS_GENEVE_LINK_ASSERT(link); in rtnl_link_geneve_set_tos()
544 * @arg link Link object
548 int rtnl_link_geneve_get_tos(struct rtnl_link *link) in rtnl_link_geneve_get_tos() argument
550 struct geneve_info *geneve = link->l_info; in rtnl_link_geneve_get_tos()
552 IS_GENEVE_LINK_ASSERT(link); in rtnl_link_geneve_get_tos()
562 * @arg link Link object
568 int rtnl_link_geneve_set_port(struct rtnl_link *link, uint32_t port) in rtnl_link_geneve_set_port() argument
570 struct geneve_info *geneve = link->l_info; in rtnl_link_geneve_set_port()
572 IS_GENEVE_LINK_ASSERT(link); in rtnl_link_geneve_set_port()
582 * @arg link Link object
587 int rtnl_link_geneve_get_port(struct rtnl_link *link, uint32_t *port) in rtnl_link_geneve_get_port() argument
589 struct geneve_info *geneve = link->l_info; in rtnl_link_geneve_get_port()
591 IS_GENEVE_LINK_ASSERT(link); in rtnl_link_geneve_get_port()
606 * @arg link Link object
611 int rtnl_link_geneve_set_label(struct rtnl_link *link, uint32_t label) in rtnl_link_geneve_set_label() argument
613 struct geneve_info *geneve = link->l_info; in rtnl_link_geneve_set_label()
615 IS_GENEVE_LINK_ASSERT(link); in rtnl_link_geneve_set_label()
625 * @arg link Link object
630 int rtnl_link_geneve_get_label(struct rtnl_link *link, uint32_t *label) in rtnl_link_geneve_get_label() argument
632 struct geneve_info *geneve = link->l_info; in rtnl_link_geneve_get_label()
634 IS_GENEVE_LINK_ASSERT(link); in rtnl_link_geneve_get_label()
648 * @arg link Link object
653 int rtnl_link_geneve_set_udp_csum(struct rtnl_link *link, uint8_t csum) in rtnl_link_geneve_set_udp_csum() argument
655 struct geneve_info *geneve = link->l_info; in rtnl_link_geneve_set_udp_csum()
657 IS_GENEVE_LINK_ASSERT(link); in rtnl_link_geneve_set_udp_csum()
667 * @arg link Link object
671 int rtnl_link_geneve_get_udp_csum(struct rtnl_link *link) in rtnl_link_geneve_get_udp_csum() argument
673 struct geneve_info *geneve = link->l_info; in rtnl_link_geneve_get_udp_csum()
675 IS_GENEVE_LINK_ASSERT(link); in rtnl_link_geneve_get_udp_csum()
685 * @arg link Link object
690 int rtnl_link_geneve_set_udp_zero_csum6_tx(struct rtnl_link *link, uint8_t csum) in rtnl_link_geneve_set_udp_zero_csum6_tx() argument
692 struct geneve_info *geneve = link->l_info; in rtnl_link_geneve_set_udp_zero_csum6_tx()
694 IS_GENEVE_LINK_ASSERT(link); in rtnl_link_geneve_set_udp_zero_csum6_tx()
704 * @arg link Link object
708 int rtnl_link_geneve_get_udp_zero_csum6_tx(struct rtnl_link *link) in rtnl_link_geneve_get_udp_zero_csum6_tx() argument
710 struct geneve_info *geneve = link->l_info; in rtnl_link_geneve_get_udp_zero_csum6_tx()
712 IS_GENEVE_LINK_ASSERT(link); in rtnl_link_geneve_get_udp_zero_csum6_tx()
722 * @arg link Link object
727 int rtnl_link_geneve_set_udp_zero_csum6_rx(struct rtnl_link *link, uint8_t csum) in rtnl_link_geneve_set_udp_zero_csum6_rx() argument
729 struct geneve_info *geneve = link->l_info; in rtnl_link_geneve_set_udp_zero_csum6_rx()
731 IS_GENEVE_LINK_ASSERT(link); in rtnl_link_geneve_set_udp_zero_csum6_rx()
741 * @arg link Link object
745 int rtnl_link_geneve_get_udp_zero_csum6_rx(struct rtnl_link *link) in rtnl_link_geneve_get_udp_zero_csum6_rx() argument
747 struct geneve_info *geneve = link->l_info; in rtnl_link_geneve_get_udp_zero_csum6_rx()
749 IS_GENEVE_LINK_ASSERT(link); in rtnl_link_geneve_get_udp_zero_csum6_rx()
759 * @arg link Link object
765 int rtnl_link_geneve_set_flags(struct rtnl_link *link, uint8_t flags, int enable) in rtnl_link_geneve_set_flags() argument
767 struct geneve_info *geneve = link->l_info; in rtnl_link_geneve_set_flags()
769 IS_GENEVE_LINK_ASSERT(link); in rtnl_link_geneve_set_flags()
784 * @arg link Link object
789 int rtnl_link_geneve_get_flags(struct rtnl_link *link, uint8_t *flags) in rtnl_link_geneve_get_flags() argument
791 struct geneve_info *geneve = link->l_info; in rtnl_link_geneve_get_flags()
793 IS_GENEVE_LINK_ASSERT(link); in rtnl_link_geneve_get_flags()