diff options
-rw-r--r-- | pcap2tzsp.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/pcap2tzsp.c b/pcap2tzsp.c index e548ed9..05c1a4e 100644 --- a/pcap2tzsp.c +++ b/pcap2tzsp.c @@ -317,6 +317,7 @@ void process_packet(u_char *void_args, const struct pcap_pkthdr* pkthdr, const u double throughput; uint32_t ts; /* In network byte order */ + //uint32_t pkt_num; /* In network byte order */ uint16_t len; /* In network byte order */ char buf[UDP_SEND_BUFLEN]; /* struct timespec ts_reqsleep; For simulation */ @@ -342,6 +343,7 @@ void process_packet(u_char *void_args, const struct pcap_pkthdr* pkthdr, const u /* Variable fields for TZSP packet */ ts=htonl((uint32_t) pkthdr->ts.tv_sec); /* TODO : this cast is bullshit ? */ len=htons((uint16_t) pkthdr->len); + //pkt_num=htons((uint32_t) args->captured_pkt_count); /* TaZmen Sniffing Protocol (TZSP) packet forging */ @@ -357,8 +359,13 @@ void process_packet(u_char *void_args, const struct pcap_pkthdr* pkthdr, const u /* buf[6,7,8,9] Timestamp on 4 bytes (network order) */ memcpy(buf+6, &ts, 4); + /* Wireshark don't dissect that */ + //buf[10]=0x28; /* Tag type TAG_PACKET_COUNT */ + //buf[11]=0x04; /* Tag length == 4 bytes */ + //memcpy(buf+12,&pkt_num, 4); + buf[10]=0x29; /* Tag type TAG_RX_FRAME_LENGTH */ - buf[11]=0x02; /* Tag length : 2 bytes */ + buf[11]=0x02; /* Tag length == 2 bytes */ memcpy(buf+12,&len, 2); buf[14]=0x00; /* Tag type TAG PADDING (for alignement) */ |