if ENABLE_TEST
+AM_LDFLAGS = -lutil
+
INCLUDES= -I$(top_srcdir)/src
noinst_PROGRAMS = \
confile_SOURCES = confile.c
confile_LDADD = \
- $(top_builddir)/src/lxc/lxc_config.o \
+ $(top_builddir)/src/lxc/conf.o \
+ $(top_builddir)/src/lxc/confile.o \
$(top_builddir)/src/lxc/liblxc.la
conf_SOURCES = conf.c
lxc_state_LDADD = \
$(top_builddir)/src/lxc/liblxc.la
-endif
\ No newline at end of file
+endif
#include <netinet/in.h>
#include <net/if.h>
-#include <lxc/lxc_list.h>
-#include <lxc/lxc_conf.h>
+#include <lxc/list.h>
+#include <lxc/conf.h>
/*
* I want to setup a container with a veth attached on a bridge,
#include <net/if.h>
#include <lxc/lxc.h>
-#include <lxc/lxc_config.h>
+#include <lxc/conf.h>
+#include <lxc/confile.h>
static void usage(const char *cmd)
{
if (!file || !name)
usage(argv[0]);
- if (lxc_config_init(&lxc_conf)) {
+ if (lxc_conf_init(&lxc_conf)) {
fprintf(stderr, "failed to initialize configuration structure\n");
return 1;
}
}
if (destroy)
- ret = device_delete(ifname);
+ ret = lxc_device_delete(ifname);
else if (!strcmp(flag, "up"))
- ret = device_up(ifname);
+ ret = lxc_device_up(ifname);
else if (!strcmp(flag, "down"))
- ret = device_down(ifname);
+ ret = lxc_device_down(ifname);
if (ret) {
fprintf(stderr, "failed to set %s: %s\n",
}
if (!strcmp(flag, "on"))
- ret = ip_forward_on(ifname, family);
+ ret = lxc_ip_forward_on(ifname, family);
else if (!strcmp(flag, "off"))
- ret = ip_forward_off(ifname, family);
+ ret = lxc_ip_forward_off(ifname, family);
else {
usage(argv[0]);
return 1;
return 1;
}
- ret = ip_addr_add(ifname, addr, 24, NULL);
+ ret = lxc_ip_addr_add(ifname, addr, 24, NULL);
if (ret) {
fprintf(stderr, "failed to set %s: %s\n",
ifname, strerror(-ret));
return 1;
}
- ret = ip6_addr_add(ifname, addr, 64, NULL);
+ ret = lxc_ip6_addr_add(ifname, addr, 64, NULL);
if (ret) {
fprintf(stderr, "failed to set %s: %s\n",
ifname, strerror(-ret));
if (!name)
usage(argv[0]);
- fd = lxc_monitor_open(name);
+ fd = lxc_monitor_open();
if (fd < 0) {
fprintf(stderr, "failed to open monitor\n");
return -1;
}
for (;;) {
- lxc_state_t state;
- lxc_monitor_read(fd, &state);
- printf("received changing state '%s'\n", lxc_state2str(state));
+ struct lxc_msg msg;
+ lxc_monitor_read(fd, &msg);
+ if (msg.type == lxc_msg_state) {
+ printf("received changing state '%s'\n", lxc_state2str(msg.value));
+ }
}
}
return 1;
}
- ret = macvlan_create(ifname, peer);
+ ret = lxc_macvlan_create(ifname, peer);
if (ret) {
fprintf(stderr, "failed to set %s/%s: %s\n",
ifname, peer, strerror(-ret));
return 1;
}
- if (device_move(ifname, pid)) {
+ if (lxc_device_move(ifname, pid)) {
fprintf(stderr, "failed to move %s\n", ifname);
return 1;
}
}
if (!strcmp(flag, "on"))
- ret = neigh_proxy_on(ifname, family);
+ ret = lxc_neigh_proxy_on(ifname, family);
else if (!strcmp(flag, "off"))
- ret = neigh_proxy_off(ifname, family);
+ ret = lxc_neigh_proxy_off(ifname, family);
else {
usage(argv[0]);
return 1;
#include <stdio.h>
#include <string.h>
-#include <lxc/lxc_list.h>
+#include <lxc/list.h>
int main(int argc, char *argv[])
{
return 1;
}
- ret = veth_create(ifname, peer);
+ ret = lxc_veth_create(ifname, peer);
if (ret) {
fprintf(stderr, "failed to set %s/%s: %s\n",
ifname, peer, strerror(-ret));