blob: d45f4fad42be2eaa4a155c1d484c9315286186db [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Ben Cheng655a7c02013-10-16 16:09:24 -07007#ifndef _UAPI__LINUX_OPENVSWITCH_H
8#define _UAPI__LINUX_OPENVSWITCH_H 1
9#include <linux/types.h>
10#include <linux/if_ether.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070011struct ovs_header {
Tao Baod7db5942015-01-28 10:07:51 -080012 int dp_ifindex;
Ben Cheng655a7c02013-10-16 16:09:24 -070013};
14#define OVS_DATAPATH_FAMILY "ovs_datapath"
Ben Cheng655a7c02013-10-16 16:09:24 -070015#define OVS_DATAPATH_MCGROUP "ovs_datapath"
Christopher Ferris38062f92014-07-09 15:33:25 -070016#define OVS_DATAPATH_VERSION 2
17#define OVS_DP_VER_FEATURES 2
Ben Cheng655a7c02013-10-16 16:09:24 -070018enum ovs_datapath_cmd {
Tao Baod7db5942015-01-28 10:07:51 -080019 OVS_DP_CMD_UNSPEC,
20 OVS_DP_CMD_NEW,
21 OVS_DP_CMD_DEL,
22 OVS_DP_CMD_GET,
Tao Baod7db5942015-01-28 10:07:51 -080023 OVS_DP_CMD_SET
Ben Cheng655a7c02013-10-16 16:09:24 -070024};
25enum ovs_datapath_attr {
Tao Baod7db5942015-01-28 10:07:51 -080026 OVS_DP_ATTR_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -080027 OVS_DP_ATTR_NAME,
28 OVS_DP_ATTR_UPCALL_PID,
29 OVS_DP_ATTR_STATS,
30 OVS_DP_ATTR_MEGAFLOW_STATS,
Tao Baod7db5942015-01-28 10:07:51 -080031 OVS_DP_ATTR_USER_FEATURES,
Christopher Ferris106b3a82016-08-24 12:15:38 -070032 OVS_DP_ATTR_PAD,
Christopher Ferris25c18d42020-10-14 17:42:58 -070033 OVS_DP_ATTR_MASKS_CACHE_SIZE,
Christopher Ferris2abfa9e2021-11-01 16:26:06 -070034 OVS_DP_ATTR_PER_CPU_PIDS,
Christopher Ferris6cd53a52022-12-12 23:39:16 +000035 OVS_DP_ATTR_IFINDEX,
Tao Baod7db5942015-01-28 10:07:51 -080036 __OVS_DP_ATTR_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -070037};
Christopher Ferris106b3a82016-08-24 12:15:38 -070038#define OVS_DP_ATTR_MAX (__OVS_DP_ATTR_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070039struct ovs_dp_stats {
Tao Baod7db5942015-01-28 10:07:51 -080040 __u64 n_hit;
41 __u64 n_missed;
Christopher Ferris106b3a82016-08-24 12:15:38 -070042 __u64 n_lost;
Tao Baod7db5942015-01-28 10:07:51 -080043 __u64 n_flows;
Ben Cheng655a7c02013-10-16 16:09:24 -070044};
Christopher Ferris38062f92014-07-09 15:33:25 -070045struct ovs_dp_megaflow_stats {
Christopher Ferris106b3a82016-08-24 12:15:38 -070046 __u64 n_mask_hit;
Tao Baod7db5942015-01-28 10:07:51 -080047 __u32 n_masks;
48 __u32 pad0;
Christopher Ferris25c18d42020-10-14 17:42:58 -070049 __u64 n_cache_hit;
Tao Baod7db5942015-01-28 10:07:51 -080050 __u64 pad1;
Ben Cheng655a7c02013-10-16 16:09:24 -070051};
Christopher Ferris38062f92014-07-09 15:33:25 -070052struct ovs_vport_stats {
Tao Baod7db5942015-01-28 10:07:51 -080053 __u64 rx_packets;
Christopher Ferris106b3a82016-08-24 12:15:38 -070054 __u64 tx_packets;
Tao Baod7db5942015-01-28 10:07:51 -080055 __u64 rx_bytes;
56 __u64 tx_bytes;
57 __u64 rx_errors;
Christopher Ferris106b3a82016-08-24 12:15:38 -070058 __u64 tx_errors;
Tao Baod7db5942015-01-28 10:07:51 -080059 __u64 rx_dropped;
60 __u64 tx_dropped;
Christopher Ferris38062f92014-07-09 15:33:25 -070061};
Christopher Ferris106b3a82016-08-24 12:15:38 -070062#define OVS_DP_F_UNALIGNED (1 << 0)
Christopher Ferris82d75042015-01-26 10:57:07 -080063#define OVS_DP_F_VPORT_PIDS (1 << 1)
Christopher Ferris9584fa42019-12-09 15:36:13 -080064#define OVS_DP_F_TC_RECIRC_SHARING (1 << 2)
Christopher Ferris2abfa9e2021-11-01 16:26:06 -070065#define OVS_DP_F_DISPATCH_UPCALL_PER_CPU (1 << 3)
Tao Baod7db5942015-01-28 10:07:51 -080066#define OVSP_LOCAL ((__u32) 0)
Ben Cheng655a7c02013-10-16 16:09:24 -070067#define OVS_PACKET_FAMILY "ovs_packet"
Christopher Ferris106b3a82016-08-24 12:15:38 -070068#define OVS_PACKET_VERSION 0x1
Christopher Ferris82d75042015-01-26 10:57:07 -080069enum ovs_packet_cmd {
Tao Baod7db5942015-01-28 10:07:51 -080070 OVS_PACKET_CMD_UNSPEC,
71 OVS_PACKET_CMD_MISS,
Christopher Ferris106b3a82016-08-24 12:15:38 -070072 OVS_PACKET_CMD_ACTION,
Tao Baod7db5942015-01-28 10:07:51 -080073 OVS_PACKET_CMD_EXECUTE
Ben Cheng655a7c02013-10-16 16:09:24 -070074};
75enum ovs_packet_attr {
Christopher Ferris106b3a82016-08-24 12:15:38 -070076 OVS_PACKET_ATTR_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -080077 OVS_PACKET_ATTR_PACKET,
78 OVS_PACKET_ATTR_KEY,
79 OVS_PACKET_ATTR_ACTIONS,
Christopher Ferris106b3a82016-08-24 12:15:38 -070080 OVS_PACKET_ATTR_USERDATA,
Christopher Ferris05d08e92016-02-04 13:16:38 -080081 OVS_PACKET_ATTR_EGRESS_TUN_KEY,
82 OVS_PACKET_ATTR_UNUSED1,
83 OVS_PACKET_ATTR_UNUSED2,
Christopher Ferris106b3a82016-08-24 12:15:38 -070084 OVS_PACKET_ATTR_PROBE,
Christopher Ferris05d08e92016-02-04 13:16:38 -080085 OVS_PACKET_ATTR_MRU,
Christopher Ferris49f525c2016-12-12 14:55:36 -080086 OVS_PACKET_ATTR_LEN,
Christopher Ferrisd32ca142020-02-04 16:16:51 -080087 OVS_PACKET_ATTR_HASH,
Tao Baod7db5942015-01-28 10:07:51 -080088 __OVS_PACKET_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -080089};
Christopher Ferris106b3a82016-08-24 12:15:38 -070090#define OVS_PACKET_ATTR_MAX (__OVS_PACKET_ATTR_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -080091#define OVS_VPORT_FAMILY "ovs_vport"
Christopher Ferris82d75042015-01-26 10:57:07 -080092#define OVS_VPORT_MCGROUP "ovs_vport"
Christopher Ferris49f525c2016-12-12 14:55:36 -080093#define OVS_VPORT_VERSION 0x1
Christopher Ferris106b3a82016-08-24 12:15:38 -070094enum ovs_vport_cmd {
Christopher Ferris05d08e92016-02-04 13:16:38 -080095 OVS_VPORT_CMD_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -080096 OVS_VPORT_CMD_NEW,
Christopher Ferris49f525c2016-12-12 14:55:36 -080097 OVS_VPORT_CMD_DEL,
Christopher Ferris106b3a82016-08-24 12:15:38 -070098 OVS_VPORT_CMD_GET,
Christopher Ferris05d08e92016-02-04 13:16:38 -080099 OVS_VPORT_CMD_SET
Christopher Ferris82d75042015-01-26 10:57:07 -0800100};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800101enum ovs_vport_type {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700102 OVS_VPORT_TYPE_UNSPEC,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800103 OVS_VPORT_TYPE_NETDEV,
Tao Baod7db5942015-01-28 10:07:51 -0800104 OVS_VPORT_TYPE_INTERNAL,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800105 OVS_VPORT_TYPE_GRE,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700106 OVS_VPORT_TYPE_VXLAN,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800107 OVS_VPORT_TYPE_GENEVE,
Tao Baod7db5942015-01-28 10:07:51 -0800108 __OVS_VPORT_TYPE_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800109};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700110#define OVS_VPORT_TYPE_MAX (__OVS_VPORT_TYPE_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800111enum ovs_vport_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800112 OVS_VPORT_ATTR_UNSPEC,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800113 OVS_VPORT_ATTR_PORT_NO,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700114 OVS_VPORT_ATTR_TYPE,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800115 OVS_VPORT_ATTR_NAME,
Tao Baod7db5942015-01-28 10:07:51 -0800116 OVS_VPORT_ATTR_OPTIONS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800117 OVS_VPORT_ATTR_UPCALL_PID,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700118 OVS_VPORT_ATTR_STATS,
119 OVS_VPORT_ATTR_PAD,
Christopher Ferris934ec942018-01-31 15:29:16 -0800120 OVS_VPORT_ATTR_IFINDEX,
121 OVS_VPORT_ATTR_NETNSID,
Christopher Ferris8b7fdc92023-02-21 13:36:32 -0800122 OVS_VPORT_ATTR_UPCALL_STATS,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800123 __OVS_VPORT_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800124};
Ben Cheng655a7c02013-10-16 16:09:24 -0700125#define OVS_VPORT_ATTR_MAX (__OVS_VPORT_ATTR_MAX - 1)
Christopher Ferris8b7fdc92023-02-21 13:36:32 -0800126enum ovs_vport_upcall_attr {
127 OVS_VPORT_UPCALL_ATTR_SUCCESS,
128 OVS_VPORT_UPCALL_ATTR_FAIL,
129 __OVS_VPORT_UPCALL_ATTR_MAX
130};
131#define OVS_VPORT_UPCALL_ATTR_MAX (__OVS_VPORT_UPCALL_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 Ferris10a76e62022-06-08 13:31:52 -0700189 OVS_KEY_ATTR_PACKET_TYPE,
190 OVS_KEY_ATTR_ND_EXTENSIONS,
191 OVS_KEY_ATTR_TUNNEL_INFO,
192 OVS_KEY_ATTR_IPV6_EXTHDRS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800193 __OVS_KEY_ATTR_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700194};
195#define OVS_KEY_ATTR_MAX (__OVS_KEY_ATTR_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800196enum ovs_tunnel_key_attr {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800197 OVS_TUNNEL_KEY_ATTR_ID,
Tao Baod7db5942015-01-28 10:07:51 -0800198 OVS_TUNNEL_KEY_ATTR_IPV4_SRC,
199 OVS_TUNNEL_KEY_ATTR_IPV4_DST,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800200 OVS_TUNNEL_KEY_ATTR_TOS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800201 OVS_TUNNEL_KEY_ATTR_TTL,
Tao Baod7db5942015-01-28 10:07:51 -0800202 OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT,
203 OVS_TUNNEL_KEY_ATTR_CSUM,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800204 OVS_TUNNEL_KEY_ATTR_OAM,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800205 OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800206 OVS_TUNNEL_KEY_ATTR_TP_SRC,
207 OVS_TUNNEL_KEY_ATTR_TP_DST,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800208 OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800209 OVS_TUNNEL_KEY_ATTR_IPV6_SRC,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700210 OVS_TUNNEL_KEY_ATTR_IPV6_DST,
211 OVS_TUNNEL_KEY_ATTR_PAD,
Christopher Ferris76a1d452018-06-27 14:12:29 -0700212 OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700213 OVS_TUNNEL_KEY_ATTR_IPV4_INFO_BRIDGE,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700214 __OVS_TUNNEL_KEY_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800215};
Christopher Ferris38062f92014-07-09 15:33:25 -0700216#define OVS_TUNNEL_KEY_ATTR_MAX (__OVS_TUNNEL_KEY_ATTR_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700217enum ovs_frag_type {
Tao Baod7db5942015-01-28 10:07:51 -0800218 OVS_FRAG_TYPE_NONE,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800219 OVS_FRAG_TYPE_FIRST,
Tao Baod7db5942015-01-28 10:07:51 -0800220 OVS_FRAG_TYPE_LATER,
Tao Baod7db5942015-01-28 10:07:51 -0800221 __OVS_FRAG_TYPE_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -0700222};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800223#define OVS_FRAG_TYPE_MAX (__OVS_FRAG_TYPE_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700224struct ovs_key_ethernet {
Tao Baod7db5942015-01-28 10:07:51 -0800225 __u8 eth_src[ETH_ALEN];
226 __u8 eth_dst[ETH_ALEN];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800227};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800228struct ovs_key_mpls {
229 __be32 mpls_lse;
230};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800231struct ovs_key_ipv4 {
Tao Baod7db5942015-01-28 10:07:51 -0800232 __be32 ipv4_src;
233 __be32 ipv4_dst;
234 __u8 ipv4_proto;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800235 __u8 ipv4_tos;
Tao Baod7db5942015-01-28 10:07:51 -0800236 __u8 ipv4_ttl;
237 __u8 ipv4_frag;
Christopher Ferris38062f92014-07-09 15:33:25 -0700238};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800239struct ovs_key_ipv6 {
Tao Baod7db5942015-01-28 10:07:51 -0800240 __be32 ipv6_src[4];
241 __be32 ipv6_dst[4];
242 __be32 ipv6_label;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800243 __u8 ipv6_proto;
Tao Baod7db5942015-01-28 10:07:51 -0800244 __u8 ipv6_tclass;
245 __u8 ipv6_hlimit;
246 __u8 ipv6_frag;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800247};
Christopher Ferris10a76e62022-06-08 13:31:52 -0700248struct ovs_key_ipv6_exthdrs {
249 __u16 hdrs;
250};
Ben Cheng655a7c02013-10-16 16:09:24 -0700251struct ovs_key_tcp {
Tao Baod7db5942015-01-28 10:07:51 -0800252 __be16 tcp_src;
253 __be16 tcp_dst;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800254};
Ben Cheng655a7c02013-10-16 16:09:24 -0700255struct ovs_key_udp {
Tao Baod7db5942015-01-28 10:07:51 -0800256 __be16 udp_src;
257 __be16 udp_dst;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800258};
Christopher Ferris38062f92014-07-09 15:33:25 -0700259struct ovs_key_sctp {
Tao Baod7db5942015-01-28 10:07:51 -0800260 __be16 sctp_src;
261 __be16 sctp_dst;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800262};
Ben Cheng655a7c02013-10-16 16:09:24 -0700263struct ovs_key_icmp {
Tao Baod7db5942015-01-28 10:07:51 -0800264 __u8 icmp_type;
265 __u8 icmp_code;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800266};
Ben Cheng655a7c02013-10-16 16:09:24 -0700267struct ovs_key_icmpv6 {
Tao Baod7db5942015-01-28 10:07:51 -0800268 __u8 icmpv6_type;
269 __u8 icmpv6_code;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800270};
Ben Cheng655a7c02013-10-16 16:09:24 -0700271struct ovs_key_arp {
Tao Baod7db5942015-01-28 10:07:51 -0800272 __be32 arp_sip;
273 __be32 arp_tip;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800274 __be16 arp_op;
Tao Baod7db5942015-01-28 10:07:51 -0800275 __u8 arp_sha[ETH_ALEN];
276 __u8 arp_tha[ETH_ALEN];
Christopher Ferris38062f92014-07-09 15:33:25 -0700277};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800278struct ovs_key_nd {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800279 __be32 nd_target[4];
Tao Baod7db5942015-01-28 10:07:51 -0800280 __u8 nd_sll[ETH_ALEN];
281 __u8 nd_tll[ETH_ALEN];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800282};
Christopher Ferris525ce912017-07-26 13:12:53 -0700283#define OVS_CT_LABELS_LEN_32 4
284#define OVS_CT_LABELS_LEN (OVS_CT_LABELS_LEN_32 * sizeof(__u32))
Christopher Ferris05d08e92016-02-04 13:16:38 -0800285struct ovs_key_ct_labels {
Christopher Ferris525ce912017-07-26 13:12:53 -0700286 union {
287 __u8 ct_labels[OVS_CT_LABELS_LEN];
288 __u32 ct_labels_32[OVS_CT_LABELS_LEN_32];
289 };
Christopher Ferris49f525c2016-12-12 14:55:36 -0800290};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800291#define OVS_CS_F_NEW 0x01
292#define OVS_CS_F_ESTABLISHED 0x02
293#define OVS_CS_F_RELATED 0x04
Christopher Ferris49f525c2016-12-12 14:55:36 -0800294#define OVS_CS_F_REPLY_DIR 0x08
Christopher Ferris05d08e92016-02-04 13:16:38 -0800295#define OVS_CS_F_INVALID 0x10
296#define OVS_CS_F_TRACKED 0x20
Christopher Ferris106b3a82016-08-24 12:15:38 -0700297#define OVS_CS_F_SRC_NAT 0x40
Christopher Ferris49f525c2016-12-12 14:55:36 -0800298#define OVS_CS_F_DST_NAT 0x80
Christopher Ferris106b3a82016-08-24 12:15:38 -0700299#define OVS_CS_F_NAT_MASK (OVS_CS_F_SRC_NAT | OVS_CS_F_DST_NAT)
Christopher Ferris525ce912017-07-26 13:12:53 -0700300struct ovs_key_ct_tuple_ipv4 {
301 __be32 ipv4_src;
302 __be32 ipv4_dst;
303 __be16 src_port;
304 __be16 dst_port;
305 __u8 ipv4_proto;
306};
307struct ovs_key_ct_tuple_ipv6 {
308 __be32 ipv6_src[4];
309 __be32 ipv6_dst[4];
310 __be16 src_port;
311 __be16 dst_port;
312 __u8 ipv6_proto;
313};
Christopher Ferris934ec942018-01-31 15:29:16 -0800314enum ovs_nsh_key_attr {
315 OVS_NSH_KEY_ATTR_UNSPEC,
316 OVS_NSH_KEY_ATTR_BASE,
317 OVS_NSH_KEY_ATTR_MD1,
318 OVS_NSH_KEY_ATTR_MD2,
319 __OVS_NSH_KEY_ATTR_MAX
320};
321#define OVS_NSH_KEY_ATTR_MAX (__OVS_NSH_KEY_ATTR_MAX - 1)
322struct ovs_nsh_key_base {
323 __u8 flags;
324 __u8 ttl;
325 __u8 mdtype;
326 __u8 np;
327 __be32 path_hdr;
328};
329#define NSH_MD1_CONTEXT_SIZE 4
330struct ovs_nsh_key_md1 {
331 __be32 context[NSH_MD1_CONTEXT_SIZE];
332};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700333enum ovs_flow_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800334 OVS_FLOW_ATTR_UNSPEC,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800335 OVS_FLOW_ATTR_KEY,
Tao Baod7db5942015-01-28 10:07:51 -0800336 OVS_FLOW_ATTR_ACTIONS,
Tao Baod7db5942015-01-28 10:07:51 -0800337 OVS_FLOW_ATTR_STATS,
338 OVS_FLOW_ATTR_TCP_FLAGS,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800339 OVS_FLOW_ATTR_USED,
Tao Baod7db5942015-01-28 10:07:51 -0800340 OVS_FLOW_ATTR_CLEAR,
Tao Baod7db5942015-01-28 10:07:51 -0800341 OVS_FLOW_ATTR_MASK,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800342 OVS_FLOW_ATTR_PROBE,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800343 OVS_FLOW_ATTR_UFID,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700344 OVS_FLOW_ATTR_UFID_FLAGS,
345 OVS_FLOW_ATTR_PAD,
346 __OVS_FLOW_ATTR_MAX
Christopher Ferris49f525c2016-12-12 14:55:36 -0800347};
Ben Cheng655a7c02013-10-16 16:09:24 -0700348#define OVS_FLOW_ATTR_MAX (__OVS_FLOW_ATTR_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800349#define OVS_UFID_F_OMIT_KEY (1 << 0)
350#define OVS_UFID_F_OMIT_MASK (1 << 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800351#define OVS_UFID_F_OMIT_ACTIONS (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700352enum ovs_sample_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800353 OVS_SAMPLE_ATTR_UNSPEC,
354 OVS_SAMPLE_ATTR_PROBABILITY,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800355 OVS_SAMPLE_ATTR_ACTIONS,
Tao Baod7db5942015-01-28 10:07:51 -0800356 __OVS_SAMPLE_ATTR_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -0700357};
358#define OVS_SAMPLE_ATTR_MAX (__OVS_SAMPLE_ATTR_MAX - 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800359enum ovs_userspace_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800360 OVS_USERSPACE_ATTR_UNSPEC,
361 OVS_USERSPACE_ATTR_PID,
362 OVS_USERSPACE_ATTR_USERDATA,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800363 OVS_USERSPACE_ATTR_EGRESS_TUN_PORT,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800364 OVS_USERSPACE_ATTR_ACTIONS,
Tao Baod7db5942015-01-28 10:07:51 -0800365 __OVS_USERSPACE_ATTR_MAX
Christopher Ferris05d08e92016-02-04 13:16:38 -0800366};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800367#define OVS_USERSPACE_ATTR_MAX (__OVS_USERSPACE_ATTR_MAX - 1)
Christopher Ferris49f525c2016-12-12 14:55:36 -0800368struct ovs_action_trunc {
369 __u32 max_len;
370};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800371struct ovs_action_push_mpls {
372 __be32 mpls_lse;
373 __be16 mpls_ethertype;
Ben Cheng655a7c02013-10-16 16:09:24 -0700374};
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700375struct ovs_action_add_mpls {
376 __be32 mpls_lse;
377 __be16 mpls_ethertype;
378 __u16 tun_flags;
379};
380#define OVS_MPLS_L3_TUNNEL_FLAG_MASK (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700381struct ovs_action_push_vlan {
Tao Baod7db5942015-01-28 10:07:51 -0800382 __be16 vlan_tpid;
Tao Baod7db5942015-01-28 10:07:51 -0800383 __be16 vlan_tci;
Ben Cheng655a7c02013-10-16 16:09:24 -0700384};
Christopher Ferris82d75042015-01-26 10:57:07 -0800385enum ovs_hash_alg {
Tao Baod7db5942015-01-28 10:07:51 -0800386 OVS_HASH_ALG_L4,
Christopher Ferris8666d042023-09-06 14:55:31 -0700387 OVS_HASH_ALG_SYM_L4,
Christopher Ferris82d75042015-01-26 10:57:07 -0800388};
389struct ovs_action_hash {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800390 __u32 hash_alg;
391 __u32 hash_basis;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800392};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800393enum ovs_ct_attr {
394 OVS_CT_ATTR_UNSPEC,
395 OVS_CT_ATTR_COMMIT,
396 OVS_CT_ATTR_ZONE,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800397 OVS_CT_ATTR_MARK,
398 OVS_CT_ATTR_LABELS,
399 OVS_CT_ATTR_HELPER,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700400 OVS_CT_ATTR_NAT,
Christopher Ferris525ce912017-07-26 13:12:53 -0700401 OVS_CT_ATTR_FORCE_COMMIT,
402 OVS_CT_ATTR_EVENTMASK,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700403 OVS_CT_ATTR_TIMEOUT,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800404 __OVS_CT_ATTR_MAX
Christopher Ferris82d75042015-01-26 10:57:07 -0800405};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800406#define OVS_CT_ATTR_MAX (__OVS_CT_ATTR_MAX - 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700407enum ovs_nat_attr {
408 OVS_NAT_ATTR_UNSPEC,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700409 OVS_NAT_ATTR_SRC,
410 OVS_NAT_ATTR_DST,
411 OVS_NAT_ATTR_IP_MIN,
412 OVS_NAT_ATTR_IP_MAX,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700413 OVS_NAT_ATTR_PROTO_MIN,
414 OVS_NAT_ATTR_PROTO_MAX,
415 OVS_NAT_ATTR_PERSISTENT,
416 OVS_NAT_ATTR_PROTO_HASH,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700417 OVS_NAT_ATTR_PROTO_RANDOM,
418 __OVS_NAT_ATTR_MAX,
419};
420#define OVS_NAT_ATTR_MAX (__OVS_NAT_ATTR_MAX - 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800421struct ovs_action_push_eth {
422 struct ovs_key_ethernet addresses;
423};
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700424enum ovs_check_pkt_len_attr {
425 OVS_CHECK_PKT_LEN_ATTR_UNSPEC,
426 OVS_CHECK_PKT_LEN_ATTR_PKT_LEN,
427 OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_GREATER,
428 OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_LESS_EQUAL,
429 __OVS_CHECK_PKT_LEN_ATTR_MAX,
430};
431#define OVS_CHECK_PKT_LEN_ATTR_MAX (__OVS_CHECK_PKT_LEN_ATTR_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700432enum ovs_action_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800433 OVS_ACTION_ATTR_UNSPEC,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800434 OVS_ACTION_ATTR_OUTPUT,
Tao Baod7db5942015-01-28 10:07:51 -0800435 OVS_ACTION_ATTR_USERSPACE,
436 OVS_ACTION_ATTR_SET,
437 OVS_ACTION_ATTR_PUSH_VLAN,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800438 OVS_ACTION_ATTR_POP_VLAN,
Tao Baod7db5942015-01-28 10:07:51 -0800439 OVS_ACTION_ATTR_SAMPLE,
440 OVS_ACTION_ATTR_RECIRC,
441 OVS_ACTION_ATTR_HASH,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800442 OVS_ACTION_ATTR_PUSH_MPLS,
443 OVS_ACTION_ATTR_POP_MPLS,
444 OVS_ACTION_ATTR_SET_MASKED,
445 OVS_ACTION_ATTR_CT,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800446 OVS_ACTION_ATTR_TRUNC,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800447 OVS_ACTION_ATTR_PUSH_ETH,
448 OVS_ACTION_ATTR_POP_ETH,
Christopher Ferris934ec942018-01-31 15:29:16 -0800449 OVS_ACTION_ATTR_CT_CLEAR,
450 OVS_ACTION_ATTR_PUSH_NSH,
451 OVS_ACTION_ATTR_POP_NSH,
452 OVS_ACTION_ATTR_METER,
Christopher Ferris9ce28842018-10-25 12:11:39 -0700453 OVS_ACTION_ATTR_CLONE,
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700454 OVS_ACTION_ATTR_CHECK_PKT_LEN,
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700455 OVS_ACTION_ATTR_ADD_MPLS,
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700456 OVS_ACTION_ATTR_DEC_TTL,
Christopher Ferris67d1e5e2023-10-31 13:36:37 -0700457 OVS_ACTION_ATTR_DROP,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800458 __OVS_ACTION_ATTR_MAX,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800459};
Ben Cheng655a7c02013-10-16 16:09:24 -0700460#define OVS_ACTION_ATTR_MAX (__OVS_ACTION_ATTR_MAX - 1)
Christopher Ferris934ec942018-01-31 15:29:16 -0800461#define OVS_METER_FAMILY "ovs_meter"
462#define OVS_METER_MCGROUP "ovs_meter"
463#define OVS_METER_VERSION 0x1
464enum ovs_meter_cmd {
465 OVS_METER_CMD_UNSPEC,
466 OVS_METER_CMD_FEATURES,
467 OVS_METER_CMD_SET,
468 OVS_METER_CMD_DEL,
469 OVS_METER_CMD_GET
470};
471enum ovs_meter_attr {
472 OVS_METER_ATTR_UNSPEC,
473 OVS_METER_ATTR_ID,
474 OVS_METER_ATTR_KBPS,
475 OVS_METER_ATTR_STATS,
476 OVS_METER_ATTR_BANDS,
477 OVS_METER_ATTR_USED,
478 OVS_METER_ATTR_CLEAR,
479 OVS_METER_ATTR_MAX_METERS,
480 OVS_METER_ATTR_MAX_BANDS,
481 OVS_METER_ATTR_PAD,
482 __OVS_METER_ATTR_MAX
483};
484#define OVS_METER_ATTR_MAX (__OVS_METER_ATTR_MAX - 1)
485enum ovs_band_attr {
486 OVS_BAND_ATTR_UNSPEC,
487 OVS_BAND_ATTR_TYPE,
488 OVS_BAND_ATTR_RATE,
489 OVS_BAND_ATTR_BURST,
490 OVS_BAND_ATTR_STATS,
491 __OVS_BAND_ATTR_MAX
492};
493#define OVS_BAND_ATTR_MAX (__OVS_BAND_ATTR_MAX - 1)
494enum ovs_meter_band_type {
495 OVS_METER_BAND_TYPE_UNSPEC,
496 OVS_METER_BAND_TYPE_DROP,
497 __OVS_METER_BAND_TYPE_MAX
498};
499#define OVS_METER_BAND_TYPE_MAX (__OVS_METER_BAND_TYPE_MAX - 1)
Christopher Ferris9ce28842018-10-25 12:11:39 -0700500#define OVS_CT_LIMIT_FAMILY "ovs_ct_limit"
501#define OVS_CT_LIMIT_MCGROUP "ovs_ct_limit"
502#define OVS_CT_LIMIT_VERSION 0x1
503enum ovs_ct_limit_cmd {
504 OVS_CT_LIMIT_CMD_UNSPEC,
505 OVS_CT_LIMIT_CMD_SET,
506 OVS_CT_LIMIT_CMD_DEL,
507 OVS_CT_LIMIT_CMD_GET
508};
509enum ovs_ct_limit_attr {
510 OVS_CT_LIMIT_ATTR_UNSPEC,
511 OVS_CT_LIMIT_ATTR_ZONE_LIMIT,
512 __OVS_CT_LIMIT_ATTR_MAX
513};
514#define OVS_CT_LIMIT_ATTR_MAX (__OVS_CT_LIMIT_ATTR_MAX - 1)
515#define OVS_ZONE_LIMIT_DEFAULT_ZONE - 1
516struct ovs_zone_limit {
517 int zone_id;
518 __u32 limit;
519 __u32 count;
520};
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700521enum ovs_dec_ttl_attr {
522 OVS_DEC_TTL_ATTR_UNSPEC,
523 OVS_DEC_TTL_ATTR_ACTION,
524 __OVS_DEC_TTL_ATTR_MAX
525};
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800526#define OVS_DEC_TTL_ATTR_MAX (__OVS_DEC_TTL_ATTR_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700527#endif