1/* SPDX-License-Identifier: GPL-2.0 */ 2#ifndef __NET_GENEVE_H 3#define __NET_GENEVE_H 1 4 5#include <net/udp_tunnel.h> 6 7/* Geneve Header: 8 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 9 * |Ver| Opt Len |O|C| Rsvd. | Protocol Type | 10 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 11 * | Virtual Network Identifier (VNI) | Reserved | 12 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 13 * | Variable Length Options | 14 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 15 * 16 * Option Header: 17 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 18 * | Option Class | Type |R|R|R| Length | 19 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 20 * | Variable Option Data | 21 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 22 */ 23 24struct geneve_opt { 25 __be16 opt_class; 26 u8 type; 27#ifdef __LITTLE_ENDIAN_BITFIELD 28 u8 length:5; 29 u8 r3:1; 30 u8 r2:1; 31 u8 r1:1; 32#else 33 u8 r1:1; 34 u8 r2:1; 35 u8 r3:1; 36 u8 length:5; 37#endif 38 u8 opt_data[]; 39}; 40 41#define GENEVE_CRIT_OPT_TYPE (1 << 7) 42 43struct genevehdr { 44#ifdef __LITTLE_ENDIAN_BITFIELD 45 u8 opt_len:6; 46 u8 ver:2; 47 u8 rsvd1:6; 48 u8 critical:1; 49 u8 oam:1; 50#else 51 u8 ver:2; 52 u8 opt_len:6; 53 u8 oam:1; 54 u8 critical:1; 55 u8 rsvd1:6; 56#endif 57 __be16 proto_type; 58 u8 vni[3]; 59 u8 rsvd2; 60 struct geneve_opt options[]; 61}; 62 63#ifdef CONFIG_INET 64struct net_device *geneve_dev_create_fb(struct net *net, const char *name, 65 u8 name_assign_type, u16 dst_port); 66#endif /*ifdef CONFIG_INET */ 67 68#endif /*ifdef__NET_GENEVE_H */ 69