return template;
}
+
+#ifdef IN_LIBLXC
+
static const char loop_device[] = "lo";
+#endif /* IN_LIBLXC */
+
static int lxc_ip_route_dest(__u16 nlmsg_type, int family, int ifindex, void *dest, unsigned int netmask)
{
call_cleaner(nlmsg_free) struct nlmsg *answer = NULL, *nlmsg = NULL;
return lxc_ip_route_dest(RTM_NEWROUTE, AF_INET6, ifindex, dest, netmask);
}
+#ifdef IN_LIBLXC
+
static int lxc_ipv4_dest_del(int ifindex, struct in_addr *dest, unsigned int netmask)
{
return lxc_ip_route_dest(RTM_DELROUTE, AF_INET, ifindex, dest, netmask);
[LXC_NET_NONE] = netdev_configure_server_none,
};
+#endif /* IN_LIBLXC */
+
static int __netdev_configure_container_common(struct lxc_netdev *netdev)
{
char current_ifname[IFNAMSIZ];
[LXC_NET_NONE] = netdev_configure_container_none,
};
+#ifdef IN_LIBLXC
+
static int netdev_shutdown_server_veth(struct lxc_handler *handler, struct lxc_netdev *netdev)
{
int ret;
[LXC_NET_NONE] = netdev_shutdown_server_none,
};
+#endif /* IN_LIBLXC */
+
static int lxc_netdev_move_by_index_fd(int ifindex, int fd, const char *ifname)
{
call_cleaner(nlmsg_free) struct nlmsg *nlmsg = NULL;
return proc_sys_net_write(path, flag ? "1" : "0");
}
+#ifdef IN_LIBLXC
+
static int lxc_is_ip_neigh_proxy_enabled(const char *ifname, int family)
{
int ret;
return lxc_read_file_expect(path, buf, 1, "1");
}
+#endif /* IN_LIBLXC */
+
int lxc_neigh_proxy_on(const char *name, int family)
{
return neigh_proxy_set(name, family, 1);
return 0;
}
+#ifdef IN_LIBLXC
+
#define LXC_USERNIC_PATH LIBEXECDIR "/lxc/lxc-user-nic"
static int lxc_create_network_unpriv_exec(const char *lxcpath,
const char *lxcname,
return 0;
}
+#endif /* IN_LIBLXC */
+
/*
* LXC moves network devices into the target namespace based on their created
* name. The created name can either be randomly generated for e.g. veth
return true;
}
+#ifdef IN_LIBLXC
+
static int lxc_create_network_unpriv(struct lxc_handler *handler)
{
int hooks_version = handler->conf->hooks_version;
return true;
}
+#endif /* IN_LIBLXC */
+
int lxc_requests_empty_network(struct lxc_handler *handler)
{
struct list_head *netdevs = &handler->conf->netdevs;
return 0;
}
+#ifdef IN_LIBLXC
+
void lxc_delete_network(struct lxc_handler *handler)
{
bool bret;
DEBUG("Deleted network devices");
}
+#endif /* IN_LIBLXC */
+
int lxc_netns_set_nsid(int fd)
{
int ret;
return -1;
}
+#ifdef IN_LIBLXC
+
int lxc_create_network(struct lxc_handler *handler)
{
int ret;
return lxc_create_network_unpriv(handler);
}
+
+#endif /* IN_LIBLXC */