ndt-dev - [ndt-dev] [ndt] r740 committed - Changes to server side files to use new changes for protocol logging t...
Subject: NDT-DEV email list created
List archive
[ndt-dev] [ndt] r740 committed - Changes to server side files to use new changes for protocol logging t...
Chronological Thread
- From:
- To:
- Subject: [ndt-dev] [ndt] r740 committed - Changes to server side files to use new changes for protocol logging t...
- Date: Fri, 28 Oct 2011 15:07:40 +0000
Revision: 740
Author:
Date: Fri Oct 28 08:06:41 2011
Log: Changes to server side files to use new changes for protocol logging to include both end points of tests in filename. Also including logging.h which should have gone in with previous commits in CLT side
http://code.google.com/p/ndt/source/detail?r=740
Modified:
/branches/kkumar_code_organize/src/logging.h
/branches/kkumar_code_organize/src/test_c2s_srv.c
/branches/kkumar_code_organize/src/test_meta_srv.c
/branches/kkumar_code_organize/src/test_mid_srv.c
/branches/kkumar_code_organize/src/test_s2c_srv.c
/branches/kkumar_code_organize/src/test_sfw_srv.c
/branches/kkumar_code_organize/src/usage.c
/branches/kkumar_code_organize/src/web100srv.c
=======================================
--- /branches/kkumar_code_organize/src/logging.h Tue Oct 18 09:01:08
2011
+++ /branches/kkumar_code_organize/src/logging.h Fri Oct 28 08:06:41
2011
@@ -79,7 +79,7 @@
void set_protologdir(char* dirname);
void set_protologfile(char* client_ip, char *protologfileparam);
-char* get_protologfile();
+char* get_protologfile(int socketnum);
char* get_protologdir();
void enableprotocollogging();
char *createprotologfilename(char* client_ip, char* textappendarg);
@@ -90,17 +90,17 @@
int finalsuffixsize);
void log_linkspeed(int index);
-void protolog_printgeneric(const char* key, const char* val);
+void protolog_printgeneric(const char* key, const char* val,int socketnum);
void protolog_status(int pid, enum TEST_ID testid,
- enum TEST_STATUS_INT teststatus);
+ enum TEST_STATUS_INT teststatus,int socketnum);
void protolog_sendprintln(const int type, void* msg, const int len,
const int processid, const int ctlSocket);
void protolog_rcvprintln(const int type, void* msg, const int len,
const int processid, const int ctlSocket);
void protolog_procstatus(int pid, enum TEST_ID testidarg,
- enum PROCESS_TYPE_INT procidarg, enum PROCESS_STATUS_INT
teststatusarg);
+ enum PROCESS_TYPE_INT procidarg, enum PROCESS_STATUS_INT teststatusarg, int socketnum);
void protolog_procstatuslog(int pid, enum TEST_ID testidarg,
- enum PROCESS_TYPE_INT procidarg, enum PROCESS_STATUS_INT
teststatusarg);
+ enum PROCESS_TYPE_INT procidarg, enum PROCESS_STATUS_INT teststatusarg, int socketnum);
struct metadata meta;
#endif
=======================================
--- /branches/kkumar_code_organize/src/test_c2s_srv.c Tue Oct 18 09:05:36 2011
+++ /branches/kkumar_code_organize/src/test_c2s_srv.c Fri Oct 28 08:06:41 2011
@@ -100,6 +100,7 @@
enum PROCESS_STATUS_INT procstatusenum = UNKNOWN;
enum PROCESS_TYPE_INT proctypeenum = CONNECT_TYPE;
char namesuffix[256] = "c2s_snaplog";
+ char currenttestdesc[TEST_NAME_DESC_SIZE] = "c2s" ; // todo hardcoded coz of pcap
if (testOptions->c2sopt) {
setCurrentTest(TEST_C2S);
@@ -109,7 +110,7 @@
//log protocol validation logs
teststatuses = TEST_STARTED;
- protolog_status(testOptions->child0, testids, teststatuses);
+ protolog_status(testOptions->child0, testids, teststatuses,
ctlsockfd);
// Determine port to be used. Compute based on options set
earlier
// by reading from config file, or use default port2 (3002).
@@ -210,7 +211,7 @@
procstatusenum = PROCESS_STARTED;
proctypeenum = CONNECT_TYPE;
protolog_procstatus(testOptions->child0,
testids, proctypeenum,
- procstatusenum);
+ procstatusenum, recvsfd);
break;
}
if ((recvsfd == -1) && (errno == EINTR)) { // socket interrupted, wait some more
@@ -241,7 +242,7 @@
testOptions->child0, recvsfd);
// commenting out below to move to init_pkttrace function
- // src_addr = I2AddrByLocalSockFD(get_errhandle(), recvsfd,
0);
+ I2Addr src_addr = I2AddrByLocalSockFD(get_errhandle(),
recvsfd, 0);
// Get web100 connection. Used to collect web100 variable
statistics
conn = web100_connection_from_socket(agent, recvsfd);
@@ -250,11 +251,15 @@
if (getuid() == 0) {
pipe(mon_pipe1);
- log_println(0, "C2S test calling pkt_trace_start() with
pd=%d",
- clilen);
- start_packet_trace(recvsfd, testOptions->c2ssockfd,
&c2s_childpid,
+ log_println(0, "%s test calling pkt_trace_start() with pd=%d for device %s, addr %s",
+ currenttestdesc, clilen, device ,
src_addr);
+ /*start_packet_trace(recvsfd, testOptions->c2ssockfd,
&c2s_childpid,
mon_pipe1, (struct sockaddr *)
&cli_addr, clilen, device,
&pair, "c2s", options->compress,
meta.c2s_ndttrace);
+ */
+ start_packet_trace(recvsfd, testOptions->c2ssockfd,
&c2s_childpid,
+ mon_pipe1,
(struct sockaddr *) &cli_addr, clilen, device,
+ &pair,
currenttestdesc, options->compress, meta.c2s_ndttrace);
log_println(3, "--tracefile after packet_trace %s",
meta.c2s_ndttrace);
}
@@ -266,11 +271,13 @@
setCwndlimit(conn, group, agent, options);
// Create C->S snaplog directories, and perform some initialization based on options
+//todo remove logs
+ log_println(0,"***Before create client, C2s");
create_client_logdir((struct sockaddr *) &cli_addr, clilen,
options->c2s_logname,
sizeof(options->c2s_logname), namesuffix,
sizeof(namesuffix));
-
+ log_println(0,"***AFTER create client, C2s"); //todo remove
log
sleep(2);
// send empty TEST_START indicating start of the test
@@ -406,7 +413,7 @@
log_println(1, " <----------- %d -------------->",
testOptions->child0);
//protocol logs
teststatuses = TEST_ENDED;
- protolog_status(testOptions->child0, testids, teststatuses);
+ protolog_status(testOptions->child0, testids, teststatuses,
ctlsockfd);
//set current test status and free address
setCurrentTest(TEST_NONE);
=======================================
--- /branches/kkumar_code_organize/src/test_meta_srv.c Mon Oct 17 06:43:25 2011
+++ /branches/kkumar_code_organize/src/test_meta_srv.c Fri Oct 28 08:06:41 2011
@@ -56,7 +56,7 @@
// log protocol validation details
teststatuses = TEST_STARTED;
- protolog_status(testOptions->child0, testids, teststatuses);
+ protolog_status(testOptions->child0, testids,
teststatuses,ctlsockfd);
// first message exchanged is am empty TEST_PREPARE message
j = send_msg(ctlsockfd, TEST_PREPARE, "", 0);
@@ -149,7 +149,7 @@
log_println(1, " <-------------------------->");
teststatuses = TEST_ENDED; // protocol log section
- protolog_status(testOptions->child0, testids, teststatuses);
+ protolog_status(testOptions->child0, testids,
teststatuses,ctlsockfd);
setCurrentTest(TEST_NONE);
}
=======================================
--- /branches/kkumar_code_organize/src/test_mid_srv.c Tue Oct 18 09:05:36 2011
+++ /branches/kkumar_code_organize/src/test_mid_srv.c Fri Oct 28 08:06:41 2011
@@ -91,7 +91,7 @@
printf(" <--- %d - Middlebox test --->", options->child0);
thistestId = MIDDLEBOX;
teststatusnow = TEST_STARTED;
- protolog_status(options->child0, thistestId, teststatusnow);
+ protolog_status(options->child0, thistestId, teststatusnow,
ctlsockfd);
// determine port to be used. Compute based on options set
earlier
// by reading from config file, or use default port3 (3003),
@@ -205,7 +205,7 @@
procstatusenum = PROCESS_STARTED;
proctypeenum = CONNECT_TYPE;
protolog_procstatus(options->child0,
thistestId, proctypeenum,
- procstatusenum);
+ procstatusenum, midsfd);
break;
}
@@ -291,7 +291,7 @@
// log end of test into protocol doc, just to delimit.
teststatusnow = TEST_ENDED;
//protolog_status(1, options->child0, thistestId,
teststatusnow);
- protolog_status(options->child0, thistestId, teststatusnow);
+ protolog_status(options->child0, thistestId,
teststatusnow,ctlsockfd);
setCurrentTest(TEST_NONE);
/* I2AddrFree(midsrv_addr); */
=======================================
--- /branches/kkumar_code_organize/src/test_s2c_srv.c Tue Oct 18 13:58:02 2011
+++ /branches/kkumar_code_organize/src/test_s2c_srv.c Fri Oct 28 08:06:41 2011
@@ -135,7 +135,7 @@
//protocol logs
teststatuses = TEST_STARTED;
- protolog_status(testOptions->child0, testids, teststatuses);
+ protolog_status(testOptions->child0, testids, teststatuses,
ctlsockfd);
strlcpy(listens2cport, PORT4, sizeof(listens2cport));
@@ -241,7 +241,7 @@
procstatusenum = PROCESS_STARTED;
proctypeenum = CONNECT_TYPE;
protolog_procstatus(testOptions->child0,
testids, proctypeenum,
- procstatusenum);
+ procstatusenum, xmitsfd);
break;
}
if ((xmitsfd == -1) && (errno == EINTR)) { // socket interrupted, wait some more
@@ -547,7 +547,7 @@
log_println(0, " <------------ %d ------------->",
testOptions->child0);
//log protocol validation logs
teststatuses = TEST_ENDED;
- protolog_status(testOptions->child0, testids, teststatuses);
+ protolog_status(testOptions->child0, testids,
teststatuses,ctlsockfd);
setCurrentTest(TEST_NONE);
=======================================
--- /branches/kkumar_code_organize/src/test_sfw_srv.c Mon Oct 17 06:43:25 2011
+++ /branches/kkumar_code_organize/src/test_sfw_srv.c Fri Oct 28 08:06:41 2011
@@ -99,7 +99,7 @@
// log
teststatusnow = TEST_ENDED;
- protolog_status(getpid(), thistestId, teststatusnow);
+ protolog_status(getpid(), thistestId, teststatusnow, ctlsockfd);
log_println(1, " <-------------------------->");
// unset test name
setCurrentTest(TEST_NONE);
@@ -150,7 +150,7 @@
log_println(1, " <-- %d - Simple firewall test -->",
options->child0);
thistestId = SFW;
teststatusnow = TEST_STARTED;
- protolog_status(options->child0, thistestId, teststatusnow);
+ protolog_status(options->child0, thistestId,
teststatusnow,ctlsockfd);
// bind to a new port and obtain address structure with details of port etc
sfwsrv_addr = CreateListenSocket(NULL, "0", conn_options, 0);
@@ -252,7 +252,7 @@
// log end
teststatusnow = TEST_ENDED;
- protolog_status(options->child0, thistestId,
teststatusnow);
+ protolog_status(options->child0, thistestId,
teststatusnow, ctlsockfd);
log_println(1, " <-------------------------->");
I2AddrFree(sfwsrv_addr);
return 5;
@@ -301,7 +301,7 @@
sockfd = accept(sfwsockfd, (struct sockaddr *) &cli_addr,
&clilen);
// protocol validation log to indicate client tried connecting
procstatusenum = PROCESS_STARTED;
- protolog_procstatus(options->child0, thistestId, proctypeenum, procstatusenum);
+ protolog_procstatus(options->child0, thistestId, proctypeenum, procstatusenum, sockfd);
msgLen = sizeof(buff);
if (recv_msg(sockfd, &msgType, buff, &msgLen)) { // message received in error
=======================================
--- /branches/kkumar_code_organize/src/usage.c Mon Oct 17 06:43:25 2011
+++ /branches/kkumar_code_organize/src/usage.c Fri Oct 28 08:06:41 2011
@@ -146,6 +146,8 @@
printf(" --disablec2s - disable the C2S throughput
test\n");
printf(" --disables2c - disable the S2C throughput
test\n");
printf(" --disablesfw - disable the Simple firewall
test\n\n");
+ printf(" -u, --protolog_dir DIR - specify the base directory for protocol validation logs \n");
+ printf(" --enableprotolog - enable protocol logging \n");
#ifdef AF_INET6
printf(" IP family:\n\n");
printf(" -4, --ipv4 - use IPv4 addresses only\n");
=======================================
--- /branches/kkumar_code_organize/src/web100srv.c Tue Oct 18 09:01:08
2011
+++ /branches/kkumar_code_organize/src/web100srv.c Fri Oct 28 08:06:41
2011
@@ -1188,7 +1188,7 @@
// time spent in being send-limited due to own fault
sendtime = calc_sendlimited_sndrfault(SndLimTimeSender, totaltime);
- timesec = totaltime / MEGA; // total time in get microsecs
+ timesec = totaltime / MEGA; // total time in microsecs
// get fraction of total test time waiting for packets to arrive
RTOidle = calc_RTOIdle(Timeouts, CurrentRTO, timesec);
@@ -1507,10 +1507,10 @@
char *name;
// variables used for protocol validation logs
- char startsrvmsg[256]; // used to log start of server process
- char *srvstatusdesc;
- enum PROCESS_STATUS_INT srvstatusenum = UNKNOWN;
- char statustemparr[PROCESS_STATUS_DESC_SIZE]; // temp storage for process name
+ //char startsrvmsg[256]; // used to log start of server process
+ //char *srvstatusdesc;
+ //enum PROCESS_STATUS_INT srvstatusenum = UNKNOWN;
+ //char statustemparr[PROCESS_STATUS_DESC_SIZE]; // temp storage for process name
enum PROCESS_TYPE_INT proctypeenum = PROCESS_TYPE;
enum PROCESS_STATUS_INT procstatusenum = UNKNOWN;
@@ -1896,11 +1896,14 @@
VERSION);
// create protocol validation entry every time a process starts up
+ // This whole block is not needed since there are protocol log files per client
+ // and server start is not a protocol process
+ /*
sprintf(startsrvmsg, "Web100srv (ver %s)", VERSION);
srvstatusenum = PROCESS_STARTED;
srvstatusdesc = get_procstatusdesc(srvstatusenum, statustemparr);
- //protolog_printgeneric(0, srvstatusdesc, startsrvmsg);
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
@@ -2201,7 +2204,7 @@
procstatusenum = PROCESS_STARTED;
proctypeenum = CONNECT_TYPE;
protolog_procstatus(getpid(),
getCurrentTest(), proctypeenum,
- procstatusenum);
+ procstatusenum, ctlsockfd );
}
// the specially crafted data that kicks off the old
clients
- [ndt-dev] [ndt] r740 committed - Changes to server side files to use new changes for protocol logging t..., ndt, 10/28/2011
Archive powered by MHonArc 2.6.16.