ndt-dev - [ndt-dev] [ndt] r1187 committed - Merge Issue165 branch
Subject: NDT-DEV email list created
List archive
- From:
- To:
- Subject: [ndt-dev] [ndt] r1187 committed - Merge Issue165 branch
- Date: Wed, 18 Feb 2015 16:55:10 +0000
Revision: 1187
Author:
Date: Wed Feb 18 16:54:51 2015 UTC
Log: Merge Issue165 branch
https://code.google.com/p/ndt/source/detail?r=1187
Modified:
/trunk
/trunk/src/analyze.c
/trunk/src/ndt_odbc.c
/trunk/src/ndt_odbc.h
/trunk/src/testoptions.c
/trunk/src/web100srv.c
/trunk/src/web100srv.h
=======================================
--- /trunk/src/analyze.c Thu Nov 15 21:34:19 2012 UTC
+++ /trunk/src/analyze.c Wed Feb 18 16:54:51 2015 UTC
@@ -42,7 +42,6 @@
char buff[BUFFSIZE + 1];
int window = 64000;
int randomize = 0;
-char *rmt_host;
char *VarFileName = NULL;
char *LogFileName = NULL;
char *ProtoLogFileName = NULL; // Log file used to log protocol validation logs
=======================================
--- /trunk/src/ndt_odbc.c Thu Nov 15 21:34:19 2012 UTC
+++ /trunk/src/ndt_odbc.c Wed Feb 18 16:54:51 2015 UTC
@@ -1,7 +1,7 @@
/*
* This file contains functions needed to handle database support (ODBC).
*
- * Jakub S³awiñski 2007-07-23
+ * Jakub S�awi�ski 2007-07-23
*
*/
@@ -257,7 +257,7 @@
* */
int db_insert(char spds[4][256], float runave[], char* cputimelog,
char* snaplog, char* c2s_snaplog, char* hostName, int testPort,
- char* date, char* rmt_host, int s2c2spd, int s2cspd, int c2sspd,
+ char* date, char* rmt_addr, int s2c2spd, int s2cspd, int c2sspd,
int Timeouts, int SumRTT, int CountRTT, int PktsRetrans,
int FastRetran, int DataPktsOut, int AckPktsOut, int CurrentMSS,
int DupAcksIn, int AckPktsIn, int MaxRwinRcvd, int Sndbuf,
@@ -304,7 +304,7 @@
");",
spds[0], spds[1], spds[2], spds[3], runave[0], runave[1], runave[2],
runave[3], cputimelog, snaplog, c2s_snaplog, hostName, testPort,
- date, rmt_host, s2c2spd, s2cspd, c2sspd, Timeouts,
+ date, rmt_addr, s2c2spd, s2cspd, c2sspd, Timeouts,
SumRTT, CountRTT, PktsRetrans, FastRetran, DataPktsOut,
AckPktsOut, CurrentMSS, DupAcksIn, AckPktsIn, MaxRwinRcvd,
Sndbuf, MaxCwnd, SndLimTimeRwin, SndLimTimeCwnd, SndLimTimeSender,
=======================================
--- /trunk/src/ndt_odbc.h Thu Nov 15 21:33:44 2012 UTC
+++ /trunk/src/ndt_odbc.h Wed Feb 18 16:54:51 2015 UTC
@@ -1,7 +1,7 @@
/*
* This file contains function declarations to handle database support (ODBC).
*
- * Jakub S³awiñski 2007-07-23
+ * Jakub S�awi�ski 2007-07-23
*
*/
@@ -11,7 +11,7 @@
int initialize_db(int options, char* dsn, char* uin, char* pwd);
int db_insert(char spds[4][256], float runave[], char* cputimelog,
char* snaplog, char* c2s_snaplog, char* hostName, int testPort,
- char* date, char* rmt_host, int s2c2spd, int s2cspd, int c2sspd,
+ char* date, char* rmt_addr, int s2c2spd, int s2cspd, int c2sspd,
int Timeouts, int SumRTT, int CountRTT, int PktsRetrans,
int FastRetran, int DataPktsOut, int AckPktsOut, int CurrentMSS,
int DupAcksIn, int AckPktsIn, int MaxRwinRcvd, int Sndbuf,
=======================================
--- /trunk/src/testoptions.c Wed May 28 11:17:18 2014 UTC
+++ /trunk/src/testoptions.c Wed Feb 18 16:54:51 2015 UTC
@@ -219,7 +219,7 @@
char* jsonMsgValue;
// char remhostarr[256], protologlocalarr[256];
- // char *remhost_ptr = get_remotehost();
+ // char *remhost_ptr = get_remotehostaddress();
assert(ctlsockfd != -1);
assert(options);
@@ -284,9 +284,9 @@
// log that client connected, and create log file
log_println(0,
"Client connect received from :IP %s to some server on socket %d",
- get_remotehost(), ctlsockfd);
+ get_remotehostaddress(), ctlsockfd);
- // set_protologfile(get_remotehost(), protologlocalarr);
+ // set_protologfile(get_remotehostaddress(), protologlocalarr);
if (!(useropt
& (TEST_MID | TEST_C2S | TEST_S2C | TEST_SFW | TEST_STATUS
=======================================
--- /trunk/src/web100srv.c Thu Nov 20 00:29:27 2014 UTC
+++ /trunk/src/web100srv.c Wed Feb 18 16:54:51 2015 UTC
@@ -136,9 +136,10 @@
static int syslogfacility = LOG_FACILITY;
static char *ConfigFileName = NULL;
static char buff[BUFFSIZE + 1];
-static char*rmt_host;
+static char rmt_host[256];
+static char rmt_addr[256];
static char *device = NULL;
-static char* port = PORT;
+static char *port = PORT;
static TestOptions testopt;
static int conn_options = 0;
@@ -954,7 +955,7 @@
// start with a clean slate of currently running test and direction
setCurrentTest(TEST_NONE);
- log_println(7, "Remote host= %s", get_remotehost());
+ log_println(7, "Remote host= %s", get_remotehostaddress());
stime = time(0);
log_println(4, "Child process %d started", getpid());
@@ -1262,9 +1263,9 @@
get_ISOtime(isoTime, sizeof(isoTime)));
log_println(9, "meta.date=%s, meta.clientip =%s:%s:%d", meta.date,
- meta.client_ip, rmt_host, strlen(rmt_host));
- memcpy(meta.client_ip, rmt_host, strlen(rmt_host));
- log_println(9, "2. meta.clientip =%s:%s:%d", meta.client_ip, rmt_host);
+ meta.client_ip, rmt_addr, strlen(rmt_addr));
+ memcpy(meta.client_ip, rmt_addr, strlen(rmt_addr));
+ log_println(9, "2. meta.clientip =%s:%s:%d", meta.client_ip, rmt_addr);
memset(tmpstr, 0, sizeof(tmpstr));
snprintf(tmpstr, sizeof(tmpstr), "%d,%d,%d,%"VARtype",%"VARtype",%"
@@ -1326,7 +1327,7 @@
fprintf(fp, "%s,", date);
fprintf(fp, "%s,%d,%d,%d,%"VARtype",%"VARtype",%"VARtype",%"
VARtype",%"VARtype",%"VARtype",%"VARtype",%"VARtype",%"
- VARtype",%"VARtype",", rmt_host,
+ VARtype",%"VARtype",", rmt_addr,
(int) s2c2spd, (int) s2cspd, (int) c2sspd, vars.Timeouts,
vars.SumRTT, vars.CountRTT, vars.PktsRetrans, vars.FastRetran,
vars.DataPktsOut, vars.AckPktsOut, vars.CurrentMSS, vars.DupAcksIn,
@@ -1355,7 +1356,7 @@
fclose(fp);
}
db_insert(spds, runave, cputimelog, options.s2c_logname,
- options.c2s_logname, testName, testPort, date, rmt_host, s2c2spd,
+ options.c2s_logname, testName, testPort, date, rmt_addr, s2c2spd,
s2cspd, c2sspd, vars.Timeouts, vars.SumRTT, vars.CountRTT,
vars.PktsRetrans, vars.FastRetran, vars.DataPktsOut,
vars.AckPktsOut, vars.CurrentMSS, vars.DupAcksIn, vars.AckPktsIn,
@@ -1380,7 +1381,7 @@
"AckPktsOut=%"VARtype","
"CurrentMSS=%"VARtype",DupAcksIn=%"VARtype","
"AckPktsIn=%"VARtype",",
- rmt_host, c2sspd, s2cspd, vars.Timeouts, vars.SumRTT, vars.CountRTT,
+ rmt_addr, c2sspd, s2cspd, vars.Timeouts, vars.SumRTT, vars.CountRTT,
vars.PktsRetrans, vars.FastRetran, vars.DataPktsOut, vars.AckPktsOut,
vars.CurrentMSS, vars.DupAcksIn, vars.AckPktsIn);
snprintf(
@@ -2184,12 +2185,15 @@
memcpy(&meta.c_addr, &cli_addr, clilen);
meta.family = ((struct sockaddr *) &cli_addr)->sa_family;
- size_t tmpstrlen = sizeof(tmpstr);
- memset(tmpstr, 0, tmpstrlen);
+ memset(rmt_addr, 0, sizeof(rmt_addr));
// get addr details based on socket info available
I2Addr tmp_addr = I2AddrBySockFD(get_errhandle(), ctlsockfd,
False);
- I2AddrNodeName(tmp_addr, tmpstr, &tmpstrlen);
+ addr2a(&cli_addr, rmt_addr, sizeof(rmt_addr));
+
+ size_t rmt_host_strlen = sizeof(rmt_host);
+ memset(rmt_host, 0, rmt_host_strlen);
+ I2AddrNodeName(tmp_addr, rmt_host, &rmt_host_strlen);
/* I2AddrFree(tmp_addr); */
log_println(4,
"New connection received from 0x%x [%s] sockfd=%d.",
@@ -2245,9 +2249,6 @@
new_child = (struct ndtchild *) malloc(sizeof(struct ndtchild));
memset(new_child, 0, sizeof(struct ndtchild));
tt = time(0);
- name = tmpstr;
-
- rmt_host = tmpstr;
// At this point we have received a connection from a client,
// meaning that a test is being requested. At this point we should
@@ -2313,10 +2314,10 @@
log_println(6, "creating new child - semaphore locked");
/*sigprocmask(SIG_BLOCK, &newmask, &oldmask); */
new_child->pid = chld_pid;
- /* strncpy(new_child->addr, rmt_host, strlen(rmt_host));
- strncpy(new_child->host, name, strlen(name));*/
- strlcpy(new_child->addr, rmt_host, sizeof(new_child->addr));
- strlcpy(new_child->host, name, sizeof(new_child->host));
+ /* strncpy(new_child->addr, rmt_addr, strlen(rmt_host));
+ strncpy(new_child->host, rmt_host, strlen(name));*/
+ strlcpy(new_child->addr, rmt_addr, sizeof(new_child->addr));
+ strlcpy(new_child->host, rmt_host, sizeof(new_child->host));
// compute start time based in the number of waiting clients
// set other properties on this child process
@@ -2662,12 +2663,12 @@
False);
testPort = I2AddrPort(tmp_addr);
meta.ctl_port = testPort;
- snprintf(testName, sizeof(testName), "%s", name);
+ snprintf(testName, sizeof(testName), "%s", rmt_host);
I2AddrFree(tmp_addr);
memset(cputimelog, 0, 256);
if (cputime) {
snprintf(dir, sizeof(dir), "%s_%s:%d.cputime",
- get_ISOtime(isoTime, sizeof(isoTime)), name,
+ get_ISOtime(isoTime, sizeof(isoTime)), rmt_host,
testPort);
log_println(8, "CPUTIME:suffix=%s", dir);
create_named_logdir(cputimelog, sizeof(cputimelog), dir, 0);
@@ -2687,7 +2688,7 @@
log_println(0, "Unable to open log file '%s', continuing on "
"without logging", get_logfile());
} else {
- fprintf(fp, "%15.15s %s port %d\n", ctime(&tt)+4, name,
+ fprintf(fp, "%15.15s %s port %d\n", ctime(&tt)+4, rmt_host,
testPort);
if (cputime && workerThreadId) {
log_println(1, "cputime trace file: %s\n", cputimelog);
@@ -2769,8 +2770,8 @@
/**
* Method to get remote host's address.
- * @return remote host name
+ * @return remote host's address
* */
-char *get_remotehost() {
- return rmt_host;
+char *get_remotehostaddress() {
+ return rmt_addr;
}
=======================================
--- /trunk/src/web100srv.h Wed May 28 11:17:18 2014 UTC
+++ /trunk/src/web100srv.h Wed Feb 18 16:54:51 2015 UTC
@@ -325,7 +325,7 @@
int KillHung(void);
void writeMeta(int compress, int cputime, int snaplog, int tcpdump);
-char *get_remotehost();
+char *get_remotehostaddress();
/* global variables for signal processing */
sig_atomic_t sig13;
- [ndt-dev] [ndt] r1187 committed - Merge Issue165 branch, ndt, 02/18/2015
Archive powered by MHonArc 2.6.16.