blob: c7d719c7631c1c8edf9483cd3ca80cd3f954e5d7 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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>
Ben Cheng655a7c02013-10-16 16:09:24 -070023struct ovs_header {
Tao Baod7db5942015-01-28 10:07:51 -080024 int dp_ifindex;
Ben Cheng655a7c02013-10-16 16:09:24 -070025};
26#define OVS_DATAPATH_FAMILY "ovs_datapath"
Ben Cheng655a7c02013-10-16 16:09:24 -070027#define OVS_DATAPATH_MCGROUP "ovs_datapath"
Christopher Ferris38062f92014-07-09 15:33:25 -070028#define OVS_DATAPATH_VERSION 2
29#define OVS_DP_VER_FEATURES 2
Ben Cheng655a7c02013-10-16 16:09:24 -070030enum ovs_datapath_cmd {
Tao Baod7db5942015-01-28 10:07:51 -080031 OVS_DP_CMD_UNSPEC,
32 OVS_DP_CMD_NEW,
33 OVS_DP_CMD_DEL,
34 OVS_DP_CMD_GET,
Tao Baod7db5942015-01-28 10:07:51 -080035 OVS_DP_CMD_SET
Ben Cheng655a7c02013-10-16 16:09:24 -070036};
37enum ovs_datapath_attr {
Tao Baod7db5942015-01-28 10:07:51 -080038 OVS_DP_ATTR_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -080039 OVS_DP_ATTR_NAME,
40 OVS_DP_ATTR_UPCALL_PID,
41 OVS_DP_ATTR_STATS,
42 OVS_DP_ATTR_MEGAFLOW_STATS,
Tao Baod7db5942015-01-28 10:07:51 -080043 OVS_DP_ATTR_USER_FEATURES,
Christopher Ferris106b3a82016-08-24 12:15:38 -070044 OVS_DP_ATTR_PAD,
Christopher Ferris25c18d42020-10-14 17:42:58 -070045 OVS_DP_ATTR_MASKS_CACHE_SIZE,
Christopher Ferris2abfa9e2021-11-01 16:26:06 -070046 OVS_DP_ATTR_PER_CPU_PIDS,
Tao Baod7db5942015-01-28 10:07:51 -080047 __OVS_DP_ATTR_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -070048};
Christopher Ferris106b3a82016-08-24 12:15:38 -070049#define OVS_DP_ATTR_MAX (__OVS_DP_ATTR_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070050struct ovs_dp_stats {
Tao Baod7db5942015-01-28 10:07:51 -080051 __u64 n_hit;
52 __u64 n_missed;
Christopher Ferris106b3a82016-08-24 12:15:38 -070053 __u64 n_lost;
Tao Baod7db5942015-01-28 10:07:51 -080054 __u64 n_flows;
Ben Cheng655a7c02013-10-16 16:09:24 -070055};
Christopher Ferris38062f92014-07-09 15:33:25 -070056struct ovs_dp_megaflow_stats {
Christopher Ferris106b3a82016-08-24 12:15:38 -070057 __u64 n_mask_hit;
Tao Baod7db5942015-01-28 10:07:51 -080058 __u32 n_masks;
59 __u32 pad0;
Christopher Ferris25c18d42020-10-14 17:42:58 -070060 __u64 n_cache_hit;
Tao Baod7db5942015-01-28 10:07:51 -080061 __u64 pad1;
Ben Cheng655a7c02013-10-16 16:09:24 -070062};
Christopher Ferris38062f92014-07-09 15:33:25 -070063struct ovs_vport_stats {
Tao Baod7db5942015-01-28 10:07:51 -080064 __u64 rx_packets;
Christopher Ferris106b3a82016-08-24 12:15:38 -070065 __u64 tx_packets;
Tao Baod7db5942015-01-28 10:07:51 -080066 __u64 rx_bytes;
67 __u64 tx_bytes;
68 __u64 rx_errors;
Christopher Ferris106b3a82016-08-24 12:15:38 -070069 __u64 tx_errors;
Tao Baod7db5942015-01-28 10:07:51 -080070 __u64 rx_dropped;
71 __u64 tx_dropped;
Christopher Ferris38062f92014-07-09 15:33:25 -070072};
Christopher Ferris106b3a82016-08-24 12:15:38 -070073#define OVS_DP_F_UNALIGNED (1 << 0)
Christopher Ferris82d75042015-01-26 10:57:07 -080074#define OVS_DP_F_VPORT_PIDS (1 << 1)
Christopher Ferris9584fa42019-12-09 15:36:13 -080075#define OVS_DP_F_TC_RECIRC_SHARING (1 << 2)
Christopher Ferris2abfa9e2021-11-01 16:26:06 -070076#define OVS_DP_F_DISPATCH_UPCALL_PER_CPU (1 << 3)
Tao Baod7db5942015-01-28 10:07:51 -080077#define OVSP_LOCAL ((__u32) 0)
Ben Cheng655a7c02013-10-16 16:09:24 -070078#define OVS_PACKET_FAMILY "ovs_packet"
Christopher Ferris106b3a82016-08-24 12:15:38 -070079#define OVS_PACKET_VERSION 0x1
Christopher Ferris82d75042015-01-26 10:57:07 -080080enum ovs_packet_cmd {
Tao Baod7db5942015-01-28 10:07:51 -080081 OVS_PACKET_CMD_UNSPEC,
82 OVS_PACKET_CMD_MISS,
Christopher Ferris106b3a82016-08-24 12:15:38 -070083 OVS_PACKET_CMD_ACTION,
Tao Baod7db5942015-01-28 10:07:51 -080084 OVS_PACKET_CMD_EXECUTE
Ben Cheng655a7c02013-10-16 16:09:24 -070085};
86enum ovs_packet_attr {
Christopher Ferris106b3a82016-08-24 12:15:38 -070087 OVS_PACKET_ATTR_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -080088 OVS_PACKET_ATTR_PACKET,
89 OVS_PACKET_ATTR_KEY,
90 OVS_PACKET_ATTR_ACTIONS,
Christopher Ferris106b3a82016-08-24 12:15:38 -070091 OVS_PACKET_ATTR_USERDATA,
Christopher Ferris05d08e92016-02-04 13:16:38 -080092 OVS_PACKET_ATTR_EGRESS_TUN_KEY,
93 OVS_PACKET_ATTR_UNUSED1,
94 OVS_PACKET_ATTR_UNUSED2,
Christopher Ferris106b3a82016-08-24 12:15:38 -070095 OVS_PACKET_ATTR_PROBE,
Christopher Ferris05d08e92016-02-04 13:16:38 -080096 OVS_PACKET_ATTR_MRU,
Christopher Ferris49f525c2016-12-12 14:55:36 -080097 OVS_PACKET_ATTR_LEN,
Christopher Ferrisd32ca142020-02-04 16:16:51 -080098 OVS_PACKET_ATTR_HASH,
Tao Baod7db5942015-01-28 10:07:51 -080099 __OVS_PACKET_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800100};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700101#define OVS_PACKET_ATTR_MAX (__OVS_PACKET_ATTR_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800102#define OVS_VPORT_FAMILY "ovs_vport"
Christopher Ferris82d75042015-01-26 10:57:07 -0800103#define OVS_VPORT_MCGROUP "ovs_vport"
Christopher Ferris49f525c2016-12-12 14:55:36 -0800104#define OVS_VPORT_VERSION 0x1
Christopher Ferris106b3a82016-08-24 12:15:38 -0700105enum ovs_vport_cmd {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800106 OVS_VPORT_CMD_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -0800107 OVS_VPORT_CMD_NEW,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800108 OVS_VPORT_CMD_DEL,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700109 OVS_VPORT_CMD_GET,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800110 OVS_VPORT_CMD_SET
Christopher Ferris82d75042015-01-26 10:57:07 -0800111};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800112enum ovs_vport_type {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700113 OVS_VPORT_TYPE_UNSPEC,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800114 OVS_VPORT_TYPE_NETDEV,
Tao Baod7db5942015-01-28 10:07:51 -0800115 OVS_VPORT_TYPE_INTERNAL,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800116 OVS_VPORT_TYPE_GRE,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700117 OVS_VPORT_TYPE_VXLAN,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800118 OVS_VPORT_TYPE_GENEVE,
Tao Baod7db5942015-01-28 10:07:51 -0800119 __OVS_VPORT_TYPE_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800120};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700121#define OVS_VPORT_TYPE_MAX (__OVS_VPORT_TYPE_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800122enum ovs_vport_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800123 OVS_VPORT_ATTR_UNSPEC,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800124 OVS_VPORT_ATTR_PORT_NO,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700125 OVS_VPORT_ATTR_TYPE,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800126 OVS_VPORT_ATTR_NAME,
Tao Baod7db5942015-01-28 10:07:51 -0800127 OVS_VPORT_ATTR_OPTIONS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800128 OVS_VPORT_ATTR_UPCALL_PID,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700129 OVS_VPORT_ATTR_STATS,
130 OVS_VPORT_ATTR_PAD,
Christopher Ferris934ec942018-01-31 15:29:16 -0800131 OVS_VPORT_ATTR_IFINDEX,
132 OVS_VPORT_ATTR_NETNSID,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800133 __OVS_VPORT_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800134};
Ben Cheng655a7c02013-10-16 16:09:24 -0700135#define OVS_VPORT_ATTR_MAX (__OVS_VPORT_ATTR_MAX - 1)
Christopher Ferris38062f92014-07-09 15:33:25 -0700136enum {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800137 OVS_VXLAN_EXT_UNSPEC,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800138 OVS_VXLAN_EXT_GBP,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800139 __OVS_VXLAN_EXT_MAX,
140};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800141#define OVS_VXLAN_EXT_MAX (__OVS_VXLAN_EXT_MAX - 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800142enum {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800143 OVS_TUNNEL_ATTR_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -0800144 OVS_TUNNEL_ATTR_DST_PORT,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800145 OVS_TUNNEL_ATTR_EXTENSION,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800146 __OVS_TUNNEL_ATTR_MAX
Christopher Ferris38062f92014-07-09 15:33:25 -0700147};
148#define OVS_TUNNEL_ATTR_MAX (__OVS_TUNNEL_ATTR_MAX - 1)
149#define OVS_FLOW_FAMILY "ovs_flow"
Christopher Ferris49f525c2016-12-12 14:55:36 -0800150#define OVS_FLOW_MCGROUP "ovs_flow"
Ben Cheng655a7c02013-10-16 16:09:24 -0700151#define OVS_FLOW_VERSION 0x1
152enum ovs_flow_cmd {
Tao Baod7db5942015-01-28 10:07:51 -0800153 OVS_FLOW_CMD_UNSPEC,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800154 OVS_FLOW_CMD_NEW,
Tao Baod7db5942015-01-28 10:07:51 -0800155 OVS_FLOW_CMD_DEL,
156 OVS_FLOW_CMD_GET,
Tao Baod7db5942015-01-28 10:07:51 -0800157 OVS_FLOW_CMD_SET
Christopher Ferris49f525c2016-12-12 14:55:36 -0800158};
Ben Cheng655a7c02013-10-16 16:09:24 -0700159struct ovs_flow_stats {
Tao Baod7db5942015-01-28 10:07:51 -0800160 __u64 n_packets;
Tao Baod7db5942015-01-28 10:07:51 -0800161 __u64 n_bytes;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800162};
Ben Cheng655a7c02013-10-16 16:09:24 -0700163enum ovs_key_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800164 OVS_KEY_ATTR_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -0800165 OVS_KEY_ATTR_ENCAP,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800166 OVS_KEY_ATTR_PRIORITY,
Tao Baod7db5942015-01-28 10:07:51 -0800167 OVS_KEY_ATTR_IN_PORT,
168 OVS_KEY_ATTR_ETHERNET,
Tao Baod7db5942015-01-28 10:07:51 -0800169 OVS_KEY_ATTR_VLAN,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800170 OVS_KEY_ATTR_ETHERTYPE,
Tao Baod7db5942015-01-28 10:07:51 -0800171 OVS_KEY_ATTR_IPV4,
172 OVS_KEY_ATTR_IPV6,
Tao Baod7db5942015-01-28 10:07:51 -0800173 OVS_KEY_ATTR_TCP,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800174 OVS_KEY_ATTR_UDP,
Tao Baod7db5942015-01-28 10:07:51 -0800175 OVS_KEY_ATTR_ICMP,
176 OVS_KEY_ATTR_ICMPV6,
Tao Baod7db5942015-01-28 10:07:51 -0800177 OVS_KEY_ATTR_ARP,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800178 OVS_KEY_ATTR_ND,
Tao Baod7db5942015-01-28 10:07:51 -0800179 OVS_KEY_ATTR_SKB_MARK,
180 OVS_KEY_ATTR_TUNNEL,
Tao Baod7db5942015-01-28 10:07:51 -0800181 OVS_KEY_ATTR_SCTP,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800182 OVS_KEY_ATTR_TCP_FLAGS,
Tao Baod7db5942015-01-28 10:07:51 -0800183 OVS_KEY_ATTR_DP_HASH,
184 OVS_KEY_ATTR_RECIRC_ID,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800185 OVS_KEY_ATTR_MPLS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800186 OVS_KEY_ATTR_CT_STATE,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800187 OVS_KEY_ATTR_CT_ZONE,
188 OVS_KEY_ATTR_CT_MARK,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800189 OVS_KEY_ATTR_CT_LABELS,
Christopher Ferris525ce912017-07-26 13:12:53 -0700190 OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV4,
191 OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV6,
Christopher Ferris934ec942018-01-31 15:29:16 -0800192 OVS_KEY_ATTR_NSH,
Christopher Ferris10a76e62022-06-08 13:31:52 -0700193 OVS_KEY_ATTR_PACKET_TYPE,
194 OVS_KEY_ATTR_ND_EXTENSIONS,
195 OVS_KEY_ATTR_TUNNEL_INFO,
196 OVS_KEY_ATTR_IPV6_EXTHDRS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800197 __OVS_KEY_ATTR_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700198};
199#define OVS_KEY_ATTR_MAX (__OVS_KEY_ATTR_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800200enum ovs_tunnel_key_attr {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800201 OVS_TUNNEL_KEY_ATTR_ID,
Tao Baod7db5942015-01-28 10:07:51 -0800202 OVS_TUNNEL_KEY_ATTR_IPV4_SRC,
203 OVS_TUNNEL_KEY_ATTR_IPV4_DST,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800204 OVS_TUNNEL_KEY_ATTR_TOS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800205 OVS_TUNNEL_KEY_ATTR_TTL,
Tao Baod7db5942015-01-28 10:07:51 -0800206 OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT,
207 OVS_TUNNEL_KEY_ATTR_CSUM,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800208 OVS_TUNNEL_KEY_ATTR_OAM,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800209 OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800210 OVS_TUNNEL_KEY_ATTR_TP_SRC,
211 OVS_TUNNEL_KEY_ATTR_TP_DST,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800212 OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800213 OVS_TUNNEL_KEY_ATTR_IPV6_SRC,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700214 OVS_TUNNEL_KEY_ATTR_IPV6_DST,
215 OVS_TUNNEL_KEY_ATTR_PAD,
Christopher Ferris76a1d452018-06-27 14:12:29 -0700216 OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700217 OVS_TUNNEL_KEY_ATTR_IPV4_INFO_BRIDGE,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700218 __OVS_TUNNEL_KEY_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800219};
Christopher Ferris38062f92014-07-09 15:33:25 -0700220#define OVS_TUNNEL_KEY_ATTR_MAX (__OVS_TUNNEL_KEY_ATTR_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700221enum ovs_frag_type {
Tao Baod7db5942015-01-28 10:07:51 -0800222 OVS_FRAG_TYPE_NONE,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800223 OVS_FRAG_TYPE_FIRST,
Tao Baod7db5942015-01-28 10:07:51 -0800224 OVS_FRAG_TYPE_LATER,
Tao Baod7db5942015-01-28 10:07:51 -0800225 __OVS_FRAG_TYPE_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700226};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800227#define OVS_FRAG_TYPE_MAX (__OVS_FRAG_TYPE_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700228struct ovs_key_ethernet {
Tao Baod7db5942015-01-28 10:07:51 -0800229 __u8 eth_src[ETH_ALEN];
230 __u8 eth_dst[ETH_ALEN];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800231};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800232struct ovs_key_mpls {
233 __be32 mpls_lse;
234};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800235struct ovs_key_ipv4 {
Tao Baod7db5942015-01-28 10:07:51 -0800236 __be32 ipv4_src;
237 __be32 ipv4_dst;
238 __u8 ipv4_proto;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800239 __u8 ipv4_tos;
Tao Baod7db5942015-01-28 10:07:51 -0800240 __u8 ipv4_ttl;
241 __u8 ipv4_frag;
Christopher Ferris38062f92014-07-09 15:33:25 -0700242};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800243struct ovs_key_ipv6 {
Tao Baod7db5942015-01-28 10:07:51 -0800244 __be32 ipv6_src[4];
245 __be32 ipv6_dst[4];
246 __be32 ipv6_label;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800247 __u8 ipv6_proto;
Tao Baod7db5942015-01-28 10:07:51 -0800248 __u8 ipv6_tclass;
249 __u8 ipv6_hlimit;
250 __u8 ipv6_frag;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800251};
Christopher Ferris10a76e62022-06-08 13:31:52 -0700252struct ovs_key_ipv6_exthdrs {
253 __u16 hdrs;
254};
Ben Cheng655a7c02013-10-16 16:09:24 -0700255struct ovs_key_tcp {
Tao Baod7db5942015-01-28 10:07:51 -0800256 __be16 tcp_src;
257 __be16 tcp_dst;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800258};
Ben Cheng655a7c02013-10-16 16:09:24 -0700259struct ovs_key_udp {
Tao Baod7db5942015-01-28 10:07:51 -0800260 __be16 udp_src;
261 __be16 udp_dst;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800262};
Christopher Ferris38062f92014-07-09 15:33:25 -0700263struct ovs_key_sctp {
Tao Baod7db5942015-01-28 10:07:51 -0800264 __be16 sctp_src;
265 __be16 sctp_dst;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800266};
Ben Cheng655a7c02013-10-16 16:09:24 -0700267struct ovs_key_icmp {
Tao Baod7db5942015-01-28 10:07:51 -0800268 __u8 icmp_type;
269 __u8 icmp_code;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800270};
Ben Cheng655a7c02013-10-16 16:09:24 -0700271struct ovs_key_icmpv6 {
Tao Baod7db5942015-01-28 10:07:51 -0800272 __u8 icmpv6_type;
273 __u8 icmpv6_code;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800274};
Ben Cheng655a7c02013-10-16 16:09:24 -0700275struct ovs_key_arp {
Tao Baod7db5942015-01-28 10:07:51 -0800276 __be32 arp_sip;
277 __be32 arp_tip;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800278 __be16 arp_op;
Tao Baod7db5942015-01-28 10:07:51 -0800279 __u8 arp_sha[ETH_ALEN];
280 __u8 arp_tha[ETH_ALEN];
Christopher Ferris38062f92014-07-09 15:33:25 -0700281};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800282struct ovs_key_nd {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800283 __be32 nd_target[4];
Tao Baod7db5942015-01-28 10:07:51 -0800284 __u8 nd_sll[ETH_ALEN];
285 __u8 nd_tll[ETH_ALEN];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800286};
Christopher Ferris525ce912017-07-26 13:12:53 -0700287#define OVS_CT_LABELS_LEN_32 4
288#define OVS_CT_LABELS_LEN (OVS_CT_LABELS_LEN_32 * sizeof(__u32))
Christopher Ferris05d08e92016-02-04 13:16:38 -0800289struct ovs_key_ct_labels {
Christopher Ferris525ce912017-07-26 13:12:53 -0700290 union {
291 __u8 ct_labels[OVS_CT_LABELS_LEN];
292 __u32 ct_labels_32[OVS_CT_LABELS_LEN_32];
293 };
Christopher Ferris49f525c2016-12-12 14:55:36 -0800294};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800295#define OVS_CS_F_NEW 0x01
296#define OVS_CS_F_ESTABLISHED 0x02
297#define OVS_CS_F_RELATED 0x04
Christopher Ferris49f525c2016-12-12 14:55:36 -0800298#define OVS_CS_F_REPLY_DIR 0x08
Christopher Ferris05d08e92016-02-04 13:16:38 -0800299#define OVS_CS_F_INVALID 0x10
300#define OVS_CS_F_TRACKED 0x20
Christopher Ferris106b3a82016-08-24 12:15:38 -0700301#define OVS_CS_F_SRC_NAT 0x40
Christopher Ferris49f525c2016-12-12 14:55:36 -0800302#define OVS_CS_F_DST_NAT 0x80
Christopher Ferris106b3a82016-08-24 12:15:38 -0700303#define OVS_CS_F_NAT_MASK (OVS_CS_F_SRC_NAT | OVS_CS_F_DST_NAT)
Christopher Ferris525ce912017-07-26 13:12:53 -0700304struct ovs_key_ct_tuple_ipv4 {
305 __be32 ipv4_src;
306 __be32 ipv4_dst;
307 __be16 src_port;
308 __be16 dst_port;
309 __u8 ipv4_proto;
310};
311struct ovs_key_ct_tuple_ipv6 {
312 __be32 ipv6_src[4];
313 __be32 ipv6_dst[4];
314 __be16 src_port;
315 __be16 dst_port;
316 __u8 ipv6_proto;
317};
Christopher Ferris934ec942018-01-31 15:29:16 -0800318enum ovs_nsh_key_attr {
319 OVS_NSH_KEY_ATTR_UNSPEC,
320 OVS_NSH_KEY_ATTR_BASE,
321 OVS_NSH_KEY_ATTR_MD1,
322 OVS_NSH_KEY_ATTR_MD2,
323 __OVS_NSH_KEY_ATTR_MAX
324};
325#define OVS_NSH_KEY_ATTR_MAX (__OVS_NSH_KEY_ATTR_MAX - 1)
326struct ovs_nsh_key_base {
327 __u8 flags;
328 __u8 ttl;
329 __u8 mdtype;
330 __u8 np;
331 __be32 path_hdr;
332};
333#define NSH_MD1_CONTEXT_SIZE 4
334struct ovs_nsh_key_md1 {
335 __be32 context[NSH_MD1_CONTEXT_SIZE];
336};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700337enum ovs_flow_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800338 OVS_FLOW_ATTR_UNSPEC,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800339 OVS_FLOW_ATTR_KEY,
Tao Baod7db5942015-01-28 10:07:51 -0800340 OVS_FLOW_ATTR_ACTIONS,
Tao Baod7db5942015-01-28 10:07:51 -0800341 OVS_FLOW_ATTR_STATS,
342 OVS_FLOW_ATTR_TCP_FLAGS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800343 OVS_FLOW_ATTR_USED,
Tao Baod7db5942015-01-28 10:07:51 -0800344 OVS_FLOW_ATTR_CLEAR,
Tao Baod7db5942015-01-28 10:07:51 -0800345 OVS_FLOW_ATTR_MASK,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800346 OVS_FLOW_ATTR_PROBE,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800347 OVS_FLOW_ATTR_UFID,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700348 OVS_FLOW_ATTR_UFID_FLAGS,
349 OVS_FLOW_ATTR_PAD,
350 __OVS_FLOW_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800351};
Ben Cheng655a7c02013-10-16 16:09:24 -0700352#define OVS_FLOW_ATTR_MAX (__OVS_FLOW_ATTR_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800353#define OVS_UFID_F_OMIT_KEY (1 << 0)
354#define OVS_UFID_F_OMIT_MASK (1 << 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800355#define OVS_UFID_F_OMIT_ACTIONS (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700356enum ovs_sample_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800357 OVS_SAMPLE_ATTR_UNSPEC,
358 OVS_SAMPLE_ATTR_PROBABILITY,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800359 OVS_SAMPLE_ATTR_ACTIONS,
Tao Baod7db5942015-01-28 10:07:51 -0800360 __OVS_SAMPLE_ATTR_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -0700361};
362#define OVS_SAMPLE_ATTR_MAX (__OVS_SAMPLE_ATTR_MAX - 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800363enum ovs_userspace_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800364 OVS_USERSPACE_ATTR_UNSPEC,
365 OVS_USERSPACE_ATTR_PID,
366 OVS_USERSPACE_ATTR_USERDATA,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800367 OVS_USERSPACE_ATTR_EGRESS_TUN_PORT,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800368 OVS_USERSPACE_ATTR_ACTIONS,
Tao Baod7db5942015-01-28 10:07:51 -0800369 __OVS_USERSPACE_ATTR_MAX
Christopher Ferris05d08e92016-02-04 13:16:38 -0800370};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800371#define OVS_USERSPACE_ATTR_MAX (__OVS_USERSPACE_ATTR_MAX - 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800372struct ovs_action_trunc {
373 __u32 max_len;
374};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800375struct ovs_action_push_mpls {
376 __be32 mpls_lse;
377 __be16 mpls_ethertype;
Ben Cheng655a7c02013-10-16 16:09:24 -0700378};
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700379struct ovs_action_add_mpls {
380 __be32 mpls_lse;
381 __be16 mpls_ethertype;
382 __u16 tun_flags;
383};
384#define OVS_MPLS_L3_TUNNEL_FLAG_MASK (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700385struct ovs_action_push_vlan {
Tao Baod7db5942015-01-28 10:07:51 -0800386 __be16 vlan_tpid;
Tao Baod7db5942015-01-28 10:07:51 -0800387 __be16 vlan_tci;
Ben Cheng655a7c02013-10-16 16:09:24 -0700388};
Christopher Ferris82d75042015-01-26 10:57:07 -0800389enum ovs_hash_alg {
Tao Baod7db5942015-01-28 10:07:51 -0800390 OVS_HASH_ALG_L4,
Christopher Ferris82d75042015-01-26 10:57:07 -0800391};
392struct ovs_action_hash {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800393 __u32 hash_alg;
394 __u32 hash_basis;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800395};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800396enum ovs_ct_attr {
397 OVS_CT_ATTR_UNSPEC,
398 OVS_CT_ATTR_COMMIT,
399 OVS_CT_ATTR_ZONE,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800400 OVS_CT_ATTR_MARK,
401 OVS_CT_ATTR_LABELS,
402 OVS_CT_ATTR_HELPER,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700403 OVS_CT_ATTR_NAT,
Christopher Ferris525ce912017-07-26 13:12:53 -0700404 OVS_CT_ATTR_FORCE_COMMIT,
405 OVS_CT_ATTR_EVENTMASK,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700406 OVS_CT_ATTR_TIMEOUT,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800407 __OVS_CT_ATTR_MAX
Christopher Ferris82d75042015-01-26 10:57:07 -0800408};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800409#define OVS_CT_ATTR_MAX (__OVS_CT_ATTR_MAX - 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700410enum ovs_nat_attr {
411 OVS_NAT_ATTR_UNSPEC,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700412 OVS_NAT_ATTR_SRC,
413 OVS_NAT_ATTR_DST,
414 OVS_NAT_ATTR_IP_MIN,
415 OVS_NAT_ATTR_IP_MAX,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700416 OVS_NAT_ATTR_PROTO_MIN,
417 OVS_NAT_ATTR_PROTO_MAX,
418 OVS_NAT_ATTR_PERSISTENT,
419 OVS_NAT_ATTR_PROTO_HASH,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700420 OVS_NAT_ATTR_PROTO_RANDOM,
421 __OVS_NAT_ATTR_MAX,
422};
423#define OVS_NAT_ATTR_MAX (__OVS_NAT_ATTR_MAX - 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800424struct ovs_action_push_eth {
425 struct ovs_key_ethernet addresses;
426};
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700427enum ovs_check_pkt_len_attr {
428 OVS_CHECK_PKT_LEN_ATTR_UNSPEC,
429 OVS_CHECK_PKT_LEN_ATTR_PKT_LEN,
430 OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_GREATER,
431 OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_LESS_EQUAL,
432 __OVS_CHECK_PKT_LEN_ATTR_MAX,
433};
434#define OVS_CHECK_PKT_LEN_ATTR_MAX (__OVS_CHECK_PKT_LEN_ATTR_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700435enum ovs_action_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800436 OVS_ACTION_ATTR_UNSPEC,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800437 OVS_ACTION_ATTR_OUTPUT,
Tao Baod7db5942015-01-28 10:07:51 -0800438 OVS_ACTION_ATTR_USERSPACE,
439 OVS_ACTION_ATTR_SET,
440 OVS_ACTION_ATTR_PUSH_VLAN,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800441 OVS_ACTION_ATTR_POP_VLAN,
Tao Baod7db5942015-01-28 10:07:51 -0800442 OVS_ACTION_ATTR_SAMPLE,
443 OVS_ACTION_ATTR_RECIRC,
444 OVS_ACTION_ATTR_HASH,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800445 OVS_ACTION_ATTR_PUSH_MPLS,
446 OVS_ACTION_ATTR_POP_MPLS,
447 OVS_ACTION_ATTR_SET_MASKED,
448 OVS_ACTION_ATTR_CT,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800449 OVS_ACTION_ATTR_TRUNC,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800450 OVS_ACTION_ATTR_PUSH_ETH,
451 OVS_ACTION_ATTR_POP_ETH,
Christopher Ferris934ec942018-01-31 15:29:16 -0800452 OVS_ACTION_ATTR_CT_CLEAR,
453 OVS_ACTION_ATTR_PUSH_NSH,
454 OVS_ACTION_ATTR_POP_NSH,
455 OVS_ACTION_ATTR_METER,
Christopher Ferris9ce28842018-10-25 12:11:39 -0700456 OVS_ACTION_ATTR_CLONE,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700457 OVS_ACTION_ATTR_CHECK_PKT_LEN,
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700458 OVS_ACTION_ATTR_ADD_MPLS,
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700459 OVS_ACTION_ATTR_DEC_TTL,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800460 __OVS_ACTION_ATTR_MAX,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800461};
Ben Cheng655a7c02013-10-16 16:09:24 -0700462#define OVS_ACTION_ATTR_MAX (__OVS_ACTION_ATTR_MAX - 1)
Christopher Ferris934ec942018-01-31 15:29:16 -0800463#define OVS_METER_FAMILY "ovs_meter"
464#define OVS_METER_MCGROUP "ovs_meter"
465#define OVS_METER_VERSION 0x1
466enum ovs_meter_cmd {
467 OVS_METER_CMD_UNSPEC,
468 OVS_METER_CMD_FEATURES,
469 OVS_METER_CMD_SET,
470 OVS_METER_CMD_DEL,
471 OVS_METER_CMD_GET
472};
473enum ovs_meter_attr {
474 OVS_METER_ATTR_UNSPEC,
475 OVS_METER_ATTR_ID,
476 OVS_METER_ATTR_KBPS,
477 OVS_METER_ATTR_STATS,
478 OVS_METER_ATTR_BANDS,
479 OVS_METER_ATTR_USED,
480 OVS_METER_ATTR_CLEAR,
481 OVS_METER_ATTR_MAX_METERS,
482 OVS_METER_ATTR_MAX_BANDS,
483 OVS_METER_ATTR_PAD,
484 __OVS_METER_ATTR_MAX
485};
486#define OVS_METER_ATTR_MAX (__OVS_METER_ATTR_MAX - 1)
487enum ovs_band_attr {
488 OVS_BAND_ATTR_UNSPEC,
489 OVS_BAND_ATTR_TYPE,
490 OVS_BAND_ATTR_RATE,
491 OVS_BAND_ATTR_BURST,
492 OVS_BAND_ATTR_STATS,
493 __OVS_BAND_ATTR_MAX
494};
495#define OVS_BAND_ATTR_MAX (__OVS_BAND_ATTR_MAX - 1)
496enum ovs_meter_band_type {
497 OVS_METER_BAND_TYPE_UNSPEC,
498 OVS_METER_BAND_TYPE_DROP,
499 __OVS_METER_BAND_TYPE_MAX
500};
501#define OVS_METER_BAND_TYPE_MAX (__OVS_METER_BAND_TYPE_MAX - 1)
Christopher Ferris9ce28842018-10-25 12:11:39 -0700502#define OVS_CT_LIMIT_FAMILY "ovs_ct_limit"
503#define OVS_CT_LIMIT_MCGROUP "ovs_ct_limit"
504#define OVS_CT_LIMIT_VERSION 0x1
505enum ovs_ct_limit_cmd {
506 OVS_CT_LIMIT_CMD_UNSPEC,
507 OVS_CT_LIMIT_CMD_SET,
508 OVS_CT_LIMIT_CMD_DEL,
509 OVS_CT_LIMIT_CMD_GET
510};
511enum ovs_ct_limit_attr {
512 OVS_CT_LIMIT_ATTR_UNSPEC,
513 OVS_CT_LIMIT_ATTR_ZONE_LIMIT,
514 __OVS_CT_LIMIT_ATTR_MAX
515};
516#define OVS_CT_LIMIT_ATTR_MAX (__OVS_CT_LIMIT_ATTR_MAX - 1)
517#define OVS_ZONE_LIMIT_DEFAULT_ZONE - 1
518struct ovs_zone_limit {
519 int zone_id;
520 __u32 limit;
521 __u32 count;
522};
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700523enum ovs_dec_ttl_attr {
524 OVS_DEC_TTL_ATTR_UNSPEC,
525 OVS_DEC_TTL_ATTR_ACTION,
526 __OVS_DEC_TTL_ATTR_MAX
527};
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800528#define OVS_DEC_TTL_ATTR_MAX (__OVS_DEC_TTL_ATTR_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700529#endif