Skip to Content.
Sympa Menu

ndt-dev - [ndt-dev] [ndt] r1184 committed - Corrected rmt_host and rmt_addr usages

Subject: NDT-DEV email list created

List archive

[ndt-dev] [ndt] r1184 committed - Corrected rmt_host and rmt_addr usages


Chronological Thread 
  • From:
  • To:
  • Subject: [ndt-dev] [ndt] r1184 committed - Corrected rmt_host and rmt_addr usages
  • Date: Wed, 18 Feb 2015 16:22:03 +0000

Revision: 1184
Author:

Date: Wed Feb 18 16:21:38 2015 UTC
Log: Corrected rmt_host and rmt_addr usages
https://code.google.com/p/ndt/source/detail?r=1184

Modified:
/branches/Issue165/src/analyze.c
/branches/Issue165/src/ndt_odbc.c
/branches/Issue165/src/ndt_odbc.h
/branches/Issue165/src/testoptions.c
/branches/Issue165/src/web100srv.c
/branches/Issue165/src/web100srv.h

=======================================
--- /branches/Issue165/src/analyze.c Thu Nov 15 21:34:19 2012 UTC
+++ /branches/Issue165/src/analyze.c Wed Feb 18 16:21:38 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
=======================================
--- /branches/Issue165/src/ndt_odbc.c Thu Nov 15 21:34:19 2012 UTC
+++ /branches/Issue165/src/ndt_odbc.c Wed Feb 18 16:21:38 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
*

*/

@@ -37,7 +37,7 @@
"hostName TEXT,"
"testPort INT,"
"date TEXT,"
-"rmt_host TEXT,";
+"rmt_addr TEXT,";
char* ctStmt_2 = "s2c2spd INT,"
"s2cspd INT,"
"c2sspd INT,"
@@ -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,
=======================================
--- /branches/Issue165/src/ndt_odbc.h Thu Nov 15 21:33:44 2012 UTC
+++ /branches/Issue165/src/ndt_odbc.h Wed Feb 18 16:21:38 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,
=======================================
--- /branches/Issue165/src/testoptions.c Wed May 28 11:17:18 2014 UTC
+++ /branches/Issue165/src/testoptions.c Wed Feb 18 16:21:38 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
=======================================
--- /branches/Issue165/src/web100srv.c Tue Feb 17 13:40:44 2015 UTC
+++ /branches/Issue165/src/web100srv.c Wed Feb 18 16:21:38 2015 UTC
@@ -955,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());
@@ -1327,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,
@@ -1356,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,
@@ -1381,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(
@@ -2249,7 +2249,6 @@
new_child = (struct ndtchild *) malloc(sizeof(struct ndtchild));
memset(new_child, 0, sizeof(struct ndtchild));
tt = time(0);
- name = rmt_host;

// At this point we have received a connection from a client,
// meaning that a test is being requested. At this point we should
@@ -2315,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
@@ -2664,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);
@@ -2689,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);
@@ -2771,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;
}
=======================================
--- /branches/Issue165/src/web100srv.h Wed May 28 11:17:18 2014 UTC
+++ /branches/Issue165/src/web100srv.h Wed Feb 18 16:21:38 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] r1184 committed - Corrected rmt_host and rmt_addr usages, ndt, 02/18/2015

Archive powered by MHonArc 2.6.16.

Top of Page