[netperf-dev] netperf2 commit notice r292 - trunk/src

raj at netperf.org raj at netperf.org
Tue Oct 21 15:51:01 PDT 2008


Author: raj
Date: 2008-10-21 15:51:00 -0700 (Tue, 21 Oct 2008)
New Revision: 292

Modified:
   trunk/src/netlib.h
   trunk/src/nettest_omni.c
Log:
add some strings

Modified: trunk/src/netlib.h
===================================================================
--- trunk/src/netlib.h	2008-10-21 21:54:29 UTC (rev 291)
+++ trunk/src/netlib.h	2008-10-21 22:51:00 UTC (rev 292)
@@ -533,6 +533,8 @@
 extern  char    *inet_ftos(int family);
 extern  char    *inet_ttos(int type);
 extern  char    *inet_ptos(int protocol);
+extern  char    *nsec_enabled_to_str(int enabled);
+extern  char    *nsec_type_to_str(int type);
 extern  double  ntohd(double net_double);
 extern  double  htond(double host_double);
 extern  int     inet_nton(int af, const void *src, char *dst, int cnt);

Modified: trunk/src/nettest_omni.c
===================================================================
--- trunk/src/nettest_omni.c	2008-10-21 21:54:29 UTC (rev 291)
+++ trunk/src/nettest_omni.c	2008-10-21 22:51:00 UTC (rev 292)
@@ -416,11 +416,15 @@
 char        *remote_cpu_model;
 int         remote_cpu_frequency;
 
-int         local_security_type;
-int         local_security_enabled;
+int         local_security_type_id;
+int         local_security_enabled_num;
+char        *local_security_type;
+char        *local_security_enabled;
 char        *local_security_specific;
-int         remote_security_type;
-int         remote_security_enabled;
+int         remote_security_type_id;
+int         remote_security_enabled_num;
+char        *remote_security_enabled;
+char        *remote_security_type;
 char        *remote_security_specific;
 
 int printing_initialized = 0;
@@ -602,10 +606,14 @@
   LOCAL_INTERVAL_BURST,
   REMOTE_INTERVAL_USECS,
   REMOTE_INTERVAL_BURST,
+  LOCAL_SECURITY_TYPE_ID,
   LOCAL_SECURITY_TYPE,
+  LOCAL_SECURITY_ENABLED_NUM,
   LOCAL_SECURITY_ENABLED,
   LOCAL_SECURITY_SPECIFIC,
+  REMOTE_SECURITY_TYPE_ID,
   REMOTE_SECURITY_TYPE,
+  REMOTE_SECURITY_ENABLED_NUM,
   REMOTE_SECURITY_ENABLED,
   REMOTE_SECURITY_SPECIFIC,
   RESULT_BRAND,
@@ -993,12 +1001,20 @@
     return "REMOTE_INTERVAL_USECS";
   case REMOTE_INTERVAL_BURST:
     return "REMOTE_INTERVAL_BURST";
+  case LOCAL_SECURITY_TYPE_ID:
+    return "LOCAL_SECURITY_TYPE_ID";
+  case LOCAL_SECURITY_ENABLED_NUM:
+    return "LOCAL_SECURITY_ENABLED_NUM";
   case LOCAL_SECURITY_TYPE:
     return "LOCAL_SECURITY_TYPE";
   case LOCAL_SECURITY_ENABLED:
     return "LOCAL_SECURITY_ENABLED";
   case LOCAL_SECURITY_SPECIFIC:
     return "LOCAL_SECURITY_SPECIFIC";
+  case REMOTE_SECURITY_TYPE_ID:
+    return "REMOTE_SECURITY_TYPE_ID";
+  case REMOTE_SECURITY_ENABLED_NUM:
+    return "REMOTE_SECURITY_ENABLED_NUM";
   case REMOTE_SECURITY_TYPE:
     return "REMOTE_SECURITY_TYPE";
   case REMOTE_SECURITY_ENABLED:
