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 / net_util.cc
diff --git a/misc/network_servers/vtl/net_util.cc b/misc/network_servers/vtl/net_util.cc
new file mode 100644 (file)
index 0000000..7b352ee
--- /dev/null
@@ -0,0 +1,53 @@
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "net_util.h"
+
+
+void do_string_to_ipaddress(unsigned char * ip, IPADDRESS & ipaddress) {
+
+}
+
+unsigned long do_ipaddress_to_unsigned_long(IPADDRESS & ipaddress) {
+       return 0;
+}
+
+// ip address conversion functions
+void do_binary_to_ipaddress(unsigned char* ip,IPADDRESS& ipaddress) {
+  ipaddress.a1 = ip[0];
+  ipaddress.a2 = ip[1];
+  ipaddress.a3 = ip[2];
+  ipaddress.a4 = ip[3];
+}
+
+
+// ip address conversion functions
+void do_binary_to_string(unsigned char* ip,char* buffer) {
+  IPADDRESS ipaddress;
+  do_binary_to_ipaddress(ip, ipaddress);
+  do_ipaddress_to_string(ipaddress, buffer);
+}
+
+void do_ipaddress_to_string(IPADDRESS ipaddress, char* buffer) {
+  sprintf(buffer,"%d.%d.%d.%d", ipaddress.a1, ipaddress.a2, ipaddress.a3, ipaddress.a4);
+}
+
+/*
+// this function returns the ip protocol string based on the ip protocol number
+char* return_ip_protocol(unsigned char protocol) {
+
+  if(protocol == 0x1) {
+      return "ICMP";
+  } else if(protocol == 0x6) {
+      return "TCP";
+  } else if(protocol == 17) {
+      return "UDP";
+  } else if(protocol == 121) {
+      return "SMP";
+  } else {
+    return "Unknown";
+  }
+
+  return 0;
+}
+*/