[netperf-dev] netperf2 commit notice r290 - in trunk: . doc doc/examples src src/missing src/missing/m4
raj at netperf.org
raj at netperf.org
Mon Oct 20 17:43:56 PDT 2008
Author: raj
Date: 2008-10-20 17:43:53 -0700 (Mon, 20 Oct 2008)
New Revision: 290
Added:
trunk/src/netsec_linux.c
trunk/src/netsec_none.c
Modified:
trunk/Makefile.in
trunk/config.h.in
trunk/configure
trunk/configure.ac
trunk/doc/Makefile.in
trunk/doc/examples/Makefile.in
trunk/src/Makefile.am
trunk/src/Makefile.in
trunk/src/missing/Makefile.in
trunk/src/missing/m4/Makefile.in
trunk/src/netdrv_ethtool.c
trunk/src/netlib.c
trunk/src/netlib.h
trunk/src/nettest_bsd.c
trunk/src/nettest_bsd.h
trunk/src/nettest_omni.c
Log:
learning about selinux and perhaps a better ethtool ioctl fix
Modified: trunk/Makefile.in
===================================================================
--- trunk/Makefile.in 2008-08-14 20:38:31 UTC (rev 289)
+++ trunk/Makefile.in 2008-10-21 00:43:53 UTC (rev 290)
@@ -72,6 +72,7 @@
NETCPU_SOURCE = @NETCPU_SOURCE@
NETDRVLKUP_SOURCE = @NETDRVLKUP_SOURCE@
NETRTLKUP_SOURCE = @NETRTLKUP_SOURCE@
+NETSECLKUP_SOURCE = @NETSECLKUP_SOURCE@
NETSLOTLKUP_SOURCE = @NETSLOTLKUP_SOURCE@
NETSYSLKUP_SOURCE = @NETSYSLKUP_SOURCE@
OBJEXT = @OBJEXT@
Modified: trunk/config.h.in
===================================================================
--- trunk/config.h.in 2008-08-14 20:38:31 UTC (rev 289)
+++ trunk/config.h.in 2008-10-21 00:43:53 UTC (rev 290)
@@ -69,6 +69,9 @@
/* Define to 1 if you have the `devinfo' library (-ldevinfo). */
#undef HAVE_LIBDEVINFO
+/* Define to 1 if you have the `dl' library (-ldl). */
+#undef HAVE_LIBDL
+
/* Define to 1 if you have the `exs' library (-lexs). */
#undef HAVE_LIBEXS
Modified: trunk/configure
===================================================================
--- trunk/configure 2008-08-14 20:38:31 UTC (rev 289)
+++ trunk/configure 2008-10-21 00:43:53 UTC (rev 290)
@@ -707,6 +707,7 @@
NETCPU_SOURCE
NETRTLKUP_SOURCE
NETSLOTLKUP_SOURCE
+NETSECLKUP_SOURCE
NETDRVLKUP_SOURCE
NETSYSLKUP_SOURCE
LTLIBOBJS'
@@ -1327,6 +1328,8 @@
using specified mechanism
--enable-slotlookup include code to find the probable egress interface
using specified mechanism
+ --enable-seclookup include code to find the system security mechanism
+ and its state
--enable-drvlookup include code to find the driver information for the
probable egress interface
--enable-syslookup include code to find some rudimentary system
@@ -9738,6 +9741,121 @@
+
+# time to see about sec lookup mechanisms
+
+{ echo "$as_me:$LINENO: checking which sec lookup type to use" >&5
+echo $ECHO_N "checking which sec lookup type to use... $ECHO_C" >&6; }
+
+# Check whether --enable-seclookup was given.
+if test "${enable_seclookup+set}" = set; then
+ enableval=$enable_seclookup;
+fi
+
+
+NETSECLKUP_SOURCE="$enable_seclookup"
+case "$enable_seclookup" in
+
+ linux)
+ use_seclookup=true
+ ;;
+ '')
+# guess it automagically in a nice big case statement
+ case $target in
+ *-*-linux*)
+
+{ echo "$as_me:$LINENO: checking for main in -ldl" >&5
+echo $ECHO_N "checking for main in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+return main ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_dl_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_dl_main=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_main" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_main" >&6; }
+if test $ac_cv_lib_dl_main = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBDL 1
+_ACEOF
+
+ LIBS="-ldl $LIBS"
+
+fi
+ac_cv_lib_dl=ac_cv_lib_dl_main
+
+ use_seclookup=true
+ enable_seclookup="linux - auto"
+ NETSECLKUP_SOURCE="linux"
+ ;;
+ *)
+ use_seclookup=false
+ NETSECLKUP_SOURCE="none"
+ enable_seclookup="none. Consider teaching configure about your platform."
+ ;;
+ esac
+ ;;
+ none)
+ use_seclookup=false
+ ;;
+ *)
+ { { echo "$as_me:$LINENO: error: --enable-seclookup takes linux or none" >&5
+echo "$as_me: error: --enable-seclookup takes linux or none" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+esac
+
+ { echo "$as_me:$LINENO: result: \"$enable_seclookup\"" >&5
+echo "${ECHO_T}\"$enable_seclookup\"" >&6; }
+
+
+
+
# time to see about driver lookup mechanisms
{ echo "$as_me:$LINENO: checking which driver info lookup type to use" >&5
@@ -11433,12 +11551,13 @@
NETCPU_SOURCE!$NETCPU_SOURCE$ac_delim
NETRTLKUP_SOURCE!$NETRTLKUP_SOURCE$ac_delim
NETSLOTLKUP_SOURCE!$NETSLOTLKUP_SOURCE$ac_delim
+NETSECLKUP_SOURCE!$NETSECLKUP_SOURCE$ac_delim
NETDRVLKUP_SOURCE!$NETDRVLKUP_SOURCE$ac_delim
NETSYSLKUP_SOURCE!$NETSYSLKUP_SOURCE$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 96; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2008-08-14 20:38:31 UTC (rev 289)
+++ trunk/configure.ac 2008-10-21 00:43:53 UTC (rev 290)
@@ -824,6 +824,49 @@
AC_SUBST(NETSLOTLKUP_SOURCE)
+
+# time to see about sec lookup mechanisms
+
+AC_MSG_CHECKING([which sec lookup type to use])
+
+AC_ARG_ENABLE(seclookup,
+ [AS_HELP_STRING([--enable-seclookup],[include code to find the system security mechanism and its state])])
+
+NETSECLKUP_SOURCE="$enable_seclookup"
+case "$enable_seclookup" in
+
+ linux)
+ use_seclookup=true
+ ;;
+ '')
+# guess it automagically in a nice big case statement
+ case $target in
+ *-*-linux*)
+ AC_HAVE_LIBRARY(dl)
+ use_seclookup=true
+ enable_seclookup="linux - auto"
+ NETSECLKUP_SOURCE="linux"
+ ;;
+ *)
+ use_seclookup=false
+ NETSECLKUP_SOURCE="none"
+ enable_seclookup="none. Consider teaching configure about your platform."
+ ;;
+ esac
+ ;;
+ none)
+ use_seclookup=false
+ ;;
+ *)
+ AC_MSG_ERROR([--enable-seclookup takes linux or none])
+ ;;
+esac
+
+ AC_MSG_RESULT("$enable_seclookup")
+
+AC_SUBST(NETSECLKUP_SOURCE)
+
+
# time to see about driver lookup mechanisms
AC_MSG_CHECKING([which driver info lookup type to use])
Modified: trunk/doc/Makefile.in
===================================================================
--- trunk/doc/Makefile.in 2008-08-14 20:38:31 UTC (rev 289)
+++ trunk/doc/Makefile.in 2008-10-21 00:43:53 UTC (rev 290)
@@ -76,6 +76,7 @@
NETCPU_SOURCE = @NETCPU_SOURCE@
NETDRVLKUP_SOURCE = @NETDRVLKUP_SOURCE@
NETRTLKUP_SOURCE = @NETRTLKUP_SOURCE@
+NETSECLKUP_SOURCE = @NETSECLKUP_SOURCE@
NETSLOTLKUP_SOURCE = @NETSLOTLKUP_SOURCE@
NETSYSLKUP_SOURCE = @NETSYSLKUP_SOURCE@
OBJEXT = @OBJEXT@
Modified: trunk/doc/examples/Makefile.in
===================================================================
--- trunk/doc/examples/Makefile.in 2008-08-14 20:38:31 UTC (rev 289)
+++ trunk/doc/examples/Makefile.in 2008-10-21 00:43:53 UTC (rev 290)
@@ -72,6 +72,7 @@
NETCPU_SOURCE = @NETCPU_SOURCE@
NETDRVLKUP_SOURCE = @NETDRVLKUP_SOURCE@
NETRTLKUP_SOURCE = @NETRTLKUP_SOURCE@
+NETSECLKUP_SOURCE = @NETSECLKUP_SOURCE@
NETSLOTLKUP_SOURCE = @NETSLOTLKUP_SOURCE@
NETSYSLKUP_SOURCE = @NETSYSLKUP_SOURCE@
OBJEXT = @OBJEXT@
Modified: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am 2008-08-14 20:38:31 UTC (rev 289)
+++ trunk/src/Makefile.am 2008-10-21 00:43:53 UTC (rev 290)
@@ -11,13 +11,14 @@
USE_DRV_SOURCE=netdrv_ at NETDRVLKUP_SOURCE@.c
USE_SLOT_SOURCE=netslot_ at NETSLOTLKUP_SOURCE@.c
USE_SYS_SOURCE=netsys_ at NETSYSLKUP_SOURCE@.c
+USE_SEC_SOURCE=netsec_ at NETSECLKUP_SOURCE@.c
-EXTRA_DIST = netcpu_none.c netcpu_looper.c netcpu_pstat.c netcpu_pstatnew.c netcpu_perfstat.c netcpu_procstat.c netcpu_kstat.c netcpu_kstat10.c netcpu_sysctl.c netcpu_ntperf.c netcpu_osx.c dirs NetPerfDir/* NetServerDir/* netperf_version.h.in netrt_rtnetlink.c netrt_none.c netrt_rtmget.c netdrv_ethtool.c netdrv_none.c netslot_linux.c netslot_none.c netsys_none.c netsys_hpux11i.c netsys_linux.c netsys_solaris.c netdrv_solaris.c netslot_solaris.c Makefile.uw
+EXTRA_DIST = netcpu_none.c netcpu_looper.c netcpu_pstat.c netcpu_pstatnew.c netcpu_perfstat.c netcpu_procstat.c netcpu_kstat.c netcpu_kstat10.c netcpu_sysctl.c netcpu_ntperf.c netcpu_osx.c dirs NetPerfDir/* NetServerDir/* netperf_version.h.in netrt_rtnetlink.c netrt_none.c netrt_rtmget.c netdrv_ethtool.c netdrv_none.c netslot_linux.c netslot_none.c netsys_none.c netsys_hpux11i.c netsys_linux.c netsys_solaris.c netdrv_solaris.c netslot_solaris.c netsec_linux.c netsec_none.c Makefile.uw
COMMON_SRC = hist.h netlib.c netlib.h netcpu.h netsh.c netsh.h nettest_bsd.c nettest_bsd.h nettest_dlpi.c nettest_dlpi.h nettest_unix.c nettest_unix.h nettest_xti.c nettest_xti.h nettest_sctp.c nettest_sctp.h netperf_version.h nettest_sdp.c nettest_sdp.h nettest_omni.c
-netperf_SOURCES = netperf.c $(COMMON_SRC) $(USE_CPU_SOURCE) $(USE_RT_SOURCE) $(USE_DRV_SOURCE) $(USE_SLOT_SOURCE) $(USE_SYS_SOURCE)
-netserver_SOURCES = netserver.c $(COMMON_SRC) $(USE_CPU_SOURCE) $(USE_RT_SOURCE) $(USE_DRV_SOURCE) $(USE_SLOT_SOURCE) $(USE_SYS_SOURCE)
+netperf_SOURCES = netperf.c $(COMMON_SRC) $(USE_CPU_SOURCE) $(USE_RT_SOURCE) $(USE_DRV_SOURCE) $(USE_SLOT_SOURCE) $(USE_SYS_SOURCE) $(USE_SEC_SOURCE)
+netserver_SOURCES = netserver.c $(COMMON_SRC) $(USE_CPU_SOURCE) $(USE_RT_SOURCE) $(USE_DRV_SOURCE) $(USE_SLOT_SOURCE) $(USE_SYS_SOURCE) $(USE_SEC_SOURCE)
# if there are any "missing" routines, the libobjs should cover it
if NEED_LIBCOMPAT
Modified: trunk/src/Makefile.in
===================================================================
--- trunk/src/Makefile.in 2008-08-14 20:38:31 UTC (rev 289)
+++ trunk/src/Makefile.in 2008-10-21 00:43:53 UTC (rev 290)
@@ -72,6 +72,7 @@
NETCPU_SOURCE = @NETCPU_SOURCE@
NETDRVLKUP_SOURCE = @NETDRVLKUP_SOURCE@
NETRTLKUP_SOURCE = @NETRTLKUP_SOURCE@
+NETSECLKUP_SOURCE = @NETSECLKUP_SOURCE@
NETSLOTLKUP_SOURCE = @NETSLOTLKUP_SOURCE@
NETSYSLKUP_SOURCE = @NETSYSLKUP_SOURCE@
OBJEXT = @OBJEXT@
@@ -144,13 +145,14 @@
USE_DRV_SOURCE = netdrv_ at NETDRVLKUP_SOURCE@.c
USE_SLOT_SOURCE = netslot_ at NETSLOTLKUP_SOURCE@.c
USE_SYS_SOURCE = netsys_ at NETSYSLKUP_SOURCE@.c
+USE_SEC_SOURCE = netsec_ at NETSECLKUP_SOURCE@.c
-EXTRA_DIST = netcpu_none.c netcpu_looper.c netcpu_pstat.c netcpu_pstatnew.c netcpu_perfstat.c netcpu_procstat.c netcpu_kstat.c netcpu_kstat10.c netcpu_sysctl.c netcpu_ntperf.c netcpu_osx.c dirs NetPerfDir/* NetServerDir/* netperf_version.h.in netrt_rtnetlink.c netrt_none.c netrt_rtmget.c netdrv_ethtool.c netdrv_none.c netslot_linux.c netslot_none.c netsys_none.c netsys_hpux11i.c netsys_linux.c netsys_solaris.c netdrv_solaris.c netslot_solaris.c Makefile.uw
+EXTRA_DIST = netcpu_none.c netcpu_looper.c netcpu_pstat.c netcpu_pstatnew.c netcpu_perfstat.c netcpu_procstat.c netcpu_kstat.c netcpu_kstat10.c netcpu_sysctl.c netcpu_ntperf.c netcpu_osx.c dirs NetPerfDir/* NetServerDir/* netperf_version.h.in netrt_rtnetlink.c netrt_none.c netrt_rtmget.c netdrv_ethtool.c netdrv_none.c netslot_linux.c netslot_none.c netsys_none.c netsys_hpux11i.c netsys_linux.c netsys_solaris.c netdrv_solaris.c netslot_solaris.c netsec_linux.c netsec_none.c Makefile.uw
COMMON_SRC = hist.h netlib.c netlib.h netcpu.h netsh.c netsh.h nettest_bsd.c nettest_bsd.h nettest_dlpi.c nettest_dlpi.h nettest_unix.c nettest_unix.h nettest_xti.c nettest_xti.h nettest_sctp.c nettest_sctp.h netperf_version.h nettest_sdp.c nettest_sdp.h nettest_omni.c
-netperf_SOURCES = netperf.c $(COMMON_SRC) $(USE_CPU_SOURCE) $(USE_RT_SOURCE) $(USE_DRV_SOURCE) $(USE_SLOT_SOURCE) $(USE_SYS_SOURCE)
-netserver_SOURCES = netserver.c $(COMMON_SRC) $(USE_CPU_SOURCE) $(USE_RT_SOURCE) $(USE_DRV_SOURCE) $(USE_SLOT_SOURCE) $(USE_SYS_SOURCE)
+netperf_SOURCES = netperf.c $(COMMON_SRC) $(USE_CPU_SOURCE) $(USE_RT_SOURCE) $(USE_DRV_SOURCE) $(USE_SLOT_SOURCE) $(USE_SYS_SOURCE) $(USE_SEC_SOURCE)
+netserver_SOURCES = netserver.c $(COMMON_SRC) $(USE_CPU_SOURCE) $(USE_RT_SOURCE) $(USE_DRV_SOURCE) $(USE_SLOT_SOURCE) $(USE_SYS_SOURCE) $(USE_SEC_SOURCE)
# if there are any "missing" routines, the libobjs should cover it
@NEED_LIBCOMPAT_TRUE at netperf_LDADD = missing/libcompat.a
@@ -172,16 +174,17 @@
am__objects_4 = netdrv_ at NETDRVLKUP_SOURCE@.$(OBJEXT)
am__objects_5 = netslot_ at NETSLOTLKUP_SOURCE@.$(OBJEXT)
am__objects_6 = netsys_ at NETSYSLKUP_SOURCE@.$(OBJEXT)
+am__objects_7 = netsec_ at NETSECLKUP_SOURCE@.$(OBJEXT)
am_netperf_OBJECTS = netperf.$(OBJEXT) $(am__objects_1) $(am__objects_2) \
$(am__objects_3) $(am__objects_4) $(am__objects_5) \
- $(am__objects_6)
+ $(am__objects_6) $(am__objects_7)
netperf_OBJECTS = $(am_netperf_OBJECTS)
@NEED_LIBCOMPAT_TRUE at netperf_DEPENDENCIES = missing/libcompat.a
@NEED_LIBCOMPAT_FALSE at netperf_DEPENDENCIES =
netperf_LDFLAGS =
am_netserver_OBJECTS = netserver.$(OBJEXT) $(am__objects_1) \
$(am__objects_2) $(am__objects_3) $(am__objects_4) \
- $(am__objects_5) $(am__objects_6)
+ $(am__objects_5) $(am__objects_6) $(am__objects_7)
netserver_OBJECTS = $(am_netserver_OBJECTS)
@NEED_LIBCOMPAT_TRUE at netserver_DEPENDENCIES = missing/libcompat.a
@NEED_LIBCOMPAT_FALSE at netserver_DEPENDENCIES =
@@ -194,6 +197,7 @@
@AMDEP_TRUE@ ./$(DEPDIR)/netdrv_ at NETDRVLKUP_SOURCE@.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/netlib.Po ./$(DEPDIR)/netperf.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/netrt_ at NETRTLKUP_SOURCE@.Po \
+ at AMDEP_TRUE@ ./$(DEPDIR)/netsec_ at NETSECLKUP_SOURCE@.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/netserver.Po ./$(DEPDIR)/netsh.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/netslot_ at NETSLOTLKUP_SOURCE@.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/netsys_ at NETSYSLKUP_SOURCE@.Po \
@@ -272,6 +276,7 @@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/netlib.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/netperf.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/netrt_ at NETRTLKUP_SOURCE@.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/netsec_ at NETSECLKUP_SOURCE@.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/netserver.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/netsh.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/netslot_ at NETSLOTLKUP_SOURCE@.Po at am__quote@
Modified: trunk/src/missing/Makefile.in
===================================================================
--- trunk/src/missing/Makefile.in 2008-08-14 20:38:31 UTC (rev 289)
+++ trunk/src/missing/Makefile.in 2008-10-21 00:43:53 UTC (rev 290)
@@ -72,6 +72,7 @@
NETCPU_SOURCE = @NETCPU_SOURCE@
NETDRVLKUP_SOURCE = @NETDRVLKUP_SOURCE@
NETRTLKUP_SOURCE = @NETRTLKUP_SOURCE@
+NETSECLKUP_SOURCE = @NETSECLKUP_SOURCE@
NETSLOTLKUP_SOURCE = @NETSLOTLKUP_SOURCE@
NETSYSLKUP_SOURCE = @NETSYSLKUP_SOURCE@
OBJEXT = @OBJEXT@
Modified: trunk/src/missing/m4/Makefile.in
===================================================================
--- trunk/src/missing/m4/Makefile.in 2008-08-14 20:38:31 UTC (rev 289)
+++ trunk/src/missing/m4/Makefile.in 2008-10-21 00:43:53 UTC (rev 290)
@@ -72,6 +72,7 @@
NETCPU_SOURCE = @NETCPU_SOURCE@
NETDRVLKUP_SOURCE = @NETDRVLKUP_SOURCE@
NETRTLKUP_SOURCE = @NETRTLKUP_SOURCE@
+NETSECLKUP_SOURCE = @NETSECLKUP_SOURCE@
NETSLOTLKUP_SOURCE = @NETSLOTLKUP_SOURCE@
NETSYSLKUP_SOURCE = @NETSYSLKUP_SOURCE@
OBJEXT = @OBJEXT@
Modified: trunk/src/netdrv_ethtool.c
===================================================================
--- trunk/src/netdrv_ethtool.c 2008-08-14 20:38:31 UTC (rev 289)
+++ trunk/src/netdrv_ethtool.c 2008-10-21 00:43:53 UTC (rev 290)
@@ -9,23 +9,23 @@
#include <string.h>
#include <errno.h>
#include <net/if.h>
+#include <asm/types.h>
#include <linux/sockios.h>
/* alas, direct inclusion of ethtool.h depends on some types not
normally found in nature, which we must provide or things will be
- quite unhappy. */
+ quite unhappy. newer ethtool.h include files will it seems be happy
+ with our including linux/types.h which will give us __umumble */
-typedef __uint64_t __u64;
-typedef __uint32_t __u32;
-typedef __uint16_t __u16;
-typedef __uint8_t __u8;
+#include <linux/types.h>
-/* older ones want them without the leading underscores */
-typedef __uint64_t u64;
-typedef __uint32_t u32;
-typedef __uint16_t u16;
-typedef __uint8_t u8;
+/* older ethtool.h includes want them without the leading underscores */
+typedef unsigned long long u64;
+typedef unsigned int u32;
+typedef unsigned short u16;
+typedef unsigned char u8;
+/* ostensibly at this point we should be covered for any ethtool.h? */
#include <linux/ethtool.h>
void
Modified: trunk/src/netlib.c
===================================================================
--- trunk/src/netlib.c 2008-08-14 20:38:31 UTC (rev 289)
+++ trunk/src/netlib.c 2008-10-21 00:43:53 UTC (rev 290)
@@ -448,6 +448,33 @@
}
#endif /* WIN32 */
+char *
+nsec_enabled_to_str(int enabled) {
+ switch (enabled) {
+ case NSEC_UNKNOWN:
+ return("Unknown");
+ case NSEC_DISABLED:
+ return("Disabled");
+ case NSEC_PERMISSIVE:
+ return("Permissive");
+ case NSEC_ENFORCING:
+ return("Enforcing");
+ default:
+ return("UNKNOWN MODE");
+ }
+}
+
+char * nsec_type_to_str(int type) {
+ switch (type) {
+ case NSEC_TYPE_UNKNOWN:
+ return("Unknown");
+ case NSEC_TYPE_SELINUX:
+ return("SELinux");
+ default:
+ return("UNKNOWN TYPE");
+ }
+}
+
char *
inet_ttos(int type)
Modified: trunk/src/netlib.h
===================================================================
--- trunk/src/netlib.h 2008-08-14 20:38:31 UTC (rev 289)
+++ trunk/src/netlib.h 2008-10-21 00:43:53 UTC (rev 290)
@@ -241,6 +241,17 @@
RECV_BUFFER
};
+/* some defines for security types, perhaps these would be better
+ elsewhere but for now here they are */
+
+#define NSEC_UNKNOWN -1
+#define NSEC_DISABLED 0
+#define NSEC_PERMISSIVE 1
+#define NSEC_ENFORCING 2
+
+#define NSEC_TYPE_UNKNOWN -1
+#define NSEC_TYPE_SELINUX 1
+
/* some of the fields in these structures are going to be doubles and */
/* such. so, we probably want to ensure that they will start on */
/* "double" boundaries. this will break compatability to pre-2.1 */
Added: trunk/src/netsec_linux.c
===================================================================
--- trunk/src/netsec_linux.c (rev 0)
+++ trunk/src/netsec_linux.c 2008-10-21 00:43:53 UTC (rev 290)
@@ -0,0 +1,148 @@
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
+
+#if defined(HAVE_STRING_H)
+#include <string.h>
+#endif
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <dlfcn.h>
+
+void *messiah; /* Handel's... */
+
+/* for the NSEC_mumble defines */
+#include "netlib.h"
+
+
+void
+find_security_info_selinux(int *enabled, int *type, char **specific){
+
+ int ret;
+ int enforcing;
+
+ /* at some point we should probably get these from
+ selinux/selinux.h? */
+ int (*getenforce)(int *);
+ int (*getpolicy)(char **);
+
+ *enabled = NSEC_UNKNOWN;
+ *type = NSEC_TYPE_SELINUX;
+
+ getenforce = dlsym(messiah, "selinux_getenforcemode");
+ if (NULL == getenforce) {
+ dlclose(messiah);
+ *specific = strdup("no getenforcemode");
+ return;
+ }
+
+ ret = (*getenforce)(&enforcing);
+#if defined(NETPERF_STANDALONE_DEBUG)
+ printf("after selinux_getenforcemode() ret is %d\n",ret);
+#endif
+
+ switch(enforcing) {
+ case -1:
+ *enabled = NSEC_DISABLED;
+ break;
+ case 0:
+ *enabled = NSEC_PERMISSIVE;
+ break;
+ case 1:
+ *enabled = NSEC_ENFORCING;
+ break;
+ default:
+ *enabled = NSEC_UNKNOWN;
+ }
+
+ getpolicy = dlsym(messiah, "selinux_getpolicytype");
+ if (NULL == getpolicy) {
+ dlclose(messiah);
+ *specific = strdup("no getpolicytype");
+ return;
+ }
+
+ ret = (*getpolicy)(specific);
+#if defined(NETPERF_STANDALONE_DEBUG)
+ printf("after selinux_getpolicytype ret is %d\n",ret);
+#endif
+
+ return;
+}
+
+/* presently we only know about SELinux or nothing. at some point we
+ probably need to learn about AppArmor and the like. raj
+ 20081020 */
+
+void
+find_security_info(int *enabled, int *type, char **specific) {
+
+ /* first, might it be selinux? */
+ messiah = dlopen("libselinux.so", RTLD_LAZY);
+ if (NULL != messiah) {
+ dlerror();
+ return find_security_info_selinux(enabled, type, specific);
+ }
+ else {
+ *enabled = NSEC_UNKNOWN;
+ *type = NSEC_TYPE_UNKNOWN;
+ *specific = "unknown";
+ return;
+ }
+}
+
+#if defined(NETPERF_STANDALONE_DEBUG)
+
+/* these are normally found in src/netlib.c but we put copies here for
+ the nefaious popoise of standalone debugging */
+
+char *
+nsec_enabled_to_str(int enabled) {
+ switch (enabled) {
+ case NSEC_UNKNOWN:
+ return("Unknown");
+ case NSEC_DISABLED:
+ return("Disabled");
+ case NSEC_PERMISSIVE:
+ return("Permissive");
+ case NSEC_ENFORCING:
+ return("Enforcing");
+ default:
+ return("UNKNOWN MODE");
+ }
+}
+
+char * nsec_type_to_str(int type) {
+ switch (type) {
+ case NSEC_TYPE_UNKNOWN:
+ return("Unknown");
+ case NSEC_TYPE_SELINUX:
+ return("SELinux");
+ default:
+ return("UNKNOWN TYPE");
+ }
+}
+
+int
+main(int argc, char *argv[]) {
+
+ char *specific;
+ int enabled;
+ int type;
+
+ find_security_info(&enabled, &type, &specific);
+
+ printf("Security info: enabled %s (%d) type %s (0x%x) specific %s\n",
+ nsec_enabled_to_str(enabled),
+ enabled,
+ nsec_type_to_str(type),
+ type,
+ specific);
+
+ return 0;
+}
+#endif
Added: trunk/src/netsec_none.c
===================================================================
--- trunk/src/netsec_none.c (rev 0)
+++ trunk/src/netsec_none.c 2008-10-21 00:43:53 UTC (rev 290)
@@ -0,0 +1,37 @@
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
+
+#if defined(HAVE_STRING_H)
+#include <string.h>
+#endif
+
+#include <stdio.h>
+#include "netlib.h"
+
+void
+find_security_info(int *enabled, int *type, char **specific){
+ *enabled = NSEC_UNKNOWN;
+ *type = NSEC_TYPE_UNKNOWN;
+ *specific = strdup("N/A");
+ return;
+}
+
+#if defined(NETPERF_STANDALONE_DEBUG)
+int
+main(int argc, char *argv[]) {
+
+ char *specific;
+ int enabled;
+ int type;
+
+ find_security_info(&enabled, &type, &specific);
+
+ printf("Security info: enabled %d type 0x%x specific %s\n",
+ enabled,
+ type,
+ specific);
+
+ return 0;
+}
+#endif
Modified: trunk/src/nettest_bsd.c
===================================================================
--- trunk/src/nettest_bsd.c 2008-08-14 20:38:31 UTC (rev 289)
+++ trunk/src/nettest_bsd.c 2008-10-21 00:43:53 UTC (rev 290)
@@ -1961,8 +1961,10 @@
recv_response();
if (!netperf_response.content.serv_errno) {
- if (debug)
- fprintf(where,"remote results obtained\n");
+ if (debug)
+ fprintf(where,
+ "remote reporting results for %.2f seconds\n",
+ tcp_stream_result->elapsed_time);
}
else {
Set_errno(netperf_response.content.serv_errno);
Modified: trunk/src/nettest_bsd.h
===================================================================
--- trunk/src/nettest_bsd.h 2008-08-14 20:38:31 UTC (rev 289)
+++ trunk/src/nettest_bsd.h 2008-10-21 00:43:53 UTC (rev 290)
@@ -24,6 +24,7 @@
#define NST_DGRAM 2
#define NST_DCCP 3
+
#ifdef WANT_OMNI
struct omni_request_struct {
int32_t send_buf_size; /* SO_SNDBUF */
@@ -97,13 +98,16 @@
connections are made, and the omni_results_struct is already
full */
uint32_t cpu_frequency; /* this should be megahertz */
- char system_model[32];
+ uint32_t security_info;
+#define OMNI_RESPONSE_CONV_CUTOFF 18
+ char system_model[33];
char cpu_model[80]; /* seems like an awful lot doesn't
it. some clever person at Intel
decided to give Montecito processors a
name that long - and still didn't
include the 9NNN model number! */
- /* 68 bytes left */
+ char security_string[16];
+ /* 48 bytes left */
};
@@ -134,6 +138,7 @@
interface */
int32_t subvendor;
int32_t subdevice;
+ #define OMNI_RESULTS_CONF_CUTOFF 21
/* this is the 22dn 32-bit word and we have 248-(17*4) bytes
available from here */
char ifname[16]; /* the probable egress interface */
Modified: trunk/src/nettest_omni.c
===================================================================
--- trunk/src/nettest_omni.c 2008-08-14 20:38:31 UTC (rev 289)
+++ trunk/src/nettest_omni.c 2008-10-21 00:43:53 UTC (rev 290)
@@ -416,6 +416,13 @@
char *remote_cpu_model;
int remote_cpu_frequency;
+int local_security_type;
+int local_security_enabled;
+char *local_security_specific;
+int remote_security_type;
+int remote_security_enabled;
+char *remote_security_specific;
+
int printing_initialized = 0;
char *sd_str;
@@ -595,6 +602,12 @@
LOCAL_INTERVAL_BURST,
REMOTE_INTERVAL_USECS,
REMOTE_INTERVAL_BURST,
+ LOCAL_SECURITY_TYPE,
+ LOCAL_SECURITY_ENABLED,
+ LOCAL_SECURITY_SPECIFIC,
+ REMOTE_SECURITY_TYPE,
+ REMOTE_SECURITY_ENABLED,
+ REMOTE_SECURITY_SPECIFIC,
RESULT_BRAND,
COMMAND_LINE,
OUTPUT_END,
@@ -980,6 +993,18 @@
return "REMOTE_INTERVAL_USECS";
case REMOTE_INTERVAL_BURST:
return "REMOTE_INTERVAL_BURST";
+ 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:
+ return "REMOTE_SECURITY_TYPE";
+ case REMOTE_SECURITY_ENABLED:
+ return "REMOTE_SECURITY_ENABLED";
+ case REMOTE_SECURITY_SPECIFIC:
+ return "REMOTE_SECURITY_SPECIFIC";
case LOCAL_DRIVER_BUS:
return "LOCAL_DRIVER_BUS";
case REMOTE_SYSNAME:
@@ -2826,6 +2851,78 @@
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].max_line_len =
+ NETPERF_LINE_MAX(LOCAL_SECURITY_ENABLED);
+ netperf_output_source[LOCAL_SECURITY_ENABLED].tot_line_len =
+ NETPERF_LINE_TOT(LOCAL_SECURITY_ENABLED);
+
+ netperf_output_source[LOCAL_SECURITY_TYPE].output_name = LOCAL_SECURITY_TYPE;
+ netperf_output_source[LOCAL_SECURITY_TYPE].line[0] = "Local";
+ 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].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[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].max_line_len =
+ NETPERF_LINE_MAX(REMOTE_SECURITY_ENABLED);
+ netperf_output_source[REMOTE_SECURITY_ENABLED].tot_line_len =
+ NETPERF_LINE_TOT(REMOTE_SECURITY_ENABLED);
+
+ netperf_output_source[REMOTE_SECURITY_TYPE].output_name = REMOTE_SECURITY_TYPE;
+ netperf_output_source[REMOTE_SECURITY_TYPE].line[0] = "Remote";
+ 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].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[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";
@@ -3998,7 +4095,7 @@
so, we can shove them back into the relevant variables here
and be on our way. */
- recv_response_n(17); /* brittle, but functional */
+ recv_response_n(OMNI_RESPONSE_CONV_CUTOFF); /* brittle, but functional */
if (!netperf_response.content.serv_errno) {
rsr_size = omni_response->recv_buf_size;
@@ -4031,6 +4128,14 @@
remote_cpu_model = strdup(omni_response->cpu_model);
}
remote_cpu_frequency = omni_response->cpu_frequency;
+
+ if (NULL == remote_security_specific) {
+ omni_response->security_string[sizeof(omni_response->security_string) - 1] = 0;
+ 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;
}
else {
Set_errno(netperf_response.content.serv_errno);
@@ -4455,6 +4560,10 @@
local_res->ai_protocol);
+ find_security_info(&local_security_enabled,
+ &local_security_type,
+ &local_security_specific);
+
/* 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
connection. */
@@ -4545,7 +4654,7 @@
calculated service demand and all those interesting things. If
it wasn't supposed to care, it will return obvious values. */
- recv_response_n(21);
+ recv_response_n(OMNI_RESULTS_CONF_CUTOFF);
if (!netperf_response.content.serv_errno) {
if (debug)
fprintf(where,"remote results obtained\n");
@@ -5081,8 +5190,19 @@
omni_response->cpu_model[sizeof(omni_response->cpu_model)-1] = 0;
omni_response->cpu_frequency = local_cpu_frequency;
- send_response_n(17); /* brittle, but functional */
+ find_security_info(&local_security_enabled,
+ &local_security_type,
+ &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;
+ strncpy(omni_response->security_string,
+ local_security_specific,
+ sizeof(omni_response->security_string));
+ omni_response->security_string[sizeof(omni_response->security_string)-1] = 0;
+ send_response_n(OMNI_RESPONSE_CONV_CUTOFF); /* brittle, but functional */
+
local_send_calls = 0;
local_receive_calls = 0;
@@ -5445,7 +5565,7 @@
fflush(where);
}
- send_response_n(21);
+ send_response_n(OMNI_RESULTS_CONF_CUTOFF);
/* when we implement this, it will look a little strange, but we do
it to avoid certain overheads when running aggregates and using
More information about the netperf-dev
mailing list