Commit 24654103 by Daniel Lezcano Committed by Daniel Lezcano

rename network type enum

Use a prefixed enum to avoid conflict later. Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 872e1899
......@@ -104,12 +104,12 @@ static int instanciate_vlan(struct lxc_netdev *);
static int instanciate_phys(struct lxc_netdev *);
static int instanciate_empty(struct lxc_netdev *);
static instanciate_cb netdev_conf[MAXCONFTYPE + 1] = {
[VETH] = instanciate_veth,
[MACVLAN] = instanciate_macvlan,
[VLAN] = instanciate_vlan,
[PHYS] = instanciate_phys,
[EMPTY] = instanciate_empty,
static instanciate_cb netdev_conf[LXC_NET_MAXCONFTYPE + 1] = {
[LXC_NET_VETH] = instanciate_veth,
[LXC_NET_MACVLAN] = instanciate_macvlan,
[LXC_NET_VLAN] = instanciate_vlan,
[LXC_NET_PHYS] = instanciate_phys,
[LXC_NET_EMPTY] = instanciate_empty,
};
static struct mount_opt mount_opt[] = {
......@@ -1241,7 +1241,7 @@ int lxc_create_network(struct lxc_list *network)
netdev = iterator->elem;
if (netdev->type < 0 || netdev->type > MAXCONFTYPE) {
if (netdev->type < 0 || netdev->type > LXC_NET_MAXCONFTYPE) {
ERROR("invalid network configuration type '%d'",
netdev->type);
return -1;
......
......@@ -29,12 +29,12 @@
#include <lxc/list.h>
enum {
EMPTY,
VETH,
MACVLAN,
PHYS,
VLAN,
MAXCONFTYPE,
LXC_NET_EMPTY,
LXC_NET_VETH,
LXC_NET_MACVLAN,
LXC_NET_PHYS,
LXC_NET_VLAN,
LXC_NET_MAXCONFTYPE,
};
/*
......
......@@ -132,15 +132,15 @@ static int config_network_type(const char *key, char *value,
lxc_list_add(network, list);
if (!strcmp(value, "veth"))
netdev->type = VETH;
netdev->type = LXC_NET_VETH;
else if (!strcmp(value, "macvlan"))
netdev->type = MACVLAN;
netdev->type = LXC_NET_MACVLAN;
else if (!strcmp(value, "vlan"))
netdev->type = VLAN;
netdev->type = LXC_NET_VLAN;
else if (!strcmp(value, "phys"))
netdev->type = PHYS;
netdev->type = LXC_NET_PHYS;
else if (!strcmp(value, "empty"))
netdev->type = EMPTY;
netdev->type = LXC_NET_EMPTY;
else {
ERROR("invalid network type %s", value);
return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment