1 /* SPDX-License-Identifier: LGPL-2.1-or-later
2  * Copyright © 2020 VMware, Inc. */
3 #pragma once
4 
5 typedef struct BareUDP BareUDP;
6 
7 #include <linux/if_ether.h>
8 
9 #include "conf-parser.h"
10 #include "netdev.h"
11 
12 typedef enum BareUDPProtocol {
13         BARE_UDP_PROTOCOL_IPV4    = ETH_P_IP,
14         BARE_UDP_PROTOCOL_IPV6    = ETH_P_IPV6,
15         BARE_UDP_PROTOCOL_MPLS_UC = ETH_P_MPLS_UC,
16         BARE_UDP_PROTOCOL_MPLS_MC = ETH_P_MPLS_MC,
17         _BARE_UDP_PROTOCOL_MAX,
18         _BARE_UDP_PROTOCOL_INVALID = -EINVAL,
19 } BareUDPProtocol;
20 
21 struct BareUDP {
22         NetDev meta;
23 
24         BareUDPProtocol iftype;
25         uint16_t dest_port;
26 };
27 
28 DEFINE_NETDEV_CAST(BAREUDP, BareUDP);
29 extern const NetDevVTable bare_udp_vtable;
30 
31 const char *bare_udp_protocol_to_string(BareUDPProtocol d) _const_;
32 BareUDPProtocol bare_udp_protocol_from_string(const char *d) _pure_;
33 
34 CONFIG_PARSER_PROTOTYPE(config_parse_bare_udp_iftype);
35