#include "caps.h" /* for lxc_caps_last_cap() */
#include "cgroup.h"
#include "conf.h"
+#include "confile_utils.h"
#include "error.h"
#include "log.h"
#include "lxcaufs.h"
if (!am_root)
return 0;
+ lxc_log_configured_netdevs(handler->conf);
+
lxc_list_for_each(iterator, network) {
netdev = iterator->elem;
return netdev;
}
+
+void lxc_log_configured_netdevs(const struct lxc_conf *conf)
+{
+ struct lxc_netdev *netdev;
+ struct lxc_list *it = (struct lxc_list *)&conf->network;;
+
+ if ((conf->loglevel != LXC_LOG_LEVEL_TRACE) &&
+ (lxc_log_get_level() != LXC_LOG_LEVEL_TRACE))
+ return;
+
+ if (lxc_list_empty(it)) {
+ TRACE("container has no networks configured");
+ return;
+ }
+
+ lxc_list_for_each(it, &conf->network) {
+ netdev = it->elem;
+
+ TRACE("index: %d", netdev->idx);
+ switch (netdev->type) {
+ case LXC_NET_VETH:
+ TRACE("type: veth");
+ break;
+ case LXC_NET_MACVLAN:
+ TRACE("type: macvlan");
+ break;
+ case LXC_NET_VLAN:
+ TRACE("type: vlan");
+ break;
+ case LXC_NET_PHYS:
+ TRACE("type: phys");
+ break;
+ case LXC_NET_EMPTY:
+ TRACE("type: empty");
+ break;
+ case LXC_NET_NONE:
+ TRACE("type: none");
+ break;
+ default:
+ ERROR("invalid network type %d", netdev->type);
+ return;
+ }
+
+ TRACE("flags: %s", netdev->flags == IFF_UP ? "up" : "none");
+ if (netdev->link)
+ TRACE("link: %s", netdev->link);
+ if (netdev->name)
+ TRACE("name: %s", netdev->name);
+ if (netdev->hwaddr)
+ TRACE("hwaddr: %s", netdev->hwaddr);
+ if (netdev->mtu)
+ TRACE("mtu: %s", netdev->mtu);
+ if (netdev->upscript)
+ TRACE("upscript: %s", netdev->upscript);
+ if (netdev->downscript)
+ TRACE("downscript: %s", netdev->downscript);
+ }
+}