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.


fore ported to latest GCC version
Jack Lange [Sun, 24 May 2009 18:35:32 +0000 (13:35 -0500)]
misc/network_servers/vtl/.dependencies [new file with mode: 0644]
misc/network_servers/vtl/if.cc
misc/network_servers/vtl/raw_ethernet_packet.cc
misc/network_servers/vtl/vtl_model.cc
misc/network_servers/vtl/vtl_util.cc

diff --git a/misc/network_servers/vtl/.dependencies b/misc/network_servers/vtl/.dependencies
new file mode 100644 (file)
index 0000000..e69de29
index b96bbae..808eb6b 100644 (file)
@@ -1,4 +1,5 @@
 #include "if.h"
+#include <assert.h>
 
 iface_t *  if_connect(string if_name, char mode) {
   char pcap_errbuf[PCAP_ERRBUF_SIZE];
@@ -117,11 +118,11 @@ int if_write_pkt(iface_t * iface, RawEthernetPacket * pkt) {
   ASSERT((iface != NULL) && (pkt != NULL) && (iface->net_interface != NULL));
 
 #ifdef linux
-  JRLDBG("Writing pkt size(%d)\n", pkt->get_size());
+  JRLDBG("Writing pkt size(%lu)\n", pkt->get_size());
   if (libnet_adv_write_link(iface->net_interface, 
                            (u_char *)(pkt->get_data()), 
                            pkt->get_size()) < 0) {
-    JRLDBG("Libnet could not inject packet size (%d)\n", pkt->get_size());
+    JRLDBG("Libnet could not inject packet size (%lu)\n", pkt->get_size());
     return -1;
   }
 
index 90cc098..1df7149 100644 (file)
@@ -105,7 +105,7 @@ int RawEthernetPacket::Unserialize(const SOCK fd, SSL * ssl) {
     return -1;
   }
 
-  JRLDBG("Receiving TCP data. size=%d, offset=%d\n", this->get_size(), *(pkt + 2));
+  JRLDBG("Receiving TCP data. size=%lu, offset=%d\n", this->get_size(), *(pkt + 2));
 
   ret = Receive(fd, ssl, data, this->get_size(), true);
   if (ret == 0) {
@@ -143,7 +143,7 @@ int RawEthernetPacket::Unserialize(const SOCK fd) {
     return -1;
   }
 
-  JRLDBG("Receiving TCP data. size=%d, offset=%d\n", this->get_size(), *(pkt + 2));
+  JRLDBG("Receiving TCP data. size=%lu, offset=%d\n", this->get_size(), *(pkt + 2));
 
   ret = Receive(fd, data, this->get_size(), true);
   if (ret == 0) {
@@ -264,7 +264,7 @@ int RawEthernetPacket::VtpSerialize(const SOCK fd, struct in_addr * serveraddr )
 
 void RawEthernetPacket::Print(unsigned size, FILE *out) const
 {
-  fprintf(out,"raw_ethernet_packet: size %-4u first %u bytes: ", *(this->size), MIN(*(this->size),size));
+  fprintf(out,"raw_ethernet_packet: size %-4lu first %lu bytes: ", *(this->size), MIN(*(this->size), size));
   printhexbuffer(out, data, MIN(*(this->size),size));
   fprintf(out,"\n");
 }
@@ -275,7 +275,7 @@ ostream & RawEthernetPacket::Print(ostream &os) const
   unsigned n;
   unsigned i;
 
-  snprintf(buf,2048,"RawEthernetPacket(size=%u, bytes=",  this->get_size());
+  snprintf(buf,2048,"RawEthernetPacket(size=%lu, bytes=",  this->get_size());
   n=strlen(buf);
   for (i=0;i<this->get_size();i++) { 
     bytetohexbyte(data[i],&(buf[n+2*i]));
index 2b95abd..a571c62 100644 (file)
@@ -1,5 +1,5 @@
 #include "vtl_model.h"
-
+#include <assert.h>
 
 
 /* VTL Models */
@@ -510,13 +510,13 @@ void dbg_dump_ip_model(ip_model_t * model) {
 
   printf("\tSrc Host {\n");
   printf("\t\taddr: %s\n", ip_to_string(model->src.addr));
-  printf("\t\tIP ID: %lu\n", model->src.ip_id);
+  printf("\t\tIP ID: %d\n", model->src.ip_id);
   printf("\t\tttl: %d\n", model->src.ttl);
   printf("\t}\n");
 
   printf("\tDst Host {\n");
   printf("\t\taddr: %s\n", ip_to_string(model->dst.addr));
-  printf("\t\tIP ID: %lu\n", model->dst.ip_id);
+  printf("\t\tIP ID: %d\n", model->dst.ip_id);
   printf("\t\tttl: %d\n", model->dst.ttl);
   printf("\t}\n");
 
index 87e7803..e9e3f9b 100644 (file)
@@ -1,5 +1,5 @@
 #include "vtl_util.h"
-
+#include <assert.h>
 
 
 void dbg_print_pkt_info(RawEthernetPacket * pkt) {
@@ -30,7 +30,7 @@ void dbg_print_pkt(RawEthernetPacket * pkt) {
   char pkt_line[128];
   unsigned int pkt_size = pkt->get_size() - 1;
 
-  JRLDBG("Packet Dump: (pkt_size=%d) \n", pkt->get_size());
+  JRLDBG("Packet Dump: (pkt_size=%lu) \n", pkt->get_size());
 
   for (x = 0; x < pkt_size;) {
     sprintf(pkt_line, "\t%.4x:  ", x);