#include "if.h"
+#include <assert.h>
iface_t * if_connect(string if_name, char mode) {
char pcap_errbuf[PCAP_ERRBUF_SIZE];
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;
}
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) {
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) {
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");
}
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]));
#include "vtl_model.h"
-
+#include <assert.h>
/* VTL Models */
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");
#include "vtl_util.h"
-
+#include <assert.h>
void dbg_print_pkt_info(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);