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_MAX, 38 }; 39 40 #define TCA_TUNNEL_KEY_MAX (__TCA_TUNNEL_KEY_MAX - 1) 41 42 enum { 43 TCA_TUNNEL_KEY_ENC_OPTS_UNSPEC, 44 TCA_TUNNEL_KEY_ENC_OPTS_GENEVE, /* Nested 45 * TCA_TUNNEL_KEY_ENC_OPTS_ 46 * attributes 47 */ 48 TCA_TUNNEL_KEY_ENC_OPTS_VXLAN, /* Nested 49 * TCA_TUNNEL_KEY_ENC_OPTS_ 50 * attributes 51 */ 52 TCA_TUNNEL_KEY_ENC_OPTS_ERSPAN, /* Nested 53 * TCA_TUNNEL_KEY_ENC_OPTS_ 54 * attributes 55 */ 56 __TCA_TUNNEL_KEY_ENC_OPTS_MAX, 57 }; 58 59 #define TCA_TUNNEL_KEY_ENC_OPTS_MAX (__TCA_TUNNEL_KEY_ENC_OPTS_MAX - 1) 60 61 enum { 62 TCA_TUNNEL_KEY_ENC_OPT_GENEVE_UNSPEC, 63 TCA_TUNNEL_KEY_ENC_OPT_GENEVE_CLASS, /* be16 */ 64 TCA_TUNNEL_KEY_ENC_OPT_GENEVE_TYPE, /* u8 */ 65 TCA_TUNNEL_KEY_ENC_OPT_GENEVE_DATA, /* 4 to 128 bytes */ 66 67 __TCA_TUNNEL_KEY_ENC_OPT_GENEVE_MAX, 68 }; 69 70 #define TCA_TUNNEL_KEY_ENC_OPT_GENEVE_MAX \ 71 (__TCA_TUNNEL_KEY_ENC_OPT_GENEVE_MAX - 1) 72 73 enum { 74 TCA_TUNNEL_KEY_ENC_OPT_VXLAN_UNSPEC, 75 TCA_TUNNEL_KEY_ENC_OPT_VXLAN_GBP, /* u32 */ 76 __TCA_TUNNEL_KEY_ENC_OPT_VXLAN_MAX, 77 }; 78 79 #define TCA_TUNNEL_KEY_ENC_OPT_VXLAN_MAX \ 80 (__TCA_TUNNEL_KEY_ENC_OPT_VXLAN_MAX - 1) 81 82 enum { 83 TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_UNSPEC, 84 TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_VER, /* u8 */ 85 TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_INDEX, /* be32 */ 86 TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_DIR, /* u8 */ 87 TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_HWID, /* u8 */ 88 __TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_MAX, 89 }; 90 91 #define TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_MAX \ 92 (__TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_MAX - 1) 93 94 #endif 95