ndt-dev - [ndt-dev] [ndt] r993 committed - Cleanup tcp_stats_connection_from_socket
Subject: NDT-DEV email list created
List archive
- From:
- To:
- Subject: [ndt-dev] [ndt] r993 committed - Cleanup tcp_stats_connection_from_socket
- Date: Mon, 10 Mar 2014 13:44:35 +0000
Revision: 993
Author:
Date: Mon Mar 10 13:42:11 2014 UTC
Log: Cleanup tcp_stats_connection_from_socket
http://code.google.com/p/ndt/source/detail?r=993
Modified:
/branches/aaron-tcp_stats_cleanup/src/test_c2s_srv.c
/branches/aaron-tcp_stats_cleanup/src/test_mid_srv.c
/branches/aaron-tcp_stats_cleanup/src/test_s2c_srv.c
/branches/aaron-tcp_stats_cleanup/src/web100-util.c
/branches/aaron-tcp_stats_cleanup/src/web100srv.c
/branches/aaron-tcp_stats_cleanup/src/web100srv.h
=======================================
--- /branches/aaron-tcp_stats_cleanup/src/test_c2s_srv.c Mon Oct 14 13:20:21 2013 UTC
+++ /branches/aaron-tcp_stats_cleanup/src/test_c2s_srv.c Mon Mar 10 13:42:11 2014 UTC
@@ -251,7 +251,7 @@
I2Addr src_addr = I2AddrByLocalSockFD(get_errhandle(), recvsfd, 0);
// Get tcp_stat connection. Used to collect tcp_stat variable statistics
- conn = tcp_stat_connection_from_socket(agent, recvsfd);
+ conn = tcp_stats_connection_from_socket(agent, recvsfd);
// set up packet tracing. Collected data is used for bottleneck link
// calculations
=======================================
--- /branches/aaron-tcp_stats_cleanup/src/test_mid_srv.c Mon Mar 10 13:40:31 2014 UTC
+++ /branches/aaron-tcp_stats_cleanup/src/test_mid_srv.c Mon Mar 10 13:42:11 2014 UTC
@@ -221,11 +221,7 @@
buff[0] = '\0';
// get tcp_stat connection data
-#if USE_WEB100
- if ((conn = tcp_stat_connection_from_socket(agent, midsfd)) == NULL) {
-#elif USE_WEB10G
- if ((conn = tcp_stat_connection_from_socket(agent, midsfd)) == -1) {
-#endif
+ if ((conn = tcp_stats_connection_from_socket(agent, midsfd)) == NULL) {
log_println(
0,
"!!!!!!!!!!! test_mid() failed to get "TCP_STAT_NAME
=======================================
--- /branches/aaron-tcp_stats_cleanup/src/test_s2c_srv.c Mon Oct 14 13:20:21 2013 UTC
+++ /branches/aaron-tcp_stats_cleanup/src/test_s2c_srv.c Mon Mar 10 13:42:11 2014 UTC
@@ -283,7 +283,7 @@
}
}
src_addr = I2AddrByLocalSockFD(get_errhandle(), xmitsfd, 0);
- conn = tcp_stat_connection_from_socket(agent, xmitsfd);
+ conn = tcp_stats_connection_from_socket(agent, xmitsfd);
// set up packet capture. The data collected is used for bottleneck link
// calculations
=======================================
--- /branches/aaron-tcp_stats_cleanup/src/web100-util.c Mon Mar 10 13:41:40 2014 UTC
+++ /branches/aaron-tcp_stats_cleanup/src/web100-util.c Mon Mar 10 13:42:11 2014 UTC
@@ -1047,6 +1047,19 @@
return value.uv32;
#endif
}
+
+tcp_stat_connection tcp_stats_connection_from_socket(tcp_stat_agent *agent, int sock) {
+ tcp_stat_connection retval;
+
+#ifdef USE_WEB100
+ retval = web100_connection_from_socket(agent, sock);
+#elif USE_WEB10G
+ retval = web10g_connection_from_socket(agent, sock);
+ if (retval == -1)
+ retval = NULL;
+#endif
+ return retval;
+}
void tcp_stats_set_cwnd(tcp_stat_agent *agent, tcp_stat_connection cn, uint32_t cwnd) {
#if USE_WEB100
=======================================
--- /branches/aaron-tcp_stats_cleanup/src/web100srv.c Mon Mar 10 13:41:40 2014 UTC
+++ /branches/aaron-tcp_stats_cleanup/src/web100srv.c Mon Mar 10 13:42:11 2014 UTC
@@ -965,7 +965,7 @@
spd_index = 0;
// obtain web100 connection and check auto-tune status
- conn = tcp_stat_connection_from_socket(agent, ctlsockfd);
+ conn = tcp_stats_connection_from_socket(agent, ctlsockfd);
autotune = tcp_stat_autotune(ctlsockfd, agent, conn);
// client needs to be version compatible. Send current version
=======================================
--- /branches/aaron-tcp_stats_cleanup/src/web100srv.h Mon Mar 10 13:41:40 2014 UTC
+++ /branches/aaron-tcp_stats_cleanup/src/web100srv.h Mon Mar 10 13:42:11 2014 UTC
@@ -284,7 +284,6 @@
typedef void tcp_stat_group;
/* Log currently unimplemented in web10g */
typedef estats_record tcp_stat_log;
-#define tcp_stat_connection_from_socket web10g_connection_from_socket
/* Extra Web10G functions web10g-util.c */
int web10g_find_val(const tcp_stat_snap* data, const char* name,
@@ -303,7 +302,6 @@
/* Group only relevent to web100 */
typedef web100_group tcp_stat_group;
typedef web100_log tcp_stat_log;
-#define tcp_stat_connection_from_socket web100_connection_from_socket
#endif
@@ -313,6 +311,7 @@
void tcp_stats_free_agent(tcp_stat_agent *agent);
int tcp_stats_snap_read_var(tcp_stat_agent *agent, tcp_stat_snap *snap, const char *var_name);
void tcp_stats_set_cwnd(tcp_stat_agent *agent, tcp_stat_connection cn, uint32_t cwnd);
+tcp_stat_connection tcp_stats_connection_from_socket(tcp_stat_agent *agent, int sock);
int tcp_stat_autotune(int sock, tcp_stat_agent* agent, tcp_stat_connection cn);
void tcp_stat_middlebox(int sock, tcp_stat_agent* agent, tcp_stat_connection cn,
- [ndt-dev] [ndt] r993 committed - Cleanup tcp_stats_connection_from_socket, ndt, 03/10/2014
Archive powered by MHonArc 2.6.16.