Merge pull request #15166 from ssahani/networkctl-ipvlan
networkctl: Add support to display ipvlan
This commit is contained in:
@@ -4,25 +4,11 @@
|
||||
|
||||
#include "conf-parser.h"
|
||||
#include "ipvlan.h"
|
||||
#include "ipvlan-util.h"
|
||||
#include "networkd-link.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
|
||||
static const char* const ipvlan_mode_table[_NETDEV_IPVLAN_MODE_MAX] = {
|
||||
[NETDEV_IPVLAN_MODE_L2] = "L2",
|
||||
[NETDEV_IPVLAN_MODE_L3] = "L3",
|
||||
[NETDEV_IPVLAN_MODE_L3S] = "L3S",
|
||||
};
|
||||
|
||||
DEFINE_STRING_TABLE_LOOKUP(ipvlan_mode, IPVlanMode);
|
||||
DEFINE_CONFIG_PARSE_ENUM(config_parse_ipvlan_mode, ipvlan_mode, IPVlanMode, "Failed to parse ipvlan mode");
|
||||
|
||||
static const char* const ipvlan_flags_table[_NETDEV_IPVLAN_FLAGS_MAX] = {
|
||||
[NETDEV_IPVLAN_FLAGS_BRIGDE] = "bridge",
|
||||
[NETDEV_IPVLAN_FLAGS_PRIVATE] = "private",
|
||||
[NETDEV_IPVLAN_FLAGS_VEPA] = "vepa",
|
||||
};
|
||||
|
||||
DEFINE_STRING_TABLE_LOOKUP(ipvlan_flags, IPVlanFlags);
|
||||
DEFINE_CONFIG_PARSE_ENUM(config_parse_ipvlan_flags, ipvlan_flags, IPVlanFlags, "Failed to parse ipvlan flags");
|
||||
|
||||
static int netdev_ipvlan_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *req) {
|
||||
|
||||
@@ -4,24 +4,9 @@
|
||||
#include <netinet/in.h>
|
||||
#include <linux/if_link.h>
|
||||
|
||||
#include "ipvlan-util.h"
|
||||
#include "netdev.h"
|
||||
|
||||
typedef enum IPVlanMode {
|
||||
NETDEV_IPVLAN_MODE_L2 = IPVLAN_MODE_L2,
|
||||
NETDEV_IPVLAN_MODE_L3 = IPVLAN_MODE_L3,
|
||||
NETDEV_IPVLAN_MODE_L3S = IPVLAN_MODE_L3S,
|
||||
_NETDEV_IPVLAN_MODE_MAX,
|
||||
_NETDEV_IPVLAN_MODE_INVALID = -1
|
||||
} IPVlanMode;
|
||||
|
||||
typedef enum IPVlanFlags {
|
||||
NETDEV_IPVLAN_FLAGS_BRIGDE,
|
||||
NETDEV_IPVLAN_FLAGS_PRIVATE = IPVLAN_F_PRIVATE,
|
||||
NETDEV_IPVLAN_FLAGS_VEPA = IPVLAN_F_VEPA,
|
||||
_NETDEV_IPVLAN_FLAGS_MAX,
|
||||
_NETDEV_IPVLAN_FLAGS_INVALID = -1
|
||||
} IPVlanFlags;
|
||||
|
||||
typedef struct IPVlan {
|
||||
NetDev meta;
|
||||
|
||||
@@ -34,12 +19,6 @@ DEFINE_NETDEV_CAST(IPVTAP, IPVlan);
|
||||
extern const NetDevVTable ipvlan_vtable;
|
||||
extern const NetDevVTable ipvtap_vtable;
|
||||
|
||||
const char *ipvlan_mode_to_string(IPVlanMode d) _const_;
|
||||
IPVlanMode ipvlan_mode_from_string(const char *d) _pure_;
|
||||
|
||||
const char *ipvlan_flags_to_string(IPVlanFlags d) _const_;
|
||||
IPVlanFlags ipvlan_flags_from_string(const char *d) _pure_;
|
||||
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_ipvlan_mode);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_ipvlan_flags);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user