summaryrefslogtreecommitdiff
path: root/pcap2tzsp.c
diff options
context:
space:
mode:
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 ? */