Line data Source code
1 : /* SPDX-License-Identifier: LGPL-2.1+ */ 2 : #pragma once 3 : 4 : #include <netinet/in.h> 5 : #include <linux/if_link.h> 6 : 7 : #include "netdev/netdev.h" 8 : 9 : typedef enum IPVlanMode { 10 : NETDEV_IPVLAN_MODE_L2 = IPVLAN_MODE_L2, 11 : NETDEV_IPVLAN_MODE_L3 = IPVLAN_MODE_L3, 12 : NETDEV_IPVLAN_MODE_L3S = IPVLAN_MODE_L3S, 13 : _NETDEV_IPVLAN_MODE_MAX, 14 : _NETDEV_IPVLAN_MODE_INVALID = -1 15 : } IPVlanMode; 16 : 17 : typedef enum IPVlanFlags { 18 : NETDEV_IPVLAN_FLAGS_BRIGDE, 19 : NETDEV_IPVLAN_FLAGS_PRIVATE = IPVLAN_F_PRIVATE, 20 : NETDEV_IPVLAN_FLAGS_VEPA = IPVLAN_F_VEPA, 21 : _NETDEV_IPVLAN_FLAGS_MAX, 22 : _NETDEV_IPVLAN_FLAGS_INVALID = -1 23 : } IPVlanFlags; 24 : 25 : typedef struct IPVlan { 26 : NetDev meta; 27 : 28 : IPVlanMode mode; 29 : IPVlanFlags flags; 30 : } IPVlan; 31 : 32 0 : DEFINE_NETDEV_CAST(IPVLAN, IPVlan); 33 0 : DEFINE_NETDEV_CAST(IPVTAP, IPVlan); 34 : extern const NetDevVTable ipvlan_vtable; 35 : extern const NetDevVTable ipvtap_vtable; 36 : 37 : const char *ipvlan_mode_to_string(IPVlanMode d) _const_; 38 : IPVlanMode ipvlan_mode_from_string(const char *d) _pure_; 39 : 40 : const char *ipvlan_flags_to_string(IPVlanFlags d) _const_; 41 : IPVlanFlags ipvlan_flags_from_string(const char *d) _pure_; 42 : 43 : CONFIG_PARSER_PROTOTYPE(config_parse_ipvlan_mode); 44 : CONFIG_PARSER_PROTOTYPE(config_parse_ipvlan_flags); 45 : 46 : IPVlanMode link_get_ipvlan_mode(Link *link);