code cleanup to allow it compile without unused variables warning
Costa Tsaousis (ktsaou) committed
Sep 18, 2016 at 17:18 UTC
09a50340a68a3a827daaab5c8ea168a9e1cd7dc1
1 file changed
+32
-26
src/proc_net_netstat.c
+32
-26
@@ -199,31 +199,20 @@ int do_proc_net_netstat(int update_every, unsigned long long dt) {
199
static uint32_t hash_ipext = 0, hash_tcpext = 0;
200
static procfile *ff = NULL;
201
202
- // https://github.com/ecki/net-tools/blob/bd8bceaed2311651710331a7f8990c3e31be9840/statistics.c
203
-
204
- // Reordering
202
static unsigned long long *tcpext_TCPRenoReorder = NULL;
203
static unsigned long long *tcpext_TCPFACKReorder = NULL;
204
static unsigned long long *tcpext_TCPSACKReorder = NULL;
205
static unsigned long long *tcpext_TCPTSReorder = NULL;
206
210
- // SYN Cookies
207
static unsigned long long *tcpext_SyncookiesSent = NULL;
208
static unsigned long long *tcpext_SyncookiesRecv = NULL;
209
static unsigned long long *tcpext_SyncookiesFailed = NULL;
210
215
- // Out Of Order Queue
216
- // http://www.spinics.net/lists/netdev/msg204696.html
211
static unsigned long long *tcpext_TCPOFOQueue = NULL; // Number of packets queued in OFO queue
212
static unsigned long long *tcpext_TCPOFODrop = NULL; // Number of packets meant to be queued in OFO but dropped because socket rcvbuf limit hit.
213
static unsigned long long *tcpext_TCPOFOMerge = NULL; // Number of packets in OFO that were merged with other packets.
214
static unsigned long long *tcpext_OfoPruned = NULL; // packets dropped from out-of-order queue because of socket buffer overrun
215
222
- // connection rejects
223
- static unsigned long long *tcpext_PAWSActive = NULL; // active connections rejected because of time stamp
224
- static unsigned long long *tcpext_PAWSPassive = NULL; // passive connections rejected because of time stamp
225
-
226
- // connection resets
216
static unsigned long long *tcpext_TCPAbortOnData = NULL; // connections reset due to unexpected data
217
static unsigned long long *tcpext_TCPAbortOnClose = NULL; // connections reset due to early user close
218
static unsigned long long *tcpext_TCPAbortOnMemory = NULL; // connections aborted due to memory pressure
@@ -231,6 +220,11 @@ int do_proc_net_netstat(int update_every, unsigned long long dt) {
220
static unsigned long long *tcpext_TCPAbortOnLinger = NULL; // connections aborted after user close in linger timeout
221
static unsigned long long *tcpext_TCPAbortFailed = NULL; // times unable to send RST due to no memory
222
223
+/*
224
+ // connection rejects
225
+ static unsigned long long *tcpext_PAWSActive = NULL; // active connections rejected because of time stamp
226
+ static unsigned long long *tcpext_PAWSPassive = NULL; // passive connections rejected because of time stamp
227
+
228
static unsigned long long *tcpext_TCPTimeouts = NULL;
229
230
static unsigned long long *tcpext_TCPDSACKUndo = NULL;
@@ -355,6 +349,7 @@ int do_proc_net_netstat(int update_every, unsigned long long dt) {
349
350
static unsigned long long *tcpext_TCPMTUPFail = NULL;
351
static unsigned long long *tcpext_TCPMTUPSuccess = NULL;
352
+*/
353
354
static unsigned long long *ipext_InNoRoutes = NULL;
355
static unsigned long long *ipext_InTruncatedPkts = NULL;
@@ -394,13 +389,37 @@ int do_proc_net_netstat(int update_every, unsigned long long dt) {
389
hash_array(ipext_data);
390
hash_array(tcpext_data);
391
392
+ // Reordering
393
+ tcpext_TCPFACKReorder = netstat_columns_find(tcpext_data, "TCPFACKReorder");
394
+ tcpext_TCPSACKReorder = netstat_columns_find(tcpext_data, "TCPSACKReorder");
395
+ tcpext_TCPRenoReorder = netstat_columns_find(tcpext_data, "TCPRenoReorder");
396
+ tcpext_TCPTSReorder = netstat_columns_find(tcpext_data, "TCPTSReorder");
397
+
398
+ // SYN Cookies
399
tcpext_SyncookiesSent = netstat_columns_find(tcpext_data, "SyncookiesSent");
400
tcpext_SyncookiesRecv = netstat_columns_find(tcpext_data, "SyncookiesRecv");
401
tcpext_SyncookiesFailed = netstat_columns_find(tcpext_data, "SyncookiesFailed");
402
+
403
+ // Out Of Order Queue
404
+ // http://www.spinics.net/lists/netdev/msg204696.html
405
+ tcpext_TCPOFOQueue = netstat_columns_find(tcpext_data, "TCPOFOQueue"); // Number of packets queued in OFO queue
406
+ tcpext_TCPOFODrop = netstat_columns_find(tcpext_data, "TCPOFODrop"); // Number of packets meant to be queued in OFO but dropped because socket rcvbuf limit hit.
407
+ tcpext_TCPOFOMerge = netstat_columns_find(tcpext_data, "TCPOFOMerge"); // Number of packets in OFO that were merged with other packets.
408
+ tcpext_OfoPruned = netstat_columns_find(tcpext_data, "OfoPruned"); // packets dropped from out-of-order queue because of socket buffer overrun
409
+
410
+ // connection resets
411
+ // https://github.com/ecki/net-tools/blob/bd8bceaed2311651710331a7f8990c3e31be9840/statistics.c
412
+ tcpext_TCPAbortOnData = netstat_columns_find(tcpext_data, "TCPAbortOnData"); // connections reset due to unexpected data
413
+ tcpext_TCPAbortOnClose = netstat_columns_find(tcpext_data, "TCPAbortOnClose"); // connections reset due to early user close
414
+ tcpext_TCPAbortOnMemory = netstat_columns_find(tcpext_data, "TCPAbortOnMemory"); // connections aborted due to memory pressure
415
+ tcpext_TCPAbortOnTimeout = netstat_columns_find(tcpext_data, "TCPAbortOnTimeout"); // connections aborted due to timeout
416
+ tcpext_TCPAbortOnLinger = netstat_columns_find(tcpext_data, "TCPAbortOnLinger"); // connections aborted after user close in linger timeout
417
+ tcpext_TCPAbortFailed = netstat_columns_find(tcpext_data, "TCPAbortFailed"); // times unable to send RST due to no memory
418
+
419
+ /*
420
tcpext_EmbryonicRsts = netstat_columns_find(tcpext_data, "EmbryonicRsts");
421
tcpext_PruneCalled = netstat_columns_find(tcpext_data, "PruneCalled");
422
tcpext_RcvPruned = netstat_columns_find(tcpext_data, "RcvPruned");
403
- tcpext_OfoPruned = netstat_columns_find(tcpext_data, "OfoPruned");
423
tcpext_OutOfWindowIcmps = netstat_columns_find(tcpext_data, "OutOfWindowIcmps");
424
tcpext_LockDroppedIcmps = netstat_columns_find(tcpext_data, "LockDroppedIcmps");
425
tcpext_ArpFilter = netstat_columns_find(tcpext_data, "ArpFilter");
@@ -426,10 +445,6 @@ int do_proc_net_netstat(int update_every, unsigned long long dt) {
445
tcpext_TCPRenoRecovery = netstat_columns_find(tcpext_data, "TCPRenoRecovery");
446
tcpext_TCPSackRecovery = netstat_columns_find(tcpext_data, "TCPSackRecovery");
447
tcpext_TCPSACKReneging = netstat_columns_find(tcpext_data, "TCPSACKReneging");
429
- tcpext_TCPFACKReorder = netstat_columns_find(tcpext_data, "TCPFACKReorder");
430
- tcpext_TCPSACKReorder = netstat_columns_find(tcpext_data, "TCPSACKReorder");
431
- tcpext_TCPRenoReorder = netstat_columns_find(tcpext_data, "TCPRenoReorder");
432
- tcpext_TCPTSReorder = netstat_columns_find(tcpext_data, "TCPTSReorder");
448
tcpext_TCPFullUndo = netstat_columns_find(tcpext_data, "TCPFullUndo");
449
tcpext_TCPPartialUndo = netstat_columns_find(tcpext_data, "TCPPartialUndo");
450
tcpext_TCPDSACKUndo = netstat_columns_find(tcpext_data, "TCPDSACKUndo");
@@ -452,12 +467,6 @@ int do_proc_net_netstat(int update_every, unsigned long long dt) {
467
tcpext_TCPDSACKOfoSent = netstat_columns_find(tcpext_data, "TCPDSACKOfoSent");
468
tcpext_TCPDSACKRecv = netstat_columns_find(tcpext_data, "TCPDSACKRecv");
469
tcpext_TCPDSACKOfoRecv = netstat_columns_find(tcpext_data, "TCPDSACKOfoRecv");
455
- tcpext_TCPAbortOnData = netstat_columns_find(tcpext_data, "TCPAbortOnData");
456
- tcpext_TCPAbortOnClose = netstat_columns_find(tcpext_data, "TCPAbortOnClose");
457
- tcpext_TCPAbortOnMemory = netstat_columns_find(tcpext_data, "TCPAbortOnMemory");
458
- tcpext_TCPAbortOnTimeout = netstat_columns_find(tcpext_data, "TCPAbortOnTimeout");
459
- tcpext_TCPAbortOnLinger = netstat_columns_find(tcpext_data, "TCPAbortOnLinger");
460
- tcpext_TCPAbortFailed = netstat_columns_find(tcpext_data, "TCPAbortFailed");
470
tcpext_TCPMemoryPressures = netstat_columns_find(tcpext_data, "TCPMemoryPressures");
471
tcpext_TCPSACKDiscard = netstat_columns_find(tcpext_data, "TCPSACKDiscard");
472
tcpext_TCPDSACKIgnoredOld = netstat_columns_find(tcpext_data, "TCPDSACKIgnoredOld");
@@ -477,9 +486,6 @@ int do_proc_net_netstat(int update_every, unsigned long long dt) {
486
tcpext_TCPReqQFullDrop = netstat_columns_find(tcpext_data, "TCPReqQFullDrop");
487
tcpext_TCPRetransFail = netstat_columns_find(tcpext_data, "TCPRetransFail");
488
tcpext_TCPRcvCoalesce = netstat_columns_find(tcpext_data, "TCPRcvCoalesce");
480
- tcpext_TCPOFOQueue = netstat_columns_find(tcpext_data, "TCPOFOQueue");
481
- tcpext_TCPOFODrop = netstat_columns_find(tcpext_data, "TCPOFODrop");
482
- tcpext_TCPOFOMerge = netstat_columns_find(tcpext_data, "TCPOFOMerge");
489
tcpext_TCPChallengeACK = netstat_columns_find(tcpext_data, "TCPChallengeACK");
490
tcpext_TCPSYNChallenge = netstat_columns_find(tcpext_data, "TCPSYNChallenge");
491
tcpext_TCPFastOpenActive = netstat_columns_find(tcpext_data, "TCPFastOpenActive");
@@ -510,7 +516,7 @@ int do_proc_net_netstat(int update_every, unsigned long long dt) {
516
tcpext_TCPKeepAlive = netstat_columns_find(tcpext_data, "TCPKeepAlive");
517
tcpext_TCPMTUPFail = netstat_columns_find(tcpext_data, "TCPMTUPFail");
518
tcpext_TCPMTUPSuccess = netstat_columns_find(tcpext_data, "TCPMTUPSuccess");
513
-
519
+*/
520
ipext_InNoRoutes = netstat_columns_find(ipext_data, "InNoRoutes");
521
ipext_InTruncatedPkts = netstat_columns_find(ipext_data, "InTruncatedPkts");
522
ipext_InMcastPkts = netstat_columns_find(ipext_data, "InMcastPkts");