From ac85647309e45ad3705a72a7828954a07c24f5a7 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Sun, 21 Oct 2012 08:18:53 +0000 Subject: Essai du tag packet count TZSP pour détecter les pertes côté receveur, mais wireshark disset pas ce tag, alors c'est chiant. Laissé en commentaire MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///var/svn/2012-tzsp/trunk@8 147d2d3d-d0bd-48ea-923a-d90ac20f5906 --- pcap2tzsp.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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) */ -- cgit v1.2.3