macro: add macvlan properties

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