blob: 0226e9313feb7171a4237e1a76f9edaf4b55ed70 [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,
Christopher Ferris6cd53a52022-12-12 23:39:16 +000047 OVS_DP_ATTR_IFINDEX,
Tao Baod7db5942015-01-28 10:07:51 -080048 __OVS_DP_ATTR_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -070049};
Christopher Ferris106b3a82016-08-24 12:15:38 -070050#define OVS_DP_ATTR_MAX (__OVS_DP_ATTR_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070051struct ovs_dp_stats {
Tao Baod7db5942015-01-28 10:07:51 -080052 __u64 n_hit;
53 __u64 n_missed;
Christopher Ferris106b3a82016-08-24 12:15:38 -070054 __u64 n_lost;
Tao Baod7db5942015-01-28 10:07:51 -080055 __u64 n_flows;
Ben Cheng655a7c02013-10-16 16:09:24 -070056};
Christopher Ferris38062f92014-07-09 15:33:25 -070057struct ovs_dp_megaflow_stats {
Christopher Ferris106b3a82016-08-24 12:15:38 -070058 __u64 n_mask_hit;
Tao Baod7db5942015-01-28 10:07:51 -080059 __u32 n_masks;
60 __u32 pad0;
Christopher Ferris25c18d42020-10-14 17:42:58 -070061 __u64 n_cache_hit;
Tao Baod7db5942015-01-28 10:07:51 -080062 __u64 pad1;
Ben Cheng655a7c02013-10-16 16:09:24 -070063};
Christopher Ferris38062f92014-07-09 15:33:25 -070064struct ovs_vport_stats {
Tao Baod7db5942015-01-28 10:07:51 -080065 __u64 rx_packets;
Christopher Ferris106b3a82016-08-24 12:15:38 -070066 __u64 tx_packets;
Tao Baod7db5942015-01-28 10:07:51 -080067 __u64 rx_bytes;
68 __u64 tx_bytes;
69 __u64 rx_errors;
Christopher Ferris106b3a82016-08-24 12:15:38 -070070 __u64 tx_errors;
Tao Baod7db5942015-01-28 10:07:51 -080071 __u64 rx_dropped;
72 __u64 tx_dropped;
Christopher Ferris38062f92014-07-09 15:33:25 -070073};
Christopher Ferris106b3a82016-08-24 12:15:38 -070074#define OVS_DP_F_UNALIGNED (1 << 0)
Christopher Ferris82d75042015-01-26 10:57:07 -080075#define OVS_DP_F_VPORT_PIDS (1 << 1)
Christopher Ferris9584fa42019-12-09 15:36:13 -080076#define OVS_DP_F_TC_RECIRC_SHARING (1 << 2)
Christopher Ferris2abfa9e2021-11-01 16:26:06 -070077#define OVS_DP_F_DISPATCH_UPCALL_PER_CPU (1 << 3)
Tao Baod7db5942015-01-28 10:07:51 -080078#define OVSP_LOCAL ((__u32) 0)
Ben Cheng655a7c02013-10-16 16:09:24 -070079#define OVS_PACKET_FAMILY "ovs_packet"
Christopher Ferris106b3a82016-08-24 12:15:38 -070080#define OVS_PACKET_VERSION 0x1
Christopher Ferris82d75042015-01-26 10:57:07 -080081enum ovs_packet_cmd {
Tao Baod7db5942015-01-28 10:07:51 -080082 OVS_PACKET_CMD_UNSPEC,
83 OVS_PACKET_CMD_MISS,
Christopher Ferris106b3a82016-08-24 12:15:38 -070084 OVS_PACKET_CMD_ACTION,
Tao Baod7db5942015-01-28 10:07:51 -080085 OVS_PACKET_CMD_EXECUTE
Ben Cheng655a7c02013-10-16 16:09:24 -070086};
87enum ovs_packet_attr {
Christopher Ferris106b3a82016-08-24 12:15:38 -070088 OVS_PACKET_ATTR_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -080089 OVS_PACKET_ATTR_PACKET,
90 OVS_PACKET_ATTR_KEY,
91 OVS_PACKET_ATTR_ACTIONS,
Christopher Ferris106b3a82016-08-24 12:15:38 -070092 OVS_PACKET_ATTR_USERDATA,
Christopher Ferris05d08e92016-02-04 13:16:38 -080093 OVS_PACKET_ATTR_EGRESS_TUN_KEY,
94 OVS_PACKET_ATTR_UNUSED1,
95 OVS_PACKET_ATTR_UNUSED2,
Christopher Ferris106b3a82016-08-24 12:15:38 -070096 OVS_PACKET_ATTR_PROBE,
Christopher Ferris05d08e92016-02-04 13:16:38 -080097 OVS_PACKET_ATTR_MRU,
Christopher Ferris49f525c2016-12-12 14:55:36 -080098 OVS_PACKET_ATTR_LEN,
Christopher Ferrisd32ca142020-02-04 16:16:51 -080099 OVS_PACKET_ATTR_HASH,
Tao Baod7db5942015-01-28 10:07:51 -0800100 __OVS_PACKET_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800101};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700102#define OVS_PACKET_ATTR_MAX (__OVS_PACKET_ATTR_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800103#define OVS_VPORT_FAMILY "ovs_vport"
Christopher Ferris82d75042015-01-26 10:57:07 -0800104#define OVS_VPORT_MCGROUP "ovs_vport"
Christopher Ferris49f525c2016-12-12 14:55:36 -0800105#define OVS_VPORT_VERSION 0x1
Christopher Ferris106b3a82016-08-24 12:15:38 -0700106enum ovs_vport_cmd {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800107 OVS_VPORT_CMD_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -0800108 OVS_VPORT_CMD_NEW,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800109 OVS_VPORT_CMD_DEL,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700110 OVS_VPORT_CMD_GET,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800111 OVS_VPORT_CMD_SET
Christopher Ferris82d75042015-01-26 10:57:07 -0800112};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800113enum ovs_vport_type {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700114 OVS_VPORT_TYPE_UNSPEC,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800115 OVS_VPORT_TYPE_NETDEV,
Tao Baod7db5942015-01-28 10:07:51 -0800116 OVS_VPORT_TYPE_INTERNAL,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800117 OVS_VPORT_TYPE_GRE,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700118 OVS_VPORT_TYPE_VXLAN,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800119 OVS_VPORT_TYPE_GENEVE,
Tao Baod7db5942015-01-28 10:07:51 -0800120 __OVS_VPORT_TYPE_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800121};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700122#define OVS_VPORT_TYPE_MAX (__OVS_VPORT_TYPE_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800123enum ovs_vport_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800124 OVS_VPORT_ATTR_UNSPEC,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800125 OVS_VPORT_ATTR_PORT_NO,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700126 OVS_VPORT_ATTR_TYPE,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800127 OVS_VPORT_ATTR_NAME,
Tao Baod7db5942015-01-28 10:07:51 -0800128 OVS_VPORT_ATTR_OPTIONS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800129 OVS_VPORT_ATTR_UPCALL_PID,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700130 OVS_VPORT_ATTR_STATS,
131 OVS_VPORT_ATTR_PAD,
Christopher Ferris934ec942018-01-31 15:29:16 -0800132 OVS_VPORT_ATTR_IFINDEX,
133 OVS_VPORT_ATTR_NETNSID,
Christopher Ferris8b7fdc92023-02-21 13:36:32 -0800134 OVS_VPORT_ATTR_UPCALL_STATS,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800135 __OVS_VPORT_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800136};
Ben Cheng655a7c02013-10-16 16:09:24 -0700137#define OVS_VPORT_ATTR_MAX (__OVS_VPORT_ATTR_MAX - 1)
Christopher Ferris8b7fdc92023-02-21 13:36:32 -0800138enum ovs_vport_upcall_attr {
139 OVS_VPORT_UPCALL_ATTR_SUCCESS,
140 OVS_VPORT_UPCALL_ATTR_FAIL,
141 __OVS_VPORT_UPCALL_ATTR_MAX
142};
143#define OVS_VPORT_UPCALL_ATTR_MAX (__OVS_VPORT_UPCALL_ATTR_MAX - 1)
Christopher Ferris38062f92014-07-09 15:33:25 -0700144enum {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800145 OVS_VXLAN_EXT_UNSPEC,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800146 OVS_VXLAN_EXT_GBP,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800147 __OVS_VXLAN_EXT_MAX,
148};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800149#define OVS_VXLAN_EXT_MAX (__OVS_VXLAN_EXT_MAX - 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800150enum {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800151 OVS_TUNNEL_ATTR_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -0800152 OVS_TUNNEL_ATTR_DST_PORT,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800153 OVS_TUNNEL_ATTR_EXTENSION,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800154 __OVS_TUNNEL_ATTR_MAX
Christopher Ferris38062f92014-07-09 15:33:25 -0700155};
156#define OVS_TUNNEL_ATTR_MAX (__OVS_TUNNEL_ATTR_MAX - 1)
157#define OVS_FLOW_FAMILY "ovs_flow"
Christopher Ferris49f525c2016-12-12 14:55:36 -0800158#define OVS_FLOW_MCGROUP "ovs_flow"
Ben Cheng655a7c02013-10-16 16:09:24 -0700159#define OVS_FLOW_VERSION 0x1
160enum ovs_flow_cmd {
Tao Baod7db5942015-01-28 10:07:51 -0800161 OVS_FLOW_CMD_UNSPEC,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800162 OVS_FLOW_CMD_NEW,
Tao Baod7db5942015-01-28 10:07:51 -0800163 OVS_FLOW_CMD_DEL,
164 OVS_FLOW_CMD_GET,
Tao Baod7db5942015-01-28 10:07:51 -0800165 OVS_FLOW_CMD_SET
Christopher Ferris49f525c2016-12-12 14:55:36 -0800166};
Ben Cheng655a7c02013-10-16 16:09:24 -0700167struct ovs_flow_stats {
Tao Baod7db5942015-01-28 10:07:51 -0800168 __u64 n_packets;
Tao Baod7db5942015-01-28 10:07:51 -0800169 __u64 n_bytes;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800170};
Ben Cheng655a7c02013-10-16 16:09:24 -0700171enum ovs_key_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800172 OVS_KEY_ATTR_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -0800173 OVS_KEY_ATTR_ENCAP,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800174 OVS_KEY_ATTR_PRIORITY,
Tao Baod7db5942015-01-28 10:07:51 -0800175 OVS_KEY_ATTR_IN_PORT,
176 OVS_KEY_ATTR_ETHERNET,
Tao Baod7db5942015-01-28 10:07:51 -0800177 OVS_KEY_ATTR_VLAN,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800178 OVS_KEY_ATTR_ETHERTYPE,
Tao Baod7db5942015-01-28 10:07:51 -0800179 OVS_KEY_ATTR_IPV4,
180 OVS_KEY_ATTR_IPV6,
Tao Baod7db5942015-01-28 10:07:51 -0800181 OVS_KEY_ATTR_TCP,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800182 OVS_KEY_ATTR_UDP,
Tao Baod7db5942015-01-28 10:07:51 -0800183 OVS_KEY_ATTR_ICMP,
184 OVS_KEY_ATTR_ICMPV6,
Tao Baod7db5942015-01-28 10:07:51 -0800185 OVS_KEY_ATTR_ARP,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800186 OVS_KEY_ATTR_ND,
Tao Baod7db5942015-01-28 10:07:51 -0800187 OVS_KEY_ATTR_SKB_MARK,
188 OVS_KEY_ATTR_TUNNEL,
Tao Baod7db5942015-01-28 10:07:51 -0800189 OVS_KEY_ATTR_SCTP,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800190 OVS_KEY_ATTR_TCP_FLAGS,
Tao Baod7db5942015-01-28 10:07:51 -0800191 OVS_KEY_ATTR_DP_HASH,
192 OVS_KEY_ATTR_RECIRC_ID,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800193 OVS_KEY_ATTR_MPLS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800194 OVS_KEY_ATTR_CT_STATE,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800195 OVS_KEY_ATTR_CT_ZONE,
196 OVS_KEY_ATTR_CT_MARK,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800197 OVS_KEY_ATTR_CT_LABELS,
Christopher Ferris525ce912017-07-26 13:12:53 -0700198 OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV4,
199 OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV6,
Christopher Ferris934ec942018-01-31 15:29:16 -0800200 OVS_KEY_ATTR_NSH,
Christopher Ferris10a76e62022-06-08 13:31:52 -0700201 OVS_KEY_ATTR_PACKET_TYPE,
202 OVS_KEY_ATTR_ND_EXTENSIONS,
203 OVS_KEY_ATTR_TUNNEL_INFO,
204 OVS_KEY_ATTR_IPV6_EXTHDRS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800205 __OVS_KEY_ATTR_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700206};
207#define OVS_KEY_ATTR_MAX (__OVS_KEY_ATTR_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800208enum ovs_tunnel_key_attr {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800209 OVS_TUNNEL_KEY_ATTR_ID,
Tao Baod7db5942015-01-28 10:07:51 -0800210 OVS_TUNNEL_KEY_ATTR_IPV4_SRC,
211 OVS_TUNNEL_KEY_ATTR_IPV4_DST,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800212 OVS_TUNNEL_KEY_ATTR_TOS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800213 OVS_TUNNEL_KEY_ATTR_TTL,
Tao Baod7db5942015-01-28 10:07:51 -0800214 OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT,
215 OVS_TUNNEL_KEY_ATTR_CSUM,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800216 OVS_TUNNEL_KEY_ATTR_OAM,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800217 OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800218 OVS_TUNNEL_KEY_ATTR_TP_SRC,
219 OVS_TUNNEL_KEY_ATTR_TP_DST,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800220 OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800221 OVS_TUNNEL_KEY_ATTR_IPV6_SRC,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700222 OVS_TUNNEL_KEY_ATTR_IPV6_DST,
223 OVS_TUNNEL_KEY_ATTR_PAD,
Christopher Ferris76a1d452018-06-27 14:12:29 -0700224 OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700225 OVS_TUNNEL_KEY_ATTR_IPV4_INFO_BRIDGE,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700226 __OVS_TUNNEL_KEY_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800227};
Christopher Ferris38062f92014-07-09 15:33:25 -0700228#define OVS_TUNNEL_KEY_ATTR_MAX (__OVS_TUNNEL_KEY_ATTR_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700229enum ovs_frag_type {
Tao Baod7db5942015-01-28 10:07:51 -0800230 OVS_FRAG_TYPE_NONE,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800231 OVS_FRAG_TYPE_FIRST,
Tao Baod7db5942015-01-28 10:07:51 -0800232 OVS_FRAG_TYPE_LATER,
Tao Baod7db5942015-01-28 10:07:51 -0800233 __OVS_FRAG_TYPE_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700234};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800235#define OVS_FRAG_TYPE_MAX (__OVS_FRAG_TYPE_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700236struct ovs_key_ethernet {
Tao Baod7db5942015-01-28 10:07:51 -0800237 __u8 eth_src[ETH_ALEN];
238 __u8 eth_dst[ETH_ALEN];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800239};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800240struct ovs_key_mpls {
241 __be32 mpls_lse;
242};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800243struct ovs_key_ipv4 {
Tao Baod7db5942015-01-28 10:07:51 -0800244 __be32 ipv4_src;
245 __be32 ipv4_dst;
246 __u8 ipv4_proto;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800247 __u8 ipv4_tos;
Tao Baod7db5942015-01-28 10:07:51 -0800248 __u8 ipv4_ttl;
249 __u8 ipv4_frag;
Christopher Ferris38062f92014-07-09 15:33:25 -0700250};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800251struct ovs_key_ipv6 {
Tao Baod7db5942015-01-28 10:07:51 -0800252 __be32 ipv6_src[4];
253 __be32 ipv6_dst[4];
254 __be32 ipv6_label;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800255 __u8 ipv6_proto;
Tao Baod7db5942015-01-28 10:07:51 -0800256 __u8 ipv6_tclass;
257 __u8 ipv6_hlimit;
258 __u8 ipv6_frag;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800259};
Christopher Ferris10a76e62022-06-08 13:31:52 -0700260struct ovs_key_ipv6_exthdrs {
261 __u16 hdrs;
262};
Ben Cheng655a7c02013-10-16 16:09:24 -0700263struct ovs_key_tcp {
Tao Baod7db5942015-01-28 10:07:51 -0800264 __be16 tcp_src;
265 __be16 tcp_dst;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800266};
Ben Cheng655a7c02013-10-16 16:09:24 -0700267struct ovs_key_udp {
Tao Baod7db5942015-01-28 10:07:51 -0800268 __be16 udp_src;
269 __be16 udp_dst;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800270};
Christopher Ferris38062f92014-07-09 15:33:25 -0700271struct ovs_key_sctp {
Tao Baod7db5942015-01-28 10:07:51 -0800272 __be16 sctp_src;
273 __be16 sctp_dst;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800274};
Ben Cheng655a7c02013-10-16 16:09:24 -0700275struct ovs_key_icmp {
Tao Baod7db5942015-01-28 10:07:51 -0800276 __u8 icmp_type;
277 __u8 icmp_code;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800278};
Ben Cheng655a7c02013-10-16 16:09:24 -0700279struct ovs_key_icmpv6 {
Tao Baod7db5942015-01-28 10:07:51 -0800280 __u8 icmpv6_type;
281 __u8 icmpv6_code;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800282};
Ben Cheng655a7c02013-10-16 16:09:24 -0700283struct ovs_key_arp {
Tao Baod7db5942015-01-28 10:07:51 -0800284 __be32 arp_sip;
285 __be32 arp_tip;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800286 __be16 arp_op;
Tao Baod7db5942015-01-28 10:07:51 -0800287 __u8 arp_sha[ETH_ALEN];
288 __u8 arp_tha[ETH_ALEN];
Christopher Ferris38062f92014-07-09 15:33:25 -0700289};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800290struct ovs_key_nd {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800291 __be32 nd_target[4];
Tao Baod7db5942015-01-28 10:07:51 -0800292 __u8 nd_sll[ETH_ALEN];
293 __u8 nd_tll[ETH_ALEN];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800294};
Christopher Ferris525ce912017-07-26 13:12:53 -0700295#define OVS_CT_LABELS_LEN_32 4
296#define OVS_CT_LABELS_LEN (OVS_CT_LABELS_LEN_32 * sizeof(__u32))
Christopher Ferris05d08e92016-02-04 13:16:38 -0800297struct ovs_key_ct_labels {
Christopher Ferris525ce912017-07-26 13:12:53 -0700298 union {
299 __u8 ct_labels[OVS_CT_LABELS_LEN];
300 __u32 ct_labels_32[OVS_CT_LABELS_LEN_32];
301 };
Christopher Ferris49f525c2016-12-12 14:55:36 -0800302};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800303#define OVS_CS_F_NEW 0x01
304#define OVS_CS_F_ESTABLISHED 0x02
305#define OVS_CS_F_RELATED 0x04
Christopher Ferris49f525c2016-12-12 14:55:36 -0800306#define OVS_CS_F_REPLY_DIR 0x08
Christopher Ferris05d08e92016-02-04 13:16:38 -0800307#define OVS_CS_F_INVALID 0x10
308#define OVS_CS_F_TRACKED 0x20
Christopher Ferris106b3a82016-08-24 12:15:38 -0700309#define OVS_CS_F_SRC_NAT 0x40
Christopher Ferris49f525c2016-12-12 14:55:36 -0800310#define OVS_CS_F_DST_NAT 0x80
Christopher Ferris106b3a82016-08-24 12:15:38 -0700311#define OVS_CS_F_NAT_MASK (OVS_CS_F_SRC_NAT | OVS_CS_F_DST_NAT)
Christopher Ferris525ce912017-07-26 13:12:53 -0700312struct ovs_key_ct_tuple_ipv4 {
313 __be32 ipv4_src;
314 __be32 ipv4_dst;
315 __be16 src_port;
316 __be16 dst_port;
317 __u8 ipv4_proto;
318};
319struct ovs_key_ct_tuple_ipv6 {
320 __be32 ipv6_src[4];
321 __be32 ipv6_dst[4];
322 __be16 src_port;
323 __be16 dst_port;
324 __u8 ipv6_proto;
325};
Christopher Ferris934ec942018-01-31 15:29:16 -0800326enum ovs_nsh_key_attr {
327 OVS_NSH_KEY_ATTR_UNSPEC,
328 OVS_NSH_KEY_ATTR_BASE,
329 OVS_NSH_KEY_ATTR_MD1,
330 OVS_NSH_KEY_ATTR_MD2,
331 __OVS_NSH_KEY_ATTR_MAX
332};
333#define OVS_NSH_KEY_ATTR_MAX (__OVS_NSH_KEY_ATTR_MAX - 1)
334struct ovs_nsh_key_base {
335 __u8 flags;
336 __u8 ttl;
337 __u8 mdtype;
338 __u8 np;
339 __be32 path_hdr;
340};
341#define NSH_MD1_CONTEXT_SIZE 4
342struct ovs_nsh_key_md1 {
343 __be32 context[NSH_MD1_CONTEXT_SIZE];
344};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700345enum ovs_flow_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800346 OVS_FLOW_ATTR_UNSPEC,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800347 OVS_FLOW_ATTR_KEY,
Tao Baod7db5942015-01-28 10:07:51 -0800348 OVS_FLOW_ATTR_ACTIONS,
Tao Baod7db5942015-01-28 10:07:51 -0800349 OVS_FLOW_ATTR_STATS,
350 OVS_FLOW_ATTR_TCP_FLAGS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800351 OVS_FLOW_ATTR_USED,
Tao Baod7db5942015-01-28 10:07:51 -0800352 OVS_FLOW_ATTR_CLEAR,
Tao Baod7db5942015-01-28 10:07:51 -0800353 OVS_FLOW_ATTR_MASK,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800354 OVS_FLOW_ATTR_PROBE,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800355 OVS_FLOW_ATTR_UFID,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700356 OVS_FLOW_ATTR_UFID_FLAGS,
357 OVS_FLOW_ATTR_PAD,
358 __OVS_FLOW_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800359};
Ben Cheng655a7c02013-10-16 16:09:24 -0700360#define OVS_FLOW_ATTR_MAX (__OVS_FLOW_ATTR_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800361#define OVS_UFID_F_OMIT_KEY (1 << 0)
362#define OVS_UFID_F_OMIT_MASK (1 << 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800363#define OVS_UFID_F_OMIT_ACTIONS (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700364enum ovs_sample_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800365 OVS_SAMPLE_ATTR_UNSPEC,
366 OVS_SAMPLE_ATTR_PROBABILITY,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800367 OVS_SAMPLE_ATTR_ACTIONS,
Tao Baod7db5942015-01-28 10:07:51 -0800368 __OVS_SAMPLE_ATTR_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -0700369};
370#define OVS_SAMPLE_ATTR_MAX (__OVS_SAMPLE_ATTR_MAX - 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800371enum ovs_userspace_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800372 OVS_USERSPACE_ATTR_UNSPEC,
373 OVS_USERSPACE_ATTR_PID,
374 OVS_USERSPACE_ATTR_USERDATA,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800375 OVS_USERSPACE_ATTR_EGRESS_TUN_PORT,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800376 OVS_USERSPACE_ATTR_ACTIONS,
Tao Baod7db5942015-01-28 10:07:51 -0800377 __OVS_USERSPACE_ATTR_MAX
Christopher Ferris05d08e92016-02-04 13:16:38 -0800378};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800379#define OVS_USERSPACE_ATTR_MAX (__OVS_USERSPACE_ATTR_MAX - 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800380struct ovs_action_trunc {
381 __u32 max_len;
382};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800383struct ovs_action_push_mpls {
384 __be32 mpls_lse;
385 __be16 mpls_ethertype;
Ben Cheng655a7c02013-10-16 16:09:24 -0700386};
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700387struct ovs_action_add_mpls {
388 __be32 mpls_lse;
389 __be16 mpls_ethertype;
390 __u16 tun_flags;
391};
392#define OVS_MPLS_L3_TUNNEL_FLAG_MASK (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700393struct ovs_action_push_vlan {
Tao Baod7db5942015-01-28 10:07:51 -0800394 __be16 vlan_tpid;
Tao Baod7db5942015-01-28 10:07:51 -0800395 __be16 vlan_tci;
Ben Cheng655a7c02013-10-16 16:09:24 -0700396};
Christopher Ferris82d75042015-01-26 10:57:07 -0800397enum ovs_hash_alg {
Tao Baod7db5942015-01-28 10:07:51 -0800398 OVS_HASH_ALG_L4,
Christopher Ferris82d75042015-01-26 10:57:07 -0800399};
400struct ovs_action_hash {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800401 __u32 hash_alg;
402 __u32 hash_basis;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800403};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800404enum ovs_ct_attr {
405 OVS_CT_ATTR_UNSPEC,
406 OVS_CT_ATTR_COMMIT,
407 OVS_CT_ATTR_ZONE,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800408 OVS_CT_ATTR_MARK,
409 OVS_CT_ATTR_LABELS,
410 OVS_CT_ATTR_HELPER,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700411 OVS_CT_ATTR_NAT,
Christopher Ferris525ce912017-07-26 13:12:53 -0700412 OVS_CT_ATTR_FORCE_COMMIT,
413 OVS_CT_ATTR_EVENTMASK,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700414 OVS_CT_ATTR_TIMEOUT,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800415 __OVS_CT_ATTR_MAX
Christopher Ferris82d75042015-01-26 10:57:07 -0800416};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800417#define OVS_CT_ATTR_MAX (__OVS_CT_ATTR_MAX - 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700418enum ovs_nat_attr {
419 OVS_NAT_ATTR_UNSPEC,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700420 OVS_NAT_ATTR_SRC,
421 OVS_NAT_ATTR_DST,
422 OVS_NAT_ATTR_IP_MIN,
423 OVS_NAT_ATTR_IP_MAX,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700424 OVS_NAT_ATTR_PROTO_MIN,
425 OVS_NAT_ATTR_PROTO_MAX,
426 OVS_NAT_ATTR_PERSISTENT,
427 OVS_NAT_ATTR_PROTO_HASH,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700428 OVS_NAT_ATTR_PROTO_RANDOM,
429 __OVS_NAT_ATTR_MAX,
430};
431#define OVS_NAT_ATTR_MAX (__OVS_NAT_ATTR_MAX - 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800432struct ovs_action_push_eth {
433 struct ovs_key_ethernet addresses;
434};
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700435enum ovs_check_pkt_len_attr {
436 OVS_CHECK_PKT_LEN_ATTR_UNSPEC,
437 OVS_CHECK_PKT_LEN_ATTR_PKT_LEN,
438 OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_GREATER,
439 OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_LESS_EQUAL,
440 __OVS_CHECK_PKT_LEN_ATTR_MAX,
441};
442#define OVS_CHECK_PKT_LEN_ATTR_MAX (__OVS_CHECK_PKT_LEN_ATTR_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700443enum ovs_action_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800444 OVS_ACTION_ATTR_UNSPEC,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800445 OVS_ACTION_ATTR_OUTPUT,
Tao Baod7db5942015-01-28 10:07:51 -0800446 OVS_ACTION_ATTR_USERSPACE,
447 OVS_ACTION_ATTR_SET,
448 OVS_ACTION_ATTR_PUSH_VLAN,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800449 OVS_ACTION_ATTR_POP_VLAN,
Tao Baod7db5942015-01-28 10:07:51 -0800450 OVS_ACTION_ATTR_SAMPLE,
451 OVS_ACTION_ATTR_RECIRC,
452 OVS_ACTION_ATTR_HASH,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800453 OVS_ACTION_ATTR_PUSH_MPLS,
454 OVS_ACTION_ATTR_POP_MPLS,
455 OVS_ACTION_ATTR_SET_MASKED,
456 OVS_ACTION_ATTR_CT,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800457 OVS_ACTION_ATTR_TRUNC,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800458 OVS_ACTION_ATTR_PUSH_ETH,
459 OVS_ACTION_ATTR_POP_ETH,
Christopher Ferris934ec942018-01-31 15:29:16 -0800460 OVS_ACTION_ATTR_CT_CLEAR,
461 OVS_ACTION_ATTR_PUSH_NSH,
462 OVS_ACTION_ATTR_POP_NSH,
463 OVS_ACTION_ATTR_METER,
Christopher Ferris9ce28842018-10-25 12:11:39 -0700464 OVS_ACTION_ATTR_CLONE,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700465 OVS_ACTION_ATTR_CHECK_PKT_LEN,
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700466 OVS_ACTION_ATTR_ADD_MPLS,
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700467 OVS_ACTION_ATTR_DEC_TTL,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800468 __OVS_ACTION_ATTR_MAX,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800469};
Ben Cheng655a7c02013-10-16 16:09:24 -0700470#define OVS_ACTION_ATTR_MAX (__OVS_ACTION_ATTR_MAX - 1)
Christopher Ferris934ec942018-01-31 15:29:16 -0800471#define OVS_METER_FAMILY "ovs_meter"
472#define OVS_METER_MCGROUP "ovs_meter"
473#define OVS_METER_VERSION 0x1
474enum ovs_meter_cmd {
475 OVS_METER_CMD_UNSPEC,
476 OVS_METER_CMD_FEATURES,
477 OVS_METER_CMD_SET,
478 OVS_METER_CMD_DEL,
479 OVS_METER_CMD_GET
480};
481enum ovs_meter_attr {
482 OVS_METER_ATTR_UNSPEC,
483 OVS_METER_ATTR_ID,
484 OVS_METER_ATTR_KBPS,
485 OVS_METER_ATTR_STATS,
486 OVS_METER_ATTR_BANDS,
487 OVS_METER_ATTR_USED,
488 OVS_METER_ATTR_CLEAR,
489 OVS_METER_ATTR_MAX_METERS,
490 OVS_METER_ATTR_MAX_BANDS,
491 OVS_METER_ATTR_PAD,
492 __OVS_METER_ATTR_MAX
493};
494#define OVS_METER_ATTR_MAX (__OVS_METER_ATTR_MAX - 1)
495enum ovs_band_attr {
496 OVS_BAND_ATTR_UNSPEC,
497 OVS_BAND_ATTR_TYPE,
498 OVS_BAND_ATTR_RATE,
499 OVS_BAND_ATTR_BURST,
500 OVS_BAND_ATTR_STATS,
501 __OVS_BAND_ATTR_MAX
502};
503#define OVS_BAND_ATTR_MAX (__OVS_BAND_ATTR_MAX - 1)
504enum ovs_meter_band_type {
505 OVS_METER_BAND_TYPE_UNSPEC,
506 OVS_METER_BAND_TYPE_DROP,
507 __OVS_METER_BAND_TYPE_MAX
508};
509#define OVS_METER_BAND_TYPE_MAX (__OVS_METER_BAND_TYPE_MAX - 1)
Christopher Ferris9ce28842018-10-25 12:11:39 -0700510#define OVS_CT_LIMIT_FAMILY "ovs_ct_limit"
511#define OVS_CT_LIMIT_MCGROUP "ovs_ct_limit"
512#define OVS_CT_LIMIT_VERSION 0x1
513enum ovs_ct_limit_cmd {
514 OVS_CT_LIMIT_CMD_UNSPEC,
515 OVS_CT_LIMIT_CMD_SET,
516 OVS_CT_LIMIT_CMD_DEL,
517 OVS_CT_LIMIT_CMD_GET
518};
519enum ovs_ct_limit_attr {
520 OVS_CT_LIMIT_ATTR_UNSPEC,
521 OVS_CT_LIMIT_ATTR_ZONE_LIMIT,
522 __OVS_CT_LIMIT_ATTR_MAX
523};
524#define OVS_CT_LIMIT_ATTR_MAX (__OVS_CT_LIMIT_ATTR_MAX - 1)
525#define OVS_ZONE_LIMIT_DEFAULT_ZONE - 1
526struct ovs_zone_limit {
527 int zone_id;
528 __u32 limit;
529 __u32 count;
530};
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700531enum ovs_dec_ttl_attr {
532 OVS_DEC_TTL_ATTR_UNSPEC,
533 OVS_DEC_TTL_ATTR_ACTION,
534 __OVS_DEC_TTL_ATTR_MAX
535};
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800536#define OVS_DEC_TTL_ATTR_MAX (__OVS_DEC_TTL_ATTR_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700537#endif