blob: bea44d0bc102e9ad3f19394c5620ffce1301733f [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,
Tao Baod7db5942015-01-28 10:07:51 -080045 __OVS_DP_ATTR_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -070046};
Christopher Ferris106b3a82016-08-24 12:15:38 -070047#define OVS_DP_ATTR_MAX (__OVS_DP_ATTR_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070048struct ovs_dp_stats {
Tao Baod7db5942015-01-28 10:07:51 -080049 __u64 n_hit;
50 __u64 n_missed;
Christopher Ferris106b3a82016-08-24 12:15:38 -070051 __u64 n_lost;
Tao Baod7db5942015-01-28 10:07:51 -080052 __u64 n_flows;
Ben Cheng655a7c02013-10-16 16:09:24 -070053};
Christopher Ferris38062f92014-07-09 15:33:25 -070054struct ovs_dp_megaflow_stats {
Christopher Ferris106b3a82016-08-24 12:15:38 -070055 __u64 n_mask_hit;
Tao Baod7db5942015-01-28 10:07:51 -080056 __u32 n_masks;
57 __u32 pad0;
58 __u64 pad1;
Christopher Ferris106b3a82016-08-24 12:15:38 -070059 __u64 pad2;
Ben Cheng655a7c02013-10-16 16:09:24 -070060};
Christopher Ferris38062f92014-07-09 15:33:25 -070061struct ovs_vport_stats {
Tao Baod7db5942015-01-28 10:07:51 -080062 __u64 rx_packets;
Christopher Ferris106b3a82016-08-24 12:15:38 -070063 __u64 tx_packets;
Tao Baod7db5942015-01-28 10:07:51 -080064 __u64 rx_bytes;
65 __u64 tx_bytes;
66 __u64 rx_errors;
Christopher Ferris106b3a82016-08-24 12:15:38 -070067 __u64 tx_errors;
Tao Baod7db5942015-01-28 10:07:51 -080068 __u64 rx_dropped;
69 __u64 tx_dropped;
Christopher Ferris38062f92014-07-09 15:33:25 -070070};
Christopher Ferris106b3a82016-08-24 12:15:38 -070071#define OVS_DP_F_UNALIGNED (1 << 0)
Christopher Ferris82d75042015-01-26 10:57:07 -080072#define OVS_DP_F_VPORT_PIDS (1 << 1)
Tao Baod7db5942015-01-28 10:07:51 -080073#define OVSP_LOCAL ((__u32) 0)
Ben Cheng655a7c02013-10-16 16:09:24 -070074#define OVS_PACKET_FAMILY "ovs_packet"
Christopher Ferris106b3a82016-08-24 12:15:38 -070075#define OVS_PACKET_VERSION 0x1
Christopher Ferris82d75042015-01-26 10:57:07 -080076enum ovs_packet_cmd {
Tao Baod7db5942015-01-28 10:07:51 -080077 OVS_PACKET_CMD_UNSPEC,
78 OVS_PACKET_CMD_MISS,
Christopher Ferris106b3a82016-08-24 12:15:38 -070079 OVS_PACKET_CMD_ACTION,
Tao Baod7db5942015-01-28 10:07:51 -080080 OVS_PACKET_CMD_EXECUTE
Ben Cheng655a7c02013-10-16 16:09:24 -070081};
82enum ovs_packet_attr {
Christopher Ferris106b3a82016-08-24 12:15:38 -070083 OVS_PACKET_ATTR_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -080084 OVS_PACKET_ATTR_PACKET,
85 OVS_PACKET_ATTR_KEY,
86 OVS_PACKET_ATTR_ACTIONS,
Christopher Ferris106b3a82016-08-24 12:15:38 -070087 OVS_PACKET_ATTR_USERDATA,
Christopher Ferris05d08e92016-02-04 13:16:38 -080088 OVS_PACKET_ATTR_EGRESS_TUN_KEY,
89 OVS_PACKET_ATTR_UNUSED1,
90 OVS_PACKET_ATTR_UNUSED2,
Christopher Ferris106b3a82016-08-24 12:15:38 -070091 OVS_PACKET_ATTR_PROBE,
Christopher Ferris05d08e92016-02-04 13:16:38 -080092 OVS_PACKET_ATTR_MRU,
Christopher Ferris49f525c2016-12-12 14:55:36 -080093 OVS_PACKET_ATTR_LEN,
Tao Baod7db5942015-01-28 10:07:51 -080094 __OVS_PACKET_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -080095};
Christopher Ferris106b3a82016-08-24 12:15:38 -070096#define OVS_PACKET_ATTR_MAX (__OVS_PACKET_ATTR_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -080097#define OVS_VPORT_FAMILY "ovs_vport"
Christopher Ferris82d75042015-01-26 10:57:07 -080098#define OVS_VPORT_MCGROUP "ovs_vport"
Christopher Ferris49f525c2016-12-12 14:55:36 -080099#define OVS_VPORT_VERSION 0x1
Christopher Ferris106b3a82016-08-24 12:15:38 -0700100enum ovs_vport_cmd {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800101 OVS_VPORT_CMD_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -0800102 OVS_VPORT_CMD_NEW,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800103 OVS_VPORT_CMD_DEL,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700104 OVS_VPORT_CMD_GET,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800105 OVS_VPORT_CMD_SET
Christopher Ferris82d75042015-01-26 10:57:07 -0800106};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800107enum ovs_vport_type {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700108 OVS_VPORT_TYPE_UNSPEC,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800109 OVS_VPORT_TYPE_NETDEV,
Tao Baod7db5942015-01-28 10:07:51 -0800110 OVS_VPORT_TYPE_INTERNAL,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800111 OVS_VPORT_TYPE_GRE,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700112 OVS_VPORT_TYPE_VXLAN,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800113 OVS_VPORT_TYPE_GENEVE,
Tao Baod7db5942015-01-28 10:07:51 -0800114 __OVS_VPORT_TYPE_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800115};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700116#define OVS_VPORT_TYPE_MAX (__OVS_VPORT_TYPE_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800117enum ovs_vport_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800118 OVS_VPORT_ATTR_UNSPEC,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800119 OVS_VPORT_ATTR_PORT_NO,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700120 OVS_VPORT_ATTR_TYPE,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800121 OVS_VPORT_ATTR_NAME,
Tao Baod7db5942015-01-28 10:07:51 -0800122 OVS_VPORT_ATTR_OPTIONS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800123 OVS_VPORT_ATTR_UPCALL_PID,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700124 OVS_VPORT_ATTR_STATS,
125 OVS_VPORT_ATTR_PAD,
Christopher Ferris934ec942018-01-31 15:29:16 -0800126 OVS_VPORT_ATTR_IFINDEX,
127 OVS_VPORT_ATTR_NETNSID,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800128 __OVS_VPORT_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800129};
Ben Cheng655a7c02013-10-16 16:09:24 -0700130#define OVS_VPORT_ATTR_MAX (__OVS_VPORT_ATTR_MAX - 1)
Christopher Ferris38062f92014-07-09 15:33:25 -0700131enum {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800132 OVS_VXLAN_EXT_UNSPEC,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800133 OVS_VXLAN_EXT_GBP,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800134 __OVS_VXLAN_EXT_MAX,
135};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800136#define OVS_VXLAN_EXT_MAX (__OVS_VXLAN_EXT_MAX - 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800137enum {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800138 OVS_TUNNEL_ATTR_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -0800139 OVS_TUNNEL_ATTR_DST_PORT,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800140 OVS_TUNNEL_ATTR_EXTENSION,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800141 __OVS_TUNNEL_ATTR_MAX
Christopher Ferris38062f92014-07-09 15:33:25 -0700142};
143#define OVS_TUNNEL_ATTR_MAX (__OVS_TUNNEL_ATTR_MAX - 1)
144#define OVS_FLOW_FAMILY "ovs_flow"
Christopher Ferris49f525c2016-12-12 14:55:36 -0800145#define OVS_FLOW_MCGROUP "ovs_flow"
Ben Cheng655a7c02013-10-16 16:09:24 -0700146#define OVS_FLOW_VERSION 0x1
147enum ovs_flow_cmd {
Tao Baod7db5942015-01-28 10:07:51 -0800148 OVS_FLOW_CMD_UNSPEC,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800149 OVS_FLOW_CMD_NEW,
Tao Baod7db5942015-01-28 10:07:51 -0800150 OVS_FLOW_CMD_DEL,
151 OVS_FLOW_CMD_GET,
Tao Baod7db5942015-01-28 10:07:51 -0800152 OVS_FLOW_CMD_SET
Christopher Ferris49f525c2016-12-12 14:55:36 -0800153};
Ben Cheng655a7c02013-10-16 16:09:24 -0700154struct ovs_flow_stats {
Tao Baod7db5942015-01-28 10:07:51 -0800155 __u64 n_packets;
Tao Baod7db5942015-01-28 10:07:51 -0800156 __u64 n_bytes;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800157};
Ben Cheng655a7c02013-10-16 16:09:24 -0700158enum ovs_key_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800159 OVS_KEY_ATTR_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -0800160 OVS_KEY_ATTR_ENCAP,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800161 OVS_KEY_ATTR_PRIORITY,
Tao Baod7db5942015-01-28 10:07:51 -0800162 OVS_KEY_ATTR_IN_PORT,
163 OVS_KEY_ATTR_ETHERNET,
Tao Baod7db5942015-01-28 10:07:51 -0800164 OVS_KEY_ATTR_VLAN,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800165 OVS_KEY_ATTR_ETHERTYPE,
Tao Baod7db5942015-01-28 10:07:51 -0800166 OVS_KEY_ATTR_IPV4,
167 OVS_KEY_ATTR_IPV6,
Tao Baod7db5942015-01-28 10:07:51 -0800168 OVS_KEY_ATTR_TCP,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800169 OVS_KEY_ATTR_UDP,
Tao Baod7db5942015-01-28 10:07:51 -0800170 OVS_KEY_ATTR_ICMP,
171 OVS_KEY_ATTR_ICMPV6,
Tao Baod7db5942015-01-28 10:07:51 -0800172 OVS_KEY_ATTR_ARP,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800173 OVS_KEY_ATTR_ND,
Tao Baod7db5942015-01-28 10:07:51 -0800174 OVS_KEY_ATTR_SKB_MARK,
175 OVS_KEY_ATTR_TUNNEL,
Tao Baod7db5942015-01-28 10:07:51 -0800176 OVS_KEY_ATTR_SCTP,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800177 OVS_KEY_ATTR_TCP_FLAGS,
Tao Baod7db5942015-01-28 10:07:51 -0800178 OVS_KEY_ATTR_DP_HASH,
179 OVS_KEY_ATTR_RECIRC_ID,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800180 OVS_KEY_ATTR_MPLS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800181 OVS_KEY_ATTR_CT_STATE,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800182 OVS_KEY_ATTR_CT_ZONE,
183 OVS_KEY_ATTR_CT_MARK,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800184 OVS_KEY_ATTR_CT_LABELS,
Christopher Ferris525ce912017-07-26 13:12:53 -0700185 OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV4,
186 OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV6,
Christopher Ferris934ec942018-01-31 15:29:16 -0800187 OVS_KEY_ATTR_NSH,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800188 __OVS_KEY_ATTR_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700189};
190#define OVS_KEY_ATTR_MAX (__OVS_KEY_ATTR_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800191enum ovs_tunnel_key_attr {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800192 OVS_TUNNEL_KEY_ATTR_ID,
Tao Baod7db5942015-01-28 10:07:51 -0800193 OVS_TUNNEL_KEY_ATTR_IPV4_SRC,
194 OVS_TUNNEL_KEY_ATTR_IPV4_DST,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800195 OVS_TUNNEL_KEY_ATTR_TOS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800196 OVS_TUNNEL_KEY_ATTR_TTL,
Tao Baod7db5942015-01-28 10:07:51 -0800197 OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT,
198 OVS_TUNNEL_KEY_ATTR_CSUM,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800199 OVS_TUNNEL_KEY_ATTR_OAM,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800200 OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800201 OVS_TUNNEL_KEY_ATTR_TP_SRC,
202 OVS_TUNNEL_KEY_ATTR_TP_DST,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800203 OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800204 OVS_TUNNEL_KEY_ATTR_IPV6_SRC,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700205 OVS_TUNNEL_KEY_ATTR_IPV6_DST,
206 OVS_TUNNEL_KEY_ATTR_PAD,
207 __OVS_TUNNEL_KEY_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800208};
Christopher Ferris38062f92014-07-09 15:33:25 -0700209#define OVS_TUNNEL_KEY_ATTR_MAX (__OVS_TUNNEL_KEY_ATTR_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700210enum ovs_frag_type {
Tao Baod7db5942015-01-28 10:07:51 -0800211 OVS_FRAG_TYPE_NONE,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800212 OVS_FRAG_TYPE_FIRST,
Tao Baod7db5942015-01-28 10:07:51 -0800213 OVS_FRAG_TYPE_LATER,
Tao Baod7db5942015-01-28 10:07:51 -0800214 __OVS_FRAG_TYPE_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700215};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800216#define OVS_FRAG_TYPE_MAX (__OVS_FRAG_TYPE_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700217struct ovs_key_ethernet {
Tao Baod7db5942015-01-28 10:07:51 -0800218 __u8 eth_src[ETH_ALEN];
219 __u8 eth_dst[ETH_ALEN];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800220};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800221struct ovs_key_mpls {
222 __be32 mpls_lse;
223};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800224struct ovs_key_ipv4 {
Tao Baod7db5942015-01-28 10:07:51 -0800225 __be32 ipv4_src;
226 __be32 ipv4_dst;
227 __u8 ipv4_proto;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800228 __u8 ipv4_tos;
Tao Baod7db5942015-01-28 10:07:51 -0800229 __u8 ipv4_ttl;
230 __u8 ipv4_frag;
Christopher Ferris38062f92014-07-09 15:33:25 -0700231};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800232struct ovs_key_ipv6 {
Tao Baod7db5942015-01-28 10:07:51 -0800233 __be32 ipv6_src[4];
234 __be32 ipv6_dst[4];
235 __be32 ipv6_label;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800236 __u8 ipv6_proto;
Tao Baod7db5942015-01-28 10:07:51 -0800237 __u8 ipv6_tclass;
238 __u8 ipv6_hlimit;
239 __u8 ipv6_frag;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800240};
Ben Cheng655a7c02013-10-16 16:09:24 -0700241struct ovs_key_tcp {
Tao Baod7db5942015-01-28 10:07:51 -0800242 __be16 tcp_src;
243 __be16 tcp_dst;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800244};
Ben Cheng655a7c02013-10-16 16:09:24 -0700245struct ovs_key_udp {
Tao Baod7db5942015-01-28 10:07:51 -0800246 __be16 udp_src;
247 __be16 udp_dst;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800248};
Christopher Ferris38062f92014-07-09 15:33:25 -0700249struct ovs_key_sctp {
Tao Baod7db5942015-01-28 10:07:51 -0800250 __be16 sctp_src;
251 __be16 sctp_dst;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800252};
Ben Cheng655a7c02013-10-16 16:09:24 -0700253struct ovs_key_icmp {
Tao Baod7db5942015-01-28 10:07:51 -0800254 __u8 icmp_type;
255 __u8 icmp_code;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800256};
Ben Cheng655a7c02013-10-16 16:09:24 -0700257struct ovs_key_icmpv6 {
Tao Baod7db5942015-01-28 10:07:51 -0800258 __u8 icmpv6_type;
259 __u8 icmpv6_code;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800260};
Ben Cheng655a7c02013-10-16 16:09:24 -0700261struct ovs_key_arp {
Tao Baod7db5942015-01-28 10:07:51 -0800262 __be32 arp_sip;
263 __be32 arp_tip;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800264 __be16 arp_op;
Tao Baod7db5942015-01-28 10:07:51 -0800265 __u8 arp_sha[ETH_ALEN];
266 __u8 arp_tha[ETH_ALEN];
Christopher Ferris38062f92014-07-09 15:33:25 -0700267};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800268struct ovs_key_nd {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800269 __be32 nd_target[4];
Tao Baod7db5942015-01-28 10:07:51 -0800270 __u8 nd_sll[ETH_ALEN];
271 __u8 nd_tll[ETH_ALEN];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800272};
Christopher Ferris525ce912017-07-26 13:12:53 -0700273#define OVS_CT_LABELS_LEN_32 4
274#define OVS_CT_LABELS_LEN (OVS_CT_LABELS_LEN_32 * sizeof(__u32))
Christopher Ferris05d08e92016-02-04 13:16:38 -0800275struct ovs_key_ct_labels {
Christopher Ferris525ce912017-07-26 13:12:53 -0700276 union {
277 __u8 ct_labels[OVS_CT_LABELS_LEN];
278 __u32 ct_labels_32[OVS_CT_LABELS_LEN_32];
279 };
Christopher Ferris49f525c2016-12-12 14:55:36 -0800280};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800281#define OVS_CS_F_NEW 0x01
282#define OVS_CS_F_ESTABLISHED 0x02
283#define OVS_CS_F_RELATED 0x04
Christopher Ferris49f525c2016-12-12 14:55:36 -0800284#define OVS_CS_F_REPLY_DIR 0x08
Christopher Ferris05d08e92016-02-04 13:16:38 -0800285#define OVS_CS_F_INVALID 0x10
286#define OVS_CS_F_TRACKED 0x20
Christopher Ferris106b3a82016-08-24 12:15:38 -0700287#define OVS_CS_F_SRC_NAT 0x40
Christopher Ferris49f525c2016-12-12 14:55:36 -0800288#define OVS_CS_F_DST_NAT 0x80
Christopher Ferris106b3a82016-08-24 12:15:38 -0700289#define OVS_CS_F_NAT_MASK (OVS_CS_F_SRC_NAT | OVS_CS_F_DST_NAT)
Christopher Ferris525ce912017-07-26 13:12:53 -0700290struct ovs_key_ct_tuple_ipv4 {
291 __be32 ipv4_src;
292 __be32 ipv4_dst;
293 __be16 src_port;
294 __be16 dst_port;
295 __u8 ipv4_proto;
296};
297struct ovs_key_ct_tuple_ipv6 {
298 __be32 ipv6_src[4];
299 __be32 ipv6_dst[4];
300 __be16 src_port;
301 __be16 dst_port;
302 __u8 ipv6_proto;
303};
Christopher Ferris934ec942018-01-31 15:29:16 -0800304enum ovs_nsh_key_attr {
305 OVS_NSH_KEY_ATTR_UNSPEC,
306 OVS_NSH_KEY_ATTR_BASE,
307 OVS_NSH_KEY_ATTR_MD1,
308 OVS_NSH_KEY_ATTR_MD2,
309 __OVS_NSH_KEY_ATTR_MAX
310};
311#define OVS_NSH_KEY_ATTR_MAX (__OVS_NSH_KEY_ATTR_MAX - 1)
312struct ovs_nsh_key_base {
313 __u8 flags;
314 __u8 ttl;
315 __u8 mdtype;
316 __u8 np;
317 __be32 path_hdr;
318};
319#define NSH_MD1_CONTEXT_SIZE 4
320struct ovs_nsh_key_md1 {
321 __be32 context[NSH_MD1_CONTEXT_SIZE];
322};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700323enum ovs_flow_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800324 OVS_FLOW_ATTR_UNSPEC,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800325 OVS_FLOW_ATTR_KEY,
Tao Baod7db5942015-01-28 10:07:51 -0800326 OVS_FLOW_ATTR_ACTIONS,
Tao Baod7db5942015-01-28 10:07:51 -0800327 OVS_FLOW_ATTR_STATS,
328 OVS_FLOW_ATTR_TCP_FLAGS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800329 OVS_FLOW_ATTR_USED,
Tao Baod7db5942015-01-28 10:07:51 -0800330 OVS_FLOW_ATTR_CLEAR,
Tao Baod7db5942015-01-28 10:07:51 -0800331 OVS_FLOW_ATTR_MASK,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800332 OVS_FLOW_ATTR_PROBE,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800333 OVS_FLOW_ATTR_UFID,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700334 OVS_FLOW_ATTR_UFID_FLAGS,
335 OVS_FLOW_ATTR_PAD,
336 __OVS_FLOW_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800337};
Ben Cheng655a7c02013-10-16 16:09:24 -0700338#define OVS_FLOW_ATTR_MAX (__OVS_FLOW_ATTR_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800339#define OVS_UFID_F_OMIT_KEY (1 << 0)
340#define OVS_UFID_F_OMIT_MASK (1 << 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800341#define OVS_UFID_F_OMIT_ACTIONS (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700342enum ovs_sample_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800343 OVS_SAMPLE_ATTR_UNSPEC,
344 OVS_SAMPLE_ATTR_PROBABILITY,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800345 OVS_SAMPLE_ATTR_ACTIONS,
Tao Baod7db5942015-01-28 10:07:51 -0800346 __OVS_SAMPLE_ATTR_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -0700347};
348#define OVS_SAMPLE_ATTR_MAX (__OVS_SAMPLE_ATTR_MAX - 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800349enum ovs_userspace_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800350 OVS_USERSPACE_ATTR_UNSPEC,
351 OVS_USERSPACE_ATTR_PID,
352 OVS_USERSPACE_ATTR_USERDATA,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800353 OVS_USERSPACE_ATTR_EGRESS_TUN_PORT,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800354 OVS_USERSPACE_ATTR_ACTIONS,
Tao Baod7db5942015-01-28 10:07:51 -0800355 __OVS_USERSPACE_ATTR_MAX
Christopher Ferris05d08e92016-02-04 13:16:38 -0800356};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800357#define OVS_USERSPACE_ATTR_MAX (__OVS_USERSPACE_ATTR_MAX - 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800358struct ovs_action_trunc {
359 __u32 max_len;
360};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800361struct ovs_action_push_mpls {
362 __be32 mpls_lse;
363 __be16 mpls_ethertype;
Ben Cheng655a7c02013-10-16 16:09:24 -0700364};
Ben Cheng655a7c02013-10-16 16:09:24 -0700365struct ovs_action_push_vlan {
Tao Baod7db5942015-01-28 10:07:51 -0800366 __be16 vlan_tpid;
Tao Baod7db5942015-01-28 10:07:51 -0800367 __be16 vlan_tci;
Ben Cheng655a7c02013-10-16 16:09:24 -0700368};
Christopher Ferris82d75042015-01-26 10:57:07 -0800369enum ovs_hash_alg {
Tao Baod7db5942015-01-28 10:07:51 -0800370 OVS_HASH_ALG_L4,
Christopher Ferris82d75042015-01-26 10:57:07 -0800371};
372struct ovs_action_hash {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800373 __u32 hash_alg;
374 __u32 hash_basis;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800375};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800376enum ovs_ct_attr {
377 OVS_CT_ATTR_UNSPEC,
378 OVS_CT_ATTR_COMMIT,
379 OVS_CT_ATTR_ZONE,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800380 OVS_CT_ATTR_MARK,
381 OVS_CT_ATTR_LABELS,
382 OVS_CT_ATTR_HELPER,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700383 OVS_CT_ATTR_NAT,
Christopher Ferris525ce912017-07-26 13:12:53 -0700384 OVS_CT_ATTR_FORCE_COMMIT,
385 OVS_CT_ATTR_EVENTMASK,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800386 __OVS_CT_ATTR_MAX
Christopher Ferris82d75042015-01-26 10:57:07 -0800387};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800388#define OVS_CT_ATTR_MAX (__OVS_CT_ATTR_MAX - 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700389enum ovs_nat_attr {
390 OVS_NAT_ATTR_UNSPEC,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700391 OVS_NAT_ATTR_SRC,
392 OVS_NAT_ATTR_DST,
393 OVS_NAT_ATTR_IP_MIN,
394 OVS_NAT_ATTR_IP_MAX,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700395 OVS_NAT_ATTR_PROTO_MIN,
396 OVS_NAT_ATTR_PROTO_MAX,
397 OVS_NAT_ATTR_PERSISTENT,
398 OVS_NAT_ATTR_PROTO_HASH,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700399 OVS_NAT_ATTR_PROTO_RANDOM,
400 __OVS_NAT_ATTR_MAX,
401};
402#define OVS_NAT_ATTR_MAX (__OVS_NAT_ATTR_MAX - 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800403struct ovs_action_push_eth {
404 struct ovs_key_ethernet addresses;
405};
Ben Cheng655a7c02013-10-16 16:09:24 -0700406enum ovs_action_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800407 OVS_ACTION_ATTR_UNSPEC,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800408 OVS_ACTION_ATTR_OUTPUT,
Tao Baod7db5942015-01-28 10:07:51 -0800409 OVS_ACTION_ATTR_USERSPACE,
410 OVS_ACTION_ATTR_SET,
411 OVS_ACTION_ATTR_PUSH_VLAN,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800412 OVS_ACTION_ATTR_POP_VLAN,
Tao Baod7db5942015-01-28 10:07:51 -0800413 OVS_ACTION_ATTR_SAMPLE,
414 OVS_ACTION_ATTR_RECIRC,
415 OVS_ACTION_ATTR_HASH,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800416 OVS_ACTION_ATTR_PUSH_MPLS,
417 OVS_ACTION_ATTR_POP_MPLS,
418 OVS_ACTION_ATTR_SET_MASKED,
419 OVS_ACTION_ATTR_CT,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800420 OVS_ACTION_ATTR_TRUNC,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800421 OVS_ACTION_ATTR_PUSH_ETH,
422 OVS_ACTION_ATTR_POP_ETH,
Christopher Ferris934ec942018-01-31 15:29:16 -0800423 OVS_ACTION_ATTR_CT_CLEAR,
424 OVS_ACTION_ATTR_PUSH_NSH,
425 OVS_ACTION_ATTR_POP_NSH,
426 OVS_ACTION_ATTR_METER,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800427 __OVS_ACTION_ATTR_MAX,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800428};
Ben Cheng655a7c02013-10-16 16:09:24 -0700429#define OVS_ACTION_ATTR_MAX (__OVS_ACTION_ATTR_MAX - 1)
Christopher Ferris934ec942018-01-31 15:29:16 -0800430#define OVS_METER_FAMILY "ovs_meter"
431#define OVS_METER_MCGROUP "ovs_meter"
432#define OVS_METER_VERSION 0x1
433enum ovs_meter_cmd {
434 OVS_METER_CMD_UNSPEC,
435 OVS_METER_CMD_FEATURES,
436 OVS_METER_CMD_SET,
437 OVS_METER_CMD_DEL,
438 OVS_METER_CMD_GET
439};
440enum ovs_meter_attr {
441 OVS_METER_ATTR_UNSPEC,
442 OVS_METER_ATTR_ID,
443 OVS_METER_ATTR_KBPS,
444 OVS_METER_ATTR_STATS,
445 OVS_METER_ATTR_BANDS,
446 OVS_METER_ATTR_USED,
447 OVS_METER_ATTR_CLEAR,
448 OVS_METER_ATTR_MAX_METERS,
449 OVS_METER_ATTR_MAX_BANDS,
450 OVS_METER_ATTR_PAD,
451 __OVS_METER_ATTR_MAX
452};
453#define OVS_METER_ATTR_MAX (__OVS_METER_ATTR_MAX - 1)
454enum ovs_band_attr {
455 OVS_BAND_ATTR_UNSPEC,
456 OVS_BAND_ATTR_TYPE,
457 OVS_BAND_ATTR_RATE,
458 OVS_BAND_ATTR_BURST,
459 OVS_BAND_ATTR_STATS,
460 __OVS_BAND_ATTR_MAX
461};
462#define OVS_BAND_ATTR_MAX (__OVS_BAND_ATTR_MAX - 1)
463enum ovs_meter_band_type {
464 OVS_METER_BAND_TYPE_UNSPEC,
465 OVS_METER_BAND_TYPE_DROP,
466 __OVS_METER_BAND_TYPE_MAX
467};
468#define OVS_METER_BAND_TYPE_MAX (__OVS_METER_BAND_TYPE_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700469#endif