blob: 1f8ae17ba5adf494ea733a1335a16cd7c84f3505 [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 Ferris49f525c2016-12-12 14:55:36 -0800193 __OVS_KEY_ATTR_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700194};
195#define OVS_KEY_ATTR_MAX (__OVS_KEY_ATTR_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800196enum ovs_tunnel_key_attr {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800197 OVS_TUNNEL_KEY_ATTR_ID,
Tao Baod7db5942015-01-28 10:07:51 -0800198 OVS_TUNNEL_KEY_ATTR_IPV4_SRC,
199 OVS_TUNNEL_KEY_ATTR_IPV4_DST,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800200 OVS_TUNNEL_KEY_ATTR_TOS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800201 OVS_TUNNEL_KEY_ATTR_TTL,
Tao Baod7db5942015-01-28 10:07:51 -0800202 OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT,
203 OVS_TUNNEL_KEY_ATTR_CSUM,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800204 OVS_TUNNEL_KEY_ATTR_OAM,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800205 OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800206 OVS_TUNNEL_KEY_ATTR_TP_SRC,
207 OVS_TUNNEL_KEY_ATTR_TP_DST,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800208 OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800209 OVS_TUNNEL_KEY_ATTR_IPV6_SRC,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700210 OVS_TUNNEL_KEY_ATTR_IPV6_DST,
211 OVS_TUNNEL_KEY_ATTR_PAD,
Christopher Ferris76a1d452018-06-27 14:12:29 -0700212 OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700213 OVS_TUNNEL_KEY_ATTR_IPV4_INFO_BRIDGE,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700214 __OVS_TUNNEL_KEY_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800215};
Christopher Ferris38062f92014-07-09 15:33:25 -0700216#define OVS_TUNNEL_KEY_ATTR_MAX (__OVS_TUNNEL_KEY_ATTR_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700217enum ovs_frag_type {
Tao Baod7db5942015-01-28 10:07:51 -0800218 OVS_FRAG_TYPE_NONE,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800219 OVS_FRAG_TYPE_FIRST,
Tao Baod7db5942015-01-28 10:07:51 -0800220 OVS_FRAG_TYPE_LATER,
Tao Baod7db5942015-01-28 10:07:51 -0800221 __OVS_FRAG_TYPE_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700222};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800223#define OVS_FRAG_TYPE_MAX (__OVS_FRAG_TYPE_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700224struct ovs_key_ethernet {
Tao Baod7db5942015-01-28 10:07:51 -0800225 __u8 eth_src[ETH_ALEN];
226 __u8 eth_dst[ETH_ALEN];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800227};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800228struct ovs_key_mpls {
229 __be32 mpls_lse;
230};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800231struct ovs_key_ipv4 {
Tao Baod7db5942015-01-28 10:07:51 -0800232 __be32 ipv4_src;
233 __be32 ipv4_dst;
234 __u8 ipv4_proto;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800235 __u8 ipv4_tos;
Tao Baod7db5942015-01-28 10:07:51 -0800236 __u8 ipv4_ttl;
237 __u8 ipv4_frag;
Christopher Ferris38062f92014-07-09 15:33:25 -0700238};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800239struct ovs_key_ipv6 {
Tao Baod7db5942015-01-28 10:07:51 -0800240 __be32 ipv6_src[4];
241 __be32 ipv6_dst[4];
242 __be32 ipv6_label;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800243 __u8 ipv6_proto;
Tao Baod7db5942015-01-28 10:07:51 -0800244 __u8 ipv6_tclass;
245 __u8 ipv6_hlimit;
246 __u8 ipv6_frag;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800247};
Ben Cheng655a7c02013-10-16 16:09:24 -0700248struct ovs_key_tcp {
Tao Baod7db5942015-01-28 10:07:51 -0800249 __be16 tcp_src;
250 __be16 tcp_dst;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800251};
Ben Cheng655a7c02013-10-16 16:09:24 -0700252struct ovs_key_udp {
Tao Baod7db5942015-01-28 10:07:51 -0800253 __be16 udp_src;
254 __be16 udp_dst;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800255};
Christopher Ferris38062f92014-07-09 15:33:25 -0700256struct ovs_key_sctp {
Tao Baod7db5942015-01-28 10:07:51 -0800257 __be16 sctp_src;
258 __be16 sctp_dst;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800259};
Ben Cheng655a7c02013-10-16 16:09:24 -0700260struct ovs_key_icmp {
Tao Baod7db5942015-01-28 10:07:51 -0800261 __u8 icmp_type;
262 __u8 icmp_code;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800263};
Ben Cheng655a7c02013-10-16 16:09:24 -0700264struct ovs_key_icmpv6 {
Tao Baod7db5942015-01-28 10:07:51 -0800265 __u8 icmpv6_type;
266 __u8 icmpv6_code;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800267};
Ben Cheng655a7c02013-10-16 16:09:24 -0700268struct ovs_key_arp {
Tao Baod7db5942015-01-28 10:07:51 -0800269 __be32 arp_sip;
270 __be32 arp_tip;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800271 __be16 arp_op;
Tao Baod7db5942015-01-28 10:07:51 -0800272 __u8 arp_sha[ETH_ALEN];
273 __u8 arp_tha[ETH_ALEN];
Christopher Ferris38062f92014-07-09 15:33:25 -0700274};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800275struct ovs_key_nd {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800276 __be32 nd_target[4];
Tao Baod7db5942015-01-28 10:07:51 -0800277 __u8 nd_sll[ETH_ALEN];
278 __u8 nd_tll[ETH_ALEN];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800279};
Christopher Ferris525ce912017-07-26 13:12:53 -0700280#define OVS_CT_LABELS_LEN_32 4
281#define OVS_CT_LABELS_LEN (OVS_CT_LABELS_LEN_32 * sizeof(__u32))
Christopher Ferris05d08e92016-02-04 13:16:38 -0800282struct ovs_key_ct_labels {
Christopher Ferris525ce912017-07-26 13:12:53 -0700283 union {
284 __u8 ct_labels[OVS_CT_LABELS_LEN];
285 __u32 ct_labels_32[OVS_CT_LABELS_LEN_32];
286 };
Christopher Ferris49f525c2016-12-12 14:55:36 -0800287};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800288#define OVS_CS_F_NEW 0x01
289#define OVS_CS_F_ESTABLISHED 0x02
290#define OVS_CS_F_RELATED 0x04
Christopher Ferris49f525c2016-12-12 14:55:36 -0800291#define OVS_CS_F_REPLY_DIR 0x08
Christopher Ferris05d08e92016-02-04 13:16:38 -0800292#define OVS_CS_F_INVALID 0x10
293#define OVS_CS_F_TRACKED 0x20
Christopher Ferris106b3a82016-08-24 12:15:38 -0700294#define OVS_CS_F_SRC_NAT 0x40
Christopher Ferris49f525c2016-12-12 14:55:36 -0800295#define OVS_CS_F_DST_NAT 0x80
Christopher Ferris106b3a82016-08-24 12:15:38 -0700296#define OVS_CS_F_NAT_MASK (OVS_CS_F_SRC_NAT | OVS_CS_F_DST_NAT)
Christopher Ferris525ce912017-07-26 13:12:53 -0700297struct ovs_key_ct_tuple_ipv4 {
298 __be32 ipv4_src;
299 __be32 ipv4_dst;
300 __be16 src_port;
301 __be16 dst_port;
302 __u8 ipv4_proto;
303};
304struct ovs_key_ct_tuple_ipv6 {
305 __be32 ipv6_src[4];
306 __be32 ipv6_dst[4];
307 __be16 src_port;
308 __be16 dst_port;
309 __u8 ipv6_proto;
310};
Christopher Ferris934ec942018-01-31 15:29:16 -0800311enum ovs_nsh_key_attr {
312 OVS_NSH_KEY_ATTR_UNSPEC,
313 OVS_NSH_KEY_ATTR_BASE,
314 OVS_NSH_KEY_ATTR_MD1,
315 OVS_NSH_KEY_ATTR_MD2,
316 __OVS_NSH_KEY_ATTR_MAX
317};
318#define OVS_NSH_KEY_ATTR_MAX (__OVS_NSH_KEY_ATTR_MAX - 1)
319struct ovs_nsh_key_base {
320 __u8 flags;
321 __u8 ttl;
322 __u8 mdtype;
323 __u8 np;
324 __be32 path_hdr;
325};
326#define NSH_MD1_CONTEXT_SIZE 4
327struct ovs_nsh_key_md1 {
328 __be32 context[NSH_MD1_CONTEXT_SIZE];
329};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700330enum ovs_flow_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800331 OVS_FLOW_ATTR_UNSPEC,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800332 OVS_FLOW_ATTR_KEY,
Tao Baod7db5942015-01-28 10:07:51 -0800333 OVS_FLOW_ATTR_ACTIONS,
Tao Baod7db5942015-01-28 10:07:51 -0800334 OVS_FLOW_ATTR_STATS,
335 OVS_FLOW_ATTR_TCP_FLAGS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800336 OVS_FLOW_ATTR_USED,
Tao Baod7db5942015-01-28 10:07:51 -0800337 OVS_FLOW_ATTR_CLEAR,
Tao Baod7db5942015-01-28 10:07:51 -0800338 OVS_FLOW_ATTR_MASK,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800339 OVS_FLOW_ATTR_PROBE,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800340 OVS_FLOW_ATTR_UFID,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700341 OVS_FLOW_ATTR_UFID_FLAGS,
342 OVS_FLOW_ATTR_PAD,
343 __OVS_FLOW_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800344};
Ben Cheng655a7c02013-10-16 16:09:24 -0700345#define OVS_FLOW_ATTR_MAX (__OVS_FLOW_ATTR_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800346#define OVS_UFID_F_OMIT_KEY (1 << 0)
347#define OVS_UFID_F_OMIT_MASK (1 << 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800348#define OVS_UFID_F_OMIT_ACTIONS (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700349enum ovs_sample_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800350 OVS_SAMPLE_ATTR_UNSPEC,
351 OVS_SAMPLE_ATTR_PROBABILITY,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800352 OVS_SAMPLE_ATTR_ACTIONS,
Tao Baod7db5942015-01-28 10:07:51 -0800353 __OVS_SAMPLE_ATTR_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -0700354};
355#define OVS_SAMPLE_ATTR_MAX (__OVS_SAMPLE_ATTR_MAX - 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800356enum ovs_userspace_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800357 OVS_USERSPACE_ATTR_UNSPEC,
358 OVS_USERSPACE_ATTR_PID,
359 OVS_USERSPACE_ATTR_USERDATA,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800360 OVS_USERSPACE_ATTR_EGRESS_TUN_PORT,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800361 OVS_USERSPACE_ATTR_ACTIONS,
Tao Baod7db5942015-01-28 10:07:51 -0800362 __OVS_USERSPACE_ATTR_MAX
Christopher Ferris05d08e92016-02-04 13:16:38 -0800363};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800364#define OVS_USERSPACE_ATTR_MAX (__OVS_USERSPACE_ATTR_MAX - 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800365struct ovs_action_trunc {
366 __u32 max_len;
367};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800368struct ovs_action_push_mpls {
369 __be32 mpls_lse;
370 __be16 mpls_ethertype;
Ben Cheng655a7c02013-10-16 16:09:24 -0700371};
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700372struct ovs_action_add_mpls {
373 __be32 mpls_lse;
374 __be16 mpls_ethertype;
375 __u16 tun_flags;
376};
377#define OVS_MPLS_L3_TUNNEL_FLAG_MASK (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700378struct ovs_action_push_vlan {
Tao Baod7db5942015-01-28 10:07:51 -0800379 __be16 vlan_tpid;
Tao Baod7db5942015-01-28 10:07:51 -0800380 __be16 vlan_tci;
Ben Cheng655a7c02013-10-16 16:09:24 -0700381};
Christopher Ferris82d75042015-01-26 10:57:07 -0800382enum ovs_hash_alg {
Tao Baod7db5942015-01-28 10:07:51 -0800383 OVS_HASH_ALG_L4,
Christopher Ferris82d75042015-01-26 10:57:07 -0800384};
385struct ovs_action_hash {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800386 __u32 hash_alg;
387 __u32 hash_basis;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800388};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800389enum ovs_ct_attr {
390 OVS_CT_ATTR_UNSPEC,
391 OVS_CT_ATTR_COMMIT,
392 OVS_CT_ATTR_ZONE,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800393 OVS_CT_ATTR_MARK,
394 OVS_CT_ATTR_LABELS,
395 OVS_CT_ATTR_HELPER,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700396 OVS_CT_ATTR_NAT,
Christopher Ferris525ce912017-07-26 13:12:53 -0700397 OVS_CT_ATTR_FORCE_COMMIT,
398 OVS_CT_ATTR_EVENTMASK,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700399 OVS_CT_ATTR_TIMEOUT,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800400 __OVS_CT_ATTR_MAX
Christopher Ferris82d75042015-01-26 10:57:07 -0800401};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800402#define OVS_CT_ATTR_MAX (__OVS_CT_ATTR_MAX - 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700403enum ovs_nat_attr {
404 OVS_NAT_ATTR_UNSPEC,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700405 OVS_NAT_ATTR_SRC,
406 OVS_NAT_ATTR_DST,
407 OVS_NAT_ATTR_IP_MIN,
408 OVS_NAT_ATTR_IP_MAX,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700409 OVS_NAT_ATTR_PROTO_MIN,
410 OVS_NAT_ATTR_PROTO_MAX,
411 OVS_NAT_ATTR_PERSISTENT,
412 OVS_NAT_ATTR_PROTO_HASH,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700413 OVS_NAT_ATTR_PROTO_RANDOM,
414 __OVS_NAT_ATTR_MAX,
415};
416#define OVS_NAT_ATTR_MAX (__OVS_NAT_ATTR_MAX - 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800417struct ovs_action_push_eth {
418 struct ovs_key_ethernet addresses;
419};
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700420enum ovs_check_pkt_len_attr {
421 OVS_CHECK_PKT_LEN_ATTR_UNSPEC,
422 OVS_CHECK_PKT_LEN_ATTR_PKT_LEN,
423 OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_GREATER,
424 OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_LESS_EQUAL,
425 __OVS_CHECK_PKT_LEN_ATTR_MAX,
426};
427#define OVS_CHECK_PKT_LEN_ATTR_MAX (__OVS_CHECK_PKT_LEN_ATTR_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700428enum ovs_action_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800429 OVS_ACTION_ATTR_UNSPEC,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800430 OVS_ACTION_ATTR_OUTPUT,
Tao Baod7db5942015-01-28 10:07:51 -0800431 OVS_ACTION_ATTR_USERSPACE,
432 OVS_ACTION_ATTR_SET,
433 OVS_ACTION_ATTR_PUSH_VLAN,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800434 OVS_ACTION_ATTR_POP_VLAN,
Tao Baod7db5942015-01-28 10:07:51 -0800435 OVS_ACTION_ATTR_SAMPLE,
436 OVS_ACTION_ATTR_RECIRC,
437 OVS_ACTION_ATTR_HASH,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800438 OVS_ACTION_ATTR_PUSH_MPLS,
439 OVS_ACTION_ATTR_POP_MPLS,
440 OVS_ACTION_ATTR_SET_MASKED,
441 OVS_ACTION_ATTR_CT,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800442 OVS_ACTION_ATTR_TRUNC,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800443 OVS_ACTION_ATTR_PUSH_ETH,
444 OVS_ACTION_ATTR_POP_ETH,
Christopher Ferris934ec942018-01-31 15:29:16 -0800445 OVS_ACTION_ATTR_CT_CLEAR,
446 OVS_ACTION_ATTR_PUSH_NSH,
447 OVS_ACTION_ATTR_POP_NSH,
448 OVS_ACTION_ATTR_METER,
Christopher Ferris9ce28842018-10-25 12:11:39 -0700449 OVS_ACTION_ATTR_CLONE,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700450 OVS_ACTION_ATTR_CHECK_PKT_LEN,
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700451 OVS_ACTION_ATTR_ADD_MPLS,
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700452 OVS_ACTION_ATTR_DEC_TTL,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800453 __OVS_ACTION_ATTR_MAX,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800454};
Ben Cheng655a7c02013-10-16 16:09:24 -0700455#define OVS_ACTION_ATTR_MAX (__OVS_ACTION_ATTR_MAX - 1)
Christopher Ferris934ec942018-01-31 15:29:16 -0800456#define OVS_METER_FAMILY "ovs_meter"
457#define OVS_METER_MCGROUP "ovs_meter"
458#define OVS_METER_VERSION 0x1
459enum ovs_meter_cmd {
460 OVS_METER_CMD_UNSPEC,
461 OVS_METER_CMD_FEATURES,
462 OVS_METER_CMD_SET,
463 OVS_METER_CMD_DEL,
464 OVS_METER_CMD_GET
465};
466enum ovs_meter_attr {
467 OVS_METER_ATTR_UNSPEC,
468 OVS_METER_ATTR_ID,
469 OVS_METER_ATTR_KBPS,
470 OVS_METER_ATTR_STATS,
471 OVS_METER_ATTR_BANDS,
472 OVS_METER_ATTR_USED,
473 OVS_METER_ATTR_CLEAR,
474 OVS_METER_ATTR_MAX_METERS,
475 OVS_METER_ATTR_MAX_BANDS,
476 OVS_METER_ATTR_PAD,
477 __OVS_METER_ATTR_MAX
478};
479#define OVS_METER_ATTR_MAX (__OVS_METER_ATTR_MAX - 1)
480enum ovs_band_attr {
481 OVS_BAND_ATTR_UNSPEC,
482 OVS_BAND_ATTR_TYPE,
483 OVS_BAND_ATTR_RATE,
484 OVS_BAND_ATTR_BURST,
485 OVS_BAND_ATTR_STATS,
486 __OVS_BAND_ATTR_MAX
487};
488#define OVS_BAND_ATTR_MAX (__OVS_BAND_ATTR_MAX - 1)
489enum ovs_meter_band_type {
490 OVS_METER_BAND_TYPE_UNSPEC,
491 OVS_METER_BAND_TYPE_DROP,
492 __OVS_METER_BAND_TYPE_MAX
493};
494#define OVS_METER_BAND_TYPE_MAX (__OVS_METER_BAND_TYPE_MAX - 1)
Christopher Ferris9ce28842018-10-25 12:11:39 -0700495#define OVS_CT_LIMIT_FAMILY "ovs_ct_limit"
496#define OVS_CT_LIMIT_MCGROUP "ovs_ct_limit"
497#define OVS_CT_LIMIT_VERSION 0x1
498enum ovs_ct_limit_cmd {
499 OVS_CT_LIMIT_CMD_UNSPEC,
500 OVS_CT_LIMIT_CMD_SET,
501 OVS_CT_LIMIT_CMD_DEL,
502 OVS_CT_LIMIT_CMD_GET
503};
504enum ovs_ct_limit_attr {
505 OVS_CT_LIMIT_ATTR_UNSPEC,
506 OVS_CT_LIMIT_ATTR_ZONE_LIMIT,
507 __OVS_CT_LIMIT_ATTR_MAX
508};
509#define OVS_CT_LIMIT_ATTR_MAX (__OVS_CT_LIMIT_ATTR_MAX - 1)
510#define OVS_ZONE_LIMIT_DEFAULT_ZONE - 1
511struct ovs_zone_limit {
512 int zone_id;
513 __u32 limit;
514 __u32 count;
515};
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700516enum ovs_dec_ttl_attr {
517 OVS_DEC_TTL_ATTR_UNSPEC,
518 OVS_DEC_TTL_ATTR_ACTION,
519 __OVS_DEC_TTL_ATTR_MAX
520};
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800521#define OVS_DEC_TTL_ATTR_MAX (__OVS_DEC_TTL_ATTR_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700522#endif