]> git.proxmox.com Git - mirror_lxc.git/commitdiff
macro: add macvlan properties
authorChristian Brauner <christian.brauner@ubuntu.com>
Sun, 19 Aug 2018 18:14:25 +0000 (20:14 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sun, 19 Aug 2018 18:27:46 +0000 (20:27 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/confile_utils.c
src/lxc/confile_utils.h
src/lxc/macro.h

index 2bb46d17bcce9efa1d93613d6fcb0fbde578141a..9b133147ada251d64bcc20efc290811ac057f80c 100644 (file)
@@ -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[] = {
index b58ce47b2dd2a71754efe3228d767448d3141223..eda6aa3dd6d6cb37392b186ca42163e16b4377e4 100644 (file)
 #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)                                                \
index 7536d611159aa682fefb05c557da569e66e8ac22..6113adc2e708415708d0ed23b95f6700379b2337 100644 (file)
@@ -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