summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2012-10-21 08:18:53 +0000
committerLudovic Pouzenc <ludovic@pouzenc.fr>2012-10-21 08:18:53 +0000
commitac85647309e45ad3705a72a7828954a07c24f5a7 (patch)
treeb3cd2696dd3e005bf6033a5fb9a34ec2a2b87520
parentbc947900ab280adc5bb8f46214436c9b51d0ba5f (diff)
download2012-tzsp-ac85647309e45ad3705a72a7828954a07c24f5a7.tar.gz
2012-tzsp-ac85647309e45ad3705a72a7828954a07c24f5a7.tar.bz2
2012-tzsp-ac85647309e45ad3705a72a7828954a07c24f5a7.zip
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
git-svn-id: file:///var/svn/2012-tzsp/trunk@8 147d2d3d-d0bd-48ea-923a-d90ac20f5906
-rw-r--r--pcap2tzsp.c9
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) */