1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
3 
4 typedef struct Geneve Geneve;
5 
6 #include "in-addr-util.h"
7 #include "netdev.h"
8 #include "networkd-network.h"
9 
10 #define GENEVE_VID_MAX (1u << 24) - 1
11 
12 typedef enum GeneveDF {
13         NETDEV_GENEVE_DF_NO = GENEVE_DF_UNSET,
14         NETDEV_GENEVE_DF_YES = GENEVE_DF_SET,
15         NETDEV_GENEVE_DF_INHERIT = GENEVE_DF_INHERIT,
16         _NETDEV_GENEVE_DF_MAX,
17         _NETDEV_GENEVE_DF_INVALID = -EINVAL,
18 } GeneveDF;
19 
20 struct Geneve {
21         NetDev meta;
22 
23         uint32_t id;
24         uint32_t flow_label;
25 
26         int remote_family;
27 
28         uint8_t tos;
29         uint8_t ttl;
30 
31         uint16_t dest_port;
32 
33         bool udpcsum;
34         bool udp6zerocsumtx;
35         bool udp6zerocsumrx;
36         bool inherit;
37 
38         GeneveDF geneve_df;
39         union in_addr_union remote;
40 };
41 
42 DEFINE_NETDEV_CAST(GENEVE, Geneve);
43 extern const NetDevVTable geneve_vtable;
44 
45 const char *geneve_df_to_string(GeneveDF d) _const_;
46 GeneveDF geneve_df_from_string(const char *d) _pure_;
47 
48 CONFIG_PARSER_PROTOTYPE(config_parse_geneve_vni);
49 CONFIG_PARSER_PROTOTYPE(config_parse_geneve_address);
50 CONFIG_PARSER_PROTOTYPE(config_parse_geneve_flow_label);
51 CONFIG_PARSER_PROTOTYPE(config_parse_geneve_df);
52 CONFIG_PARSER_PROTOTYPE(config_parse_geneve_ttl);
53