• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * netlink/route/link/vxlan.h		VXLAN interface
3  *
4  *	This library is free software; you can redistribute it and/or
5  *	modify it under the terms of the GNU Lesser General Public
6  *	License as published by the Free Software Foundation version 2.1
7  *	of the License.
8  *
9  * Copyright (c) 2013 Yasunobu Chiba <yasu@dsl.gr.jp>
10  */
11 
12 #ifndef NETLINK_LINK_VXLAN_H_
13 #define NETLINK_LINK_VXLAN_H_
14 
15 #include <netlink/netlink.h>
16 #include <netlink/route/link.h>
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 struct ifla_vxlan_port_range;
23 
24 #define VXLAN_ID_MAX 16777215
25 
26 enum {
27 	RTNL_LINK_VXLAN_F_GBP                   = 1 << 0,
28 #define RTNL_LINK_VXLAN_F_GBP RTNL_LINK_VXLAN_F_GBP
29 	RTNL_LINK_VXLAN_F_GPE                   = 1 << 1,
30 #define RTNL_LINK_VXLAN_F_GPE RTNL_LINK_VXLAN_F_GPE
31 	RTNL_LINK_VXLAN_F_REMCSUM_NOPARTIAL     = 1 << 2,
32 #define RTNL_LINK_VXLAN_F_REMCSUM_NOPARTIAL RTNL_LINK_VXLAN_F_REMCSUM_NOPARTIAL
33 };
34 
35 extern struct rtnl_link *rtnl_link_vxlan_alloc(void);
36 
37 extern int	rtnl_link_is_vxlan(struct rtnl_link *);
38 
39 extern int	rtnl_link_vxlan_set_id(struct rtnl_link *, uint32_t);
40 extern int	rtnl_link_vxlan_get_id(struct rtnl_link *, uint32_t *);
41 
42 extern int	rtnl_link_vxlan_set_group(struct rtnl_link *, struct nl_addr *);
43 extern int	rtnl_link_vxlan_get_group(struct rtnl_link *, struct nl_addr **);
44 
45 extern int	rtnl_link_vxlan_set_link(struct rtnl_link *, uint32_t);
46 extern int	rtnl_link_vxlan_get_link(struct rtnl_link *, uint32_t *);
47 
48 extern int	rtnl_link_vxlan_set_local(struct rtnl_link *, struct nl_addr *);
49 extern int	rtnl_link_vxlan_get_local(struct rtnl_link *, struct nl_addr **);
50 
51 extern int	rtnl_link_vxlan_set_ttl(struct rtnl_link *, uint8_t);
52 extern int	rtnl_link_vxlan_get_ttl(struct rtnl_link *);
53 
54 extern int	rtnl_link_vxlan_set_tos(struct rtnl_link *, uint8_t);
55 extern int	rtnl_link_vxlan_get_tos(struct rtnl_link *);
56 
57 extern int	rtnl_link_vxlan_set_learning(struct rtnl_link *, uint8_t);
58 extern int	rtnl_link_vxlan_get_learning(struct rtnl_link *);
59 extern int	rtnl_link_vxlan_enable_learning(struct rtnl_link *);
60 extern int	rtnl_link_vxlan_disable_learning(struct rtnl_link *);
61 
62 extern int	rtnl_link_vxlan_set_ageing(struct rtnl_link *, uint32_t);
63 extern int	rtnl_link_vxlan_get_ageing(struct rtnl_link *, uint32_t *);
64 
65 extern int	rtnl_link_vxlan_set_limit(struct rtnl_link *, uint32_t);
66 extern int	rtnl_link_vxlan_get_limit(struct rtnl_link *, uint32_t *);
67 
68 extern int	rtnl_link_vxlan_set_port_range(struct rtnl_link *,
69 										   struct ifla_vxlan_port_range *);
70 extern int	rtnl_link_vxlan_get_port_range(struct rtnl_link *,
71 										   struct ifla_vxlan_port_range *);
72 
73 extern int	rtnl_link_vxlan_set_proxy(struct rtnl_link *, uint8_t);
74 extern int	rtnl_link_vxlan_get_proxy(struct rtnl_link *);
75 extern int	rtnl_link_vxlan_enable_proxy(struct rtnl_link *);
76 extern int	rtnl_link_vxlan_disable_proxy(struct rtnl_link *);
77 
78 extern int	rtnl_link_vxlan_set_rsc(struct rtnl_link *, uint8_t);
79 extern int	rtnl_link_vxlan_get_rsc(struct rtnl_link *);
80 extern int	rtnl_link_vxlan_enable_rsc(struct rtnl_link *);
81 extern int	rtnl_link_vxlan_disable_rsc(struct rtnl_link *);
82 
83 extern int	rtnl_link_vxlan_set_l2miss(struct rtnl_link *, uint8_t);
84 extern int	rtnl_link_vxlan_get_l2miss(struct rtnl_link *);
85 extern int	rtnl_link_vxlan_enable_l2miss(struct rtnl_link *);
86 extern int	rtnl_link_vxlan_disable_l2miss(struct rtnl_link *);
87 
88 extern int	rtnl_link_vxlan_set_l3miss(struct rtnl_link *, uint8_t);
89 extern int	rtnl_link_vxlan_get_l3miss(struct rtnl_link *);
90 extern int	rtnl_link_vxlan_enable_l3miss(struct rtnl_link *);
91 extern int	rtnl_link_vxlan_disable_l3miss(struct rtnl_link *);
92 
93 extern int	rtnl_link_vxlan_set_port(struct rtnl_link *, uint32_t);
94 extern int	rtnl_link_vxlan_get_port(struct rtnl_link *, uint32_t *);
95 
96 extern int	rtnl_link_vxlan_set_udp_csum(struct rtnl_link *, uint8_t);
97 extern int	rtnl_link_vxlan_get_udp_csum(struct rtnl_link *);
98 
99 extern int	rtnl_link_vxlan_set_udp_zero_csum6_tx(struct rtnl_link *, uint8_t);
100 extern int	rtnl_link_vxlan_get_udp_zero_csum6_tx(struct rtnl_link *);
101 
102 extern int	rtnl_link_vxlan_set_udp_zero_csum6_rx(struct rtnl_link *, uint8_t);
103 extern int	rtnl_link_vxlan_get_udp_zero_csum6_rx(struct rtnl_link *);
104 
105 extern int	rtnl_link_vxlan_set_remcsum_tx(struct rtnl_link *, uint8_t);
106 extern int	rtnl_link_vxlan_get_remcsum_tx(struct rtnl_link *);
107 
108 extern int	rtnl_link_vxlan_set_remcsum_rx(struct rtnl_link *, uint8_t);
109 extern int	rtnl_link_vxlan_get_remcsum_rx(struct rtnl_link *);
110 
111 extern int	rtnl_link_vxlan_set_flags(struct rtnl_link *, uint32_t flags, int enable);
112 extern int	rtnl_link_vxlan_get_flags(struct rtnl_link *, uint32_t *out_flags);
113 
114 extern int	rtnl_link_vxlan_set_collect_metadata(struct rtnl_link *, uint8_t);
115 extern int	rtnl_link_vxlan_get_collect_metadata(struct rtnl_link *);
116 
117 extern int	rtnl_link_vxlan_set_label(struct rtnl_link *, uint32_t);
118 extern int	rtnl_link_vxlan_get_label(struct rtnl_link *, uint32_t *);
119 
120 #ifdef __cplusplus
121 }
122 #endif
123 
124 #endif
125