@@ -2851,25 +2867,13 @@
   netperf_output_source[REMOTE_INTERVAL_BURST].tot_line_len = 
     NETPERF_LINE_TOT(REMOTE_INTERVAL_BURST);
 
-  netperf_output_source[LOCAL_SECURITY_SPECIFIC].output_name = LOCAL_SECURITY_SPECIFIC;
-  netperf_output_source[LOCAL_SECURITY_SPECIFIC].line[0] = "Local";
-  netperf_output_source[LOCAL_SECURITY_SPECIFIC].line[1] = "OS";
-  netperf_output_source[LOCAL_SECURITY_SPECIFIC].line[2] = "Security";
-  netperf_output_source[LOCAL_SECURITY_SPECIFIC].line[3] = "Specific";
-  netperf_output_source[LOCAL_SECURITY_SPECIFIC].format = "%s";
-  netperf_output_source[LOCAL_SECURITY_SPECIFIC].display_value = local_security_specific;
-  netperf_output_source[LOCAL_SECURITY_SPECIFIC].max_line_len = 
-    NETPERF_LINE_MAX(LOCAL_SECURITY_SPECIFIC);
-  netperf_output_source[LOCAL_SECURITY_SPECIFIC].tot_line_len = 
-    NETPERF_LINE_TOT(LOCAL_SECURITY_SPECIFIC);
-
   netperf_output_source[LOCAL_SECURITY_ENABLED].output_name = LOCAL_SECURITY_ENABLED;
   netperf_output_source[LOCAL_SECURITY_ENABLED].line[0] = "Local";
   netperf_output_source[LOCAL_SECURITY_ENABLED].line[1] = "OS";
   netperf_output_source[LOCAL_SECURITY_ENABLED].line[2] = "Security";
   netperf_output_source[LOCAL_SECURITY_ENABLED].line[3] = "Enabled";
-  netperf_output_source[LOCAL_SECURITY_ENABLED].format = "%d";
-  netperf_output_source[LOCAL_SECURITY_ENABLED].display_value = &local_security_enabled;
+  netperf_output_source[LOCAL_SECURITY_ENABLED].format = "%s";
+  netperf_output_source[LOCAL_SECURITY_ENABLED].display_value = local_security_enabled;
   netperf_output_source[LOCAL_SECURITY_ENABLED].max_line_len = 
     NETPERF_LINE_MAX(LOCAL_SECURITY_ENABLED);
   netperf_output_source[LOCAL_SECURITY_ENABLED].tot_line_len = 
@@ -2880,32 +2884,56 @@
   netperf_output_source[LOCAL_SECURITY_TYPE].line[1] = "OS";
   netperf_output_source[LOCAL_SECURITY_TYPE].line[2] = "Security";
   netperf_output_source[LOCAL_SECURITY_TYPE].line[3] = "Type";
-  netperf_output_source[LOCAL_SECURITY_TYPE].format = "%d";
-  netperf_output_source[LOCAL_SECURITY_TYPE].display_value = &local_security_type;
+  netperf_output_source[LOCAL_SECURITY_TYPE].format = "%s";
+  netperf_output_source[LOCAL_SECURITY_TYPE].display_value = local_security_type;
   netperf_output_source[LOCAL_SECURITY_TYPE].max_line_len = 
     NETPERF_LINE_MAX(LOCAL_SECURITY_TYPE);
   netperf_output_source[LOCAL_SECURITY_TYPE].tot_line_len = 
     NETPERF_LINE_TOT(LOCAL_SECURITY_TYPE);
 
