macro: add macvlan properties

parent 3991c6f9
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "list.h" #include "list.h"
#include "log.h" #include "log.h"
#include "lxccontainer.h" #include "lxccontainer.h"
#include "macro.h"
#include "network.h" #include "network.h"
#include "parse.h" #include "parse.h"
#include "utils.h" #include "utils.h"
...@@ -288,13 +289,12 @@ void lxc_log_configured_netdevs(const struct lxc_conf *conf) ...@@ -288,13 +289,12 @@ void lxc_log_configured_netdevs(const struct lxc_conf *conf)
TRACE("type: macvlan"); TRACE("type: macvlan");
if (netdev->priv.macvlan_attr.mode > 0) { if (netdev->priv.macvlan_attr.mode > 0) {
char *macvlan_mode; char *mode;
macvlan_mode = lxc_macvlan_flag_to_mode( mode = lxc_macvlan_flag_to_mode(
netdev->priv.macvlan_attr.mode); netdev->priv.macvlan_attr.mode);
TRACE("macvlan mode: %s", TRACE("macvlan mode: %s",
macvlan_mode ? macvlan_mode mode ? mode : "(invalid mode)");
: "(invalid mode)");
} }
break; break;
case LXC_NET_VLAN: case LXC_NET_VLAN:
...@@ -442,7 +442,7 @@ void lxc_free_networks(struct lxc_list *networks) ...@@ -442,7 +442,7 @@ void lxc_free_networks(struct lxc_list *networks)
lxc_list_init(networks); lxc_list_init(networks);
} }
static struct macvlan_mode { static struct lxc_macvlan_mode {
char *name; char *name;
int mode; int mode;
} macvlan_mode[] = { } macvlan_mode[] = {
......
...@@ -20,27 +20,13 @@ ...@@ -20,27 +20,13 @@
#ifndef __LXC_CONFILE_UTILS_H #ifndef __LXC_CONFILE_UTILS_H
#define __LXC_CONFILE_UTILS_H #define __LXC_CONFILE_UTILS_H
#include "config.h"
#include <stdbool.h> #include <stdbool.h>
#include "conf.h" #include "conf.h"
#include "confile_utils.h" #include "confile_utils.h"
#ifndef MACVLAN_MODE_PRIVATE
#define MACVLAN_MODE_PRIVATE 1
#endif
#ifndef MACVLAN_MODE_VEPA
#define MACVLAN_MODE_VEPA 2
#endif
#ifndef MACVLAN_MODE_BRIDGE
#define MACVLAN_MODE_BRIDGE 4
#endif
#ifndef MACVLAN_MODE_PASSTHRU
#define MACVLAN_MODE_PASSTHRU 8
#endif
#define strprint(str, inlen, ...) \ #define strprint(str, inlen, ...) \
do { \ do { \
if (str) \ if (str) \
......
...@@ -197,6 +197,22 @@ extern int __build_bug_on_failed; ...@@ -197,6 +197,22 @@ extern int __build_bug_on_failed;
#define NLMSG_ERROR 0x2 #define NLMSG_ERROR 0x2
#endif #endif
#ifndef MACVLAN_MODE_PRIVATE
#define MACVLAN_MODE_PRIVATE 1
#endif
#ifndef MACVLAN_MODE_VEPA
#define MACVLAN_MODE_VEPA 2
#endif
#ifndef MACVLAN_MODE_BRIDGE
#define MACVLAN_MODE_BRIDGE 4
#endif
#ifndef MACVLAN_MODE_PASSTHRU
#define MACVLAN_MODE_PASSTHRU 8
#endif
/* mount */ /* mount */
#ifndef MS_REC #ifndef MS_REC
#define MS_REC 16384 #define MS_REC 16384
......
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