Skip to Content.
Sympa Menu

ndt-dev - [ndt-dev] [ndt] r989 committed - Use getpeername instead of RemAddress in tcp_stat_get_data_recv

Subject: NDT-DEV email list created

List archive

[ndt-dev] [ndt] r989 committed - Use getpeername instead of RemAddress in tcp_stat_get_data_recv


Chronological Thread 
  • From:
  • To:
  • Subject: [ndt-dev] [ndt] r989 committed - Use getpeername instead of RemAddress in tcp_stat_get_data_recv
  • Date: Mon, 10 Mar 2014 13:40:35 +0000

Revision: 989
Author:

Date: Mon Mar 10 13:40:04 2014 UTC
Log: Use getpeername instead of RemAddress in tcp_stat_get_data_recv


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

Modified:
/branches/aaron-tcp_stats_cleanup/src/web100-util.c

=======================================
--- /branches/aaron-tcp_stats_cleanup/src/web100-util.c Mon Oct 14 13:20:21 2013 UTC
+++ /branches/aaron-tcp_stats_cleanup/src/web100-util.c Mon Mar 10 13:40:04 2014 UTC
@@ -398,6 +398,9 @@
estats_val_data* data = NULL;
estats_error* err = NULL;
#endif
+ socklen_t len;
+ struct sockaddr_storage addr;
+ int port;
int i;
char buf[32], line[256], *ctime();
FILE * fp;
@@ -412,15 +415,12 @@
// get values for group, var of IP Address of the Remote host's side of
// connection

-#if USE_WEB100
- web100_agent_find_var_and_group(agent, "RemAddress", &group, &var);
- web100_raw_read(var, cn, buf);
- snprintf(line, sizeof(line), "%s;",
- web100_value_to_text(web100_get_var_type(var), buf));
-#elif USE_WEB10G
- web10g_get_remote_addr(agent, cn, buf, sizeof(buf));
+ len = sizeof(addr);
+ getpeername(sock, (struct sockaddr*)&addr, &len);
+ addr2a(&addr, buf, sizeof(buf));
+
snprintf(line, sizeof(line), "%s;", buf);
-#endif
+
// write remote address to log file
if (fp)
fprintf(fp, "%s", line);


  • [ndt-dev] [ndt] r989 committed - Use getpeername instead of RemAddress in tcp_stat_get_data_recv, ndt, 03/10/2014

Archive powered by MHonArc 2.6.16.

Top of Page