|
@@ -21,7 +21,10 @@
|
|
|
#include "globals.h"
|
|
|
|
|
|
#include <signal.h>
|
|
|
+
|
|
|
+#ifdef STATS
|
|
|
#include "stats.h"
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
|
@@ -113,8 +116,10 @@ int process_no = 0;
|
|
|
/* cfg parsing */
|
|
|
int cfg_errors=0;
|
|
|
|
|
|
+#ifdef STATS
|
|
|
/* jku: RX/TX statistics -- remember, they are process specific */
|
|
|
struct stats_s stats;
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
#define MAX_FD 32 /* maximum number of inherited open file descriptors,
|
|
@@ -226,9 +231,11 @@ int main_loop()
|
|
|
static void sig_usr(int signo)
|
|
|
{
|
|
|
DPrint("INT received, program terminates\n");
|
|
|
+#ifdef STATS
|
|
|
DPrint("ok_rx_rq\t%d\nok_rx_rs\t%d\nok_tx_rq\t%d\nok_tx_rs\t%d\ntotal_rx\t%d\ntotal_tx\t%d\n\n",
|
|
|
stats.ok_rx_rq, stats.ok_rx_rs, stats.ok_tx_rq, stats.ok_tx_rs, stats.total_rx, stats.total_tx );
|
|
|
DPrint("Thank you for flying ser\n");
|
|
|
+#endif
|
|
|
exit(0);
|
|
|
}
|
|
|
|
|
@@ -378,8 +385,10 @@ int main(int argc, char** argv)
|
|
|
addresses_no++;
|
|
|
}
|
|
|
|
|
|
+#ifdef STATS
|
|
|
/* jku: initialize statistic */
|
|
|
memset(&stats,0,sizeof(struct stats_s));
|
|
|
+#endif
|
|
|
|
|
|
/* get ips */
|
|
|
printf("Listening on ");
|