Files
systemd/src/network/netdev/bareudp.h
T
Zbigniew Jędrzejewski-Szmek 2d93c20e5f tree-wide: use -EINVAL for enum invalid values
As suggested in https://github.com/systemd/systemd/pull/11484#issuecomment-775288617.

This does not touch anything exposed in src/systemd. Changing the defines there
would be a compatibility break.

Note that tests are broken after this commit. They will be fixed in the next one.
2021-02-10 14:46:59 +01:00

35 lines
908 B
C

/* SPDX-License-Identifier: LGPL-2.1-or-later
* Copyright © 2020 VMware, Inc. */
#pragma once
typedef struct BareUDP BareUDP;
#include <linux/if_ether.h>
#include "conf-parser.h"
#include "netdev.h"
typedef enum BareUDPProtocol {
BARE_UDP_PROTOCOL_IPV4 = ETH_P_IP,
BARE_UDP_PROTOCOL_IPV6 = ETH_P_IPV6,
BARE_UDP_PROTOCOL_MPLS_UC = ETH_P_MPLS_UC,
BARE_UDP_PROTOCOL_MPLS_MC = ETH_P_MPLS_MC,
_BARE_UDP_PROTOCOL_MAX,
_BARE_UDP_PROTOCOL_INVALID = -EINVAL,
} BareUDPProtocol;
struct BareUDP {
NetDev meta;
BareUDPProtocol iftype;
uint16_t dest_port;
};
DEFINE_NETDEV_CAST(BAREUDP, BareUDP);
extern const NetDevVTable bare_udp_vtable;
const char *bare_udp_protocol_to_string(BareUDPProtocol d) _const_;
BareUDPProtocol bare_udp_protocol_from_string(const char *d) _pure_;
CONFIG_PARSER_PROTOTYPE(config_parse_bare_udp_iftype);