dest_str = ip_to_string(GET_IP_DST(pkt->data));
src_str = ip_to_string(GET_IP_SRC(pkt->data));
- JRLDBG("Packet: %s:%d-%s:%d seq: %lu, ack: %lu\n", src_str.c_str(), ntohs(src_port), dest_str.c_str(), ntohs(dest_port),
+ vtl_debug("Packet: %s:%d-%s:%d seq: %lu, ack: %lu\n", src_str.c_str(), ntohs(src_port), dest_str.c_str(), ntohs(dest_port),
seq_num, ack_num);
return;
char pkt_line[128];
unsigned int pkt_size = pkt->get_size() - 1;
- JRLDBG("Packet Dump: (pkt_size=%lu) \n", pkt->get_size());
+ vtl_debug("Packet Dump: (pkt_size=%lu) \n", pkt->get_size());
for (x = 0; x < pkt_size;) {
sprintf(pkt_line, "\t%.4x: ", x);
}
}
- JRLDBG("%s\n", pkt_line);
+ vtl_debug("%s\n", pkt_line);
x += 16;
}
int i;
char pkt_line[128];
- JRLDBG("Buf Dump: (len=%d) \n", len);
+ vtl_debug("Buf Dump: (len=%d) \n", len);
for (x = 0; x < len-1;) {
sprintf(pkt_line, "\t%.4x: ", x);
}
}
- JRLDBG("%s\n", pkt_line);
+ vtl_debug("%s\n", pkt_line);
x += 16;
}
}
int parse_tcp_options(tcp_opts_t * options, RawEthernetPacket * pkt) {
- ASSERT((options != NULL) && (pkt != NULL));
+ assert((options != NULL) && (pkt != NULL));
memset(options, 0, sizeof(options));
offset += *(opts + offset + 1);
} else {
offset += *(opts + offset + 1);
- //JRLDBG("Could not find timestamp\n");
+ //vtl_debug("Could not find timestamp\n");
//break;
}
}
return offset;
} else {
offset += *(opts + offset + 1);
- //JRLDBG("Could not find timestamp\n");
+ //vtl_debug("Could not find timestamp\n");
//break;
}
}
// memcpy(buf + 6, (pkt->data + ETH_HDR_LEN + GET_IP_HDR_LEN(pkt->data)), tcp_len);
memcpy(buf + 6, TCP_HDR(pkt->data), tcp_len);
if (tcp_len % 2) {
- JRLDBG("Odd tcp_len: %hu\n", tcp_len);
+ vtl_debug("Odd tcp_len: %hu\n", tcp_len);
*(((char*)buf) + 2 * 6 + tcp_len) = 0;
}
// memcpy(buf + 6, (pkt->data + ETH_HDR_LEN + GET_IP_HDR_LEN(pkt->data)), udp_len);
memcpy(buf + 6, UDP_HDR(pkt->data), udp_len);
if (udp_len % 2) {
- JRLDBG("Odd udp_len: %hu\n", udp_len);
+ vtl_debug("Odd udp_len: %hu\n", udp_len);
*(((char*)buf) + 2 * 6 + udp_len) = 0;
}