summaryrefslogtreecommitdiff
path: root/pcap2tzsp.c
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2012-10-21 17:38:41 +0000
committerLudovic Pouzenc <ludovic@pouzenc.fr>2012-10-21 17:38:41 +0000
commit9cf8b5eced54f499d905fa6b911b59b51b9d51d0 (patch)
treec209596fd37a149b2c6d3f216b1a9e16c71fa923 /pcap2tzsp.c
parent35ff384767249096b1acf71a11ed8ca7a966d6f7 (diff)
download2012-tzsp-9cf8b5eced54f499d905fa6b911b59b51b9d51d0.tar.gz
2012-tzsp-9cf8b5eced54f499d905fa6b911b59b51b9d51d0.tar.bz2
2012-tzsp-9cf8b5eced54f499d905fa6b911b59b51b9d51d0.zip
Code cleaning (encore un peu)
git-svn-id: file:///var/svn/2012-tzsp/trunk@12 147d2d3d-d0bd-48ea-923a-d90ac20f5906
Diffstat (limited to 'pcap2tzsp.c')
-rw-r--r--pcap2tzsp.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/pcap2tzsp.c b/pcap2tzsp.c
index 29687bb..5d8d05f 100644
--- a/pcap2tzsp.c
+++ b/pcap2tzsp.c
@@ -64,12 +64,12 @@
/* Max len of a numerical form of host address 39 chars in IPv6 */
#define NI_MAXHOST_NUMERIC 40
+
/*
TODO List
- * Implémenter une bwlimit en sortie (ptks/s et/ou bytes/s)
* Version qui compile sous Windows
+ * Implémenter une bwlimit en sortie (ptks/s et/ou bytes/s)
* Calcul dynamique de MAX_TZSP_PAYLOAD
- * Licence GPL
*/
/* Functions declaration */
@@ -372,9 +372,8 @@ void start_capture_loop(char *pcap_filter) {
}
-/* process_packet(): Callback function called by pcap_loop() everytime a packet */
-/* arrives to the network card. This function prints the captured raw data in */
-/* hexadecimal. */
+/* process_packet(): Callback function called by pcap_loop()
+ everytime a packet arrives to the network card. */
void process_packet(u_char *void_args, const struct pcap_pkthdr* pkthdr, const u_char * packet) {
static time_t old_tv_sec=0;
@@ -383,11 +382,11 @@ void process_packet(u_char *void_args, const struct pcap_pkthdr* pkthdr, const u
int res, tzsp_len;
double throughput;
- //uint32_t pkt_num; /* In network byte order */
+ /*uint32_t pkt_num; // In network byte order */
uint32_t field_ts; /* In network byte order */
uint16_t field_len; /* In network byte order */
char buf[UDP_SEND_BUFLEN];
- /* struct timespec ts_reqsleep; For simulation */
+ /* struct timespec ts_reqsleep; // For simulation */
process_packet_args_t *args=(process_packet_args_t *)void_args;
@@ -405,7 +404,7 @@ void process_packet(u_char *void_args, const struct pcap_pkthdr* pkthdr, const u
old_captured_pkt_count= args->captured_pkt_count;
}
- //TODO : bwlimit HERE (not before, no after)
+ //TODO : bwlimit HERE (not before, not after)
/* Variable fields for TZSP packet */
field_ts=htonl((uint32_t) pkthdr->ts.tv_sec); /* TODO : this cast is bullshit ? */