Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


added network server files
[palacios.git] / misc / network_servers / vtl / test / vtl_test.cc
diff --git a/misc/network_servers/vtl/test/vtl_test.cc b/misc/network_servers/vtl/test/vtl_test.cc
new file mode 100644 (file)
index 0000000..c500f4c
--- /dev/null
@@ -0,0 +1,30 @@
+#include "vtp_util.h"
+#include "if.h"
+#include "debug.h"
+
+#define IFACE_NAME "vmnet1"
+
+DEBUG_DECLARE();
+
+int main(int argc, char ** argv) {
+  RawEthernetPacket pkt;
+
+  char * iface_name = IFACE_NAME;
+
+  if (argc == 2) {
+    iface_name = argv[1];
+  }
+  iface_t * iface = if_connect(iface_name, IF_RW);
+
+  debug_init("./vtp.log");
+
+  while (if_read_pkt(iface, &pkt) == 0) {
+
+    printf("READ packet\n");
+    if (is_tcp_pkt(&pkt)) {
+      printf("TCP!!\n");
+    }
+
+  }
+
+}