From: Daniel Lezcano Date: Wed, 24 Feb 2010 09:57:43 +0000 (+0100) Subject: rename network type enum X-Git-Tag: lxc-0.7.0~133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=246541036cf5434749d91a566b70b7ddcdb294bd;p=thirdparty%2Flxc.git rename network type enum Use a prefixed enum to avoid conflict later. Signed-off-by: Daniel Lezcano --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index cb8fc8766..286eb7685 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -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; diff --git a/src/lxc/conf.h b/src/lxc/conf.h index f152defbe..b79dfe815 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h @@ -29,12 +29,12 @@ #include 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, }; /* diff --git a/src/lxc/confile.c b/src/lxc/confile.c index d6a7abe22..f56495623 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -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;