-  netperf_output_source[REMOTE_SECURITY_SPECIFIC].output_name = REMOTE_SECURITY_SPECIFIC;
-  netperf_output_source[REMOTE_SECURITY_SPECIFIC].line[0] = "Remote";
-  netperf_output_source[REMOTE_SECURITY_SPECIFIC].line[1] = "OS";
-  netperf_output_source[REMOTE_SECURITY_SPECIFIC].line[2] = "Security";
-  netperf_output_source[REMOTE_SECURITY_SPECIFIC].line[3] = "Specific";
-  netperf_output_source[REMOTE_SECURITY_SPECIFIC].format = "%s";
-  netperf_output_source[REMOTE_SECURITY_SPECIFIC].display_value = remote_security_specific;
-  netperf_output_source[REMOTE_SECURITY_SPECIFIC].max_line_len = 
-    NETPERF_LINE_MAX(REMOTE_SECURITY_SPECIFIC);
-  netperf_output_source[REMOTE_SECURITY_SPECIFIC].tot_line_len = 
-    NETPERF_LINE_TOT(REMOTE_SECURITY_SPECIFIC);
+  netperf_output_source[LOCAL_SECURITY_SPECIFIC].output_name = LOCAL_SECURITY_SPECIFIC;
+  netperf_output_source[LOCAL_SECURITY_SPECIFIC].line[0] = "Local";
+  netperf_output_source[LOCAL_SECURITY_SPECIFIC].line[1] = "OS";
+  netperf_output_source[LOCAL_SECURITY_SPECIFIC].line[2] = "Security";
+  netperf_output_source[LOCAL_SECURITY_SPECIFIC].line[3] = "Specific";
+  netperf_output_source[LOCAL_SECURITY_SPECIFIC].format = "%s";
+  netperf_output_source[LOCAL_SECURITY_SPECIFIC].display_value = local_security_specific;
+  netperf_output_source[LOCAL_SECURITY_SPECIFIC].max_line_len = 
+    NETPERF_LINE_MAX(LOCAL_SECURITY_SPECIFIC);
+  netperf_output_source[LOCAL_SECURITY_SPECIFIC].tot_line_len = 
+    NETPERF_LINE_TOT(LOCAL_SECURITY_SPECIFIC);
 
+  netperf_output_source[LOCAL_SECURITY_ENABLED_NUM].output_name = LOCAL_SECURITY_ENABLED_NUM;
+  netperf_output_source[LOCAL_SECURITY_ENABLED_NUM].line[0] = "Local";
+  netperf_output_source[LOCAL_SECURITY_ENABLED_NUM].line[1] = "OS";
+  netperf_output_source[LOCAL_SECURITY_ENABLED_NUM].line[2] = "Security";
+  netperf_output_source[LOCAL_SECURITY_ENABLED_NUM].line[3] = "Enabled Num";
+  netperf_output_source[LOCAL_SECURITY_ENABLED_NUM].format = "%d";
+  netperf_output_source[LOCAL_SECURITY_ENABLED_NUM].display_value = &local_security_enabled_num;
+  netperf_output_source[LOCAL_SECURITY_ENABLED_NUM].max_line_len = 
+    NETPERF_LINE_MAX(LOCAL_SECURITY_ENABLED_NUM);
+  netperf_output_source[LOCAL_SECURITY_ENABLED_NUM].tot_line_len = 
+    NETPERF_LINE_TOT(LOCAL_SECURITY_ENABLED_NUM);
+
+  netperf_output_source[LOCAL_SECURITY_TYPE_ID].output_name = LOCAL_SECURITY_TYPE_ID;
+  netperf_output_source[LOCAL_SECURITY_TYPE_ID].line[0] = "Local";
+  netperf_output_source[LOCAL_SECURITY_TYPE_ID].line[1] = "OS";
+  netperf_output_source[LOCAL_SECURITY_TYPE_ID].line[2] = "Security";
+  netperf_output_source[LOCAL_SECURITY_TYPE_ID].line[3] = "Type ID";
+  netperf_output_source[LOCAL_SECURITY_TYPE_ID].format = "%d";
+  netperf_output_source[LOCAL_SECURITY_TYPE_ID].display_value = &local_security_type_id;
+  netperf_output_source[LOCAL_SECURITY_TYPE_ID].max_line_len = 
+    NETPERF_LINE_MAX(LOCAL_SECURITY_TYPE_ID);
+  netperf_output_source[LOCAL_SECURITY_TYPE_ID].tot_line_len = 
+    NETPERF_LINE_TOT(LOCAL_SECURITY_TYPE_ID);
+
   netperf_output_source[REMOTE_SECURITY_ENABLED].output_name = REMOTE_SECURITY_ENABLED;
   netperf_output_source[REMOTE_SECURITY_ENABLED].line[0] = "Remote";
   netperf_output_source[REMOTE_SECURITY_ENABLED].line[1] = "OS";
   netperf_output_source[REMOTE_SECURITY_ENABLED].line[2] = "Security";
   netperf_output_source[REMOTE_SECURITY_ENABLED].line[3] = "Enabled";
