blob: c44e9503a49dd0e992d54fb29bd42f28f729cd53 [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 Ferris05d08e92016-02-04 13:16:38 -0800134 __OVS_VPORT_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800135};
Ben Cheng655a7c02013-10-16 16:09:24 -0700136#define OVS_VPORT_ATTR_MAX (__OVS_VPORT_ATTR_MAX - 1)
Christopher Ferris38062f92014-07-09 15:33:25 -0700137enum {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800138 OVS_VXLAN_EXT_UNSPEC,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800139 OVS_VXLAN_EXT_GBP,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800140 __OVS_VXLAN_EXT_MAX,
141};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800142#define OVS_VXLAN_EXT_MAX (__OVS_VXLAN_EXT_MAX - 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800143enum {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800144 OVS_TUNNEL_ATTR_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -0800145 OVS_TUNNEL_ATTR_DST_PORT,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800146 OVS_TUNNEL_ATTR_EXTENSION,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800147 __OVS_TUNNEL_ATTR_MAX
Christopher Ferris38062f92014-07-09 15:33:25 -0700148};
149#define OVS_TUNNEL_ATTR_MAX (__OVS_TUNNEL_ATTR_MAX - 1)
150#define OVS_FLOW_FAMILY "ovs_flow"
Christopher Ferris49f525c2016-12-12 14:55:36 -0800151#define OVS_FLOW_MCGROUP "ovs_flow"
Ben Cheng655a7c02013-10-16 16:09:24 -0700152#define OVS_FLOW_VERSION 0x1
153enum ovs_flow_cmd {
Tao Baod7db5942015-01-28 10:07:51 -0800154 OVS_FLOW_CMD_UNSPEC,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800155 OVS_FLOW_CMD_NEW,
Tao Baod7db5942015-01-28 10:07:51 -0800156 OVS_FLOW_CMD_DEL,
157 OVS_FLOW_CMD_GET,
Tao Baod7db5942015-01-28 10:07:51 -0800158 OVS_FLOW_CMD_SET
Christopher Ferris49f525c2016-12-12 14:55:36 -0800159};
Ben Cheng655a7c02013-10-16 16:09:24 -0700160struct ovs_flow_stats {
Tao Baod7db5942015-01-28 10:07:51 -0800161 __u64 n_packets;
Tao Baod7db5942015-01-28 10:07:51 -0800162 __u64 n_bytes;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800163};
Ben Cheng655a7c02013-10-16 16:09:24 -0700164enum ovs_key_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800165 OVS_KEY_ATTR_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -0800166 OVS_KEY_ATTR_ENCAP,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800167 OVS_KEY_ATTR_PRIORITY,
Tao Baod7db5942015-01-28 10:07:51 -0800168 OVS_KEY_ATTR_IN_PORT,
169 OVS_KEY_ATTR_ETHERNET,
Tao Baod7db5942015-01-28 10:07:51 -0800170 OVS_KEY_ATTR_VLAN,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800171 OVS_KEY_ATTR_ETHERTYPE,
Tao Baod7db5942015-01-28 10:07:51 -0800172 OVS_KEY_ATTR_IPV4,
173 OVS_KEY_ATTR_IPV6,
Tao Baod7db5942015-01-28 10:07:51 -0800174 OVS_KEY_ATTR_TCP,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800175 OVS_KEY_ATTR_UDP,
Tao Baod7db5942015-01-28 10:07:51 -0800176 OVS_KEY_ATTR_ICMP,
177 OVS_KEY_ATTR_ICMPV6,
Tao Baod7db5942015-01-28 10:07:51 -0800178 OVS_KEY_ATTR_ARP,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800179 OVS_KEY_ATTR_ND,
Tao Baod7db5942015-01-28 10:07:51 -0800180 OVS_KEY_ATTR_SKB_MARK,
181 OVS_KEY_ATTR_TUNNEL,
Tao Baod7db5942015-01-28 10:07:51 -0800182 OVS_KEY_ATTR_SCTP,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800183 OVS_KEY_ATTR_TCP_FLAGS,
Tao Baod7db5942015-01-28 10:07:51 -0800184 OVS_KEY_ATTR_DP_HASH,
185 OVS_KEY_ATTR_RECIRC_ID,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800186 OVS_KEY_ATTR_MPLS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800187 OVS_KEY_ATTR_CT_STATE,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800188 OVS_KEY_ATTR_CT_ZONE,
189 OVS_KEY_ATTR_CT_MARK,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800190 OVS_KEY_ATTR_CT_LABELS,
Christopher Ferris525ce912017-07-26 13:12:53 -0700191 OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV4,
192 OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV6,
Christopher Ferris934ec942018-01-31 15:29:16 -0800193 OVS_KEY_ATTR_NSH,
Christopher Ferris10a76e62022-06-08 13:31:52 -0700194 OVS_KEY_ATTR_PACKET_TYPE,
195 OVS_KEY_ATTR_ND_EXTENSIONS,
196 OVS_KEY_ATTR_TUNNEL_INFO,
197 OVS_KEY_ATTR_IPV6_EXTHDRS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800198 __OVS_KEY_ATTR_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700199};
200#define OVS_KEY_ATTR_MAX (__OVS_KEY_ATTR_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800201enum ovs_tunnel_key_attr {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800202 OVS_TUNNEL_KEY_ATTR_ID,
Tao Baod7db5942015-01-28 10:07:51 -0800203 OVS_TUNNEL_KEY_ATTR_IPV4_SRC,
204 OVS_TUNNEL_KEY_ATTR_IPV4_DST,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800205 OVS_TUNNEL_KEY_ATTR_TOS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800206 OVS_TUNNEL_KEY_ATTR_TTL,
Tao Baod7db5942015-01-28 10:07:51 -0800207 OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT,
208 OVS_TUNNEL_KEY_ATTR_CSUM,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800209 OVS_TUNNEL_KEY_ATTR_OAM,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800210 OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800211 OVS_TUNNEL_KEY_ATTR_TP_SRC,
212 OVS_TUNNEL_KEY_ATTR_TP_DST,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800213 OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800214 OVS_TUNNEL_KEY_ATTR_IPV6_SRC,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700215 OVS_TUNNEL_KEY_ATTR_IPV6_DST,
216 OVS_TUNNEL_KEY_ATTR_PAD,
Christopher Ferris76a1d452018-06-27 14:12:29 -0700217 OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700218 OVS_TUNNEL_KEY_ATTR_IPV4_INFO_BRIDGE,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700219 __OVS_TUNNEL_KEY_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800220};
Christopher Ferris38062f92014-07-09 15:33:25 -0700221#define OVS_TUNNEL_KEY_ATTR_MAX (__OVS_TUNNEL_KEY_ATTR_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700222enum ovs_frag_type {
Tao Baod7db5942015-01-28 10:07:51 -0800223 OVS_FRAG_TYPE_NONE,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800224 OVS_FRAG_TYPE_FIRST,
Tao Baod7db5942015-01-28 10:07:51 -0800225 OVS_FRAG_TYPE_LATER,
Tao Baod7db5942015-01-28 10:07:51 -0800226 __OVS_FRAG_TYPE_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700227};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800228#define OVS_FRAG_TYPE_MAX (__OVS_FRAG_TYPE_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700229struct ovs_key_ethernet {
Tao Baod7db5942015-01-28 10:07:51 -0800230 __u8 eth_src[ETH_ALEN];
231 __u8 eth_dst[ETH_ALEN];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800232};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800233struct ovs_key_mpls {
234 __be32 mpls_lse;
235};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800236struct ovs_key_ipv4 {
Tao Baod7db5942015-01-28 10:07:51 -0800237 __be32 ipv4_src;
238 __be32 ipv4_dst;
239 __u8 ipv4_proto;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800240 __u8 ipv4_tos;
Tao Baod7db5942015-01-28 10:07:51 -0800241 __u8 ipv4_ttl;
242 __u8 ipv4_frag;
Christopher Ferris38062f92014-07-09 15:33:25 -0700243};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800244struct ovs_key_ipv6 {
Tao Baod7db5942015-01-28 10:07:51 -0800245 __be32 ipv6_src[4];
246 __be32 ipv6_dst[4];
247 __be32 ipv6_label;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800248 __u8 ipv6_proto;
Tao Baod7db5942015-01-28 10:07:51 -0800249 __u8 ipv6_tclass;
250 __u8 ipv6_hlimit;
251 __u8 ipv6_frag;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800252};
Christopher Ferris10a76e62022-06-08 13:31:52 -0700253struct ovs_key_ipv6_exthdrs {
254 __u16 hdrs;
255};
Ben Cheng655a7c02013-10-16 16:09:24 -0700256struct ovs_key_tcp {
Tao Baod7db5942015-01-28 10:07:51 -0800257 __be16 tcp_src;
258 __be16 tcp_dst;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800259};
Ben Cheng655a7c02013-10-16 16:09:24 -0700260struct ovs_key_udp {
Tao Baod7db5942015-01-28 10:07:51 -0800261 __be16 udp_src;
262 __be16 udp_dst;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800263};
Christopher Ferris38062f92014-07-09 15:33:25 -0700264struct ovs_key_sctp {
Tao Baod7db5942015-01-28 10:07:51 -0800265 __be16 sctp_src;
266 __be16 sctp_dst;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800267};
Ben Cheng655a7c02013-10-16 16:09:24 -0700268struct ovs_key_icmp {
Tao Baod7db5942015-01-28 10:07:51 -0800269 __u8 icmp_type;
270 __u8 icmp_code;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800271};
Ben Cheng655a7c02013-10-16 16:09:24 -0700272struct ovs_key_icmpv6 {
Tao Baod7db5942015-01-28 10:07:51 -0800273 __u8 icmpv6_type;
274 __u8 icmpv6_code;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800275};
Ben Cheng655a7c02013-10-16 16:09:24 -0700276struct ovs_key_arp {
Tao Baod7db5942015-01-28 10:07:51 -0800277 __be32 arp_sip;
278 __be32 arp_tip;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800279 __be16 arp_op;
Tao Baod7db5942015-01-28 10:07:51 -0800280 __u8 arp_sha[ETH_ALEN];
281 __u8 arp_tha[ETH_ALEN];
Christopher Ferris38062f92014-07-09 15:33:25 -0700282};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800283struct ovs_key_nd {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800284 __be32 nd_target[4];
Tao Baod7db5942015-01-28 10:07:51 -0800285 __u8 nd_sll[ETH_ALEN];
286 __u8 nd_tll[ETH_ALEN];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800287};
Christopher Ferris525ce912017-07-26 13:12:53 -0700288#define OVS_CT_LABELS_LEN_32 4
289#define OVS_CT_LABELS_LEN (OVS_CT_LABELS_LEN_32 * sizeof(__u32))
Christopher Ferris05d08e92016-02-04 13:16:38 -0800290struct ovs_key_ct_labels {
Christopher Ferris525ce912017-07-26 13:12:53 -0700291 union {
292 __u8 ct_labels[OVS_CT_LABELS_LEN];
293 __u32 ct_labels_32[OVS_CT_LABELS_LEN_32];
294 };
Christopher Ferris49f525c2016-12-12 14:55:36 -0800295};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800296#define OVS_CS_F_NEW 0x01
297#define OVS_CS_F_ESTABLISHED 0x02
298#define OVS_CS_F_RELATED 0x04
Christopher Ferris49f525c2016-12-12 14:55:36 -0800299#define OVS_CS_F_REPLY_DIR 0x08
Christopher Ferris05d08e92016-02-04 13:16:38 -0800300#define OVS_CS_F_INVALID 0x10
301#define OVS_CS_F_TRACKED 0x20
Christopher Ferris106b3a82016-08-24 12:15:38 -0700302#define OVS_CS_F_SRC_NAT 0x40
Christopher Ferris49f525c2016-12-12 14:55:36 -0800303#define OVS_CS_F_DST_NAT 0x80
Christopher Ferris106b3a82016-08-24 12:15:38 -0700304#define OVS_CS_F_NAT_MASK (OVS_CS_F_SRC_NAT | OVS_CS_F_DST_NAT)
Christopher Ferris525ce912017-07-26 13:12:53 -0700305struct ovs_key_ct_tuple_ipv4 {
306 __be32 ipv4_src;
307 __be32 ipv4_dst;
308 __be16 src_port;
309 __be16 dst_port;
310 __u8 ipv4_proto;
311};
312struct ovs_key_ct_tuple_ipv6 {
313 __be32 ipv6_src[4];
314 __be32 ipv6_dst[4];
315 __be16 src_port;
316 __be16 dst_port;
317 __u8 ipv6_proto;
318};
Christopher Ferris934ec942018-01-31 15:29:16 -0800319enum ovs_nsh_key_attr {
320 OVS_NSH_KEY_ATTR_UNSPEC,
321 OVS_NSH_KEY_ATTR_BASE,
322 OVS_NSH_KEY_ATTR_MD1,
323 OVS_NSH_KEY_ATTR_MD2,
324 __OVS_NSH_KEY_ATTR_MAX
325};
326#define OVS_NSH_KEY_ATTR_MAX (__OVS_NSH_KEY_ATTR_MAX - 1)
327struct ovs_nsh_key_base {
328 __u8 flags;
329 __u8 ttl;
330 __u8 mdtype;
331 __u8 np;
332 __be32 path_hdr;
333};
334#define NSH_MD1_CONTEXT_SIZE 4
335struct ovs_nsh_key_md1 {
336 __be32 context[NSH_MD1_CONTEXT_SIZE];
337};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700338enum ovs_flow_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800339 OVS_FLOW_ATTR_UNSPEC,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800340 OVS_FLOW_ATTR_KEY,
Tao Baod7db5942015-01-28 10:07:51 -0800341 OVS_FLOW_ATTR_ACTIONS,
Tao Baod7db5942015-01-28 10:07:51 -0800342 OVS_FLOW_ATTR_STATS,
343 OVS_FLOW_ATTR_TCP_FLAGS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800344 OVS_FLOW_ATTR_USED,
Tao Baod7db5942015-01-28 10:07:51 -0800345 OVS_FLOW_ATTR_CLEAR,
Tao Baod7db5942015-01-28 10:07:51 -0800346 OVS_FLOW_ATTR_MASK,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800347 OVS_FLOW_ATTR_PROBE,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800348 OVS_FLOW_ATTR_UFID,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700349 OVS_FLOW_ATTR_UFID_FLAGS,
350 OVS_FLOW_ATTR_PAD,
351 __OVS_FLOW_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800352};
Ben Cheng655a7c02013-10-16 16:09:24 -0700353#define OVS_FLOW_ATTR_MAX (__OVS_FLOW_ATTR_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800354#define OVS_UFID_F_OMIT_KEY (1 << 0)
355#define OVS_UFID_F_OMIT_MASK (1 << 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800356#define OVS_UFID_F_OMIT_ACTIONS (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700357enum ovs_sample_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800358 OVS_SAMPLE_ATTR_UNSPEC,
359 OVS_SAMPLE_ATTR_PROBABILITY,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800360 OVS_SAMPLE_ATTR_ACTIONS,
Tao Baod7db5942015-01-28 10:07:51 -0800361 __OVS_SAMPLE_ATTR_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -0700362};
363#define OVS_SAMPLE_ATTR_MAX (__OVS_SAMPLE_ATTR_MAX - 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800364enum ovs_userspace_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800365 OVS_USERSPACE_ATTR_UNSPEC,
366 OVS_USERSPACE_ATTR_PID,
367 OVS_USERSPACE_ATTR_USERDATA,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800368 OVS_USERSPACE_ATTR_EGRESS_TUN_PORT,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800369 OVS_USERSPACE_ATTR_ACTIONS,
Tao Baod7db5942015-01-28 10:07:51 -0800370 __OVS_USERSPACE_ATTR_MAX
Christopher Ferris05d08e92016-02-04 13:16:38 -0800371};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800372#define OVS_USERSPACE_ATTR_MAX (__OVS_USERSPACE_ATTR_MAX - 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800373struct ovs_action_trunc {
374 __u32 max_len;
375};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800376struct ovs_action_push_mpls {
377 __be32 mpls_lse;
378 __be16 mpls_ethertype;
Ben Cheng655a7c02013-10-16 16:09:24 -0700379};
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700380struct ovs_action_add_mpls {
381 __be32 mpls_lse;
382 __be16 mpls_ethertype;
383 __u16 tun_flags;
384};
385#define OVS_MPLS_L3_TUNNEL_FLAG_MASK (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700386struct ovs_action_push_vlan {
Tao Baod7db5942015-01-28 10:07:51 -0800387 __be16 vlan_tpid;
Tao Baod7db5942015-01-28 10:07:51 -0800388 __be16 vlan_tci;
Ben Cheng655a7c02013-10-16 16:09:24 -0700389};
Christopher Ferris82d75042015-01-26 10:57:07 -0800390enum ovs_hash_alg {
Tao Baod7db5942015-01-28 10:07:51 -0800391 OVS_HASH_ALG_L4,
Christopher Ferris82d75042015-01-26 10:57:07 -0800392};
393struct ovs_action_hash {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800394 __u32 hash_alg;
395 __u32 hash_basis;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800396};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800397enum ovs_ct_attr {
398 OVS_CT_ATTR_UNSPEC,
399 OVS_CT_ATTR_COMMIT,
400 OVS_CT_ATTR_ZONE,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800401 OVS_CT_ATTR_MARK,
402 OVS_CT_ATTR_LABELS,
403 OVS_CT_ATTR_HELPER,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700404 OVS_CT_ATTR_NAT,
Christopher Ferris525ce912017-07-26 13:12:53 -0700405 OVS_CT_ATTR_FORCE_COMMIT,
406 OVS_CT_ATTR_EVENTMASK,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700407 OVS_CT_ATTR_TIMEOUT,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800408 __OVS_CT_ATTR_MAX
Christopher Ferris82d75042015-01-26 10:57:07 -0800409};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800410#define OVS_CT_ATTR_MAX (__OVS_CT_ATTR_MAX - 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700411enum ovs_nat_attr {
412 OVS_NAT_ATTR_UNSPEC,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700413 OVS_NAT_ATTR_SRC,
414 OVS_NAT_ATTR_DST,
415 OVS_NAT_ATTR_IP_MIN,
416 OVS_NAT_ATTR_IP_MAX,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700417 OVS_NAT_ATTR_PROTO_MIN,
418 OVS_NAT_ATTR_PROTO_MAX,
419 OVS_NAT_ATTR_PERSISTENT,
420 OVS_NAT_ATTR_PROTO_HASH,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700421 OVS_NAT_ATTR_PROTO_RANDOM,
422 __OVS_NAT_ATTR_MAX,
423};
424#define OVS_NAT_ATTR_MAX (__OVS_NAT_ATTR_MAX - 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800425struct ovs_action_push_eth {
426 struct ovs_key_ethernet addresses;
427};
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700428enum ovs_check_pkt_len_attr {
429 OVS_CHECK_PKT_LEN_ATTR_UNSPEC,
430 OVS_CHECK_PKT_LEN_ATTR_PKT_LEN,
431 OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_GREATER,
432 OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_LESS_EQUAL,
433 __OVS_CHECK_PKT_LEN_ATTR_MAX,
434};
435#define OVS_CHECK_PKT_LEN_ATTR_MAX (__OVS_CHECK_PKT_LEN_ATTR_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700436enum ovs_action_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800437 OVS_ACTION_ATTR_UNSPEC,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800438 OVS_ACTION_ATTR_OUTPUT,
Tao Baod7db5942015-01-28 10:07:51 -0800439 OVS_ACTION_ATTR_USERSPACE,
440 OVS_ACTION_ATTR_SET,
441 OVS_ACTION_ATTR_PUSH_VLAN,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800442 OVS_ACTION_ATTR_POP_VLAN,
Tao Baod7db5942015-01-28 10:07:51 -0800443 OVS_ACTION_ATTR_SAMPLE,
444 OVS_ACTION_ATTR_RECIRC,
445 OVS_ACTION_ATTR_HASH,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800446 OVS_ACTION_ATTR_PUSH_MPLS,
447 OVS_ACTION_ATTR_POP_MPLS,
448 OVS_ACTION_ATTR_SET_MASKED,
449 OVS_ACTION_ATTR_CT,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800450 OVS_ACTION_ATTR_TRUNC,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800451 OVS_ACTION_ATTR_PUSH_ETH,
452 OVS_ACTION_ATTR_POP_ETH,
Christopher Ferris934ec942018-01-31 15:29:16 -0800453 OVS_ACTION_ATTR_CT_CLEAR,
454 OVS_ACTION_ATTR_PUSH_NSH,
455 OVS_ACTION_ATTR_POP_NSH,
456 OVS_ACTION_ATTR_METER,
Christopher Ferris9ce28842018-10-25 12:11:39 -0700457 OVS_ACTION_ATTR_CLONE,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700458 OVS_ACTION_ATTR_CHECK_PKT_LEN,
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700459 OVS_ACTION_ATTR_ADD_MPLS,
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700460 OVS_ACTION_ATTR_DEC_TTL,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800461 __OVS_ACTION_ATTR_MAX,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800462};
Ben Cheng655a7c02013-10-16 16:09:24 -0700463#define OVS_ACTION_ATTR_MAX (__OVS_ACTION_ATTR_MAX - 1)
Christopher Ferris934ec942018-01-31 15:29:16 -0800464#define OVS_METER_FAMILY "ovs_meter"
465#define OVS_METER_MCGROUP "ovs_meter"
466#define OVS_METER_VERSION 0x1
467enum ovs_meter_cmd {
468 OVS_METER_CMD_UNSPEC,
469 OVS_METER_CMD_FEATURES,
470 OVS_METER_CMD_SET,
471 OVS_METER_CMD_DEL,
472 OVS_METER_CMD_GET
473};
474enum ovs_meter_attr {
475 OVS_METER_ATTR_UNSPEC,
476 OVS_METER_ATTR_ID,
477 OVS_METER_ATTR_KBPS,
478 OVS_METER_ATTR_STATS,
479 OVS_METER_ATTR_BANDS,
480 OVS_METER_ATTR_USED,
481 OVS_METER_ATTR_CLEAR,
482 OVS_METER_ATTR_MAX_METERS,
483 OVS_METER_ATTR_MAX_BANDS,
484 OVS_METER_ATTR_PAD,
485 __OVS_METER_ATTR_MAX
486};
487#define OVS_METER_ATTR_MAX (__OVS_METER_ATTR_MAX - 1)
488enum ovs_band_attr {
489 OVS_BAND_ATTR_UNSPEC,
490 OVS_BAND_ATTR_TYPE,
491 OVS_BAND_ATTR_RATE,
492 OVS_BAND_ATTR_BURST,
493 OVS_BAND_ATTR_STATS,
494 __OVS_BAND_ATTR_MAX
495};
496#define OVS_BAND_ATTR_MAX (__OVS_BAND_ATTR_MAX - 1)
497enum ovs_meter_band_type {
498 OVS_METER_BAND_TYPE_UNSPEC,
499 OVS_METER_BAND_TYPE_DROP,
500 __OVS_METER_BAND_TYPE_MAX
501};
502#define OVS_METER_BAND_TYPE_MAX (__OVS_METER_BAND_TYPE_MAX - 1)
Christopher Ferris9ce28842018-10-25 12:11:39 -0700503#define OVS_CT_LIMIT_FAMILY "ovs_ct_limit"
504#define OVS_CT_LIMIT_MCGROUP "ovs_ct_limit"
505#define OVS_CT_LIMIT_VERSION 0x1
506enum ovs_ct_limit_cmd {
507 OVS_CT_LIMIT_CMD_UNSPEC,
508 OVS_CT_LIMIT_CMD_SET,
509 OVS_CT_LIMIT_CMD_DEL,
510 OVS_CT_LIMIT_CMD_GET
511};
512enum ovs_ct_limit_attr {
513 OVS_CT_LIMIT_ATTR_UNSPEC,
514 OVS_CT_LIMIT_ATTR_ZONE_LIMIT,
515 __OVS_CT_LIMIT_ATTR_MAX
516};
517#define OVS_CT_LIMIT_ATTR_MAX (__OVS_CT_LIMIT_ATTR_MAX - 1)
518#define OVS_ZONE_LIMIT_DEFAULT_ZONE - 1
519struct ovs_zone_limit {
520 int zone_id;
521 __u32 limit;
522 __u32 count;
523};
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700524enum ovs_dec_ttl_attr {
525 OVS_DEC_TTL_ATTR_UNSPEC,
526 OVS_DEC_TTL_ATTR_ACTION,
527 __OVS_DEC_TTL_ATTR_MAX
528};
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800529#define OVS_DEC_TTL_ATTR_MAX (__OVS_DEC_TTL_ATTR_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700530#endif