blob: 581a371bc496786d046ea25e8c58a033ee46b4fb [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)
Christopher Ferris9584fa42019-12-09 15:36:13 -080073#define OVS_DP_F_TC_RECIRC_SHARING (1 << 2)
Tao Baod7db5942015-01-28 10:07:51 -080074#define OVSP_LOCAL ((__u32) 0)
Ben Cheng655a7c02013-10-16 16:09:24 -070075#define OVS_PACKET_FAMILY "ovs_packet"
Christopher Ferris106b3a82016-08-24 12:15:38 -070076#define OVS_PACKET_VERSION 0x1
Christopher Ferris82d75042015-01-26 10:57:07 -080077enum ovs_packet_cmd {
Tao Baod7db5942015-01-28 10:07:51 -080078 OVS_PACKET_CMD_UNSPEC,
79 OVS_PACKET_CMD_MISS,
Christopher Ferris106b3a82016-08-24 12:15:38 -070080 OVS_PACKET_CMD_ACTION,
Tao Baod7db5942015-01-28 10:07:51 -080081 OVS_PACKET_CMD_EXECUTE
Ben Cheng655a7c02013-10-16 16:09:24 -070082};
83enum ovs_packet_attr {
Christopher Ferris106b3a82016-08-24 12:15:38 -070084 OVS_PACKET_ATTR_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -080085 OVS_PACKET_ATTR_PACKET,
86 OVS_PACKET_ATTR_KEY,
87 OVS_PACKET_ATTR_ACTIONS,
Christopher Ferris106b3a82016-08-24 12:15:38 -070088 OVS_PACKET_ATTR_USERDATA,
Christopher Ferris05d08e92016-02-04 13:16:38 -080089 OVS_PACKET_ATTR_EGRESS_TUN_KEY,
90 OVS_PACKET_ATTR_UNUSED1,
91 OVS_PACKET_ATTR_UNUSED2,
Christopher Ferris106b3a82016-08-24 12:15:38 -070092 OVS_PACKET_ATTR_PROBE,
Christopher Ferris05d08e92016-02-04 13:16:38 -080093 OVS_PACKET_ATTR_MRU,
Christopher Ferris49f525c2016-12-12 14:55:36 -080094 OVS_PACKET_ATTR_LEN,
Tao Baod7db5942015-01-28 10:07:51 -080095 __OVS_PACKET_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -080096};
Christopher Ferris106b3a82016-08-24 12:15:38 -070097#define OVS_PACKET_ATTR_MAX (__OVS_PACKET_ATTR_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -080098#define OVS_VPORT_FAMILY "ovs_vport"
Christopher Ferris82d75042015-01-26 10:57:07 -080099#define OVS_VPORT_MCGROUP "ovs_vport"
Christopher Ferris49f525c2016-12-12 14:55:36 -0800100#define OVS_VPORT_VERSION 0x1
Christopher Ferris106b3a82016-08-24 12:15:38 -0700101enum ovs_vport_cmd {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800102 OVS_VPORT_CMD_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -0800103 OVS_VPORT_CMD_NEW,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800104 OVS_VPORT_CMD_DEL,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700105 OVS_VPORT_CMD_GET,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800106 OVS_VPORT_CMD_SET
Christopher Ferris82d75042015-01-26 10:57:07 -0800107};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800108enum ovs_vport_type {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700109 OVS_VPORT_TYPE_UNSPEC,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800110 OVS_VPORT_TYPE_NETDEV,
Tao Baod7db5942015-01-28 10:07:51 -0800111 OVS_VPORT_TYPE_INTERNAL,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800112 OVS_VPORT_TYPE_GRE,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700113 OVS_VPORT_TYPE_VXLAN,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800114 OVS_VPORT_TYPE_GENEVE,
Tao Baod7db5942015-01-28 10:07:51 -0800115 __OVS_VPORT_TYPE_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800116};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700117#define OVS_VPORT_TYPE_MAX (__OVS_VPORT_TYPE_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800118enum ovs_vport_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800119 OVS_VPORT_ATTR_UNSPEC,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800120 OVS_VPORT_ATTR_PORT_NO,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700121 OVS_VPORT_ATTR_TYPE,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800122 OVS_VPORT_ATTR_NAME,
Tao Baod7db5942015-01-28 10:07:51 -0800123 OVS_VPORT_ATTR_OPTIONS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800124 OVS_VPORT_ATTR_UPCALL_PID,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700125 OVS_VPORT_ATTR_STATS,
126 OVS_VPORT_ATTR_PAD,
Christopher Ferris934ec942018-01-31 15:29:16 -0800127 OVS_VPORT_ATTR_IFINDEX,
128 OVS_VPORT_ATTR_NETNSID,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800129 __OVS_VPORT_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800130};
Ben Cheng655a7c02013-10-16 16:09:24 -0700131#define OVS_VPORT_ATTR_MAX (__OVS_VPORT_ATTR_MAX - 1)
Christopher Ferris38062f92014-07-09 15:33:25 -0700132enum {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800133 OVS_VXLAN_EXT_UNSPEC,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800134 OVS_VXLAN_EXT_GBP,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800135 __OVS_VXLAN_EXT_MAX,
136};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800137#define OVS_VXLAN_EXT_MAX (__OVS_VXLAN_EXT_MAX - 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800138enum {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800139 OVS_TUNNEL_ATTR_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -0800140 OVS_TUNNEL_ATTR_DST_PORT,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800141 OVS_TUNNEL_ATTR_EXTENSION,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800142 __OVS_TUNNEL_ATTR_MAX
Christopher Ferris38062f92014-07-09 15:33:25 -0700143};
144#define OVS_TUNNEL_ATTR_MAX (__OVS_TUNNEL_ATTR_MAX - 1)
145#define OVS_FLOW_FAMILY "ovs_flow"
Christopher Ferris49f525c2016-12-12 14:55:36 -0800146#define OVS_FLOW_MCGROUP "ovs_flow"
Ben Cheng655a7c02013-10-16 16:09:24 -0700147#define OVS_FLOW_VERSION 0x1
148enum ovs_flow_cmd {
Tao Baod7db5942015-01-28 10:07:51 -0800149 OVS_FLOW_CMD_UNSPEC,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800150 OVS_FLOW_CMD_NEW,
Tao Baod7db5942015-01-28 10:07:51 -0800151 OVS_FLOW_CMD_DEL,
152 OVS_FLOW_CMD_GET,
Tao Baod7db5942015-01-28 10:07:51 -0800153 OVS_FLOW_CMD_SET
Christopher Ferris49f525c2016-12-12 14:55:36 -0800154};
Ben Cheng655a7c02013-10-16 16:09:24 -0700155struct ovs_flow_stats {
Tao Baod7db5942015-01-28 10:07:51 -0800156 __u64 n_packets;
Tao Baod7db5942015-01-28 10:07:51 -0800157 __u64 n_bytes;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800158};
Ben Cheng655a7c02013-10-16 16:09:24 -0700159enum ovs_key_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800160 OVS_KEY_ATTR_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -0800161 OVS_KEY_ATTR_ENCAP,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800162 OVS_KEY_ATTR_PRIORITY,
Tao Baod7db5942015-01-28 10:07:51 -0800163 OVS_KEY_ATTR_IN_PORT,
164 OVS_KEY_ATTR_ETHERNET,
Tao Baod7db5942015-01-28 10:07:51 -0800165 OVS_KEY_ATTR_VLAN,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800166 OVS_KEY_ATTR_ETHERTYPE,
Tao Baod7db5942015-01-28 10:07:51 -0800167 OVS_KEY_ATTR_IPV4,
168 OVS_KEY_ATTR_IPV6,
Tao Baod7db5942015-01-28 10:07:51 -0800169 OVS_KEY_ATTR_TCP,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800170 OVS_KEY_ATTR_UDP,
Tao Baod7db5942015-01-28 10:07:51 -0800171 OVS_KEY_ATTR_ICMP,
172 OVS_KEY_ATTR_ICMPV6,
Tao Baod7db5942015-01-28 10:07:51 -0800173 OVS_KEY_ATTR_ARP,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800174 OVS_KEY_ATTR_ND,
Tao Baod7db5942015-01-28 10:07:51 -0800175 OVS_KEY_ATTR_SKB_MARK,
176 OVS_KEY_ATTR_TUNNEL,
Tao Baod7db5942015-01-28 10:07:51 -0800177 OVS_KEY_ATTR_SCTP,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800178 OVS_KEY_ATTR_TCP_FLAGS,
Tao Baod7db5942015-01-28 10:07:51 -0800179 OVS_KEY_ATTR_DP_HASH,
180 OVS_KEY_ATTR_RECIRC_ID,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800181 OVS_KEY_ATTR_MPLS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800182 OVS_KEY_ATTR_CT_STATE,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800183 OVS_KEY_ATTR_CT_ZONE,
184 OVS_KEY_ATTR_CT_MARK,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800185 OVS_KEY_ATTR_CT_LABELS,
Christopher Ferris525ce912017-07-26 13:12:53 -0700186 OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV4,
187 OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV6,
Christopher Ferris934ec942018-01-31 15:29:16 -0800188 OVS_KEY_ATTR_NSH,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800189 __OVS_KEY_ATTR_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700190};
191#define OVS_KEY_ATTR_MAX (__OVS_KEY_ATTR_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800192enum ovs_tunnel_key_attr {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800193 OVS_TUNNEL_KEY_ATTR_ID,
Tao Baod7db5942015-01-28 10:07:51 -0800194 OVS_TUNNEL_KEY_ATTR_IPV4_SRC,
195 OVS_TUNNEL_KEY_ATTR_IPV4_DST,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800196 OVS_TUNNEL_KEY_ATTR_TOS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800197 OVS_TUNNEL_KEY_ATTR_TTL,
Tao Baod7db5942015-01-28 10:07:51 -0800198 OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT,
199 OVS_TUNNEL_KEY_ATTR_CSUM,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800200 OVS_TUNNEL_KEY_ATTR_OAM,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800201 OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800202 OVS_TUNNEL_KEY_ATTR_TP_SRC,
203 OVS_TUNNEL_KEY_ATTR_TP_DST,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800204 OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800205 OVS_TUNNEL_KEY_ATTR_IPV6_SRC,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700206 OVS_TUNNEL_KEY_ATTR_IPV6_DST,
207 OVS_TUNNEL_KEY_ATTR_PAD,
Christopher Ferris76a1d452018-06-27 14:12:29 -0700208 OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700209 OVS_TUNNEL_KEY_ATTR_IPV4_INFO_BRIDGE,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700210 __OVS_TUNNEL_KEY_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800211};
Christopher Ferris38062f92014-07-09 15:33:25 -0700212#define OVS_TUNNEL_KEY_ATTR_MAX (__OVS_TUNNEL_KEY_ATTR_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700213enum ovs_frag_type {
Tao Baod7db5942015-01-28 10:07:51 -0800214 OVS_FRAG_TYPE_NONE,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800215 OVS_FRAG_TYPE_FIRST,
Tao Baod7db5942015-01-28 10:07:51 -0800216 OVS_FRAG_TYPE_LATER,
Tao Baod7db5942015-01-28 10:07:51 -0800217 __OVS_FRAG_TYPE_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700218};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800219#define OVS_FRAG_TYPE_MAX (__OVS_FRAG_TYPE_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700220struct ovs_key_ethernet {
Tao Baod7db5942015-01-28 10:07:51 -0800221 __u8 eth_src[ETH_ALEN];
222 __u8 eth_dst[ETH_ALEN];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800223};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800224struct ovs_key_mpls {
225 __be32 mpls_lse;
226};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800227struct ovs_key_ipv4 {
Tao Baod7db5942015-01-28 10:07:51 -0800228 __be32 ipv4_src;
229 __be32 ipv4_dst;
230 __u8 ipv4_proto;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800231 __u8 ipv4_tos;
Tao Baod7db5942015-01-28 10:07:51 -0800232 __u8 ipv4_ttl;
233 __u8 ipv4_frag;
Christopher Ferris38062f92014-07-09 15:33:25 -0700234};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800235struct ovs_key_ipv6 {
Tao Baod7db5942015-01-28 10:07:51 -0800236 __be32 ipv6_src[4];
237 __be32 ipv6_dst[4];
238 __be32 ipv6_label;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800239 __u8 ipv6_proto;
Tao Baod7db5942015-01-28 10:07:51 -0800240 __u8 ipv6_tclass;
241 __u8 ipv6_hlimit;
242 __u8 ipv6_frag;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800243};
Ben Cheng655a7c02013-10-16 16:09:24 -0700244struct ovs_key_tcp {
Tao Baod7db5942015-01-28 10:07:51 -0800245 __be16 tcp_src;
246 __be16 tcp_dst;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800247};
Ben Cheng655a7c02013-10-16 16:09:24 -0700248struct ovs_key_udp {
Tao Baod7db5942015-01-28 10:07:51 -0800249 __be16 udp_src;
250 __be16 udp_dst;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800251};
Christopher Ferris38062f92014-07-09 15:33:25 -0700252struct ovs_key_sctp {
Tao Baod7db5942015-01-28 10:07:51 -0800253 __be16 sctp_src;
254 __be16 sctp_dst;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800255};
Ben Cheng655a7c02013-10-16 16:09:24 -0700256struct ovs_key_icmp {
Tao Baod7db5942015-01-28 10:07:51 -0800257 __u8 icmp_type;
258 __u8 icmp_code;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800259};
Ben Cheng655a7c02013-10-16 16:09:24 -0700260struct ovs_key_icmpv6 {
Tao Baod7db5942015-01-28 10:07:51 -0800261 __u8 icmpv6_type;
262 __u8 icmpv6_code;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800263};
Ben Cheng655a7c02013-10-16 16:09:24 -0700264struct ovs_key_arp {
Tao Baod7db5942015-01-28 10:07:51 -0800265 __be32 arp_sip;
266 __be32 arp_tip;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800267 __be16 arp_op;
Tao Baod7db5942015-01-28 10:07:51 -0800268 __u8 arp_sha[ETH_ALEN];
269 __u8 arp_tha[ETH_ALEN];
Christopher Ferris38062f92014-07-09 15:33:25 -0700270};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800271struct ovs_key_nd {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800272 __be32 nd_target[4];
Tao Baod7db5942015-01-28 10:07:51 -0800273 __u8 nd_sll[ETH_ALEN];
274 __u8 nd_tll[ETH_ALEN];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800275};
Christopher Ferris525ce912017-07-26 13:12:53 -0700276#define OVS_CT_LABELS_LEN_32 4
277#define OVS_CT_LABELS_LEN (OVS_CT_LABELS_LEN_32 * sizeof(__u32))
Christopher Ferris05d08e92016-02-04 13:16:38 -0800278struct ovs_key_ct_labels {
Christopher Ferris525ce912017-07-26 13:12:53 -0700279 union {
280 __u8 ct_labels[OVS_CT_LABELS_LEN];
281 __u32 ct_labels_32[OVS_CT_LABELS_LEN_32];
282 };
Christopher Ferris49f525c2016-12-12 14:55:36 -0800283};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800284#define OVS_CS_F_NEW 0x01
285#define OVS_CS_F_ESTABLISHED 0x02
286#define OVS_CS_F_RELATED 0x04
Christopher Ferris49f525c2016-12-12 14:55:36 -0800287#define OVS_CS_F_REPLY_DIR 0x08
Christopher Ferris05d08e92016-02-04 13:16:38 -0800288#define OVS_CS_F_INVALID 0x10
289#define OVS_CS_F_TRACKED 0x20
Christopher Ferris106b3a82016-08-24 12:15:38 -0700290#define OVS_CS_F_SRC_NAT 0x40
Christopher Ferris49f525c2016-12-12 14:55:36 -0800291#define OVS_CS_F_DST_NAT 0x80
Christopher Ferris106b3a82016-08-24 12:15:38 -0700292#define OVS_CS_F_NAT_MASK (OVS_CS_F_SRC_NAT | OVS_CS_F_DST_NAT)
Christopher Ferris525ce912017-07-26 13:12:53 -0700293struct ovs_key_ct_tuple_ipv4 {
294 __be32 ipv4_src;
295 __be32 ipv4_dst;
296 __be16 src_port;
297 __be16 dst_port;
298 __u8 ipv4_proto;
299};
300struct ovs_key_ct_tuple_ipv6 {
301 __be32 ipv6_src[4];
302 __be32 ipv6_dst[4];
303 __be16 src_port;
304 __be16 dst_port;
305 __u8 ipv6_proto;
306};
Christopher Ferris934ec942018-01-31 15:29:16 -0800307enum ovs_nsh_key_attr {
308 OVS_NSH_KEY_ATTR_UNSPEC,
309 OVS_NSH_KEY_ATTR_BASE,
310 OVS_NSH_KEY_ATTR_MD1,
311 OVS_NSH_KEY_ATTR_MD2,
312 __OVS_NSH_KEY_ATTR_MAX
313};
314#define OVS_NSH_KEY_ATTR_MAX (__OVS_NSH_KEY_ATTR_MAX - 1)
315struct ovs_nsh_key_base {
316 __u8 flags;
317 __u8 ttl;
318 __u8 mdtype;
319 __u8 np;
320 __be32 path_hdr;
321};
322#define NSH_MD1_CONTEXT_SIZE 4
323struct ovs_nsh_key_md1 {
324 __be32 context[NSH_MD1_CONTEXT_SIZE];
325};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700326enum ovs_flow_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800327 OVS_FLOW_ATTR_UNSPEC,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800328 OVS_FLOW_ATTR_KEY,
Tao Baod7db5942015-01-28 10:07:51 -0800329 OVS_FLOW_ATTR_ACTIONS,
Tao Baod7db5942015-01-28 10:07:51 -0800330 OVS_FLOW_ATTR_STATS,
331 OVS_FLOW_ATTR_TCP_FLAGS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800332 OVS_FLOW_ATTR_USED,
Tao Baod7db5942015-01-28 10:07:51 -0800333 OVS_FLOW_ATTR_CLEAR,
Tao Baod7db5942015-01-28 10:07:51 -0800334 OVS_FLOW_ATTR_MASK,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800335 OVS_FLOW_ATTR_PROBE,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800336 OVS_FLOW_ATTR_UFID,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700337 OVS_FLOW_ATTR_UFID_FLAGS,
338 OVS_FLOW_ATTR_PAD,
339 __OVS_FLOW_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800340};
Ben Cheng655a7c02013-10-16 16:09:24 -0700341#define OVS_FLOW_ATTR_MAX (__OVS_FLOW_ATTR_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800342#define OVS_UFID_F_OMIT_KEY (1 << 0)
343#define OVS_UFID_F_OMIT_MASK (1 << 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800344#define OVS_UFID_F_OMIT_ACTIONS (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700345enum ovs_sample_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800346 OVS_SAMPLE_ATTR_UNSPEC,
347 OVS_SAMPLE_ATTR_PROBABILITY,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800348 OVS_SAMPLE_ATTR_ACTIONS,
Tao Baod7db5942015-01-28 10:07:51 -0800349 __OVS_SAMPLE_ATTR_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -0700350};
351#define OVS_SAMPLE_ATTR_MAX (__OVS_SAMPLE_ATTR_MAX - 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800352enum ovs_userspace_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800353 OVS_USERSPACE_ATTR_UNSPEC,
354 OVS_USERSPACE_ATTR_PID,
355 OVS_USERSPACE_ATTR_USERDATA,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800356 OVS_USERSPACE_ATTR_EGRESS_TUN_PORT,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800357 OVS_USERSPACE_ATTR_ACTIONS,
Tao Baod7db5942015-01-28 10:07:51 -0800358 __OVS_USERSPACE_ATTR_MAX
Christopher Ferris05d08e92016-02-04 13:16:38 -0800359};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800360#define OVS_USERSPACE_ATTR_MAX (__OVS_USERSPACE_ATTR_MAX - 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800361struct ovs_action_trunc {
362 __u32 max_len;
363};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800364struct ovs_action_push_mpls {
365 __be32 mpls_lse;
366 __be16 mpls_ethertype;
Ben Cheng655a7c02013-10-16 16:09:24 -0700367};
Ben Cheng655a7c02013-10-16 16:09:24 -0700368struct ovs_action_push_vlan {
Tao Baod7db5942015-01-28 10:07:51 -0800369 __be16 vlan_tpid;
Tao Baod7db5942015-01-28 10:07:51 -0800370 __be16 vlan_tci;
Ben Cheng655a7c02013-10-16 16:09:24 -0700371};
Christopher Ferris82d75042015-01-26 10:57:07 -0800372enum ovs_hash_alg {
Tao Baod7db5942015-01-28 10:07:51 -0800373 OVS_HASH_ALG_L4,
Christopher Ferris82d75042015-01-26 10:57:07 -0800374};
375struct ovs_action_hash {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800376 __u32 hash_alg;
377 __u32 hash_basis;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800378};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800379enum ovs_ct_attr {
380 OVS_CT_ATTR_UNSPEC,
381 OVS_CT_ATTR_COMMIT,
382 OVS_CT_ATTR_ZONE,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800383 OVS_CT_ATTR_MARK,
384 OVS_CT_ATTR_LABELS,
385 OVS_CT_ATTR_HELPER,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700386 OVS_CT_ATTR_NAT,
Christopher Ferris525ce912017-07-26 13:12:53 -0700387 OVS_CT_ATTR_FORCE_COMMIT,
388 OVS_CT_ATTR_EVENTMASK,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700389 OVS_CT_ATTR_TIMEOUT,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800390 __OVS_CT_ATTR_MAX
Christopher Ferris82d75042015-01-26 10:57:07 -0800391};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800392#define OVS_CT_ATTR_MAX (__OVS_CT_ATTR_MAX - 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700393enum ovs_nat_attr {
394 OVS_NAT_ATTR_UNSPEC,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700395 OVS_NAT_ATTR_SRC,
396 OVS_NAT_ATTR_DST,
397 OVS_NAT_ATTR_IP_MIN,
398 OVS_NAT_ATTR_IP_MAX,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700399 OVS_NAT_ATTR_PROTO_MIN,
400 OVS_NAT_ATTR_PROTO_MAX,
401 OVS_NAT_ATTR_PERSISTENT,
402 OVS_NAT_ATTR_PROTO_HASH,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700403 OVS_NAT_ATTR_PROTO_RANDOM,
404 __OVS_NAT_ATTR_MAX,
405};
406#define OVS_NAT_ATTR_MAX (__OVS_NAT_ATTR_MAX - 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800407struct ovs_action_push_eth {
408 struct ovs_key_ethernet addresses;
409};
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700410enum ovs_check_pkt_len_attr {
411 OVS_CHECK_PKT_LEN_ATTR_UNSPEC,
412 OVS_CHECK_PKT_LEN_ATTR_PKT_LEN,
413 OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_GREATER,
414 OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_LESS_EQUAL,
415 __OVS_CHECK_PKT_LEN_ATTR_MAX,
416};
417#define OVS_CHECK_PKT_LEN_ATTR_MAX (__OVS_CHECK_PKT_LEN_ATTR_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700418enum ovs_action_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800419 OVS_ACTION_ATTR_UNSPEC,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800420 OVS_ACTION_ATTR_OUTPUT,
Tao Baod7db5942015-01-28 10:07:51 -0800421 OVS_ACTION_ATTR_USERSPACE,
422 OVS_ACTION_ATTR_SET,
423 OVS_ACTION_ATTR_PUSH_VLAN,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800424 OVS_ACTION_ATTR_POP_VLAN,
Tao Baod7db5942015-01-28 10:07:51 -0800425 OVS_ACTION_ATTR_SAMPLE,
426 OVS_ACTION_ATTR_RECIRC,
427 OVS_ACTION_ATTR_HASH,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800428 OVS_ACTION_ATTR_PUSH_MPLS,
429 OVS_ACTION_ATTR_POP_MPLS,
430 OVS_ACTION_ATTR_SET_MASKED,
431 OVS_ACTION_ATTR_CT,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800432 OVS_ACTION_ATTR_TRUNC,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800433 OVS_ACTION_ATTR_PUSH_ETH,
434 OVS_ACTION_ATTR_POP_ETH,
Christopher Ferris934ec942018-01-31 15:29:16 -0800435 OVS_ACTION_ATTR_CT_CLEAR,
436 OVS_ACTION_ATTR_PUSH_NSH,
437 OVS_ACTION_ATTR_POP_NSH,
438 OVS_ACTION_ATTR_METER,
Christopher Ferris9ce28842018-10-25 12:11:39 -0700439 OVS_ACTION_ATTR_CLONE,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700440 OVS_ACTION_ATTR_CHECK_PKT_LEN,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800441 __OVS_ACTION_ATTR_MAX,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800442};
Ben Cheng655a7c02013-10-16 16:09:24 -0700443#define OVS_ACTION_ATTR_MAX (__OVS_ACTION_ATTR_MAX - 1)
Christopher Ferris934ec942018-01-31 15:29:16 -0800444#define OVS_METER_FAMILY "ovs_meter"
445#define OVS_METER_MCGROUP "ovs_meter"
446#define OVS_METER_VERSION 0x1
447enum ovs_meter_cmd {
448 OVS_METER_CMD_UNSPEC,
449 OVS_METER_CMD_FEATURES,
450 OVS_METER_CMD_SET,
451 OVS_METER_CMD_DEL,
452 OVS_METER_CMD_GET
453};
454enum ovs_meter_attr {
455 OVS_METER_ATTR_UNSPEC,
456 OVS_METER_ATTR_ID,
457 OVS_METER_ATTR_KBPS,
458 OVS_METER_ATTR_STATS,
459 OVS_METER_ATTR_BANDS,
460 OVS_METER_ATTR_USED,
461 OVS_METER_ATTR_CLEAR,
462 OVS_METER_ATTR_MAX_METERS,
463 OVS_METER_ATTR_MAX_BANDS,
464 OVS_METER_ATTR_PAD,
465 __OVS_METER_ATTR_MAX
466};
467#define OVS_METER_ATTR_MAX (__OVS_METER_ATTR_MAX - 1)
468enum ovs_band_attr {
469 OVS_BAND_ATTR_UNSPEC,
470 OVS_BAND_ATTR_TYPE,
471 OVS_BAND_ATTR_RATE,
472 OVS_BAND_ATTR_BURST,
473 OVS_BAND_ATTR_STATS,
474 __OVS_BAND_ATTR_MAX
475};
476#define OVS_BAND_ATTR_MAX (__OVS_BAND_ATTR_MAX - 1)
477enum ovs_meter_band_type {
478 OVS_METER_BAND_TYPE_UNSPEC,
479 OVS_METER_BAND_TYPE_DROP,
480 __OVS_METER_BAND_TYPE_MAX
481};
482#define OVS_METER_BAND_TYPE_MAX (__OVS_METER_BAND_TYPE_MAX - 1)
Christopher Ferris9ce28842018-10-25 12:11:39 -0700483#define OVS_CT_LIMIT_FAMILY "ovs_ct_limit"
484#define OVS_CT_LIMIT_MCGROUP "ovs_ct_limit"
485#define OVS_CT_LIMIT_VERSION 0x1
486enum ovs_ct_limit_cmd {
487 OVS_CT_LIMIT_CMD_UNSPEC,
488 OVS_CT_LIMIT_CMD_SET,
489 OVS_CT_LIMIT_CMD_DEL,
490 OVS_CT_LIMIT_CMD_GET
491};
492enum ovs_ct_limit_attr {
493 OVS_CT_LIMIT_ATTR_UNSPEC,
494 OVS_CT_LIMIT_ATTR_ZONE_LIMIT,
495 __OVS_CT_LIMIT_ATTR_MAX
496};
497#define OVS_CT_LIMIT_ATTR_MAX (__OVS_CT_LIMIT_ATTR_MAX - 1)
498#define OVS_ZONE_LIMIT_DEFAULT_ZONE - 1
499struct ovs_zone_limit {
500 int zone_id;
501 __u32 limit;
502 __u32 count;
503};
Ben Cheng655a7c02013-10-16 16:09:24 -0700504#endif