1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ 2 /* 3 * Copyright (c) 2016, Amir Vadai <amir@vadai.me> 4 * Copyright (c) 2016, Mellanox Technologies. All rights reserved. 5 */ 6 7 #ifndef __LINUX_TC_TUNNEL_KEY_H 8 #define __LINUX_TC_TUNNEL_KEY_H 9 10 #include <linux/pkt_cls.h> 11 12 #define TCA_TUNNEL_KEY_ACT_SET 1 13 #define TCA_TUNNEL_KEY_ACT_RELEASE 2 14 15 struct tc_tunnel_key { 16 tc_gen; 17 int t_action; 18 }; 19 20 enum { 21 TCA_TUNNEL_KEY_UNSPEC, 22 TCA_TUNNEL_KEY_TM, 23 TCA_TUNNEL_KEY_PARMS, 24 TCA_TUNNEL_KEY_ENC_IPV4_SRC, /* be32 */ 25 TCA_TUNNEL_KEY_ENC_IPV4_DST, /* be32 */ 26 TCA_TUNNEL_KEY_ENC_IPV6_SRC, /* struct in6_addr */ 27 TCA_TUNNEL_KEY_ENC_IPV6_DST, /* struct in6_addr */ 28 TCA_TUNNEL_KEY_ENC_KEY_ID, /* be64 */ 29 TCA_TUNNEL_KEY_PAD, 30 TCA_TUNNEL_KEY_ENC_DST_PORT, /* be16 */ 31 TCA_TUNNEL_KEY_NO_CSUM, /* u8 */ 32 TCA_TUNNEL_KEY_ENC_OPTS, /* Nested TCA_TUNNEL_KEY_ENC_OPTS_ 33 * attributes 34 */ 35 TCA_TUNNEL_KEY_ENC_TOS, /* u8 */ 36 TCA_TUNNEL_KEY_ENC_TTL, /* u8 */ 37 TCA_TUNNEL_KEY_NO_FRAG, /* flag */ 38 __TCA_TUNNEL_KEY_MAX, 39 }; 40 41 #define TCA_TUNNEL_KEY_MAX (__TCA_TUNNEL_KEY_MAX - 1) 42 43 enum { 44 TCA_TUNNEL_KEY_ENC_OPTS_UNSPEC, 45 TCA_TUNNEL_KEY_ENC_OPTS_GENEVE, /* Nested 46 * TCA_TUNNEL_KEY_ENC_OPTS_ 47 * attributes 48 */ 49 TCA_TUNNEL_KEY_ENC_OPTS_VXLAN, /* Nested 50 * TCA_TUNNEL_KEY_ENC_OPTS_ 51 * attributes 52 */ 53 TCA_TUNNEL_KEY_ENC_OPTS_ERSPAN, /* Nested 54 * TCA_TUNNEL_KEY_ENC_OPTS_ 55 * attributes 56 */ 57 __TCA_TUNNEL_KEY_ENC_OPTS_MAX, 58 }; 59 60 #define TCA_TUNNEL_KEY_ENC_OPTS_MAX (__TCA_TUNNEL_KEY_ENC_OPTS_MAX - 1) 61 62 enum { 63 TCA_TUNNEL_KEY_ENC_OPT_GENEVE_UNSPEC, 64 TCA_TUNNEL_KEY_ENC_OPT_GENEVE_CLASS, /* be16 */ 65 TCA_TUNNEL_KEY_ENC_OPT_GENEVE_TYPE, /* u8 */ 66 TCA_TUNNEL_KEY_ENC_OPT_GENEVE_DATA, /* 4 to 128 bytes */ 67 68 __TCA_TUNNEL_KEY_ENC_OPT_GENEVE_MAX, 69 }; 70 71 #define TCA_TUNNEL_KEY_ENC_OPT_GENEVE_MAX \ 72 (__TCA_TUNNEL_KEY_ENC_OPT_GENEVE_MAX - 1) 73 74 enum { 75 TCA_TUNNEL_KEY_ENC_OPT_VXLAN_UNSPEC, 76 TCA_TUNNEL_KEY_ENC_OPT_VXLAN_GBP, /* u32 */ 77 __TCA_TUNNEL_KEY_ENC_OPT_VXLAN_MAX, 78 }; 79 80 #define TCA_TUNNEL_KEY_ENC_OPT_VXLAN_MAX \ 81 (__TCA_TUNNEL_KEY_ENC_OPT_VXLAN_MAX - 1) 82 83 enum { 84 TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_UNSPEC, 85 TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_VER, /* u8 */ 86 TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_INDEX, /* be32 */ 87 TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_DIR, /* u8 */ 88 TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_HWID, /* u8 */ 89 __TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_MAX, 90 }; 91 92 #define TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_MAX \ 93 (__TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_MAX - 1) 94 95 #endif 96