diff --git a/build.mk b/build.mk index b2895e6735..5d2ca1691e 100644 --- a/build.mk +++ b/build.mk @@ -19,7 +19,7 @@ CXXFLAGS += -pthread # Ubuntu fails without this, see https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1228201 CXXFLAGS += -Wl,--no-as-needed -tests = test-reactor fileiotest virtiotest l3_test +tests = test-reactor fileiotest virtiotest l3_test ip_test link = $(CXX) $(CXXFLAGS) -o $@ $^ @@ -44,4 +44,6 @@ virtiotest: virtiotest.o virtio.o reactor.o net.o ip.o ethernet.o arp.o l3_test: l3_test.o virtio.o reactor.o net.o ip.o ethernet.o arp.o +ip_test: ip_test.o virtio.o reactor.o net.o ip.o arp.o ethernet.o + -include *.d diff --git a/ip_test.cc b/ip_test.cc new file mode 100644 index 0000000000..5bad48b6e8 --- /dev/null +++ b/ip_test.cc @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2014 Cloudius Systems, Ltd. + */ + +#include "arp.hh" +#include "ip.hh" +#include "net.hh" +#include "reactor.hh" +#include "virtio.hh" + +using namespace net; + +int main(int ac, char** av) { + auto vnet = create_virtio_net_device("tap0"); + interface netif(std::move(vnet)); + netif.run(); + ipv4 inet(&netif); + inet.set_host_address(ipv4_address(0xc0a87a02)); + the_reactor.run(); + return 0; +} + + +