-  netperf_output_source[REMOTE_SECURITY_ENABLED].format = "%d";
-  netperf_output_source[REMOTE_SECURITY_ENABLED].display_value = &remote_security_enabled;
+  netperf_output_source[REMOTE_SECURITY_ENABLED].format = "%s";
+  netperf_output_source[REMOTE_SECURITY_ENABLED].display_value = remote_security_enabled;
   netperf_output_source[REMOTE_SECURITY_ENABLED].max_line_len = 
     NETPERF_LINE_MAX(REMOTE_SECURITY_ENABLED);
   netperf_output_source[REMOTE_SECURITY_ENABLED].tot_line_len = 
@@ -2916,13 +2944,49 @@
   netperf_output_source[REMOTE_SECURITY_TYPE].line[1] = "OS";
   netperf_output_source[REMOTE_SECURITY_TYPE].line[2] = "Security";
   netperf_output_source[REMOTE_SECURITY_TYPE].line[3] = "Type";
-  netperf_output_source[REMOTE_SECURITY_TYPE].format = "%d";
-  netperf_output_source[REMOTE_SECURITY_TYPE].display_value = &remote_security_type;
+  netperf_output_source[REMOTE_SECURITY_TYPE].format = "%s";
+  netperf_output_source[REMOTE_SECURITY_TYPE].display_value = remote_security_type;
   netperf_output_source[REMOTE_SECURITY_TYPE].max_line_len = 
     NETPERF_LINE_MAX(REMOTE_SECURITY_TYPE);
   netperf_output_source[REMOTE_SECURITY_TYPE].tot_line_len = 
     NETPERF_LINE_TOT(REMOTE_SECURITY_TYPE);
 
