• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _UAPI__LINUX_OPENVSWITCH_H
20 #define _UAPI__LINUX_OPENVSWITCH_H 1
21 #include <linux/types.h>
22 #include <linux/if_ether.h>
23 struct ovs_header {
24   int dp_ifindex;
25 };
26 #define OVS_DATAPATH_FAMILY "ovs_datapath"
27 #define OVS_DATAPATH_MCGROUP "ovs_datapath"
28 #define OVS_DATAPATH_VERSION 2
29 #define OVS_DP_VER_FEATURES 2
30 enum ovs_datapath_cmd {
31   OVS_DP_CMD_UNSPEC,
32   OVS_DP_CMD_NEW,
33   OVS_DP_CMD_DEL,
34   OVS_DP_CMD_GET,
35   OVS_DP_CMD_SET
36 };
37 enum ovs_datapath_attr {
38   OVS_DP_ATTR_UNSPEC,
39   OVS_DP_ATTR_NAME,
40   OVS_DP_ATTR_UPCALL_PID,
41   OVS_DP_ATTR_STATS,
42   OVS_DP_ATTR_MEGAFLOW_STATS,
43   OVS_DP_ATTR_USER_FEATURES,
44   OVS_DP_ATTR_PAD,
45   __OVS_DP_ATTR_MAX
46 };
47 #define OVS_DP_ATTR_MAX (__OVS_DP_ATTR_MAX - 1)
48 struct ovs_dp_stats {
49   __u64 n_hit;
50   __u64 n_missed;
51   __u64 n_lost;
52   __u64 n_flows;
53 };
54 struct ovs_dp_megaflow_stats {
55   __u64 n_mask_hit;
56   __u32 n_masks;
57   __u32 pad0;
58   __u64 pad1;
59   __u64 pad2;
60 };
61 struct ovs_vport_stats {
62   __u64 rx_packets;
63   __u64 tx_packets;
64   __u64 rx_bytes;
65   __u64 tx_bytes;
66   __u64 rx_errors;
67   __u64 tx_errors;
68   __u64 rx_dropped;
69   __u64 tx_dropped;
70 };
71 #define OVS_DP_F_UNALIGNED (1 << 0)
72 #define OVS_DP_F_VPORT_PIDS (1 << 1)
73 #define OVS_DP_F_TC_RECIRC_SHARING (1 << 2)
74 #define OVSP_LOCAL ((__u32) 0)
75 #define OVS_PACKET_FAMILY "ovs_packet"
76 #define OVS_PACKET_VERSION 0x1
77 enum ovs_packet_cmd {
78   OVS_PACKET_CMD_UNSPEC,
79   OVS_PACKET_CMD_MISS,
80   OVS_PACKET_CMD_ACTION,
81   OVS_PACKET_CMD_EXECUTE
82 };
83 enum ovs_packet_attr {
84   OVS_PACKET_ATTR_UNSPEC,
85   OVS_PACKET_ATTR_PACKET,
86   OVS_PACKET_ATTR_KEY,
87   OVS_PACKET_ATTR_ACTIONS,
88   OVS_PACKET_ATTR_USERDATA,
89   OVS_PACKET_ATTR_EGRESS_TUN_KEY,
90   OVS_PACKET_ATTR_UNUSED1,
91   OVS_PACKET_ATTR_UNUSED2,
92   OVS_PACKET_ATTR_PROBE,
93   OVS_PACKET_ATTR_MRU,
94   OVS_PACKET_ATTR_LEN,
95   OVS_PACKET_ATTR_HASH,
96   __OVS_PACKET_ATTR_MAX
97 };
98 #define OVS_PACKET_ATTR_MAX (__OVS_PACKET_ATTR_MAX - 1)
99 #define OVS_VPORT_FAMILY "ovs_vport"
100 #define OVS_VPORT_MCGROUP "ovs_vport"
101 #define OVS_VPORT_VERSION 0x1
102 enum ovs_vport_cmd {
103   OVS_VPORT_CMD_UNSPEC,
104   OVS_VPORT_CMD_NEW,
105   OVS_VPORT_CMD_DEL,
106   OVS_VPORT_CMD_GET,
107   OVS_VPORT_CMD_SET
108 };
109 enum ovs_vport_type {
110   OVS_VPORT_TYPE_UNSPEC,
111   OVS_VPORT_TYPE_NETDEV,
112   OVS_VPORT_TYPE_INTERNAL,
113   OVS_VPORT_TYPE_GRE,
114   OVS_VPORT_TYPE_VXLAN,
115   OVS_VPORT_TYPE_GENEVE,
116   __OVS_VPORT_TYPE_MAX
117 };
118 #define OVS_VPORT_TYPE_MAX (__OVS_VPORT_TYPE_MAX - 1)
119 enum ovs_vport_attr {
120   OVS_VPORT_ATTR_UNSPEC,
121   OVS_VPORT_ATTR_PORT_NO,
122   OVS_VPORT_ATTR_TYPE,
123   OVS_VPORT_ATTR_NAME,
124   OVS_VPORT_ATTR_OPTIONS,
125   OVS_VPORT_ATTR_UPCALL_PID,
126   OVS_VPORT_ATTR_STATS,
127   OVS_VPORT_ATTR_PAD,
128   OVS_VPORT_ATTR_IFINDEX,
129   OVS_VPORT_ATTR_NETNSID,
130   __OVS_VPORT_ATTR_MAX
131 };
132 #define OVS_VPORT_ATTR_MAX (__OVS_VPORT_ATTR_MAX - 1)
133 enum {
134   OVS_VXLAN_EXT_UNSPEC,
135   OVS_VXLAN_EXT_GBP,
136   __OVS_VXLAN_EXT_MAX,
137 };
138 #define OVS_VXLAN_EXT_MAX (__OVS_VXLAN_EXT_MAX - 1)
139 enum {
140   OVS_TUNNEL_ATTR_UNSPEC,
141   OVS_TUNNEL_ATTR_DST_PORT,
142   OVS_TUNNEL_ATTR_EXTENSION,
143   __OVS_TUNNEL_ATTR_MAX
144 };
145 #define OVS_TUNNEL_ATTR_MAX (__OVS_TUNNEL_ATTR_MAX - 1)
146 #define OVS_FLOW_FAMILY "ovs_flow"
147 #define OVS_FLOW_MCGROUP "ovs_flow"
148 #define OVS_FLOW_VERSION 0x1
149 enum ovs_flow_cmd {
150   OVS_FLOW_CMD_UNSPEC,
151   OVS_FLOW_CMD_NEW,
152   OVS_FLOW_CMD_DEL,
153   OVS_FLOW_CMD_GET,
154   OVS_FLOW_CMD_SET
155 };
156 struct ovs_flow_stats {
157   __u64 n_packets;
158   __u64 n_bytes;
159 };
160 enum ovs_key_attr {
161   OVS_KEY_ATTR_UNSPEC,
162   OVS_KEY_ATTR_ENCAP,
163   OVS_KEY_ATTR_PRIORITY,
164   OVS_KEY_ATTR_IN_PORT,
165   OVS_KEY_ATTR_ETHERNET,
166   OVS_KEY_ATTR_VLAN,
167   OVS_KEY_ATTR_ETHERTYPE,
168   OVS_KEY_ATTR_IPV4,
169   OVS_KEY_ATTR_IPV6,
170   OVS_KEY_ATTR_TCP,
171   OVS_KEY_ATTR_UDP,
172   OVS_KEY_ATTR_ICMP,
173   OVS_KEY_ATTR_ICMPV6,
174   OVS_KEY_ATTR_ARP,
175   OVS_KEY_ATTR_ND,
176   OVS_KEY_ATTR_SKB_MARK,
177   OVS_KEY_ATTR_TUNNEL,
178   OVS_KEY_ATTR_SCTP,
179   OVS_KEY_ATTR_TCP_FLAGS,
180   OVS_KEY_ATTR_DP_HASH,
181   OVS_KEY_ATTR_RECIRC_ID,
182   OVS_KEY_ATTR_MPLS,
183   OVS_KEY_ATTR_CT_STATE,
184   OVS_KEY_ATTR_CT_ZONE,
185   OVS_KEY_ATTR_CT_MARK,
186   OVS_KEY_ATTR_CT_LABELS,
187   OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV4,
188   OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV6,
189   OVS_KEY_ATTR_NSH,
190   __OVS_KEY_ATTR_MAX
191 };
192 #define OVS_KEY_ATTR_MAX (__OVS_KEY_ATTR_MAX - 1)
193 enum ovs_tunnel_key_attr {
194   OVS_TUNNEL_KEY_ATTR_ID,
195   OVS_TUNNEL_KEY_ATTR_IPV4_SRC,
196   OVS_TUNNEL_KEY_ATTR_IPV4_DST,
197   OVS_TUNNEL_KEY_ATTR_TOS,
198   OVS_TUNNEL_KEY_ATTR_TTL,
199   OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT,
200   OVS_TUNNEL_KEY_ATTR_CSUM,
201   OVS_TUNNEL_KEY_ATTR_OAM,
202   OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS,
203   OVS_TUNNEL_KEY_ATTR_TP_SRC,
204   OVS_TUNNEL_KEY_ATTR_TP_DST,
205   OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS,
206   OVS_TUNNEL_KEY_ATTR_IPV6_SRC,
207   OVS_TUNNEL_KEY_ATTR_IPV6_DST,
208   OVS_TUNNEL_KEY_ATTR_PAD,
209   OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS,
210   OVS_TUNNEL_KEY_ATTR_IPV4_INFO_BRIDGE,
211   __OVS_TUNNEL_KEY_ATTR_MAX
212 };
213 #define OVS_TUNNEL_KEY_ATTR_MAX (__OVS_TUNNEL_KEY_ATTR_MAX - 1)
214 enum ovs_frag_type {
215   OVS_FRAG_TYPE_NONE,
216   OVS_FRAG_TYPE_FIRST,
217   OVS_FRAG_TYPE_LATER,
218   __OVS_FRAG_TYPE_MAX
219 };
220 #define OVS_FRAG_TYPE_MAX (__OVS_FRAG_TYPE_MAX - 1)
221 struct ovs_key_ethernet {
222   __u8 eth_src[ETH_ALEN];
223   __u8 eth_dst[ETH_ALEN];
224 };
225 struct ovs_key_mpls {
226   __be32 mpls_lse;
227 };
228 struct ovs_key_ipv4 {
229   __be32 ipv4_src;
230   __be32 ipv4_dst;
231   __u8 ipv4_proto;
232   __u8 ipv4_tos;
233   __u8 ipv4_ttl;
234   __u8 ipv4_frag;
235 };
236 struct ovs_key_ipv6 {
237   __be32 ipv6_src[4];
238   __be32 ipv6_dst[4];
239   __be32 ipv6_label;
240   __u8 ipv6_proto;
241   __u8 ipv6_tclass;
242   __u8 ipv6_hlimit;
243   __u8 ipv6_frag;
244 };
245 struct ovs_key_tcp {
246   __be16 tcp_src;
247   __be16 tcp_dst;
248 };
249 struct ovs_key_udp {
250   __be16 udp_src;
251   __be16 udp_dst;
252 };
253 struct ovs_key_sctp {
254   __be16 sctp_src;
255   __be16 sctp_dst;
256 };
257 struct ovs_key_icmp {
258   __u8 icmp_type;
259   __u8 icmp_code;
260 };
261 struct ovs_key_icmpv6 {
262   __u8 icmpv6_type;
263   __u8 icmpv6_code;
264 };
265 struct ovs_key_arp {
266   __be32 arp_sip;
267   __be32 arp_tip;
268   __be16 arp_op;
269   __u8 arp_sha[ETH_ALEN];
270   __u8 arp_tha[ETH_ALEN];
271 };
272 struct ovs_key_nd {
273   __be32 nd_target[4];
274   __u8 nd_sll[ETH_ALEN];
275   __u8 nd_tll[ETH_ALEN];
276 };
277 #define OVS_CT_LABELS_LEN_32 4
278 #define OVS_CT_LABELS_LEN (OVS_CT_LABELS_LEN_32 * sizeof(__u32))
279 struct ovs_key_ct_labels {
280   union {
281     __u8 ct_labels[OVS_CT_LABELS_LEN];
282     __u32 ct_labels_32[OVS_CT_LABELS_LEN_32];
283   };
284 };
285 #define OVS_CS_F_NEW 0x01
286 #define OVS_CS_F_ESTABLISHED 0x02
287 #define OVS_CS_F_RELATED 0x04
288 #define OVS_CS_F_REPLY_DIR 0x08
289 #define OVS_CS_F_INVALID 0x10
290 #define OVS_CS_F_TRACKED 0x20
291 #define OVS_CS_F_SRC_NAT 0x40
292 #define OVS_CS_F_DST_NAT 0x80
293 #define OVS_CS_F_NAT_MASK (OVS_CS_F_SRC_NAT | OVS_CS_F_DST_NAT)
294 struct ovs_key_ct_tuple_ipv4 {
295   __be32 ipv4_src;
296   __be32 ipv4_dst;
297   __be16 src_port;
298   __be16 dst_port;
299   __u8 ipv4_proto;
300 };
301 struct ovs_key_ct_tuple_ipv6 {
302   __be32 ipv6_src[4];
303   __be32 ipv6_dst[4];
304   __be16 src_port;
305   __be16 dst_port;
306   __u8 ipv6_proto;
307 };
308 enum ovs_nsh_key_attr {
309   OVS_NSH_KEY_ATTR_UNSPEC,
310   OVS_NSH_KEY_ATTR_BASE,
311   OVS_NSH_KEY_ATTR_MD1,
312   OVS_NSH_KEY_ATTR_MD2,
313   __OVS_NSH_KEY_ATTR_MAX
314 };
315 #define OVS_NSH_KEY_ATTR_MAX (__OVS_NSH_KEY_ATTR_MAX - 1)
316 struct ovs_nsh_key_base {
317   __u8 flags;
318   __u8 ttl;
319   __u8 mdtype;
320   __u8 np;
321   __be32 path_hdr;
322 };
323 #define NSH_MD1_CONTEXT_SIZE 4
324 struct ovs_nsh_key_md1 {
325   __be32 context[NSH_MD1_CONTEXT_SIZE];
326 };
327 enum ovs_flow_attr {
328   OVS_FLOW_ATTR_UNSPEC,
329   OVS_FLOW_ATTR_KEY,
330   OVS_FLOW_ATTR_ACTIONS,
331   OVS_FLOW_ATTR_STATS,
332   OVS_FLOW_ATTR_TCP_FLAGS,
333   OVS_FLOW_ATTR_USED,
334   OVS_FLOW_ATTR_CLEAR,
335   OVS_FLOW_ATTR_MASK,
336   OVS_FLOW_ATTR_PROBE,
337   OVS_FLOW_ATTR_UFID,
338   OVS_FLOW_ATTR_UFID_FLAGS,
339   OVS_FLOW_ATTR_PAD,
340   __OVS_FLOW_ATTR_MAX
341 };
342 #define OVS_FLOW_ATTR_MAX (__OVS_FLOW_ATTR_MAX - 1)
343 #define OVS_UFID_F_OMIT_KEY (1 << 0)
344 #define OVS_UFID_F_OMIT_MASK (1 << 1)
345 #define OVS_UFID_F_OMIT_ACTIONS (1 << 2)
346 enum ovs_sample_attr {
347   OVS_SAMPLE_ATTR_UNSPEC,
348   OVS_SAMPLE_ATTR_PROBABILITY,
349   OVS_SAMPLE_ATTR_ACTIONS,
350   __OVS_SAMPLE_ATTR_MAX,
351 };
352 #define OVS_SAMPLE_ATTR_MAX (__OVS_SAMPLE_ATTR_MAX - 1)
353 enum ovs_userspace_attr {
354   OVS_USERSPACE_ATTR_UNSPEC,
355   OVS_USERSPACE_ATTR_PID,
356   OVS_USERSPACE_ATTR_USERDATA,
357   OVS_USERSPACE_ATTR_EGRESS_TUN_PORT,
358   OVS_USERSPACE_ATTR_ACTIONS,
359   __OVS_USERSPACE_ATTR_MAX
360 };
361 #define OVS_USERSPACE_ATTR_MAX (__OVS_USERSPACE_ATTR_MAX - 1)
362 struct ovs_action_trunc {
363   __u32 max_len;
364 };
365 struct ovs_action_push_mpls {
366   __be32 mpls_lse;
367   __be16 mpls_ethertype;
368 };
369 struct ovs_action_push_vlan {
370   __be16 vlan_tpid;
371   __be16 vlan_tci;
372 };
373 enum ovs_hash_alg {
374   OVS_HASH_ALG_L4,
375 };
376 struct ovs_action_hash {
377   __u32 hash_alg;
378   __u32 hash_basis;
379 };
380 enum ovs_ct_attr {
381   OVS_CT_ATTR_UNSPEC,
382   OVS_CT_ATTR_COMMIT,
383   OVS_CT_ATTR_ZONE,
384   OVS_CT_ATTR_MARK,
385   OVS_CT_ATTR_LABELS,
386   OVS_CT_ATTR_HELPER,
387   OVS_CT_ATTR_NAT,
388   OVS_CT_ATTR_FORCE_COMMIT,
389   OVS_CT_ATTR_EVENTMASK,
390   OVS_CT_ATTR_TIMEOUT,
391   __OVS_CT_ATTR_MAX
392 };
393 #define OVS_CT_ATTR_MAX (__OVS_CT_ATTR_MAX - 1)
394 enum ovs_nat_attr {
395   OVS_NAT_ATTR_UNSPEC,
396   OVS_NAT_ATTR_SRC,
397   OVS_NAT_ATTR_DST,
398   OVS_NAT_ATTR_IP_MIN,
399   OVS_NAT_ATTR_IP_MAX,
400   OVS_NAT_ATTR_PROTO_MIN,
401   OVS_NAT_ATTR_PROTO_MAX,
402   OVS_NAT_ATTR_PERSISTENT,
403   OVS_NAT_ATTR_PROTO_HASH,
404   OVS_NAT_ATTR_PROTO_RANDOM,
405   __OVS_NAT_ATTR_MAX,
406 };
407 #define OVS_NAT_ATTR_MAX (__OVS_NAT_ATTR_MAX - 1)
408 struct ovs_action_push_eth {
409   struct ovs_key_ethernet addresses;
410 };
411 enum ovs_check_pkt_len_attr {
412   OVS_CHECK_PKT_LEN_ATTR_UNSPEC,
413   OVS_CHECK_PKT_LEN_ATTR_PKT_LEN,
414   OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_GREATER,
415   OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_LESS_EQUAL,
416   __OVS_CHECK_PKT_LEN_ATTR_MAX,
417 };
418 #define OVS_CHECK_PKT_LEN_ATTR_MAX (__OVS_CHECK_PKT_LEN_ATTR_MAX - 1)
419 enum ovs_action_attr {
420   OVS_ACTION_ATTR_UNSPEC,
421   OVS_ACTION_ATTR_OUTPUT,
422   OVS_ACTION_ATTR_USERSPACE,
423   OVS_ACTION_ATTR_SET,
424   OVS_ACTION_ATTR_PUSH_VLAN,
425   OVS_ACTION_ATTR_POP_VLAN,
426   OVS_ACTION_ATTR_SAMPLE,
427   OVS_ACTION_ATTR_RECIRC,
428   OVS_ACTION_ATTR_HASH,
429   OVS_ACTION_ATTR_PUSH_MPLS,
430   OVS_ACTION_ATTR_POP_MPLS,
431   OVS_ACTION_ATTR_SET_MASKED,
432   OVS_ACTION_ATTR_CT,
433   OVS_ACTION_ATTR_TRUNC,
434   OVS_ACTION_ATTR_PUSH_ETH,
435   OVS_ACTION_ATTR_POP_ETH,
436   OVS_ACTION_ATTR_CT_CLEAR,
437   OVS_ACTION_ATTR_PUSH_NSH,
438   OVS_ACTION_ATTR_POP_NSH,
439   OVS_ACTION_ATTR_METER,
440   OVS_ACTION_ATTR_CLONE,
441   OVS_ACTION_ATTR_CHECK_PKT_LEN,
442   __OVS_ACTION_ATTR_MAX,
443 };
444 #define OVS_ACTION_ATTR_MAX (__OVS_ACTION_ATTR_MAX - 1)
445 #define OVS_METER_FAMILY "ovs_meter"
446 #define OVS_METER_MCGROUP "ovs_meter"
447 #define OVS_METER_VERSION 0x1
448 enum ovs_meter_cmd {
449   OVS_METER_CMD_UNSPEC,
450   OVS_METER_CMD_FEATURES,
451   OVS_METER_CMD_SET,
452   OVS_METER_CMD_DEL,
453   OVS_METER_CMD_GET
454 };
455 enum ovs_meter_attr {
456   OVS_METER_ATTR_UNSPEC,
457   OVS_METER_ATTR_ID,
458   OVS_METER_ATTR_KBPS,
459   OVS_METER_ATTR_STATS,
460   OVS_METER_ATTR_BANDS,
461   OVS_METER_ATTR_USED,
462   OVS_METER_ATTR_CLEAR,
463   OVS_METER_ATTR_MAX_METERS,
464   OVS_METER_ATTR_MAX_BANDS,
465   OVS_METER_ATTR_PAD,
466   __OVS_METER_ATTR_MAX
467 };
468 #define OVS_METER_ATTR_MAX (__OVS_METER_ATTR_MAX - 1)
469 enum ovs_band_attr {
470   OVS_BAND_ATTR_UNSPEC,
471   OVS_BAND_ATTR_TYPE,
472   OVS_BAND_ATTR_RATE,
473   OVS_BAND_ATTR_BURST,
474   OVS_BAND_ATTR_STATS,
475   __OVS_BAND_ATTR_MAX
476 };
477 #define OVS_BAND_ATTR_MAX (__OVS_BAND_ATTR_MAX - 1)
478 enum ovs_meter_band_type {
479   OVS_METER_BAND_TYPE_UNSPEC,
480   OVS_METER_BAND_TYPE_DROP,
481   __OVS_METER_BAND_TYPE_MAX
482 };
483 #define OVS_METER_BAND_TYPE_MAX (__OVS_METER_BAND_TYPE_MAX - 1)
484 #define OVS_CT_LIMIT_FAMILY "ovs_ct_limit"
485 #define OVS_CT_LIMIT_MCGROUP "ovs_ct_limit"
486 #define OVS_CT_LIMIT_VERSION 0x1
487 enum ovs_ct_limit_cmd {
488   OVS_CT_LIMIT_CMD_UNSPEC,
489   OVS_CT_LIMIT_CMD_SET,
490   OVS_CT_LIMIT_CMD_DEL,
491   OVS_CT_LIMIT_CMD_GET
492 };
493 enum ovs_ct_limit_attr {
494   OVS_CT_LIMIT_ATTR_UNSPEC,
495   OVS_CT_LIMIT_ATTR_ZONE_LIMIT,
496   __OVS_CT_LIMIT_ATTR_MAX
497 };
498 #define OVS_CT_LIMIT_ATTR_MAX (__OVS_CT_LIMIT_ATTR_MAX - 1)
499 #define OVS_ZONE_LIMIT_DEFAULT_ZONE - 1
500 struct ovs_zone_limit {
501   int zone_id;
502   __u32 limit;
503   __u32 count;
504 };
505 #endif
506