Skip to Content.
Sympa Menu

ndt-dev - [ndt-dev] [ndt] r818 committed - Move the iflist stuff into web100-pcap since that's it's only user

Subject: NDT-DEV email list created

List archive

[ndt-dev] [ndt] r818 committed - Move the iflist stuff into web100-pcap since that's it's only user


Chronological Thread 
  • From:
  • To:
  • Subject: [ndt-dev] [ndt] r818 committed - Move the iflist stuff into web100-pcap since that's it's only user
  • Date: Sun, 21 Apr 2013 17:38:12 +0000
  • Authentication-results: sfpop-ironport02.merit.edu; dkim=neutral (message not signed) header.i=none

Revision: 818
Author:

Date: Sun Apr 21 10:37:52 2013
Log: Move the iflist stuff into web100-pcap since that's it's only user


http://code.google.com/p/ndt/source/detail?r=818

Modified:
/trunk/src/web100-pcap.c
/trunk/src/web100srv.c
/trunk/src/web100srv.h

=======================================
--- /trunk/src/web100-pcap.c Sun Apr 21 10:26:30 2013
+++ /trunk/src/web100-pcap.c Sun Apr 21 10:37:52 2013
@@ -22,15 +22,20 @@
#include "strlutils.h"
#include "utils.h"

-int dumptrace;
-pcap_t *pd;
-pcap_dumper_t *pdump;
-int mon_pipe1[2], mon_pipe2[2];
+static struct iflists {
+ char name[8][32];
+ u_int16_t speed[32];
+} iflist;
+
+static int dumptrace;
+static pcap_t *pd;
+static pcap_dumper_t *pdump;
+static int mon_pipe1[2], mon_pipe2[2];
/* int sig1, sig2; */
-int sigj = 0, sigk = 0;
-int ifspeed;
+static int sigj = 0, sigk = 0;
+static int ifspeed;

-struct spdpair fwd, rev;
+static struct spdpair fwd, rev;

/** Scan through interface device list and get names/speeds of each interface.
*
@@ -39,7 +44,7 @@
* the bottleneck link detection algorithm RAC 7/14/09
*
*/
-void get_iflist(void) {
+void init_iflist(void) {
/* pcap_addr_t *ifaceAddr; */
pcap_if_t *alldevs, *dp;
struct ethtool_cmd ecmd;
@@ -90,6 +95,10 @@
// free list allocated by pcap_findalldevs call
if (alldevs != NULL)
pcap_freealldevs(alldevs);
+
+ for (i = 0; iflist.speed[i] > 0; i++)
+ log_println(4, "Generated iflist with device=%s and if_speed=%d",
+ iflist.name[i], iflist.speed[i]);
}

/**
@@ -759,6 +768,13 @@
init_vars(&fwd);
init_vars(&rev);

+ // scan through the interface device list and get the names/speeds of each
+ // if. The speed data can be used to cap the search for the bottleneck link
+ // capacity. The intent is to reduce the impact of interrupt coalescing on
+ // the bottleneck link detection algorithm
+ // RAC 7/14/09
+ init_iflist();
+
sockAddr = I2AddrBySAddr(get_errhandle(), sock_addr, saddrlen, 0, 0);
sock_addr = I2AddrSAddr(sockAddr, 0);
src_addr = I2AddrSAddr(srcAddr, 0);
=======================================
--- /trunk/src/web100srv.c Thu Apr 11 07:37:40 2013
+++ /trunk/src/web100srv.c Sun Apr 21 10:37:52 2013
@@ -1878,18 +1878,6 @@
protolog_printgeneric(srvstatusdesc, startsrvmsg);
*/

- // scan through the interface device list and get the names/speeds of each
- // if. The speed data can be used to cap the search for the bottleneck link
- // capacity. The intent is to reduce the impact of interrupt coalescing on
- // the bottleneck link detection algorithm
- // RAC 7/14/09
-
- get_iflist();
-
- for (i = 0; iflist.speed[i] > 0; i++)
- log_println(4, "Generated iflist with device=%s and if_speed=%d",
- iflist.name[i], iflist.speed[i]);
-
// Wait at accept() for a new connection from a client process.

// These 2 flags keep track of running processes. The 'testing' flag
=======================================
--- /trunk/src/web100srv.h Sun Apr 21 10:26:30 2013
+++ /trunk/src/web100srv.h Sun Apr 21 10:37:52 2013
@@ -179,11 +179,6 @@
u_int32_t reserved[4];
};

-struct iflists {
- char name[8][32];
- u_int16_t speed[32];
-} iflist;
-
/* web100-pcap */
#ifdef HAVE_LIBPCAP
void init_vars(struct spdpair *cur);


  • [ndt-dev] [ndt] r818 committed - Move the iflist stuff into web100-pcap since that's it's only user, ndt, 04/21/2013

Archive powered by MHonArc 2.6.16.

Top of Page