+  netperf_output_source[REMOTE_SECURITY_SPECIFIC].output_name = REMOTE_SECURITY_SPECIFIC;
+  netperf_output_source[REMOTE_SECURITY_SPECIFIC].line[0] = "Remote";
+  netperf_output_source[REMOTE_SECURITY_SPECIFIC].line[1] = "OS";
+  netperf_output_source[REMOTE_SECURITY_SPECIFIC].line[2] = "Security";
+  netperf_output_source[REMOTE_SECURITY_SPECIFIC].line[3] = "Specific";
+  netperf_output_source[REMOTE_SECURITY_SPECIFIC].format = "%s";
+  netperf_output_source[REMOTE_SECURITY_SPECIFIC].display_value = remote_security_specific;
+  netperf_output_source[REMOTE_SECURITY_SPECIFIC].max_line_len = 
+    NETPERF_LINE_MAX(REMOTE_SECURITY_SPECIFIC);
+  netperf_output_source[REMOTE_SECURITY_SPECIFIC].tot_line_len = 
+    NETPERF_LINE_TOT(REMOTE_SECURITY_SPECIFIC);
+
+  netperf_output_source[REMOTE_SECURITY_ENABLED_NUM].output_name = REMOTE_SECURITY_ENABLED_NUM;
+  netperf_output_source[REMOTE_SECURITY_ENABLED_NUM].line[0] = "Remote";
+  netperf_output_source[REMOTE_SECURITY_ENABLED_NUM].line[1] = "OS";
+  netperf_output_source[REMOTE_SECURITY_ENABLED_NUM].line[2] = "Security";
+  netperf_output_source[REMOTE_SECURITY_ENABLED_NUM].line[3] = "Enabled";
+  netperf_output_source[REMOTE_SECURITY_ENABLED_NUM].format = "%d";
+  netperf_output_source[REMOTE_SECURITY_ENABLED_NUM].display_value = &remote_security_enabled_num;
+  netperf_output_source[REMOTE_SECURITY_ENABLED_NUM].max_line_len = 
+    NETPERF_LINE_MAX(REMOTE_SECURITY_ENABLED_NUM);
+  netperf_output_source[REMOTE_SECURITY_ENABLED_NUM].tot_line_len = 
+    NETPERF_LINE_TOT(REMOTE_SECURITY_ENABLED_NUM);
+
+  netperf_output_source[REMOTE_SECURITY_TYPE_ID].output_name = REMOTE_SECURITY_TYPE_ID;
+  netperf_output_source[REMOTE_SECURITY_TYPE_ID].line[0] = "Remote";
+  netperf_output_source[REMOTE_SECURITY_TYPE_ID].line[1] = "OS";
+  netperf_output_source[REMOTE_SECURITY_TYPE_ID].line[2] = "Security";
+  netperf_output_source[REMOTE_SECURITY_TYPE_ID].line[3] = "Type";
+  netperf_output_source[REMOTE_SECURITY_TYPE_ID].format = "%d";
+  netperf_output_source[REMOTE_SECURITY_TYPE_ID].display_value = &remote_security_type_id;
+  netperf_output_source[REMOTE_SECURITY_TYPE_ID].max_line_len = 
+    NETPERF_LINE_MAX(REMOTE_SECURITY_TYPE_ID);
+  netperf_output_source[REMOTE_SECURITY_TYPE_ID].tot_line_len = 
+    NETPERF_LINE_TOT(REMOTE_SECURITY_TYPE_ID);
+
   netperf_output_source[LOCAL_INTERVAL_USECS].output_name = LOCAL_INTERVAL_USECS;
   netperf_output_source[LOCAL_INTERVAL_USECS].line[0] = "Local";
   netperf_output_source[LOCAL_INTERVAL_USECS].line[1] = "Interval";
@@ -4134,8 +4198,11 @@
 	  remote_security_specific = strdup(omni_response->security_string);
 	}
 	/* top bits type, bottom bits enabled */
-	remote_security_type = (int) omni_response->security_info >> 16;
-	remote_security_enabled = (short)omni_response->security_info;
+	remote_security_type_id = (int) omni_response->security_info >> 16;
+	remote_security_enabled_num = (short)omni_response->security_info;
+	remote_security_type = nsec_type_to_str(remote_security_type_id);
+	remote_security_enabled = 
+	  nsec_enabled_to_str(remote_security_enabled_num);
       }
       else {
 	Set_errno(netperf_response.content.serv_errno);
@@ -4560,9 +4627,11 @@
 			 local_res->ai_protocol);
     
 
-    find_security_info(&local_security_enabled,
-		       &local_security_type,
+    find_security_info(&local_security_enabled_num,
+		       &local_security_type_id,
 		       &local_security_specific);
+    local_security_enabled = nsec_enabled_to_str(local_security_enabled_num);
+    local_security_type    = nsec_type_to_str(local_security_type_id);
 
     /* so, if we have/had a data connection, we will want to close it
        now, and this will be independent of whether there is a control
@@ -5190,12 +5259,12 @@
   omni_response->cpu_model[sizeof(omni_response->cpu_model)-1] = 0;
   omni_response->cpu_frequency = local_cpu_frequency;
 
-  find_security_info(&local_security_enabled,
-		     &local_security_type,
+  find_security_info(&local_security_enabled_num,
+		     &local_security_type_id,
 		     &local_security_specific);
   /* top bits type, bottom bits enabled */
-  omni_response->security_info = local_security_type << 16;
-  omni_response->security_info += local_security_enabled & 0xff;
+  omni_response->security_info = local_security_type_id << 16;
+  omni_response->security_info += local_security_enabled_num & 0xff;
   strncpy(omni_response->security_string,
 	  local_security_specific,
 	  sizeof(omni_response->security_string));



More information about the netperf-dev mailing list