]> rtime.felk.cvut.cz Git - orte.git/commitdiff
version 0.2.2 (mac, solaris patch)
authorsmolik <smolik>
Tue, 20 Apr 2004 08:36:14 +0000 (08:36 +0000)
committersmolik <smolik>
Tue, 20 Apr 2004 08:36:14 +0000 (08:36 +0000)
53 files changed:
ChangleLog
configure
configure.in
orte/contrib/decoder/decode_msg.c
orte/contrib/shape/richtext.cpp
orte/contrib/shape/richtext.h
orte/examples/ping/orteping.c
orte/examples/spy/ortespy.c
orte/include/config.h.in
orte/include/defines.h
orte/include/defines_api.h
orte/include/ew_types.h
orte/include/orte_all.h
orte/include/orte_api.h
orte/include/orte_config_omk_rtl.h
orte/include/orte_config_omk_unix.h
orte/include/protos.h
orte/include/rtl/compat.h
orte/include/typedefs.h
orte/include/typedefs_api.h
orte/include/typedefs_defines_rtps.h
orte/include/ul_listbase.h
orte/liborte/ORTEAppRecvMetatrafficThread.c
orte/liborte/ORTEAppRecvUserdataThread.c
orte/liborte/ORTEAppSendThread.c
orte/liborte/ORTEDomainApp.c
orte/liborte/ORTEDomainMgr.c
orte/liborte/ORTEPublication.c
orte/liborte/ORTESubscription.c
orte/liborte/ORTEThreadUtils.c
orte/liborte/RTPSAck.c
orte/liborte/RTPSCSTWriter.c
orte/liborte/RTPSCSTWriterTimer.c
orte/liborte/RTPSGap.c
orte/liborte/RTPSHeader.c
orte/liborte/RTPSHeardBeat.c
orte/liborte/RTPSInfoDST.c
orte/liborte/RTPSInfoREPLY.c
orte/liborte/RTPSInfoSRC.c
orte/liborte/RTPSInfoTS.c
orte/liborte/RTPSIssue.c
orte/liborte/RTPSPad.c
orte/liborte/RTPSVar.c
orte/liborte/conv.c
orte/liborte/objectUtils.c
orte/liborte/parameter.c
orte/liborte/sock.c
orte/manager/Makefile.am
orte/manager/Makefile.in
orte/manager/mcvs/Makefile.msc
orte/manager/ortemanager.c
orte/manager/service.c [new file with mode: 0644]
readme

index c9dc5f026b506397452c0a11200c2cdeb9928d69..f7ddca7644d08b21df840e74254d9626a25a450a 100644 (file)
@@ -1,7 +1,14 @@
+v0.2.2 - 11/04/2004
+
+- added support new targets (Solaris, MacOS)
+- now ortemanager can be runnig like windows service
+- tested on big-endian machines
+
 v0.2.1 - 02/04/2004
 
-- bug in CDRStream format -> char -> u_int8_t
+- bug in CDRStream format -> char -> uint8_t
 - no fill callBack rutine in subscriber cause SIGSEV
+- change types u_intXX_t to uintXX_t
 
 
 v0.2.0 - 08/01/2004
index dbadb36cb4426d997a578b71c1b67d714ef7f509..d11b5aed7011713bab4393b93db4318685e7f572 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for orte 0.2.1.
+# Generated by GNU Autoconf 2.59 for orte 0.2.2.
 #
 # Report bugs to <petr.smolik@wo.cz>.
 #
@@ -269,8 +269,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='orte'
 PACKAGE_TARNAME='orte'
-PACKAGE_VERSION='0.2.1'
-PACKAGE_STRING='orte 0.2.1'
+PACKAGE_VERSION='0.2.2'
+PACKAGE_STRING='orte 0.2.2'
 PACKAGE_BUGREPORT='petr.smolik@wo.cz'
 
 ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LINUX_DIR LINUX_ARCH LINUX_AFLAGS LINUX_LDFLAGS LINUX_ARFLAGS LINUX_CROSS_COMPILE LINUX_KERNELRELEASE LINUX_CFLAGS LINUX_CC LINUX_LD LINUX_AS LINUX_MODULE_EXT CONFIG_ORTE_KERNEL CONFIG_ORTE_KERNEL_TRUE CONFIG_ORTE_KERNEL_FALSE CONFIG_RTHAL_TRUE CONFIG_RTHAL_FALSE CONFIG_ADEOS_TRUE CONFIG_ADEOS_FALSE RTAI_CFLAGS CONFIG_RTLINUX_TRUE CONFIG_RTLINUX_FALSE RTLINUX_CFLAGS RTLINUX_CC CONFIG_ORTE_RT USE_RTAI_TRUE USE_RTAI_FALSE USE_RTLINUX_TRUE USE_RTLINUX_FALSE CONFIG_ORTE_RT_TRUE CONFIG_ORTE_RT_FALSE ORTE_MAJOR_VERSION ORTE_MINOR_VERSION ORTE_MICRO_VERSION ORTE_VERSION CONFIG_ORTE_WIN_TRUE CONFIG_ORTE_WIN_FALSE CONFIG_ORTE_CYGWIN_TRUE CONFIG_ORTE_CYGWIN_FALSE CONFIG_ORTE_MINGW_TRUE CONFIG_ORTE_MINGW_FALSE CONFIG_ORTE_UNIX_TRUE CONFIG_ORTE_UNIX_FALSE moduledir modulePROGRAMS_INSTALL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB CPP EGREP INCLUDES LIBOBJS LTLIBOBJS'
@@ -742,7 +742,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures orte 0.2.1 to adapt to many kinds of systems.
+\`configure' configures orte 0.2.2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -809,7 +809,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of orte 0.2.1:";;
+     short | recursive ) echo "Configuration of orte 0.2.2:";;
    esac
   cat <<\_ACEOF
 
@@ -939,7 +939,7 @@ fi
 test -n "$ac_init_help" && exit 0
 if $ac_init_version; then
   cat <<\_ACEOF
-orte configure 0.2.1
+orte configure 0.2.2
 generated by GNU Autoconf 2.59
 
 Copyright (C) 2003 Free Software Foundation, Inc.
@@ -953,7 +953,7 @@ cat >&5 <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by orte $as_me 0.2.1, which was
+It was created by orte $as_me 0.2.2, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
   $ $0 $@
@@ -1650,7 +1650,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE=orte
- VERSION=0.2.1
+ VERSION=0.2.2
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2261,7 +2261,7 @@ fi
 # Package info
 ORTE_MAJOR_VERSION=0
 ORTE_MINOR_VERSION=2
-ORTE_MICRO_VERSION=1
+ORTE_MICRO_VERSION=2
 ORTE_VERSION=$ORTE_MAJOR_VERSION.$ORTE_MINOR_VERSION.$ORTE_MICRO_VERSION
 
 
@@ -2305,6 +2305,11 @@ cat >>confdefs.h <<\_ACEOF
 #define CONFIG_ORTE_MINGW 1
 _ACEOF
 
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETPOT_LONG_ORTE 1
+_ACEOF
+
     ;;
   *)
     # Assume Unix.
@@ -3703,6 +3708,142 @@ _ACEOF
 
 fi
 
+
+echo "$as_me:$LINENO: checking for main in -lsocket" >&5
+echo $ECHO_N "checking for main in -lsocket... $ECHO_C" >&6
+if test "${ac_cv_lib_socket_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket  $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 ()
+{
+main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_socket_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_socket_main=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5
+echo "${ECHO_T}$ac_cv_lib_socket_main" >&6
+if test $ac_cv_lib_socket_main = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSOCKET 1
+_ACEOF
+
+  LIBS="-lsocket $LIBS"
+
+fi
+
+
+echo "$as_me:$LINENO: checking for main in -lnsl" >&5
+echo $ECHO_N "checking for main in -lnsl... $ECHO_C" >&6
+if test "${ac_cv_lib_nsl_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl  $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 ()
+{
+main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_nsl_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_nsl_main=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_main" >&5
+echo "${ECHO_T}$ac_cv_lib_nsl_main" >&6
+if test $ac_cv_lib_nsl_main = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBNSL 1
+_ACEOF
+
+  LIBS="-lnsl $LIBS"
+
+fi
+
 fi
 
 ###############################
 
 
 
+for ac_header in \
+    arpa/inet.h fcntl.h stdio.h netdb.h stdlib.h \
+    string.h sys/ioctl.h sys/time.h unistd.h pthread.h \
+    sys/types.h sys/sockio.h stdarg.h byteswap.h getopt.h \
+    ctype.h signal.h stdint.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 
-for ac_header in \
-    arpa/inet.h fcntl.h stdio.h netdb.h netinet/in.h stdlib.h \
-    string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h pthread.h \
-    stdarg.h sys/types.h net/if.h byteswap.h getopt.h \
-    ctype.h semaphore.h signal.h
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in sys/socket.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef HAVE_SYS_TYPES_H
+            #include <sys/types.h>
+           #endif
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in netinet/in.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_header" >&5
@@ -4168,7 +4431,75 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+#ifdef HAVE_SYS_TYPES_H
+            #include <sys/types.h>
+           #endif
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 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); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in net/if.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef HAVE_SYS_TYPES_H
+            #include <sys/types.h>
+           #endif
+           #ifdef HAVE_SYS_SOCKET_H
+            #include <sys/socket.h>
+           #endif
 
 #include <$ac_header>
 _ACEOF
@@ -4430,9 +4761,8 @@ if test ${USE_RTLINUX} == 'yes' ; then
 
 
 
-
 for ac_header in \
-    string.h pthread.h semaphore.h \
+    string.h pthread.h \
     rtl.h rtl_malloc.h udp.h nic.h time.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -5099,7 +5429,8 @@ fi
 if test -z ${CONFIG_ORTE_RT} ; then
 
 
-for ac_func in strdup gethostbyname
+
+for ac_func in strdup gethostbyname getopt_long
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -5667,7 +5998,7 @@ _ASBOX
 } >&5
 cat >&5 <<_CSEOF
 
-This file was extended by orte $as_me 0.2.1, which was
+This file was extended by orte $as_me 0.2.2, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -5730,7 +6061,7 @@ _ACEOF
 
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-orte config.status 0.2.1
+orte config.status 0.2.2
 configured by $0, generated by GNU Autoconf 2.59,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 
index 834f7beced485f98f999f8a52e5c69331d646dc2..0551ee3cceb057da7f470c23e5bef89109e773ac 100644 (file)
@@ -1,12 +1,12 @@
 # Process this file with autoconf to produce a configure script.
 #
-# $Id: configure.in,v 1.7 2004/04/03 11:27:21 smolik Exp $
+# $Id: configure.in,v 1.8 2004/04/20 08:36:14 smolik Exp $
 
 # autoconf requirement
 
 AC_PREREQ([2.56])
 
-AC_INIT([orte],[0.2.1],[petr.smolik@wo.cz])
+AC_INIT([orte],[0.2.2],[petr.smolik@wo.cz])
 AC_CONFIG_AUX_DIR(admin)
 
 #Check for CPU / vendor / OS
@@ -23,7 +23,7 @@ DS_LINUX()
 # Package info
 ORTE_MAJOR_VERSION=0
 ORTE_MINOR_VERSION=2
-ORTE_MICRO_VERSION=1
+ORTE_MICRO_VERSION=2
 ORTE_VERSION=$ORTE_MAJOR_VERSION.$ORTE_MINOR_VERSION.$ORTE_MICRO_VERSION
 AC_SUBST(ORTE_MAJOR_VERSION)
 AC_SUBST(ORTE_MINOR_VERSION)
@@ -51,6 +51,7 @@ case "$target" in
     MINGW='yes'
     AC_DEFINE([CONFIG_ORTE_WIN],[1],[Define if is target windows])
     AC_DEFINE([CONFIG_ORTE_MINGW],[1],[Define if is target MINGW])
+    AC_DEFINE([HAVE_GETPOT_LONG_ORTE],[1],[Define for ORTE getopt_long self implemetation])
     ;;
   *)
     # Assume Unix.
@@ -99,6 +100,8 @@ AC_PROG_RANLIB
 if test -z ${CONFIG_ORTE_RT} ; then
   AC_CHECK_LIB([ws2_32], [main])
   AC_CHECK_LIB([pthread], [main])
+  AC_CHECK_LIB([socket], [main])
+  AC_CHECK_LIB([nsl], [main])
 fi
 
 ###############################
@@ -115,10 +118,25 @@ AH_VERBATIM([_GNU_SOURCE],[
 if test ${UNIX} == 'yes' -o ${WIN} == 'yes' ; then
     AC_HEADER_STDC
     AC_CHECK_HEADERS([\
-    arpa/inet.h fcntl.h stdio.h netdb.h netinet/in.h stdlib.h \
-    string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h pthread.h \
-    stdarg.h sys/types.h net/if.h byteswap.h getopt.h \
-    ctype.h semaphore.h signal.h],,,[[]])
+    arpa/inet.h fcntl.h stdio.h netdb.h stdlib.h \
+    string.h sys/ioctl.h sys/time.h unistd.h pthread.h \
+    sys/types.h sys/sockio.h stdarg.h byteswap.h getopt.h \
+    ctype.h signal.h stdint.h],,,[[]])
+    AC_CHECK_HEADERS([sys/socket.h], [], [],
+          [#ifdef HAVE_SYS_TYPES_H
+            #include <sys/types.h>
+           #endif])
+    AC_CHECK_HEADERS([netinet/in.h], [], [],
+          [#ifdef HAVE_SYS_TYPES_H
+            #include <sys/types.h>
+           #endif])
+    AC_CHECK_HEADERS([net/if.h], [], [],
+          [#ifdef HAVE_SYS_TYPES_H
+            #include <sys/types.h>
+           #endif
+           #ifdef HAVE_SYS_SOCKET_H
+            #include <sys/socket.h>
+           #endif])
 fi
 # win32
 if test ${WIN} == 'yes' ; then
@@ -140,7 +158,7 @@ fi
 # RTLinux
 if test ${USE_RTLINUX} == 'yes' ; then
     AC_CHECK_HEADERS([\
-    string.h pthread.h semaphore.h \
+    string.h pthread.h \
     rtl.h rtl_malloc.h udp.h nic.h time.h],,,[[]])
     AC_CHECK_HEADERS([nictab.h],,,[
     #ifdef HAVE_UDP_H
@@ -172,7 +190,7 @@ AC_C_INLINE
 # Checks for library functions.
 AC_PROG_GCC_TRADITIONAL
 if test -z ${CONFIG_ORTE_RT} ; then
-AC_CHECK_FUNCS([strdup gethostbyname])
+AC_CHECK_FUNCS([strdup gethostbyname getopt_long])
 fi
 
 AC_CONFIG_FILES([Makefile
index 150888eab9259449d23f9b3fa69a8b69d894f3f0..cbf167d2ee5f66dad96da45646048283c4e8f465 100644 (file)
@@ -11,7 +11,7 @@
 
 
 /**********************************************************************************/
-void conv_u32(u_int32_t *x,u_int8_t ef) {
+void conv_u32(uint32_t *x,uint8_t ef) {
   #if __BYTE_ORDER == __LITTLE_ENDIAN
      if(ef) bswap_32(*x);
   #elif __BYTE_ORDER == __BIG_ENDIAN
@@ -22,7 +22,7 @@ void conv_u32(u_int32_t *x,u_int8_t ef) {
 /**********************************************************************************/
 void print_obj(void *obj) {
   fprintf(ptr_out," (");
-  switch (bswap_32(*((u_int32_t*)obj))) {
+  switch (bswap_32(*((uint32_t*)obj))) {
     case OID_APP:
       fprintf(ptr_out,"ManagedApplicaton or Manager");
       break;
@@ -61,7 +61,7 @@ void print_obj(void *obj) {
 }                    
 
 /**********************************************************************************/
-void print_app(u_int8_t app) {
+void print_app(uint8_t app) {
   switch (app) {
     case MANAGEDAPPLICATION:
       fprintf(ptr_out,"(managed application)\n");
@@ -76,13 +76,13 @@ void print_app(u_int8_t app) {
 }                         
 
 /**********************************************************************************/
-void decode_parametr_sequence(u_int8_t *msg) {
+void decode_parametr_sequence(uint8_t *msg) {
   NtpTime            ts;
   ProtocolVersion    pv;
   VendorId           vid;
   SequenceNumber     sn;
-  u_int8_t      i,j,l;
-  u_int8_t      *k;
+  uint8_t      i,j,l;
+  uint8_t      *k;
 
   while(*((ParameterId*)msg)!=PID_SENTINEL) {
     printf("id%d,len%d\n",*((ParameterId*)msg),*((ParameterLength*)(msg+2)));
@@ -110,7 +110,7 @@ void decode_parametr_sequence(u_int8_t *msg) {
         fprintf(ptr_out,"     PID_TOPIC                            :\n");
         k=msg+4;
        //len of message is also in message (first ulong)
-        l=(*(u_int32_t*)(msg+4))+4;
+        l=(*(uint32_t*)(msg+4))+4;
         while(l!=0) {
           if (l>8) j=8;
          else j=l;
@@ -127,13 +127,13 @@ void decode_parametr_sequence(u_int8_t *msg) {
         break;
       case PID_STRENGTH:
         fprintf(ptr_out,"     PID_STRENGTH                         : %u\n",
-                       *(u_int32_t*)(msg+4));
+                       *(uint32_t*)(msg+4));
         break;
       case PID_TYPE_NAME:
         fprintf(ptr_out,"     PID_TYPE_NAME                        :\n");
         k=msg+4;
        //len of message is also in message (first ulong)
-        l=(*(u_int32_t*)(msg+4))+4;
+        l=(*(uint32_t*)(msg+4))+4;
         while(l!=0) {
           if (l>8) j=8;
          else j=l;
@@ -176,7 +176,7 @@ void decode_parametr_sequence(u_int8_t *msg) {
         break;
       case PID_EXPECTS_ACK:
         fprintf(ptr_out,"     PID_EXPECTS_ACK                      : %u\n",
-                       *(u_int32_t*)(msg+4));
+                       *(uint32_t*)(msg+4));
         break;
       case PID_USERDATA_MULTICAST_IPADDRESS:
         fprintf(ptr_out,"     PID_USERDATA_MULTICAST_IPADDRESS     : %u.%u.%u.%u\n",
@@ -188,7 +188,7 @@ void decode_parametr_sequence(u_int8_t *msg) {
         break;
       case PID_SEND_QUEUE_SIZE:
         fprintf(ptr_out,"     PID_SEND_QUEUE_SIZE                  : %u\n",
-                       *(u_int32_t*)(msg+4));
+                       *(uint32_t*)(msg+4));
         break;
       case PID_PROTOCOL_VERSION:
         pv=*((ProtocolVersion*)(msg+4));
@@ -206,15 +206,15 @@ void decode_parametr_sequence(u_int8_t *msg) {
         break;
       case PID_RECV_QUEUE_SIZE:
         fprintf(ptr_out,"     PID_RECV_QUEUE_SIZE                  : %u\n",
-                       *(u_int32_t*)(msg+4));
+                       *(uint32_t*)(msg+4));
         break;
       case PID_RELIABILITY_OFFERED:
         fprintf(ptr_out,"     PID_RELIABILITY_OFFERED              : %u\n",
-                       *(u_int32_t*)(msg+4));
+                       *(uint32_t*)(msg+4));
         break;
       case PID_RELIABILITY_REQUESTED:
         fprintf(ptr_out,"     PID_RELIABILITY_REQUESTED            : %u\n",
-                       *(u_int32_t*)(msg+4));
+                       *(uint32_t*)(msg+4));
         break;
       default:
         fprintf(ptr_out,"     unknow paramerId                 : %d len : %d\n",
@@ -228,7 +228,7 @@ void decode_parametr_sequence(u_int8_t *msg) {
 
 
 /**********************************************************************************/
-int decode_header(u_int8_t *msg, unsigned len, MessageInterpret *mi) {
+int decode_header(uint8_t *msg, unsigned len, MessageInterpret *mi) {
   if (len<16) return -1;                          /* message is to small */
   if (msg[0]!='R') return -2;                     /* header is invalid */
   if (msg[1]!='T') return -2;                     /* header is invalid */
@@ -243,13 +243,13 @@ int decode_header(u_int8_t *msg, unsigned len, MessageInterpret *mi) {
 }
 
 /**********************************************************************************/
-int decode_submessage(u_int8_t *msg, int ptr, MessageInterpret *mi) {
+int decode_submessage(uint8_t *msg, int ptr, MessageInterpret *mi) {
   IPAddress          ipa;
   Port               port;
   ObjectId           roid,woid,oid;
   SequenceNumber     fsn,lsn,wsn;
-  u_int8_t      i,j,l;
-  u_int8_t      *k;
+  uint8_t      i,j,l;
+  uint8_t      *k;
   HostId             hid;
   AppId              aid;
   int                ptr_off;
@@ -265,25 +265,25 @@ int decode_submessage(u_int8_t *msg, int ptr, MessageInterpret *mi) {
       fprintf(ptr_out,"     p-bit          : %d\n",(msg[ptr+1] & 2) ? 1:0);
       roid=*((ObjectId*)(msg+ptr+4));
       fprintf(ptr_out,"     ObjectId       : %d.%d.%d.%02x",
-                        *(u_int8_t*)&roid,*(((u_int8_t*)&roid)+1),*(((u_int8_t*)&roid)+2),*(((u_int8_t*)&roid)+3));
+                        *(uint8_t*)&roid,*(((uint8_t*)&roid)+1),*(((uint8_t*)&roid)+2),*(((uint8_t*)&roid)+3));
       print_obj(&roid);                      
       woid=*((ObjectId*)(msg+ptr+8));
       fprintf(ptr_out,"     ObjectId       : %d.%d.%d.%02x",
-                        *(u_int8_t*)&woid,*(((u_int8_t*)&woid)+1),*(((u_int8_t*)&woid)+2),*(((u_int8_t*)&woid)+3));
+                        *(uint8_t*)&woid,*(((uint8_t*)&woid)+1),*(((uint8_t*)&woid)+2),*(((uint8_t*)&woid)+3));
       print_obj(&woid);                      
       if (msg[ptr+1] & 8) {
         hid=*((HostId*)(msg+ptr+12));                   /* hostId */
         aid=*((AppId*)(msg+ptr+16));                   /* appId */
         fprintf(ptr_out,"     HostId         : %d.%d.%d.%d\n",
-                        *(u_int8_t*)&hid,*(((u_int8_t*)&hid)+1),*(((u_int8_t*)&hid)+2),*(((u_int8_t*)&hid)+3));
+                        *(uint8_t*)&hid,*(((uint8_t*)&hid)+1),*(((uint8_t*)&hid)+2),*(((uint8_t*)&hid)+3));
         fprintf(ptr_out,"     AppId          : %d.%d.%d.%d ",
-                        *(u_int8_t*)&aid,*(((u_int8_t*)&aid)+1),*(((u_int8_t*)&aid)+2),*(((u_int8_t*)&aid)+3));
-        print_app(*(((u_int8_t*)&aid)+3));
+                        *(uint8_t*)&aid,*(((uint8_t*)&aid)+1),*(((uint8_t*)&aid)+2),*(((uint8_t*)&aid)+3));
+        print_app(*(((uint8_t*)&aid)+3));
         ptr_off=8;
       } else ptr_off=0;
       oid=*((ObjectId*)(msg+ptr+12+ptr_off));
       fprintf(ptr_out,"     ObjectId       : %d.%d.%d.%02x",
-                        *(u_int8_t*)&oid,*(((u_int8_t*)&oid)+1),*(((u_int8_t*)&oid)+2),*(((u_int8_t*)&oid)+3));
+                        *(uint8_t*)&oid,*(((uint8_t*)&oid)+1),*(((uint8_t*)&oid)+2),*(((uint8_t*)&oid)+3));
       print_obj(&oid);               
       wsn=*((SequenceNumber*)(msg+ptr+16+ptr_off));
       fprintf(ptr_out,"     sequenceNumber : %u\n",wsn.low);                 
@@ -297,10 +297,10 @@ int decode_submessage(u_int8_t *msg, int ptr, MessageInterpret *mi) {
       fsn=*((SequenceNumber*)(msg+ptr+12));
       fprintf(ptr_out,"     p-bit          : %d\n",(msg[ptr+1] & 2) ? 1:0);
       fprintf(ptr_out,"     readerObjectId : %d.%d.%d.%02x",
-                      *(u_int8_t*)&roid,*(((u_int8_t*)&roid)+1),*(((u_int8_t*)&roid)+2),*(((u_int8_t*)&roid)+3));
+                      *(uint8_t*)&roid,*(((uint8_t*)&roid)+1),*(((uint8_t*)&roid)+2),*(((uint8_t*)&roid)+3));
       print_obj(&roid);                      
       fprintf(ptr_out,"     writeObjectId  : %d.%d.%d.%02x",
-                      *(u_int8_t*)&woid,*(((u_int8_t*)&woid)+1),*(((u_int8_t*)&woid)+2),*(((u_int8_t*)&woid)+3));
+                      *(uint8_t*)&woid,*(((uint8_t*)&woid)+1),*(((uint8_t*)&woid)+2),*(((uint8_t*)&woid)+3));
       print_obj(&woid);                      
       fprintf(ptr_out,"     issueSeqNumber : %u\n",fsn.low);                 
       k=msg+ptr+20;
@@ -309,7 +309,7 @@ int decode_submessage(u_int8_t *msg, int ptr, MessageInterpret *mi) {
       }
 //      l=(*(unsigned*)(msg+ptr+2))-(k-(msg+ptr+20)+16);
       //len of message is also in message (first ulong), internaly defined by RTI !!! 
-      l=(*(u_int32_t*)k)+4;
+      l=(*(uint32_t*)k)+4;
       while(l!=0) {
         if (l>8) j=8;
        else j=l;
@@ -329,13 +329,13 @@ int decode_submessage(u_int8_t *msg, int ptr, MessageInterpret *mi) {
       roid=*((ObjectId*)(msg+ptr+4));woid=*((ObjectId*)(msg+ptr+8));
       fprintf(ptr_out,"     final-bit      : %d\n",(msg[ptr+1] & 2) ? 1:0);
       fprintf(ptr_out,"     readerObjectId : %d.%d.%d.%02x",
-                      *(u_int8_t*)&roid,*(((u_int8_t*)&roid)+1),*(((u_int8_t*)&roid)+2),*(((u_int8_t*)&roid)+3));
+                      *(uint8_t*)&roid,*(((uint8_t*)&roid)+1),*(((uint8_t*)&roid)+2),*(((uint8_t*)&roid)+3));
       print_obj(&roid);                      
       fprintf(ptr_out,"     writeObjectId  : %d.%d.%d.%02x",
-                      *(u_int8_t*)&woid,*(((u_int8_t*)&woid)+1),*(((u_int8_t*)&woid)+2),*(((u_int8_t*)&woid)+3));
+                      *(uint8_t*)&woid,*(((uint8_t*)&woid)+1),*(((uint8_t*)&woid)+2),*(((uint8_t*)&woid)+3));
       print_obj(&woid);                      
-      fprintf(ptr_out,"     bitmap         : %u/%u:",*((u_int32_t*)(msg+ptr+16)),
-                      *((u_int32_t*)(msg+ptr+20)));
+      fprintf(ptr_out,"     bitmap         : %u/%u:",*((uint32_t*)(msg+ptr+16)),
+                      *((uint32_t*)(msg+ptr+20)));
       for(i=0;i<msg[ptr+20]/8;) {
         for(j=128;j!=0;j>>=1) fprintf(ptr_out,"%d",(msg[ptr+24+i] & j) ? 1:0);
        fprintf(ptr_out," ");
@@ -350,10 +350,10 @@ int decode_submessage(u_int8_t *msg, int ptr, MessageInterpret *mi) {
       fsn=*((SequenceNumber*)(msg+ptr+12));lsn=*((SequenceNumber*)(msg+ptr+20));
       fprintf(ptr_out,"     final-bit      : %d\n",(msg[ptr+1] & 2) ? 1:0);
       fprintf(ptr_out,"     readerObjectId : %d.%d.%d.%02x",
-                      *(u_int8_t*)&roid,*(((u_int8_t*)&roid)+1),*(((u_int8_t*)&roid)+2),*(((u_int8_t*)&roid)+3));
+                      *(uint8_t*)&roid,*(((uint8_t*)&roid)+1),*(((uint8_t*)&roid)+2),*(((uint8_t*)&roid)+3));
       print_obj(&roid);                      
       fprintf(ptr_out,"     writeObjectId  : %d.%d.%d.%02x",
-                      *(u_int8_t*)&woid,*(((u_int8_t*)&woid)+1),*(((u_int8_t*)&woid)+2),*(((u_int8_t*)&woid)+3));
+                      *(uint8_t*)&woid,*(((uint8_t*)&woid)+1),*(((uint8_t*)&woid)+2),*(((uint8_t*)&woid)+3));
       print_obj(&woid);                      
       fprintf(ptr_out,"     firstSeqNumber : %u\n",fsn.low);                 
       fprintf(ptr_out,"     lastSeqNumber  : %u\n",lsn.low);                 
@@ -364,16 +364,16 @@ int decode_submessage(u_int8_t *msg, int ptr, MessageInterpret *mi) {
       fsn=*((SequenceNumber*)(msg+ptr+12));
       lsn=*((SequenceNumber*)(msg+ptr+20));
       fprintf(ptr_out,"     readerObjectId : %d.%d.%d.%02x",
-                      *(u_int8_t*)&roid,*(((u_int8_t*)&roid)+1),*(((u_int8_t*)&roid)+2),*(((u_int8_t*)&roid)+3));
+                      *(uint8_t*)&roid,*(((uint8_t*)&roid)+1),*(((uint8_t*)&roid)+2),*(((uint8_t*)&roid)+3));
       print_obj(&roid);                      
       fprintf(ptr_out,"     writeObjectId  : %d.%d.%d.%02x",
-                      *(u_int8_t*)&woid,*(((u_int8_t*)&woid)+1),*(((u_int8_t*)&woid)+2),*(((u_int8_t*)&woid)+3));
+                      *(uint8_t*)&woid,*(((uint8_t*)&woid)+1),*(((uint8_t*)&woid)+2),*(((uint8_t*)&woid)+3));
       print_obj(&woid);                      
       fprintf(ptr_out,"     firstSeqNumber : %u\n",fsn.low);                 
       fprintf(ptr_out,"     bitmap         : %u/%u:",lsn.low,
-                      *((u_int32_t*)(msg+ptr+28)));
-      for(i=0;i<(*((u_int32_t*)(msg+ptr+28)));i++) {
-        l=((*(((u_int32_t*)(msg+ptr+32))+i/32)) & (1<<(31-i%32))) ? 1:0;
+                      *((uint32_t*)(msg+ptr+28)));
+      for(i=0;i<(*((uint32_t*)(msg+ptr+28)));i++) {
+        l=((*(((uint32_t*)(msg+ptr+32))+i/32)) & (1<<(31-i%32))) ? 1:0;
         fprintf(ptr_out,"%d",l);
       }
       fprintf(ptr_out,"\n");                 
@@ -392,20 +392,20 @@ int decode_submessage(u_int8_t *msg, int ptr, MessageInterpret *mi) {
       break;
     case INFO_REPLY:
       fprintf(ptr_out,"   INFO_REPLY\n");
-      ipa=*((u_int32_t*)(msg+ptr+4));                  /* unicastReplyIPAddress */
-      port=*((u_int32_t*)(msg+ptr+8));                 /* unicastReplyPort */
+      ipa=*((uint32_t*)(msg+ptr+4));                  /* unicastReplyIPAddress */
+      port=*((uint32_t*)(msg+ptr+8));                 /* unicastReplyPort */
       fprintf(ptr_out,"     unicastReplyIPAddress   : %d.%d.%d.%d\n",
-                      *(u_int8_t*)&ipa,*(((u_int8_t*)&ipa)+1),*(((u_int8_t*)&ipa)+2),*(((u_int8_t*)&ipa)+3));
+                      *(uint8_t*)&ipa,*(((uint8_t*)&ipa)+1),*(((uint8_t*)&ipa)+2),*(((uint8_t*)&ipa)+3));
       fprintf(ptr_out,"     unicastReplyPort        : %u\n",port);
       if (ipa!=IPADDRESS_INVALID) {
         mi->unicastReplyIPAddress=ipa;
       }
       mi->unicastReplyPort=port; 
       if ((msg[ptr+1] & 0x02) !=0) {
-        ipa=*((u_int32_t*)(msg+ptr+12));               /* multicastReplyIPAddress */
-        port=*((u_int32_t*)(msg+ptr+16));              /* multicastReplyPort */
+        ipa=*((uint32_t*)(msg+ptr+12));               /* multicastReplyIPAddress */
+        port=*((uint32_t*)(msg+ptr+16));              /* multicastReplyPort */
         fprintf(ptr_out,"     multicastReplyIPAddress : %d.%d.%d.%d\n",
-                      *(u_int8_t*)&ipa,*(((u_int8_t*)&ipa)+1),*(((u_int8_t*)&ipa)+2),*(((u_int8_t*)&ipa)+3));
+                      *(uint8_t*)&ipa,*(((uint8_t*)&ipa)+1),*(((uint8_t*)&ipa)+2),*(((uint8_t*)&ipa)+3));
         fprintf(ptr_out,"     multicastReplyPort      : %u\n",port);
         mi->multicastReplyIPAddress=ipa;
         mi->multicastReplyPort=port; 
@@ -419,10 +419,10 @@ int decode_submessage(u_int8_t *msg, int ptr, MessageInterpret *mi) {
       hid=*((HostId*)(msg+ptr+4));                   /* hostId */
       aid=*((AppId*)(msg+ptr+8));                   /* appId */
       fprintf(ptr_out,"     HostId                  : %d.%d.%d.%d\n",
-                        *(u_int8_t*)&hid,*(((u_int8_t*)&hid)+1),*(((u_int8_t*)&hid)+2),*(((u_int8_t*)&hid)+3));
+                        *(uint8_t*)&hid,*(((uint8_t*)&hid)+1),*(((uint8_t*)&hid)+2),*(((uint8_t*)&hid)+3));
       fprintf(ptr_out,"     AppId                   : %d.%d.%d.%d ",
-                        *(u_int8_t*)&aid,*(((u_int8_t*)&aid)+1),*(((u_int8_t*)&aid)+2),*(((u_int8_t*)&aid)+3));
-      print_app(*(((u_int8_t*)&aid)+3));
+                        *(uint8_t*)&aid,*(((uint8_t*)&aid)+1),*(((uint8_t*)&aid)+2),*(((uint8_t*)&aid)+3));
+      print_app(*(((uint8_t*)&aid)+3));
       break;                
     default:
       fprintf(ptr_out,"   undefined submessage code\n");
@@ -434,7 +434,7 @@ int decode_submessage(u_int8_t *msg, int ptr, MessageInterpret *mi) {
 
 /**********************************************************************************/
 int main(int argc, char * argv[]) {
-  u_int8_t rtps_msg[16384],rtps_msg_c[3]={0,0,0};
+  uint8_t rtps_msg[16384],rtps_msg_c[3]={0,0,0};
   unsigned rtps_msg_ptr=0,rtps_msg_len,rtps_submsg_cnt,submsg_len;
   int err,c,no_lchar=1;
   MessageInterpret mi;
@@ -506,11 +506,11 @@ int main(int argc, char * argv[]) {
       else {
         if ((no_lchar>5) && (no_lchar<57)) {              /* converted data from */ 
          if ((rtps_msg_c[0]!=0) && (isxdigit(c))) {      /* position 6 to 56    */
-           rtps_msg_c[1]=(u_int8_t)c;
-           rtps_msg[rtps_msg_ptr++]=(u_int8_t)strtol(rtps_msg_c,NULL,16);
+           rtps_msg_c[1]=(uint8_t)c;
+           rtps_msg[rtps_msg_ptr++]=(uint8_t)strtol(rtps_msg_c,NULL,16);
            rtps_msg_c[0]=0;
          } else {
-           if ((rtps_msg_c[0]==0) && (isxdigit(c))) rtps_msg_c[0]=(u_int8_t)c;
+           if ((rtps_msg_c[0]==0) && (isxdigit(c))) rtps_msg_c[0]=(uint8_t)c;
          }
        }
       }
index 1f8f0c086db00e845b566cead8087f4e25240ebf..aed9983a102a0f58e3abe20f173122d14ed5d5ea 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
-** $Id: richtext.cpp,v 1.4 2004/04/03 11:33:16 smolik Exp $
+** $Id: richtext.cpp,v 1.5 2004/04/20 08:37:21 smolik Exp $
 **
 ** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
 **
index 00879afb1a60d01a96bf07f725dc96675924576e..6a8aa88c69747a3b1f2fd6f021ad2c2ff3a22305 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
-** $Id: richtext.h,v 1.3 2004/04/03 11:33:16 smolik Exp $
+** $Id: richtext.h,v 1.4 2004/04/20 08:37:21 smolik Exp $
 **
 ** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
 **
index a2dc0d942e59404fac578bee712cf55fef8bd70d..84b811665d814282d715e3fa00353242d869598f 100644 (file)
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <getopt.h>
 #ifndef _WIN32
   #include <signal.h>
 #endif
 #include "orte_api.h"
+#ifdef HAVE_CONFIG_H
+  #ifdef HAVE_GETOPT_H
+    #include <getopt.h>
+  #endif
+  #ifdef HAVE_UNISTD_H
+    #include <unistd.h> //getopt.h for DarWin, Solaris, ...
+  #endif
+#else
+  #include <getopt.h>
+#endif
 
 Boolean                 quite=ORTE_FALSE;
 
 void
 recvCallBack(const ORTERecvInfo *info,void *vinstance, void *recvCallBackParam) {
-  u_int32_t *instance=(u_int32_t*)vinstance;
+  uint32_t *instance=(uint32_t*)vinstance;
   
   switch (info->status) {
     case NEW_DATA:
@@ -46,7 +55,7 @@ recvCallBack(const ORTERecvInfo *info,void *vinstance, void *recvCallBackParam)
 
 void
 sendCallBack(const ORTESendInfo *info,void *vinstance, void *sendCallBackParam) {
-  u_int32_t *instance=(u_int32_t*)vinstance;
+  uint32_t *instance=(uint32_t*)vinstance;
   
   switch (info->status) {
     case NEED_DATA:
@@ -60,7 +69,7 @@ sendCallBack(const ORTESendInfo *info,void *vinstance, void *sendCallBackParam)
 }
 
 static void usage(void) {
-  printf("usage: ORTEPing <parameters> \n");
+  printf("usage: orteping <parameters> \n");
   printf("  -d, --domain <domain>         working manager domain\n");
   printf("  -p, --publisher               create publisher Ping,PingData\n");
   printf("  -S, --strength                strength of publisher <1>\n");
@@ -71,8 +80,8 @@ static void usage(void) {
   printf("  -E, --expiration <s>          expiration time of application\n");
   printf("  -m, --minimumSeparation <s>   minimumSeparation between two issues\n");
   printf("  -v, --verbosity <level>       set verbosity level SECTION, up to LEVEL:...\n");
-  printf("      examples: ORTEManager -v 51,7:32,5 sections 51 and 32\n");
-  printf("                ORTEManager -v ALL,7     all sections up to level 7\n");
+  printf("      examples: ORTEManager -v 51.7:32.5 sections 51 and 32\n");
+  printf("                ORTEManager -v ALL.7     all sections up to level 7\n");
   printf("  -q  --quiet                   \n");
   printf("  -l, --logfile <filename>      set log file name\n");
   printf("  -V, --version                 show version\n");
@@ -80,6 +89,7 @@ static void usage(void) {
 }
 
 int main(int argc,char *argv[]) {
+#if defined HAVE_GETOPT_LONG || defined HAVE_GETOPT_LONG_ORTE
   static struct option long_opts[] = {
     { "domain",1,0, 'd' },
     { "publisher",0,0, 'p' },
@@ -97,6 +107,7 @@ int main(int argc,char *argv[]) {
     { "help",  0, 0, 'h' },
     { 0, 0, 0, 0}
   };
+#endif
   ORTEDomain              *d;
   ORTEDomainProp          dp; 
   ORTEPublication         *p=NULL;
@@ -112,8 +123,12 @@ int main(int argc,char *argv[]) {
   ORTEDomainPropDefaultGet(&dp);
   NTPTIME_BUILD(minimumSeparation,0); 
   NTPTIME_BUILD(delay,1); //1s
+
+#if defined HAVE_GETOPT_LONG || defined HAVE_GETOPT_LONG_ORTE
   while ((opt = getopt_long(argc, argv, "m:S:d:v:R:E:P:l:D:Vhpsq",&long_opts[0], NULL)) != EOF) {
+#else
+  while ((opt = getopt(argc, argv, "m:S:d:v:R:E:P:l:D:Vhpsq")) != EOF) {
+#endif
     switch (opt) {
       case 'S':
         strength=strtol(optarg,NULL,0);
index 930e6492eb51e4cd09ea061cc13be80f9bba5f0b..dcf1f11ad51dc9939d067d2651a597a3a9da7c04 100644 (file)
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <getopt.h>
 #ifndef _WIN32
   #include <signal.h>
 #endif
 #include "orte_api.h"
-
+#ifdef HAVE_CONFIG_H
+  #ifdef HAVE_GETOPT_H
+    #include <getopt.h>
+  #endif
+  #ifdef HAVE_UNISTD_H
+    #include <unistd.h> //getopt.h for DarWin, Solaris, ...
+  #endif
+#else
+  #include <getopt.h>
+#endif
 #include "string.h"
 
 ORTEDomain              *d;
@@ -70,11 +78,11 @@ subscriptionCallBack(const char *topic, const char *type, void *param) {
 }
 
 static void usage(void) {
-  printf("usage: ORTESpy <parameters> \n");
+  printf("usage: ortespy <parameters> \n");
   printf("  -d, --domain <domain>         working manager domain\n");
   printf("  -v, --verbosity <level>       set verbosity level SECTION, up to LEVEL:...\n");
-  printf("      examples: ORTEManager -v 51,7:32,5 sections 51 and 32\n");
-  printf("                ORTEManager -v ALL,7     all sections up to level 7\n");
+  printf("      examples: ORTEManager -v 51.7:32.5 sections 51 and 32\n");
+  printf("                ORTEManager -v ALL.7     all sections up to level 7\n");
   printf("  -R, --refresh <s>             refresh period in second(s)\n");
   printf("  -P, --purge <s>               purge time in second(s)\n");
   printf("  -e, --expiration <s>          expiration time of manager in second(s)\n");
@@ -84,6 +92,7 @@ static void usage(void) {
 }
 
 int main(int argc,char *argv[]) {
+#if defined HAVE_GETOPT_LONG || defined HAVE_GETOPT_LONG_ORTE
   static struct option long_opts[] = {
     { "domain",1,0, 'd' },
     { "verbosity",1,0, 'v' },
@@ -95,6 +104,7 @@ int main(int argc,char *argv[]) {
     { "help",  0, 0, 'h' },
     { 0, 0, 0, 0}
   };
+#endif
   ORTEDomainProp          dp; 
   int                     opt,domain=ORTE_DEFAULT_DOMAIN;
   
@@ -102,8 +112,12 @@ int main(int argc,char *argv[]) {
   ORTEDomainPropDefaultGet(&dp);
   NTPTIME_BUILD(deadline,3); 
   NTPTIME_BUILD(minimumSeparation,0); 
+
+#if defined HAVE_GETOPT_LONG || defined HAVE_GETOPT_LONG_ORTE
   while ((opt = getopt_long(argc, argv, "d:v:R:E:P:l:Vh",&long_opts[0], NULL)) != EOF) {
+#else
+  while ((opt = getopt(argc, argv, "d:v:R:E:P:l:Vh")) != EOF) {
+#endif
     switch (opt) {
       case 'd':
         domain=strtol(optarg,NULL,0);
index 76a717a565dffbfc3bfbe44ed8b26f683e7bce5c..d24d47584f9ed3b5c08be676881b469913e5f735 100644 (file)
 /* Define to 1 if you have the <getopt.h> header file. */
 #undef HAVE_GETOPT_H
 
+/* Define to 1 if you have the `getopt_long' function. */
+#undef HAVE_GETOPT_LONG
+
+/* Define for ORTE getopt_long self implemetation */
+#undef HAVE_GETPOT_LONG_ORTE
+
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+#undef HAVE_LIBNSL
+
 /* Define to 1 if you have the `pthread' library (-lpthread). */
 #undef HAVE_LIBPTHREAD
 
+/* Define to 1 if you have the `socket' library (-lsocket). */
+#undef HAVE_LIBSOCKET
+
 /* Define to 1 if you have the `ws2_32' library (-lws2_32). */
 #undef HAVE_LIBWS2_32
 
 /* Define to 1 if you have the <rtnet.h> header file. */
 #undef HAVE_RTNET_H
 
-/* Define to 1 if you have the <semaphore.h> header file. */
-#undef HAVE_SEMAPHORE_H
-
 /* Define to 1 if you have the <signal.h> header file. */
 #undef HAVE_SIGNAL_H
 
 /* Define to 1 if you have the <stdarg.h> header file. */
 #undef HAVE_STDARG_H
 
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
 /* Define to 1 if you have the <stdio.h> header file. */
 #undef HAVE_STDIO_H
 
 /* Define to 1 if you have the <sys/socket.h> header file. */
 #undef HAVE_SYS_SOCKET_H
 
+/* Define to 1 if you have the <sys/sockio.h> header file. */
+#undef HAVE_SYS_SOCKIO_H
+
 /* Define to 1 if you have the <sys/time.h> header file. */
 #undef HAVE_SYS_TIME_H
 
index 09bf368310c2ac0b51a03422f1c1499d515d4907..5ff8bb9e2e647a6f1b755238d0c952b850a56c0e 100644 (file)
@@ -74,7 +74,8 @@ extern "C" {
 
 //////////////////////////////////////////////////////////////////////////////
 // conv
-#if defined CONFIG_ORTE_WIN || defined _MSC_VER
+//#if defined CONFIG_ORTE_WIN || defined _MSC_VER || !define HAVE_BYTESWAP_H
+#if !defined HAVE_BYTESWAP_H && !defined HAVE_ASM_BYTEORDER_H
 /* Swap bytes in 16 bit value.  */
 #define bswap_16(x) \
      ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)) 
index ce2b325a406af08911cf8191c33c497845fcdc6f..70c89e11488b7cda4a4afd6790b78f45d30f3bb1 100644 (file)
@@ -62,7 +62,7 @@ extern "C" {
  * 
  * res = sn + 1
  */
- #define SeqNumberInc(res,sn) {                   \
+#define SeqNumberInc(res,sn) {                   \
       (res) = (sn);                              \
           if (++(res).low==0) (res).high++;      \
         }
@@ -77,7 +77,7 @@ extern "C" {
  *
  * res = sn1 + sn2
  */
- #define SeqNumberAdd(res,sn1,sn2) {              \
+#define SeqNumberAdd(res,sn1,sn2) {              \
     (res).low = (sn1).low+(sn2).low;             \
     (res).high = (sn1).high+(sn2).high;          \
     if (((res).low < (sn1).low) ||               \
@@ -177,7 +177,7 @@ extern "C" {
  * @msec: miliseconds portion of given time
  */
 #define NtpTimeAssembFromMs(time, s, msec) {         \
-    register u_int32_t ms = msec;                \
+    register uint32_t ms = msec;                     \
     (time).seconds  = s;                             \
     (time).fraction = (ms<<22) + ((ms*393)<<8);      \
 }
@@ -202,7 +202,7 @@ extern "C" {
  * @usec: microseconds portion of given time
  */
 #define NtpTimeAssembFromUs(time, s, usec) {         \
-    register u_int32_t us = usec;                     \
+    register uint32_t us = usec;                     \
     (time).seconds  = s;                             \
     (time).fraction = (us<<12)+ ((us*99)<<1)+ ((us*15 + ((us*61)>>7))>>4); \
 }
@@ -214,7 +214,7 @@ extern "C" {
  * @time: time given in NtpTime structure
  */
 #define NtpTimeDisAssembToUs(s, usec, time) {        \
-    register u_int32_t NtpTemp = (time).fraction;     \
+    register uint32_t NtpTemp = (time).fraction;     \
     s    = (time).seconds;                           \
     usec = ((time).fraction - (NtpTemp>>5)-(NtpTemp>>7)-(NtpTemp>>8)- \
             (NtpTemp>>9)-(NtpTemp>>10) - (NtpTemp>>12) - \
index 2179244d76ae9caf4789dc7ade6e65f6d1ee22ca..9d04cd24286868082b5b247869fa2ae433e472f8 100644 (file)
 extern "C" {
 #endif
 
-#define u_int8_t  unsigned char
+#define uint8_t   unsigned char
 #define int8_t    char
-#define u_int16_t unsigned short
+#define uint16_t  unsigned short
 #define int16_t   short
-#define u_int32_t unsigned int
+#define uint32_t  unsigned int
 #define int32_t   int
 
 #ifdef __cplusplus
index 6986f34c2f3cf07fe72f35784971ecbc13d34c11..8112e9c71b9ed19fe11b5eeec41b05c875288895 100644 (file)
@@ -45,9 +45,6 @@ extern "C" {
 #ifdef HAVE_NETDB_H
   #include <netdb.h>
 #endif
-#ifdef HAVE_NETINET_IN_H
-  #include <netinet/in.h>
-#endif
 #ifdef HAVE_STDLIB_H
   #include <stdlib.h>
 #endif
@@ -57,9 +54,6 @@ extern "C" {
 #ifdef HAVE_SYS_IOCTL_H
   #include <sys/ioctl.h>
 #endif
-#ifdef HAVE_SYS_SOCKET_H
-  #include <sys/socket.h>
-#endif
 #ifdef HAVE_SYS_TIME_H
   #include <sys/time.h>
 #endif
@@ -69,30 +63,39 @@ extern "C" {
 #ifdef HAVE_PTHREAD_H
   #include <pthread.h>
 #endif
-#ifdef HAVE_STDARG_H
-  #include <stdarg.h>
-#endif
 #ifdef HAVE_SYS_TYPES_H
   #include <sys/types.h>
 #endif
-#ifdef HAVE_NET_IF_H
-  #include <net/if.h>
+#ifdef HAVE_SYS_SOCKIO_H
+  #include <sys/sockio.h>
+#endif
+#ifdef HAVE_STDARG_H
+  #include <stdarg.h>
 #endif
 #ifdef HAVE_BYTESWAP_H
   #include <byteswap.h>
 #endif
-#ifdef HAVE_CTYPE_H
-  #include <ctype.h>
-#endif
-#ifdef HAVE_SEMAPHORE_H
-  #include <semaphore.h>
-#endif
 #ifdef HAVE_GETOPT_H
   #include <getopt.h>
 #endif
+#ifdef HAVE_CTYPE_H
+  #include <ctype.h>
+#endif
 #ifdef HAVE_SIGNAL_H
   #include <signal.h>
 #endif
+#ifdef HAVE_STDINT_H
+  #include <stdint.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+  #include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+  #include <netinet/in.h>
+#endif
+#ifdef HAVE_NET_IF_H
+  #include <net/if.h>
+#endif
 //win32 headers
 #if defined HAVE_WINSOCK2_H && !HAVE_SYS_SOCKET_H
   #include <winsock2.h>
@@ -162,7 +165,6 @@ extern "C" {
 #elif CONFIG_ORTE_MINGW
   #define SOCK_WIN
   #include <win32/pthread.h>
-  #include <win32/semaphore.h>
   #include <win32/timeval.h>
   #ifndef __GETOPT_H__  //mingw
     #include <win32/getopt.h>
@@ -189,12 +191,11 @@ extern "C" {
   #include <ws2tcpip.h>
   #include <windows.h>
   #include <win32/pthread.h>
-  #include <win32/semaphore.h>
   #include <win32/timeval.h>
   #include <win32/getopt.h>
   #include <ew_types.h>
   #define ioctl ioctlsocket
-  #define ORTE_PACKAGE_STRING "orte 0.2.1"
+  #define ORTE_PACKAGE_STRING "orte 0.2.2"
 #endif
 
 #ifdef __cplusplus
index e10b8af92ca720fffa1c3eb3aa3350e426baaf92..6c14d556200523c640a9b6ddd26337495eaf5173 100644 (file)
@@ -33,7 +33,9 @@ extern "C" {
   #include "orte_config_omk_rtl.h"
 #endif
 
-#ifdef HAVE_SYS_TYPES_H
+#ifdef HAVE_STDINT_H
+  #include <stdint.h>
+#elif defined HAVE_SYS_TYPES_H
   #include <sys/types.h>
 #endif
 #ifdef HAVE_LINUX_TYPES_H
index 3f8bc1430a9a0e2c599f173d5c1d89278a75406a..95a3313a2ecb764864084904591cc9960fe7bf2c 100644 (file)
@@ -97,9 +97,6 @@
 /* Define to 1 if you have the <rtnet.h> header file. */
 /* #undef HAVE_RTNET_H */
 
-/* Define to 1 if you have the <semaphore.h> header file. */
-#define HAVE_SEMAPHORE_H 1
-
 /* Define to 1 if you have the <signal.h> header file. */
 /* #undef HAVE_SIGNAL_H */
 
 #define ORTE_PACKAGE_NAME "orte"
 
 /* Define to the full name and version of this package. */
-#define ORTE_PACKAGE_STRING "orte 0.2.1"
+#define ORTE_PACKAGE_STRING "orte 0.2.2"
 
 /* Define to the one symbol short name of this package. */
 #define ORTE_PACKAGE_TARNAME "orte"
 
 /* Define to the version of this package. */
-#define ORTE_PACKAGE_VERSION "0.2.1"
+#define ORTE_PACKAGE_VERSION "0.2.2"
 
 /* Define to 1 if you have the ANSI C header files. */
 /* #undef STDC_HEADERS */
 
 /* Version number of package */
-#define ORTE_VERSION "0.2.1"
+#define ORTE_VERSION "0.2.2"
 
 /* Define to 1 if your processor stores words with the most significant byte
    first (like Motorola and SPARC, unlike Intel and VAX). */
index 2660cfe7dd4d66aae81da311a9d5e2df99882e75..7f736adc73c9eb1c915fd09654a7ab7c16f38a33 100644 (file)
@@ -1,9 +1,15 @@
 /* orte/include/config.h.  Generated by configure.  */
 /* orte/include/config.h.in.  Generated from configure.in by autoheader.  */
 
+/* Define if is target CYGWIN */
+/* #undef CONFIG_ORTE_CYGWIN */
+
 /* Define if linux kernel is found */
 /* #undef CONFIG_ORTE_KERNEL */
 
+/* Define if is target MINGW */
+/* #undef CONFIG_ORTE_MINGW */
+
 /* Define to enable ORTE's RT support */
 /* #undef CONFIG_ORTE_RT */
 
 /* Define to 1 if you have the <getopt.h> header file. */
 #define HAVE_GETOPT_H 1
 
+/* Define to 1 if you have the `getopt_long' function. */
+#define HAVE_GETOPT_LONG 1
+
+/* Define for ORTE getopt_long self implemetation */
+/* #undef HAVE_GETPOT_LONG_ORTE */
+
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+#define HAVE_LIBNSL 1
+
 /* Define to 1 if you have the `pthread' library (-lpthread). */
 #define HAVE_LIBPTHREAD 1
 
+/* Define to 1 if you have the `socket' library (-lsocket). */
+/* #undef HAVE_LIBSOCKET */
+
 /* Define to 1 if you have the `ws2_32' library (-lws2_32). */
 /* #undef HAVE_LIBWS2_32 */
 
 /* Define to 1 if you have the <rtnet.h> header file. */
 /* #undef HAVE_RTNET_H */
 
-/* Define to 1 if you have the <semaphore.h> header file. */
-#define HAVE_SEMAPHORE_H 1
-
 /* Define to 1 if you have the <signal.h> header file. */
 #define HAVE_SIGNAL_H 1
 
 /* Define to 1 if you have the <stdarg.h> header file. */
 #define HAVE_STDARG_H 1
 
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
 /* Define to 1 if you have the <stdio.h> header file. */
 #define HAVE_STDIO_H 1
 
 /* Define to 1 if you have the <sys/socket.h> header file. */
 #define HAVE_SYS_SOCKET_H 1
 
+/* Define to 1 if you have the <sys/sockio.h> header file. */
+/* #undef HAVE_SYS_SOCKIO_H */
+
 /* Define to 1 if you have the <sys/time.h> header file. */
 #define HAVE_SYS_TIME_H 1
 
 #define ORTE_PACKAGE_NAME "orte"
 
 /* Define to the full name and version of this package. */
-#define ORTE_PACKAGE_STRING "orte 0.2.1"
+#define ORTE_PACKAGE_STRING "orte 0.2.2"
 
 /* Define to the one symbol short name of this package. */
 #define ORTE_PACKAGE_TARNAME "orte"
 
 /* Define to the version of this package. */
-#define ORTE_PACKAGE_VERSION "0.2.1"
+#define ORTE_PACKAGE_VERSION "0.2.2"
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
 
 /* Version number of package */
-#define ORTE_VERSION "0.2.1"
+#define ORTE_VERSION "0.2.2"
 
 /* Define to 1 if your processor stores words with the most significant byte
    first (like Motorola and SPARC, unlike Intel and VAX). */
index e2bd1312169abdd4adf3fb0d0b7d86e2c0c9bd65..708a26ac7c854b1c449a2db8b334bae2ff089e1e 100644 (file)
@@ -40,7 +40,7 @@ sock_setsockopt(sock_t *sock,int optname,const char *optval, int optlen);
 extern int
 sock_getsockopt(sock_t *sock,int optname,char *optval, int *optlen);
 extern int
-sock_bind(sock_t *sock,u_int16_t port);
+sock_bind(sock_t *sock,uint16_t port);
 extern int
 sock_recvfrom(sock_t *sock, void *buf, int max_len,struct sockaddr_in *des,int des_len);
 extern int
@@ -53,9 +53,9 @@ sock_get_local_interfaces(sock_t *sock,ORTEIFProp *IFProp,char *IFCount);
 ///////////////////////////////////////////////////////////////////////////////
 // conv.c
 extern void 
-conv_u16(u_int16_t *x,char ef);
+conv_u16(uint16_t *x,char ef);
 extern void 
-conv_u32(u_int32_t *x,char ef);
+conv_u32(uint32_t *x,char ef);
 extern void 
 conv_sn(SequenceNumber *sn,char ef);
 extern void 
@@ -199,10 +199,10 @@ extern int
 parameterDelete(CSChange *csChange);
 extern int
 parameterCodeStreamFromCSChange(CSChange *csChange,
-    u_int8_t *rtps_msg,u_int32_t max_msg_len);
+    uint8_t *rtps_msg,uint32_t max_msg_len);
 extern int
-parameterDecodeStreamToCSChange(CSChange *csChange,u_int8_t *rtps_msg,
-    u_int16_t submsg_len,u_int8_t needByteSwap);
+parameterDecodeStreamToCSChange(CSChange *csChange,uint8_t *rtps_msg,
+    uint16_t submsg_len,uint8_t needByteSwap);
 extern int
 parameterUpdateCSChange(
      CSChange *csChange,AppParams *ap,Boolean Manager);
@@ -233,7 +233,7 @@ GAVL_CUST_NODE_INT_DEC(ORTEType, TypeEntry, TypeNode, const char *,
 ///////////////////////////////////////////////////////////////////////////////
 // ORTEThreadUtils.c
 extern void
-ORTEDomainWakeUpReceivingThread(ORTEDomain *d,sock_t *sock,u_int16_t port);
+ORTEDomainWakeUpReceivingThread(ORTEDomain *d,sock_t *sock,uint16_t port);
 extern void
 ORTEDomainWakeUpSendingThread(ObjectEntry *objectEntry);
 
@@ -255,75 +255,75 @@ ORTESendData(ORTEDomain *d,ObjectEntryAID *objectEntryAID,Boolean meta);
 ///////////////////////////////////////////////////////////////////////////////
 // RTPSHeader.c
 extern int16_t 
-RTPSHeaderCreate(u_int8_t *msg,HostId hid,AppId aid);
+RTPSHeaderCreate(uint8_t *msg,HostId hid,AppId aid);
 extern int16_t 
-RTPSHeaderCheck(u_int8_t *msg,int32_t len,MessageInterpret *mi);
+RTPSHeaderCheck(uint8_t *msg,int32_t len,MessageInterpret *mi);
 
 ///////////////////////////////////////////////////////////////////////////////
 // RTPSPad.c
 extern void 
-RTPSPad(u_int8_t *rtps_msg,MessageInterpret *mi);
+RTPSPad(uint8_t *rtps_msg,MessageInterpret *mi);
 
 ///////////////////////////////////////////////////////////////////////////////
 // RTPSInfoDST.c
 extern void 
-RTPSInfoDST(u_int8_t *rtps_msg,MessageInterpret *mi);
+RTPSInfoDST(uint8_t *rtps_msg,MessageInterpret *mi);
 
 ///////////////////////////////////////////////////////////////////////////////
 // RTPSInfoREPLY.c
 extern void 
-RTPSInfoREPLY(u_int8_t *rtps_msg,MessageInterpret *mi);
+RTPSInfoREPLY(uint8_t *rtps_msg,MessageInterpret *mi);
 
 ///////////////////////////////////////////////////////////////////////////////
 // RTPSInfoREPLY.c
 extern int32_t 
-RTPSInfoREPLYCreate(u_int8_t *rtps_msg,u_int32_t max_msg_len,
+RTPSInfoREPLYCreate(uint8_t *rtps_msg,uint32_t max_msg_len,
     IPAddress ipaddress,Port port);
 extern void 
-RTPSInfoSRC(u_int8_t *rtps_msg,MessageInterpret *mi);
+RTPSInfoSRC(uint8_t *rtps_msg,MessageInterpret *mi);
 
 ///////////////////////////////////////////////////////////////////////////////
 // RTPSInfoTS.c
 extern int32_t 
-RTPSInfoTSCreate(u_int8_t *rtps_msg,u_int32_t max_msg_len,NtpTime time);
+RTPSInfoTSCreate(uint8_t *rtps_msg,uint32_t max_msg_len,NtpTime time);
 extern void 
-RTPSInfoTS(u_int8_t *rtps_msg,MessageInterpret *mi);
+RTPSInfoTS(uint8_t *rtps_msg,MessageInterpret *mi);
 
 ///////////////////////////////////////////////////////////////////////////////
 // RTPSVar.c
 extern void 
-RTPSVar(ORTEDomain *d,u_int8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIPAddress);
+RTPSVar(ORTEDomain *d,uint8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIPAddress);
 
 ///////////////////////////////////////////////////////////////////////////////
 // RTPSAck.c
 extern int32_t 
-RTPSAckCreate(u_int8_t *rtps_msg,u_int32_t max_msg_len,
+RTPSAckCreate(uint8_t *rtps_msg,uint32_t max_msg_len,
     SequenceNumber *seqNumber,
     ObjectId roid,ObjectId woid,Boolean f_bit);
 extern void 
-RTPSAck(ORTEDomain *d,u_int8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIPAddress);
+RTPSAck(ORTEDomain *d,uint8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIPAddress);
 
 ///////////////////////////////////////////////////////////////////////////////
 // RTPSHeardBeat.c
 extern int 
-RTPSHeardBeatCreate(u_int8_t *rtps_msg,u_int32_t max_msg_len,
+RTPSHeardBeatCreate(uint8_t *rtps_msg,uint32_t max_msg_len,
     SequenceNumber *firstSeqNumber,SequenceNumber *lastSeqNumber,
     ObjectId woid,ObjectId roid,Boolean f_bit);
 extern void 
-RTPSHeardBeat(ORTEDomain *d,u_int8_t *rtps_msg,MessageInterpret *mi);
+RTPSHeardBeat(ORTEDomain *d,uint8_t *rtps_msg,MessageInterpret *mi);
 
 ///////////////////////////////////////////////////////////////////////////////
 // RTPSGap.c
 extern void 
-RTPSGap(ORTEDomain *d,u_int8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIPAddress);
+RTPSGap(ORTEDomain *d,uint8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIPAddress);
 
 ///////////////////////////////////////////////////////////////////////////////
 // RTPSIssue.c
 extern int32_t
-RTPSIssueCreateHeader(u_int8_t *rtps_msg,u_int32_t max_msg_len,u_int32_t length,
+RTPSIssueCreateHeader(uint8_t *rtps_msg,uint32_t max_msg_len,uint32_t length,
     ObjectId roid,ObjectId woid,SequenceNumber sn);
 extern void 
-RTPSIssue(ORTEDomain *d,u_int8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIPAddress);
+RTPSIssue(ORTEDomain *d,uint8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIPAddress);
 
 ///////////////////////////////////////////////////////////////////////////////
 // RTPSUtils.c
index 97ea897a448df0040d6f7da389b77dcbc68c872f..eee56ccfc57d5cf8a7e5012fd64cee95971b8bf3 100644 (file)
@@ -47,15 +47,4 @@ static inline int atoi(const char* nptr)
     return simple_strtol(nptr, (char **)NULL, 10);
 }
 
-/*static char inet_ntoa_buf[16];
-static inline char *inet_ntoa(struct in_addr in) {
-  unsigned char *octet;
-
-  octet = (unsigned char *)&(in.s_addr);
-  sprintf(inet_ntoa_buf, "%u.%u.%u.%u", octet[0], octet[1], octet[2], octet[3]);
-
-  return inet_ntoa_buf;
-}
-*/
-
 #endif /* _COMPAT_H */
index 85c1712dec84f6a8061028c031f123f04ce7f5c3..b194b6b44b9decc80510cd7e556fadd722ecf3b9 100644 (file)
@@ -37,7 +37,7 @@ typedef struct ObjectEntry ObjectEntry;
  */
 typedef struct sock_t {
   int         fd;
-  u_int16_t   port;
+  uint16_t    port;
 } sock_t;
 
 /**
@@ -192,7 +192,9 @@ struct ObjectEntry{
   pthread_rwlock_t       objRootLock;
   ul_htim_queue_t        htimRoot;     //root of tree htimers
   pthread_rwlock_t       htimRootLock;
-  sem_t                  htimSendSem;  //for wake up
+  pthread_cond_t        htimSendCond; //for wake up
+  pthread_mutex_t       htimSendMutex;
+  int                   htimSendCondValue;
   Boolean                htimNeedWakeUp;
 };
 
@@ -305,7 +307,9 @@ struct CSTWriter {
   //only for CSTPublications
   unsigned int           strictReliableCounter;
   unsigned int           bestEffortsCounter;
-  sem_t                  semCSChangeDestroyed;
+  pthread_cond_t        condCSChangeDestroyed; //for wake up
+  pthread_mutex_t       mutexCSChangeDestroyed;
+  int                   condValueCSChangeDestroyed;
 };
 
 /**
@@ -391,7 +395,7 @@ struct CSTReader {
 struct CSTPublications {
   gavl_cust_root_field_t cstWriter;
   pthread_rwlock_t       lock;        
-  u_int32_t              counter;  
+  uint32_t               counter;  
 };
   
 /**
@@ -400,7 +404,7 @@ struct CSTPublications {
 struct CSTSubscriptions {
   gavl_cust_root_field_t cstReader;
   pthread_rwlock_t       lock;        
-  u_int32_t              counter;  
+  uint32_t               counter;  
 };
 
 /**
@@ -417,7 +421,7 @@ typedef struct PSEntry {
  * struct ORTEDomain - 
  */
 struct ORTEDomain {
-  u_int32_t              domain;      //domain value
+  uint32_t               domain;      //domain value
   GUID_RTPS              guid;        //guid of self application
   AppParams              *appParams;  //self parameters (share from objectEntry)
   ObjectEntryOID         *objectEntryOID;//entry point for self OID
index c4f4adcd9af5ed92fd39101c45381881ae99b71d..fab66ee214ea08be0c79a9520a23da2f1fade15e 100644 (file)
@@ -115,8 +115,8 @@ typedef struct ORTEMulticastProp {
  * Struct @ORTECDRStream is used by serialization and deserialization functions.
  */
 typedef struct ORTECDRStream {
-  u_int8_t       *buffer;
-  u_int8_t       *bufferPtr;
+  uint8_t        *buffer;
+  uint8_t        *bufferPtr;
   Boolean        needByteSwap;
   int            length;
 } ORTECDRStream;
@@ -204,10 +204,10 @@ typedef struct ORTEPublProp {
   TypeChecksum           typeChecksum;
   Boolean                expectsAck;
   NtpTime                persistence;
-  u_int32_t              reliabilityOffered;
-  u_int32_t              sendQueueSize;
+  uint32_t               reliabilityOffered;
+  uint32_t               sendQueueSize;
   int32_t                strength;
-  u_int32_t              criticalQueueLevel;
+  uint32_t               criticalQueueLevel;
   NtpTime                HBNornalRate;
   NtpTime                HBCQLRate;
   unsigned int           HBMaxRetries;
@@ -230,11 +230,11 @@ typedef struct ORTESubsProp {
   TypeName               typeName;
   TypeChecksum           typeChecksum;
   NtpTime                minimumSeparation;
-  u_int32_t              recvQueueSize;
-  u_int32_t              reliabilityRequested;
+  uint32_t               recvQueueSize;
+  uint32_t               reliabilityRequested;
   //additional parameters
   NtpTime                deadline;
-  u_int32_t              mode;
+  uint32_t               mode;
 }  ORTESubsProp;
 
 /**
index f50836d66698365eab82803adf885cbbffd7c1d4..69f810e81ba0c468e8a3a95f4c87a6cff5b89de9 100644 (file)
@@ -49,7 +49,7 @@ typedef int32_t                  TypeChecksum;
    
   for example: IP address working nodes
 */
-typedef u_int32_t                HostId;
+typedef uint32_t                 HostId;
 #define HID_UNKNOWN              0x00
 
 /**
@@ -58,7 +58,7 @@ typedef u_int32_t                HostId;
   composed from: 3 bytes - instance Id
                  1 byte  - appKind (1 - ManagedApplication, 2 - Manager) 
 */
-typedef u_int32_t                AppId;
+typedef uint32_t                 AppId;
 #define AID_UNKNOWN              0x00
 #define MANAGEDAPPLICATION       0x01
 #define MANAGER                  0x02
@@ -69,7 +69,7 @@ typedef u_int32_t                AppId;
   composed from: 3 bytes - instance Id
                  1 byte  - objKind  
 */
-typedef u_int32_t                ObjectId;
+typedef uint32_t                 ObjectId;
 
 #define OID_UNKNOWN              0x00000000
 #define OID_APP                  0x000001C1
@@ -129,18 +129,18 @@ typedef struct {
 
 typedef struct {
        int32_t               seconds;    /* time in seconds */
-       u_int32_t             fraction;   /* time in seconds / 2^32 */
+       uint32_t              fraction;   /* time in seconds / 2^32 */
      } NtpTime;
 
 #define NTPTIME_ZERO(t)          {t.seconds=0;t.fraction=0;}
 #define NTPTIME_BUILD(t,s)       {t.seconds=s;t.fraction=0;}
 #define NTPTIME_INFINITE(t)      {t.seconds=0xffffffff;t.fraction=0;}
 
-typedef u_int32_t                IPAddress;
+typedef uint32_t                 IPAddress;
 
 #define IPADDRESS_INVALID        0
 
-typedef u_int32_t                Port;
+typedef uint32_t                 Port;
 
 #define PORT_INVALID             0
 
@@ -206,8 +206,8 @@ typedef struct {
 #define PID_VALUE_RELIABILITY_BEST_EFFORTS  0x01
 #define PID_VALUE_RELIABILITY_STRICT        0x02
 
-typedef u_int16_t ParameterId;
-typedef u_int16_t ParameterLength;
+typedef uint16_t ParameterId;
+typedef uint16_t ParameterLength;
 
 /* State Machines */
 typedef enum {
index 0297d99e31014bb45cb50cb44933681976634ed8..40d885854199155f38a35fbf242d75b8559f58ec 100644 (file)
@@ -13,6 +13,8 @@ extern "C" {
 #define LIST_POISON1  ((void *) 0)
 #define LIST_POISON2  ((void *) 0)
 
+#undef LIST_HEAD
+
 /*
  * Simple doubly linked list implementation.
  *
index dcc116c81a17f80a340fa5653ec5f679b1abf060..4b08ec50e212a4a8e7376fd3ffb9d56d40f18b45 100644 (file)
@@ -24,7 +24,7 @@
 /*****************************************************************************/
 void ORTEAppRecvMetatrafficThread(ORTEDomain *d) {
   struct sockaddr_in    des;
-  u_int16_t             submsg_len;
+  uint16_t              submsg_len;
   MessageInterpret      mi; 
 
   debug(22,10) ("ORTEAppRecvMetatrafficThread: start\n");
@@ -52,7 +52,7 @@ void ORTEAppRecvMetatrafficThread(ORTEDomain *d) {
         if ((d->mbRecvMetatraffic.cdrStream.bufferPtr-
              d->mbRecvMetatraffic.cdrStream.buffer+3)<=d->mbRecvMetatraffic.cdrStream.length) {
           char e_bit=d->mbRecvMetatraffic.cdrStream.bufferPtr[1] & 1;
-          submsg_len=*(u_int16_t*)&d->mbRecvMetatraffic.cdrStream.bufferPtr[2];
+          submsg_len=*(uint16_t*)&d->mbRecvMetatraffic.cdrStream.bufferPtr[2];
          conv_u16(&submsg_len,e_bit);
          // check if length of submessage OK
          if ((submsg_len+d->mbRecvMetatraffic.cdrStream.bufferPtr-
index fde682b08ca7bd66321eda5b50885aa7df4167d3..167912e5aff114e5f74bc691b19bcccb8406b128 100644 (file)
@@ -24,7 +24,7 @@
 /*****************************************************************************/
 void ORTEAppRecvUserdataThread(ORTEDomain *d) {
   struct sockaddr_in    des;
-  u_int16_t             submsg_len;
+  uint16_t              submsg_len;
   MessageInterpret      mi; 
 
   debug(23,10) ("ORTEAppRecvUserdataThread: start\n");
@@ -52,7 +52,7 @@ void ORTEAppRecvUserdataThread(ORTEDomain *d) {
         if ((d->mbRecvUserdata.cdrStream.bufferPtr-
              d->mbRecvUserdata.cdrStream.buffer+3)<=d->mbRecvUserdata.cdrStream.length) {
           char e_bit=d->mbRecvUserdata.cdrStream.bufferPtr[1] & 1;
-          submsg_len=*(u_int16_t*)&d->mbRecvUserdata.cdrStream.bufferPtr[2];
+          submsg_len=*(uint16_t*)&d->mbRecvUserdata.cdrStream.bufferPtr[2];
           conv_u16(&submsg_len,e_bit);
           // check if length of submessage OK 
           if ((submsg_len+d->mbRecvUserdata.cdrStream.bufferPtr-
index 8f5ae1a9ecc0056e5afd9d048c6cbfcce387ed23..5ce3b388b4a7c00fe21af1a5b64735c2ecafe2c9 100644 (file)
@@ -36,7 +36,7 @@ void ORTESendData(ORTEDomain *d,ObjectEntryAID *objectEntryAID,Boolean meta) {
       des.sin_family=AF_INET; 
       des.sin_addr.s_addr = htonl(appParams->unicastIPAddressList[i]);
       if (meta) {
-        des.sin_port = htons((u_int16_t)appParams->metatrafficUnicastPort); 
+        des.sin_port = htons((uint16_t)appParams->metatrafficUnicastPort); 
         sock_sendto (
             &d->taskSend.sock,
             d->mbSend.cdrStream.buffer,
@@ -44,7 +44,7 @@ void ORTESendData(ORTEDomain *d,ObjectEntryAID *objectEntryAID,Boolean meta) {
             &des,
             sizeof(des)); 
       } else {
-        des.sin_port = htons((u_int16_t)appParams->userdataUnicastPort); 
+        des.sin_port = htons((uint16_t)appParams->userdataUnicastPort); 
         if (d->mbSend.cdrStreamDirect)
           sock_sendto (
               &d->taskSend.sock,
@@ -93,9 +93,14 @@ void ORTEAppSendThread(ORTEDomain *d) {
     if (s<0) s=ms=0;
     debug(24,4) ("ORTEAppSendThread: sleeping for %lis %lims\n",s,ms);
     if (!((wtime.tv_sec==0) && (wtime.tv_nsec==0))) {
-      sem_timedwait(
-          &d->objectEntry.htimSendSem,
-         &wtime);
+      pthread_mutex_lock(&d->objectEntry.htimSendMutex);
+      if (d->objectEntry.htimSendCondValue==0) {
+        pthread_cond_timedwait(&d->objectEntry.htimSendCond,
+                              &d->objectEntry.htimSendMutex,
+                              &wtime);
+      }
+      d->objectEntry.htimSendCondValue=0;
+      pthread_mutex_unlock(&d->objectEntry.htimSendMutex);
     }
     debug(24,7) ("ORTEAppSendThread: fired\n");
     actTime=getActualNtpTime();
index 87ec4ae61c5bc87cfc27a6c814172c1828871c7b..e244362a9ec15e6c63aacadeee7569967cbc4619 100644 (file)
@@ -35,7 +35,7 @@ ORTEDomainAppCreate(int domain, ORTEDomainProp *prop,
   char              sIPAddress[MAX_STRING_IPADDRESS_LENGTH];
   char              sbuff[128];
   int               i;
-  u_int16_t         port=0;
+  uint16_t          port=0;
 
   debug(21,10) ("ORTEDomainAppCreate: start\n");
   //Create domainApplication
@@ -54,7 +54,9 @@ ORTEDomainAppCreate(int domain, ORTEDomainProp *prop,
   pthread_rwlock_init(&d->objectEntry.objRootLock,NULL);
   htimerRoot_init_queue(&d->objectEntry);
   pthread_rwlock_init(&d->objectEntry.htimRootLock,NULL);
-  sem_init(&d->objectEntry.htimSendSem, 0, 0);
+  pthread_cond_init(&d->objectEntry.htimSendCond,NULL);
+  pthread_mutex_init(&d->objectEntry.htimSendMutex,NULL);
+  d->objectEntry.htimSendCondValue=0;
   //publication,subscriptions
   d->publications.counter=d->subscriptions.counter=0;
   CSTWriter_init_root_field(&d->publications);
@@ -86,7 +88,7 @@ ORTEDomainAppCreate(int domain, ORTEDomainProp *prop,
       strcat(iflocal,IPAddressToString(d->domainProp.IFProp[i].ipAddress,sIPAddress));
     debug(21,2) ("ORTEDomainAppCreate: localIPAddres(es) %s\n",iflocal);
   } else{
-    debug(21,2) ("ORTEDomainAppCreate: no activ interface card\n");
+    debug(21,2) ("ORTEDomainAppCreate: no active interface card\n");
   }
 
   //DomainEvents
@@ -98,11 +100,11 @@ ORTEDomainAppCreate(int domain, ORTEDomainProp *prop,
 
   //local buffers
   d->mbRecvMetatraffic.cdrStream.buffer=
-      (u_int8_t*)MALLOC(d->domainProp.recvBuffSize);
+      (uint8_t*)MALLOC(d->domainProp.recvBuffSize);
   d->mbRecvUserdata.cdrStream.buffer=
-      (u_int8_t*)MALLOC(d->domainProp.recvBuffSize);
+      (uint8_t*)MALLOC(d->domainProp.recvBuffSize);
   d->mbSend.cdrStream.buffer=
-      (u_int8_t*)MALLOC(d->domainProp.sendBuffSize);
+      (uint8_t*)MALLOC(d->domainProp.sendBuffSize);
   if ((!d->mbRecvMetatraffic.cdrStream.buffer) || 
       (!d->mbRecvUserdata.cdrStream.buffer) || 
       (!d->mbSend.cdrStream.buffer)) {    //no memory
@@ -365,8 +367,9 @@ ORTEDomainAppDestroy(ORTEDomain *d) {
   sock_cleanup(&d->taskRecvUserdata.sock);
   sock_cleanup(&d->taskSend.sock);
 
-  //Semas
-  sem_destroy(&d->objectEntry.htimSendSem);
+  //Signals
+  pthread_cond_destroy(&d->objectEntry.htimSendCond);
+  pthread_mutex_destroy(&d->objectEntry.htimSendMutex);
 
   //rwLocks
   pthread_rwlock_destroy(&d->objectEntry.objRootLock);
index 4254dc83e39c7fc5967ae7a037280ac7e383d13f..26f6a0e3e7ddf39fa8114d61ea442bf1e1459f55 100644 (file)
@@ -34,7 +34,7 @@ ORTEDomainMgrCreate(int domain, ORTEDomainProp *prop,
   char              sIPAddress[MAX_STRING_IPADDRESS_LENGTH];
   char              sbuff[128];
   int               i;
-  u_int16_t         port=0;
+  uint16_t          port=0;
 
   debug(29,10) ("ORTEDomainMgrCreate: start\n");
   //Create domainApplication
@@ -51,7 +51,9 @@ ORTEDomainMgrCreate(int domain, ORTEDomainProp *prop,
   pthread_rwlock_init(&d->objectEntry.objRootLock,NULL);
   htimerRoot_init_queue(&d->objectEntry);
   pthread_rwlock_init(&d->objectEntry.htimRootLock,NULL);
-  sem_init(&d->objectEntry.htimSendSem, 0, 0);
+  pthread_cond_init(&d->objectEntry.htimSendCond,NULL);
+  pthread_mutex_init(&d->objectEntry.htimSendMutex,NULL);
+  d->objectEntry.htimSendCondValue=0;
   
   //create domainProp 
   if (prop!=NULL) {
@@ -67,7 +69,7 @@ ORTEDomainMgrCreate(int domain, ORTEDomainProp *prop,
       strcat(iflocal,IPAddressToString(d->domainProp.IFProp[i].ipAddress,sIPAddress));
     debug(29,2) ("ORTEDomainMgrCreate: localIPAddres(es) %s\n",iflocal);
   } else{
-    debug(29,2) ("ORTEDomainMgrCreate: no activ interface card\n");
+    debug(29,2) ("ORTEDomainMgrCreate: no active interface card\n");
   }
 
   //DomainEvents
@@ -79,10 +81,10 @@ ORTEDomainMgrCreate(int domain, ORTEDomainProp *prop,
 
   //local buffers
   d->mbRecvMetatraffic.cdrStream.buffer=
-      (u_int8_t*)MALLOC(d->domainProp.recvBuffSize);
+      (uint8_t*)MALLOC(d->domainProp.recvBuffSize);
   d->mbRecvUserdata.cdrStream.buffer=NULL;
   d->mbSend.cdrStream.buffer=
-      (u_int8_t*)MALLOC(d->domainProp.sendBuffSize);
+      (uint8_t*)MALLOC(d->domainProp.sendBuffSize);
   if ((!d->mbRecvMetatraffic.cdrStream.buffer) || 
       (!d->mbSend.cdrStream.buffer)) {    //no memory
     FREE(d->mbRecvMetatraffic.cdrStream.buffer);
@@ -314,8 +316,9 @@ ORTEDomainMgrDestroy(ORTEDomain *d) {
   sock_cleanup(&d->taskRecvMetatraffic.sock);
   sock_cleanup(&d->taskSend.sock);
 
-  //Semas
-  sem_destroy(&d->objectEntry.htimSendSem);
+  //Signals
+  pthread_cond_destroy(&d->objectEntry.htimSendCond);
+  pthread_mutex_destroy(&d->objectEntry.htimSendMutex);
   
   //rwLocks
   pthread_rwlock_destroy(&d->objectEntry.objRootLock);
index 98918e4968a712d55439dbf5f3fd745177c69d2e..236037f535db03b0bc819c09815994f4fbf42917 100644 (file)
@@ -188,7 +188,7 @@ int
 ORTEPublicationWaitForSubscriptions(ORTEPublication *cstWriter,NtpTime wait,
     unsigned int retries,unsigned int noSubscriptions) {
   unsigned int rSubscriptions;
-  u_int32_t sec,ms;
+  uint32_t sec,ms;
 
   if (!cstWriter) return ORTE_BAD_HANDLE;
   NtpTimeDisAssembToMs(sec,ms,wait);
@@ -235,14 +235,21 @@ ORTEPublicationPrepareQueue(ORTEPublication *cstWriter) {
     if (!CSTWriterTryDestroyBestEffortIssue(cstWriter)) {
       NtpTime             expire,atime=getActualNtpTime();
       struct timespec     wtime; 
-      //Count max block time
+      //count max block time
       NtpTimeAdd(expire,atime,cstWriter->domain->domainProp.baseProp.maxBlockTime);
       NtpTimeDisAssembToUs(wtime.tv_sec,wtime.tv_nsec,expire);
       wtime.tv_nsec*=1000;  //conver to nano seconds
       pthread_rwlock_unlock(&cstWriter->lock);    
-      sem_timedwait(
-          &cstWriter->semCSChangeDestroyed,
-          &wtime);
+      //wait till a message will be processed
+      pthread_mutex_lock(&cstWriter->mutexCSChangeDestroyed);
+      if (cstWriter->condValueCSChangeDestroyed==0) {
+        pthread_cond_timedwait(&cstWriter->condCSChangeDestroyed,
+                              &cstWriter->mutexCSChangeDestroyed,
+                              &wtime);
+      }
+      cstWriter->condValueCSChangeDestroyed=0;
+      pthread_mutex_unlock(&cstWriter->mutexCSChangeDestroyed);
+
       pthread_rwlock_wrlock(&cstWriter->lock);    
       pp=(ORTEPublProp*)cstWriter->objectEntryOID->attributes;
       if (cstWriter->csChangesCounter>=pp->sendQueueSize) {
@@ -273,7 +280,7 @@ ORTEPublicationSendLocked(ORTEPublication *cstWriter) {
     csChange->alive=ORTE_FALSE;
     csChange->cdrStream.length=RTPS_HEADER_LENGTH+12+     //HEADER+INFO_TS+ISSUE
                               +20+cstWriter->typeRegister->getMaxSize;
-    csChange->cdrStream.buffer=(u_int8_t*)MALLOC(csChange->cdrStream.length);
+    csChange->cdrStream.buffer=(uint8_t*)MALLOC(csChange->cdrStream.length);
     csChange->cdrStream.bufferPtr=csChange->cdrStream.buffer+RTPS_HEADER_LENGTH+12+20;
     SeqNumberInc(snNext,cstWriter->lastSN);
     RTPSHeaderCreate(csChange->cdrStream.buffer,
index 0886b64835f2a554cd420560915378e27ff16555..5f0e041f429424f821374b0f7be81994f32f806c 100644 (file)
@@ -181,7 +181,7 @@ int
 ORTESubscriptionWaitForPublications(ORTESubscription *cstReader,NtpTime wait,
     unsigned int retries,unsigned int noPublications) {
   unsigned int wPublications;
-  u_int32_t sec,ms;
+  uint32_t sec,ms;
 
   if (!cstReader) return ORTE_BAD_HANDLE;
   NtpTimeDisAssembToMs(sec,ms,wait);
index 504ef05e17db0513b54f8a6b6bcec625e07d4653..5110fbaed63b7ed08b513b3f336af7c24e8fd434 100644 (file)
@@ -23,7 +23,7 @@
 
 /*****************************************************************************/
 void
-ORTEDomainWakeUpReceivingThread(ORTEDomain *d,sock_t *sock,u_int16_t port) {
+ORTEDomainWakeUpReceivingThread(ORTEDomain *d,sock_t *sock,uint16_t port) {
   struct sockaddr_in    des;
   char                  sIPAddress[MAX_STRING_IPADDRESS_LENGTH];
   int                   i;
@@ -52,11 +52,13 @@ void
 ORTEDomainWakeUpSendingThread(ObjectEntry *objectEntry) {
   debug(25,10) ("WakeUpSendingThread : start\n");
   if (objectEntry->htimNeedWakeUp) {
-    int value;
-    sem_getvalue(&objectEntry->htimSendSem,&value);
-    debug(25,8) ("WakeUpSendingThread : value:%d\n",value);
-    if (value<1)
-      sem_post(&objectEntry->htimSendSem);
+    pthread_mutex_lock(&objectEntry->htimSendMutex);
+    if (objectEntry->htimSendCondValue==0) {
+      debug(25,8) ("WakeUpSendingThread : send wakeup signal\n");
+      pthread_cond_signal(&objectEntry->htimSendCond);
+      objectEntry->htimSendCondValue=1;
+    }
+    pthread_mutex_unlock(&objectEntry->htimSendMutex);
   }
 }
 
index 12ce43e5d7d093d45e364f1760febb5e9244f0db..a6d6133cc434a3a207a247684e1b12700c001e6f 100644 (file)
 
 /**********************************************************************************/
 int32_t 
-RTPSAckCreate(u_int8_t *rtps_msg,u_int32_t max_msg_len,
+RTPSAckCreate(uint8_t *rtps_msg,uint32_t max_msg_len,
     SequenceNumber *seqNumber,
     ObjectId roid,ObjectId woid,Boolean f_bit) {
   SequenceNumber        sn_tmp;                    
                     
   if (max_msg_len<28) return -1;
-  rtps_msg[0]=(u_int8_t)ACK;
+  rtps_msg[0]=(uint8_t)ACK;
   rtps_msg[1]=ORTE_MY_MBO;
   if (f_bit) rtps_msg[1]|=2;
   *((ParameterLength*)(rtps_msg+2))=24;
@@ -39,14 +39,14 @@ RTPSAckCreate(u_int8_t *rtps_msg,u_int32_t max_msg_len,
   *((ObjectId*)(rtps_msg+8))=woid;
   SeqNumberInc(sn_tmp,*seqNumber);
   *((SequenceNumber*)(rtps_msg+12))=sn_tmp;
-  *((u_int32_t*)(rtps_msg+20))=32;
-  *((u_int32_t*)(rtps_msg+24))=0;
+  *((uint32_t*)(rtps_msg+20))=32;
+  *((uint32_t*)(rtps_msg+24))=0;
   return 28;
 } 
 
 /**********************************************************************************/
 void 
-RTPSAck(ORTEDomain *d,u_int8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIPAddress) {
+RTPSAck(ORTEDomain *d,uint8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIPAddress) {
   GUID_RTPS          readerGUID;
   CSTWriter          *cstWriter=NULL;
   CSTRemoteReader    *cstRemoteReader;
index b7d6851f4233cf58209c6d75f95bdcdd65d402ac..f0556464e253b4ca1b7d248f8feed1999bb2eb00 100644 (file)
@@ -56,7 +56,9 @@ CSTWriterInit(ORTEDomain *d,CSTWriter *cstWriter,ObjectEntryOID *object,
   cstWriter->domain=d;
   cstWriter->typeRegister=typeRegister;
   if ((cstWriter->guid.oid & 0x07)==OID_PUBLICATION) {
-    sem_init(&cstWriter->semCSChangeDestroyed, 0, 0);
+    pthread_cond_init(&cstWriter->condCSChangeDestroyed,NULL);
+    pthread_mutex_init(&cstWriter->mutexCSChangeDestroyed,NULL);
+    cstWriter->condValueCSChangeDestroyed=0;
   }
   //add event for refresh
   if (NtpTimeCmp(cstWriter->params.refreshPeriod,iNtpTime)!=0) {
@@ -95,7 +97,8 @@ CSTWriterDelete(ORTEDomain *d,CSTWriter *cstWriter) {
       &cstWriter->refreshPeriodTimer,
       0);
   if ((cstWriter->guid.oid & 0x07)==OID_PUBLICATION) {
-    sem_destroy(&cstWriter->semCSChangeDestroyed);
+    pthread_cond_destroy(&cstWriter->condCSChangeDestroyed);
+    pthread_mutex_destroy(&cstWriter->mutexCSChangeDestroyed);
   }
   pthread_rwlock_destroy(&cstWriter->lock);
   debug(51,10) ("CSTWriterDelete: finished\n");
@@ -402,7 +405,10 @@ CSTWriterDestroyCSChangeForReader(CSTRemoteReader *cstRemoteReader,
         CSTWriterDestroyCSChange(cstRemoteReader->cstWriter->domain,
             cstRemoteReader->cstWriter,csChange);
       }
-      sem_post(&cstRemoteReader->cstWriter->semCSChangeDestroyed);
+      pthread_mutex_lock(&cstRemoteReader->cstWriter->mutexCSChangeDestroyed);
+      cstRemoteReader->cstWriter->condValueCSChangeDestroyed=1;
+      pthread_cond_signal(&cstRemoteReader->cstWriter->condCSChangeDestroyed);
+      pthread_mutex_unlock(&cstRemoteReader->cstWriter->mutexCSChangeDestroyed);
       debug(51,5) ("Publication: new queue level (%d)\n",
                   cstRemoteReader->cstWriter->csChangesCounter);
     }
index d791248220e4f16b5ddb07a965bc4b4da3abb4fb..4d2e1ea937f929e79f7c935cdfee0936ef27cf6e 100644 (file)
@@ -330,30 +330,30 @@ CSTWriterSendTimer(ORTEDomain *d,void *vcstRemoteReader) {
                        cstRemoteReader->guid.hid,
                        cstRemoteReader->guid.aid);
           len=32;
-          d->mbSend.cdrStream.bufferPtr[0]=(u_int8_t)VAR;
+          d->mbSend.cdrStream.bufferPtr[0]=(uint8_t)VAR;
           d->mbSend.cdrStream.bufferPtr[1]=ORTE_MY_MBO;
           if (csChangeForReader->csChange->alive) 
             d->mbSend.cdrStream.bufferPtr[1]|=4;
           *((ObjectId*)(d->mbSend.cdrStream.bufferPtr+4))=OID_UNKNOWN;
-          conv_u32((u_int32_t*)(d->mbSend.cdrStream.bufferPtr+4),0);
+          conv_u32((uint32_t*)(d->mbSend.cdrStream.bufferPtr+4),0);
           *((ObjectId*)(d->mbSend.cdrStream.bufferPtr+8))=
             cstRemoteReader->cstWriter->guid.oid;
-          conv_u32((u_int32_t*)(d->mbSend.cdrStream.bufferPtr+8),0);
+          conv_u32((uint32_t*)(d->mbSend.cdrStream.bufferPtr+8),0);
           if (csChangeForReader->csChange->guid.oid==OID_APP) {
             d->mbSend.cdrStream.bufferPtr[1]|=8;
             *((HostId*)(d->mbSend.cdrStream.bufferPtr+12))=
               csChangeForReader->csChange->guid.hid;
-            conv_u32((u_int32_t*)(d->mbSend.cdrStream.bufferPtr+12),0);
+            conv_u32((uint32_t*)(d->mbSend.cdrStream.bufferPtr+12),0);
             *((AppId*)(d->mbSend.cdrStream.bufferPtr+16))=
               csChangeForReader->csChange->guid.aid;
-            conv_u32((u_int32_t*)(d->mbSend.cdrStream.bufferPtr+16),0);
+            conv_u32((uint32_t*)(d->mbSend.cdrStream.bufferPtr+16),0);
           } else {
             len-=8;
             off=-8;
           }
           *((ObjectId*)(d->mbSend.cdrStream.bufferPtr+20+off))=
             csChangeForReader->csChange->guid.oid;
-          conv_u32((u_int32_t*)(d->mbSend.cdrStream.bufferPtr+20+off),0);
+          conv_u32((uint32_t*)(d->mbSend.cdrStream.bufferPtr+20+off),0);
           *((SequenceNumber*)(d->mbSend.cdrStream.bufferPtr+24+off))=
             csChangeForReader->csChange->sn;
           if (!CSChangeAttributes_is_empty(csChangeForReader->csChange)) {
@@ -373,13 +373,13 @@ CSTWriterSendTimer(ORTEDomain *d,void *vcstRemoteReader) {
                        cstRemoteReader->guid.hid,
                        cstRemoteReader->guid.aid);
           len=32;
-          d->mbSend.cdrStream.bufferPtr[0]=(u_int8_t)GAP;
+          d->mbSend.cdrStream.bufferPtr[0]=(uint8_t)GAP;
           d->mbSend.cdrStream.bufferPtr[1]=ORTE_MY_MBO;
           *((ObjectId*)(d->mbSend.cdrStream.bufferPtr+4))=OID_UNKNOWN;
-          conv_u32((u_int32_t*)(d->mbSend.cdrStream.bufferPtr+4),0);
+          conv_u32((uint32_t*)(d->mbSend.cdrStream.bufferPtr+4),0);
           *((ObjectId*)(d->mbSend.cdrStream.bufferPtr+8))=
             cstRemoteReader->cstWriter->guid.oid;
-          conv_u32((u_int32_t*)(d->mbSend.cdrStream.bufferPtr+8),0);
+          conv_u32((uint32_t*)(d->mbSend.cdrStream.bufferPtr+8),0);
           *((SequenceNumber*)(d->mbSend.cdrStream.bufferPtr+12))=
             csChangeForReader->csChange->sn;
           conv_sn((SequenceNumber*)(d->mbSend.cdrStream.bufferPtr+12),ORTE_MY_MBO);
@@ -387,7 +387,7 @@ CSTWriterSendTimer(ORTEDomain *d,void *vcstRemoteReader) {
                        csChangeForReader->csChange->sn,
                        csChangeForReader->csChange->gapSN);
           conv_sn((SequenceNumber*)(d->mbSend.cdrStream.bufferPtr+20),ORTE_MY_MBO);
-          *((u_int32_t*)(d->mbSend.cdrStream.bufferPtr+28))=0;    //NumBits 
+          *((uint32_t*)(d->mbSend.cdrStream.bufferPtr+28))=0;    //NumBits 
         }
         *((ParameterLength*)(d->mbSend.cdrStream.bufferPtr+2))=len-4; 
         d->mbSend.cdrStream.bufferPtr+=len;
index 87db602c4795655ea77ea15a2ae6299dd37b0c27..77ce65d7e350956f5992108527f568b5685efc7b 100644 (file)
 /*****************************************************************************/
 void 
 RTPSGapAdd(CSTRemoteWriter *cstRemoteWriter,GUID_RTPS *guid,SequenceNumber *fsn,
-    SequenceNumber *sn,u_int32_t numbits,u_int8_t *bitmaps,Boolean e_bit) {
+    SequenceNumber *sn,uint32_t numbits,uint8_t *bitmaps,Boolean e_bit) {
   SequenceNumber      lsn,ssn;
-  u_int32_t           i;
+  uint32_t            i;
   int8_t              bit,bit_last=0;
   CSChange            *csChange;
-  u_int32_t           bitmap;
+  uint32_t            bitmap;
   
   if (SeqNumberCmp(*sn,cstRemoteWriter->sn)<0) return;//have to be sn>=writer_sn ! 
   if (SeqNumberCmp(*fsn,*sn)==1) return;              //cannot be fsn>sn ! 
@@ -52,7 +52,7 @@ RTPSGapAdd(CSTRemoteWriter *cstRemoteWriter,GUID_RTPS *guid,SequenceNumber *fsn,
   //second case of GAP sn
   lsn=ssn=*sn;bit=0;
   for(i=0;i<numbits;i++) {
-    bitmap=*(((u_int32_t*)bitmaps)+i/32);
+    bitmap=*(((uint32_t*)bitmaps)+i/32);
     conv_u32(&bitmap,e_bit);
     bit=(bitmap & (1<<(31-i%32))) ? 1:0;
     if (i>0) {
@@ -96,13 +96,13 @@ RTPSGapAdd(CSTRemoteWriter *cstRemoteWriter,GUID_RTPS *guid,SequenceNumber *fsn,
 
 /**********************************************************************************/
 void 
-RTPSGap(ORTEDomain *d,u_int8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIPAddress) {
+RTPSGap(ORTEDomain *d,uint8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIPAddress) {
   CSTReader          *cstReader=NULL;
   CSTRemoteWriter    *cstRemoteWriter;
   GUID_RTPS          writerGUID;
   ObjectId              roid,woid;
   SequenceNumber     sn,fsn;
-  u_int32_t          numbits;
+  uint32_t           numbits;
   int8_t             e_bit;
 
   e_bit=rtps_msg[1] & 0x01;
@@ -114,7 +114,7 @@ RTPSGap(ORTEDomain *d,u_int8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIP
   conv_sn(&fsn,e_bit);
   sn=*((SequenceNumber*)(rtps_msg+20));         /* Bitmap - SN    */
   conv_sn(&sn,e_bit);
-  numbits=*((u_int32_t*)(rtps_msg+28));         /* numbits */
+  numbits=*((uint32_t*)(rtps_msg+28));         /* numbits */
   conv_u32(&numbits,e_bit);
   writerGUID.hid=mi->sourceHostId;
   writerGUID.aid=mi->sourceAppId;
index 62bed0e99c53d3dfcfff897fe7f10882f00d4c9b..1a035b3199590400506a6d662d57591c5001d4b4 100644 (file)
@@ -23,7 +23,7 @@
 
 /**********************************************************************************/
 int16_t
-RTPSHeaderCreate(u_int8_t *msg,HostId hid,AppId aid) {
+RTPSHeaderCreate(uint8_t *msg,HostId hid,AppId aid) {
   msg[0]='R';msg[1]='T'; msg[2]='P'; msg[3]='S';
   //Protocol version
   PROTOCOL_VERSION_1_0((*((ProtocolVersion*)(msg+4))));
@@ -39,7 +39,7 @@ RTPSHeaderCreate(u_int8_t *msg,HostId hid,AppId aid) {
 } 
 /**********************************************************************************/
 int16_t
-RTPSHeaderCheck(u_int8_t *msg,int32_t len,MessageInterpret *mi) {
+RTPSHeaderCheck(uint8_t *msg,int32_t len,MessageInterpret *mi) {
   if (len<16) return -1;                          /* message is too small */
   if (msg[0]!='R') return -2;                     /* header is invalid */
   if (msg[1]!='T') return -2;                     /* header is invalid */
index 4e40e264a05a99d9320e1d03f3d27599c342ad35..f2baa842cc37970c2c62f32dc494617ccf175ddc 100644 (file)
 
 /**********************************************************************************/
 int 
-RTPSHeardBeatCreate(u_int8_t *rtps_msg,u_int32_t max_msg_len,
+RTPSHeardBeatCreate(uint8_t *rtps_msg,uint32_t max_msg_len,
     SequenceNumber *firstSeqNumber,SequenceNumber *lastSeqNumber,
     ObjectId woid,ObjectId roid,Boolean f_bit) {
   if (max_msg_len<28) return -1;
-  rtps_msg[0]=(u_int8_t)HEARTBEAT;
+  rtps_msg[0]=(uint8_t)HEARTBEAT;
   rtps_msg[1]=ORTE_MY_MBO;
   if (f_bit) rtps_msg[1]|=2;
   *((ParameterLength*)(rtps_msg+2))=24;
@@ -91,7 +91,7 @@ HeardBeatProc(CSTReader *cstReader,GUID_RTPS *writerGUID,
 
 /**********************************************************************************/
 void 
-RTPSHeardBeat(ORTEDomain *d,u_int8_t *rtps_msg,MessageInterpret *mi) {
+RTPSHeardBeat(ORTEDomain *d,uint8_t *rtps_msg,MessageInterpret *mi) {
   GUID_RTPS          writerGUID;
   ObjectId              roid,woid;
   SequenceNumber     fsn,lsn;
index d7cd8fface3329594fd677eecfafe4b3f61ca89c..b440e51dfbc705b748f02003d2d98cce3d17e864 100644 (file)
 #include "orte.h"
 
 /**********************************************************************************/
-void RTPSInfoDST(u_int8_t *rtps_msg,MessageInterpret *mi) {
+void RTPSInfoDST(uint8_t *rtps_msg,MessageInterpret *mi) {
   HostId             hid;
   AppId              aid;
 
   //parsing
   hid=*((HostId*)(rtps_msg+4));                 /* HostId */
   conv_u32(&hid,0);
-  aid=*((u_int32_t*)(rtps_msg+8));              /* AppId */
+  aid=*((uint32_t*)(rtps_msg+8));              /* AppId */
   conv_u32(&aid,0);
 
   debug(42,3) ("  RTPSInfoDST:\n");
index f117f034f22172fc8996730077e156d7775128c7..19a59006a481abd11b17ff3bf31c11fe574f4d35 100644 (file)
 
 /**********************************************************************************/
 int32_t 
-RTPSInfoREPLYCreate(u_int8_t *rtps_msg,u_int32_t max_msg_len,
+RTPSInfoREPLYCreate(uint8_t *rtps_msg,uint32_t max_msg_len,
     IPAddress ipaddress,Port port) {
 
   if (max_msg_len<12) return -1;
-  rtps_msg[0]=(u_int8_t)INFO_REPLY;
+  rtps_msg[0]=(uint8_t)INFO_REPLY;
   rtps_msg[1]=ORTE_MY_MBO;
   *((ParameterLength*)(rtps_msg+2))=8;
   *((ObjectId*)(rtps_msg+4))=ipaddress;
@@ -37,7 +37,7 @@ RTPSInfoREPLYCreate(u_int8_t *rtps_msg,u_int32_t max_msg_len,
 
 /**********************************************************************************/
 void 
-RTPSInfoREPLY(u_int8_t *rtps_msg,MessageInterpret *mi) {
+RTPSInfoREPLY(uint8_t *rtps_msg,MessageInterpret *mi) {
   IPAddress          ipa;
   Port               port;
   int8_t             e_bit;
@@ -57,9 +57,9 @@ RTPSInfoREPLY(u_int8_t *rtps_msg,MessageInterpret *mi) {
   }
   mi->unicastReplyPort=port;
   if (rtps_msg[1] & 0x02) {
-    ipa=*((u_int32_t*)(rtps_msg+12));           /* multicastReplyIPAddress */
+    ipa=*((uint32_t*)(rtps_msg+12));           /* multicastReplyIPAddress */
     conv_u32(&ipa,e_bit);
-    port=*((u_int32_t*)(rtps_msg+16));          /* multicastReplyPort */
+    port=*((uint32_t*)(rtps_msg+16));          /* multicastReplyPort */
     conv_u32(&port,e_bit);
     mi->multicastReplyIPAddress=ipa;
     mi->multicastReplyPort=port;
index 7f6b66f485d589e89c7e777ef99b4b5246680028..e3e0fbd8033999e93004da75aab26916ca0899b3 100644 (file)
@@ -22,7 +22,7 @@
 #include "orte.h"
 
 /**********************************************************************************/
-void RTPSInfoSRC(u_int8_t *rtps_msg,MessageInterpret *mi) {
+void RTPSInfoSRC(uint8_t *rtps_msg,MessageInterpret *mi) {
   IPAddress          ipa;
   ProtocolVersion    protocol;
   VendorId           vid;
index d8023c7ded914437fb2ab82d5a268f75b5b79701..6562e541227666dedc47d2a6cff3902d4ad8dae2 100644 (file)
@@ -23,9 +23,9 @@
 
 /**********************************************************************************/
 int32_t 
-RTPSInfoTSCreate(u_int8_t *rtps_msg,u_int32_t max_msg_len,NtpTime time) {
+RTPSInfoTSCreate(uint8_t *rtps_msg,uint32_t max_msg_len,NtpTime time) {
   if (max_msg_len<12) return -1;
-  rtps_msg[0]=(u_int8_t)INFO_TS;
+  rtps_msg[0]=(uint8_t)INFO_TS;
   rtps_msg[1]=ORTE_MY_MBO; //I-bit = 0
   *((ParameterLength*)(rtps_msg+2))=8;
   *((NtpTime*)(rtps_msg+4))=time;
@@ -34,7 +34,7 @@ RTPSInfoTSCreate(u_int8_t *rtps_msg,u_int32_t max_msg_len,NtpTime time) {
 
 /**********************************************************************************/
 void 
-RTPSInfoTS(u_int8_t *rtps_msg,MessageInterpret *mi) {
+RTPSInfoTS(uint8_t *rtps_msg,MessageInterpret *mi) {
   int8_t   e_bit=rtps_msg[1] & 0x01;
   char buff[MAX_STRING_NTPTIME_LENGTH];
 
index be025cf331e69a1abacd49aa6e47572c2d3c553d..bf120d14576eaf416705c3e8fe3c2c7df9b6b85f 100644 (file)
 #include "orte.h"
 /**********************************************************************************/
 int32_t
-RTPSIssueCreateHeader(u_int8_t *rtps_msg,u_int32_t max_msg_len,u_int32_t length,
+RTPSIssueCreateHeader(uint8_t *rtps_msg,uint32_t max_msg_len,uint32_t length,
     ObjectId roid,ObjectId woid,SequenceNumber sn) {
   
   if (max_msg_len<20) return -1;
-  rtps_msg[0]=(u_int8_t)ISSUE;
+  rtps_msg[0]=(uint8_t)ISSUE;
   rtps_msg[1]=ORTE_MY_MBO;
-  *((ParameterLength*)(rtps_msg+2))=(u_int16_t)length;
+  *((ParameterLength*)(rtps_msg+2))=(uint16_t)length;
   conv_u32(&roid,0);
   *((ObjectId*)(rtps_msg+4))=roid;
   conv_u32(&woid,0);
@@ -39,19 +39,19 @@ RTPSIssueCreateHeader(u_int8_t *rtps_msg,u_int32_t max_msg_len,u_int32_t length,
 
 /**********************************************************************************/
 void 
-RTPSIssue(ORTEDomain *d,u_int8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIPAddress) {
+RTPSIssue(ORTEDomain *d,uint8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIPAddress) {
   GUID_RTPS          guid,writerGUID;
   ObjectId           roid,woid;
   SequenceNumber     sn,sn_tmp;   
   int8_t             e_bit,p_bit;
-  u_int16_t          submsg_len;
+  uint16_t           submsg_len;
   CSTReader          *cstReader;
   CSTRemoteWriter    *cstRemoteWriter;
   CSChange           *csChange=NULL;
 
   e_bit=rtps_msg[1] & 0x01;
   p_bit=(rtps_msg[1] & 0x02)>>1;
-  submsg_len=*((u_int16_t*)(rtps_msg+2));
+  submsg_len=*((uint16_t*)(rtps_msg+2));
   conv_u16(&submsg_len,e_bit);
   roid=*((ObjectId*)(rtps_msg+4));              /* readerObjectId */
   conv_u32(&roid,0);
index 96471319357d12153e5dbae312a0ede86177461f..145b39e076350b203790eb670ea675b1f0f41eb1 100644 (file)
@@ -22,7 +22,7 @@
 #include "orte.h"
 
 /**********************************************************************************/
-void RTPSPad(u_int8_t *rtps_msg,MessageInterpret *mi) {
+void RTPSPad(uint8_t *rtps_msg,MessageInterpret *mi) {
   //nothing to do
 
   debug(41,3) ("  RTPSInfoPAD:\n");
index 974b11626c3ed2fc8c2ab04129c975bef30f5199..900a3a05a7a646b5ab5582e529149ca06ffac4c8 100644 (file)
@@ -26,12 +26,12 @@ void NewSubscriber(ORTEDomain *d,ObjectEntryOID *os);
 
 /**********************************************************************************/
 void 
-RTPSVar(ORTEDomain *d,u_int8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIPAddress) {
+RTPSVar(ORTEDomain *d,uint8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIPAddress) {
   GUID_RTPS          objectGUID,writerGUID;
   ObjectId           roid,woid;
   SequenceNumber     sn;   
   int8_t             e_bit,p_bit,a_bit;
-  u_int16_t          submsg_len;
+  uint16_t           submsg_len;
   CSTReader          *cstReader=NULL;
   CSTRemoteWriter    *cstRemoteWriter=NULL;
   CSTRemoteReader    *cstRemoteReader=NULL;
@@ -42,7 +42,7 @@ RTPSVar(ORTEDomain *d,u_int8_t *rtps_msg,MessageInterpret *mi,IPAddress senderIP
   e_bit=rtps_msg[1] & 0x01;
   p_bit=(rtps_msg[1] & 0x02)>>1;
   a_bit=(rtps_msg[1] & 0x04)>>2;
-  submsg_len=*((u_int16_t*)(rtps_msg+2));
+  submsg_len=*((uint16_t*)(rtps_msg+2));
   conv_u16(&submsg_len,e_bit);
   roid=*((ObjectId*)(rtps_msg+4));              /* readerObjectId */
   conv_u32(&roid,0);
index 5f53fce3bcbbd30a6c35e464a8f45d632e0cbdc6..b5ace8fe0cac5b28213e1ed90d1954da808306d1 100644 (file)
@@ -27,7 +27,7 @@
 #include "orte.h"
 
 /**********************************************************************************/
-void conv_u16(u_int16_t *x,char ef) {
+void conv_u16(uint16_t *x,char ef) {
   #if WORDS_BIGENDIAN
      if(ef) *x=bswap_16(*x);
   #else
@@ -36,7 +36,7 @@ void conv_u16(u_int16_t *x,char ef) {
 }
 
 /**********************************************************************************/
-void conv_u32(u_int32_t *x,char ef) {
+void conv_u32(uint32_t *x,char ef) {
   #if WORDS_BIGENDIAN
      if(ef) *x=bswap_32(*x);
   #else
@@ -93,8 +93,8 @@ getStringPart(char *string,char divChar,int *iterator,char *buff) {
     *dcp=0;           //temporary end of string
     strcpy(buff,cp);  
     *dcp=tcp;         //restore value
-    if (dcp[0]!=0) (*iterator)=dcp-cp+1;//next value
-    else (*iterator)=dcp-cp;
+    if (dcp[0]!=0) (*iterator)+=dcp-cp+1;//next value
+    else (*iterator)=len;
     return 1;
   }
   return 0;
index de262ee4529cf7c7d6dd2a2cd14b9718ee7a1cc1..8d8dc96064017acaba03b0c4db6e4bbf6ada752b 100644 (file)
@@ -194,7 +194,7 @@ generateEvent(ORTEDomain *d,GUID_RTPS *guid,void *params,Boolean live) {
 Boolean
 getTypeApp(ORTEDomain *d,AppParams *ap,IPAddress senderIPAddress) {
   Boolean       result=ORTE_FALSE;
-  u_int16_t     i,j,k;
+  uint16_t      i,j,k;
   
   //test if the app is MOM
   for (i=0;i<d->appParams->managerKeyCount;i++) {
index 06515ea5c1913d7904d33453df4ec40e25d59454..25be10387a98d669483c2427c3e067bab0d9749b 100644 (file)
@@ -43,14 +43,14 @@ parameterDelete(CSChange *csChange) {
 /*****************************************************************************/
 int
 parameterCodeStreamFromCSChange(CSChange *csChange,
-    u_int8_t *rtps_msg,u_int32_t max_msg_len) {
+    uint8_t *rtps_msg,uint32_t max_msg_len) {
   ParameterSequence *ps;
   int               result=0;
 
   ul_list_for_each(CSChangeAttributes,
                    csChange,
                    ps) {
-    if (max_msg_len<(u_int32_t)(4+ps->parameterLength)) return -1; //no memory for copy
+    if (max_msg_len<(uint32_t)(4+ps->parameterLength)) return -1; //no memory for copy
     *((ParameterId*)rtps_msg)=ps->parameterID;
     *((ParameterLength*)(rtps_msg+2))=ps->parameterLength; 
     if (ps->parameterLength>MAX_PARAMETER_LOCAL_LENGTH) {
@@ -67,13 +67,13 @@ parameterCodeStreamFromCSChange(CSChange *csChange,
 
 /*****************************************************************************/
 int
-parameterDecodeStreamToCSChange(CSChange *csChange,u_int8_t *rtps_msg,
-    u_int16_t submsg_len,u_int8_t e_bit) {
+parameterDecodeStreamToCSChange(CSChange *csChange,uint8_t *rtps_msg,
+    uint16_t submsg_len,uint8_t e_bit) {
   ParameterId       parameterId;
   ParameterLength   parameterLength;
   ParameterSequence *ps;
-  u_int16_t         counter=0;
-  u_int8_t          *rtps_msg_it=rtps_msg;
+  uint16_t          counter=0;
+  uint8_t           *rtps_msg_it=rtps_msg;
 
   CSChangeAttributes_init_head(csChange);
   //count number of parameters
@@ -117,8 +117,8 @@ parameterDecodeStreamToCSChange(CSChange *csChange,u_int8_t *rtps_msg,
       case PID_RELIABILITY_OFFERED:
       case PID_RELIABILITY_REQUESTED:
       case PID_MANAGER_KEY:
-        *(u_int32_t*)ps->parameterLocal=*((u_int32_t*)(rtps_msg_it+4));
-        conv_u32((u_int32_t*)ps->parameterLocal,e_bit);
+        *(uint32_t*)ps->parameterLocal=*((uint32_t*)(rtps_msg_it+4));
+        conv_u32((uint32_t*)ps->parameterLocal,e_bit);
         break;
       //IPAddress
       case PID_MATATRAFFIC_MULTICAST_IPADDRESS:
@@ -255,7 +255,7 @@ parameterUpdateCSChange(
   for (i=0;i<ap->managerKeyCount;i++) {
     ps->parameterID=PID_MANAGER_KEY;
     ps->parameterLength=4;
-    *(u_int32_t*)ps->parameterLocal=ap->managerKeyList[i];
+    *(uint32_t*)ps->parameterLocal=ap->managerKeyList[i];
     ps->parameter=NULL;
     CSChangeAttributes_insert(csChange,ps);
     ps++;
@@ -286,21 +286,21 @@ parameterUpdateCSChangeFromPublication(CSChange *csChange,ORTEPublProp *pp) {
   /* reliabitityOffered */
   ps->parameterID=PID_RELIABILITY_OFFERED;
   ps->parameterLength=4;
-  *(u_int32_t*)ps->parameterLocal=pp->reliabilityOffered;
+  *(uint32_t*)ps->parameterLocal=pp->reliabilityOffered;
   ps->parameter=NULL;
   CSChangeAttributes_insert(csChange,ps);
   ps++;
   /* sendQueueSize */
   ps->parameterID=PID_SEND_QUEUE_SIZE;
   ps->parameterLength=4;
-  *(u_int32_t*)ps->parameterLocal=pp->sendQueueSize;
+  *(uint32_t*)ps->parameterLocal=pp->sendQueueSize;
   ps->parameter=NULL;
   CSChangeAttributes_insert(csChange,ps);
   ps++;
   /* strength */
   ps->parameterID=PID_STRENGTH;
   ps->parameterLength=4;
-  *(u_int32_t*)ps->parameterLocal=pp->strength;
+  *(uint32_t*)ps->parameterLocal=pp->strength;
   ps->parameter=NULL;
   CSChangeAttributes_insert(csChange,ps);
   ps++;
@@ -308,16 +308,16 @@ parameterUpdateCSChangeFromPublication(CSChange *csChange,ORTEPublProp *pp) {
   ps->parameterID=PID_TOPIC;
   len=strlen(pp->topic);
   ps->parameter=(int8_t*)MALLOC(len+8);
-  *(u_int32_t*)ps->parameter=len+1;
+  *(uint32_t*)ps->parameter=len+1;
   strncpy((4+ps->parameter),pp->topic,len);
-  *(u_int32_t*)(ps->parameter+len+4)=0;
+  *(uint32_t*)(ps->parameter+len+4)=0;
   ps->parameterLength=len+8;
   CSChangeAttributes_insert(csChange,ps);
   ps++;  
   /* typeCheckSum */
   ps->parameterID=PID_TYPE_CHECKSUM;
   ps->parameterLength=4;
-  *(u_int32_t*)ps->parameterLocal=pp->typeChecksum;
+  *(uint32_t*)ps->parameterLocal=pp->typeChecksum;
   ps->parameter=NULL;
   CSChangeAttributes_insert(csChange,ps);
   ps++;
@@ -325,9 +325,9 @@ parameterUpdateCSChangeFromPublication(CSChange *csChange,ORTEPublProp *pp) {
   ps->parameterID=PID_TYPE_NAME;
   len=strlen(pp->typeName);
   ps->parameter=(int8_t*)MALLOC(len+8);
-  *(u_int32_t*)ps->parameter=len+1;
+  *(uint32_t*)ps->parameter=len+1;
   strncpy((4+ps->parameter),pp->typeName,len);
-  *(u_int32_t*)(ps->parameter+len+4)=0;
+  *(uint32_t*)(ps->parameter+len+4)=0;
   ps->parameterLength=len+8;
   CSChangeAttributes_insert(csChange,ps);
   ps++;  
@@ -357,14 +357,14 @@ parameterUpdateCSChangeFromSubscription(CSChange *csChange,ORTESubsProp *sp) {
   /* receive queue size*/
   ps->parameterID=PID_RECV_QUEUE_SIZE;
   ps->parameterLength=4;
-  *(u_int32_t*)ps->parameterLocal=sp->recvQueueSize;
+  *(uint32_t*)ps->parameterLocal=sp->recvQueueSize;
   ps->parameter=NULL;
   CSChangeAttributes_insert(csChange,ps);
   ps++;
   /* reliabitityRequested */
   ps->parameterID=PID_RELIABILITY_REQUESTED;
   ps->parameterLength=4;
-  *(u_int32_t*)ps->parameterLocal=sp->reliabilityRequested;
+  *(uint32_t*)ps->parameterLocal=sp->reliabilityRequested;
   ps->parameter=NULL;
   CSChangeAttributes_insert(csChange,ps);
   ps++;
@@ -372,16 +372,16 @@ parameterUpdateCSChangeFromSubscription(CSChange *csChange,ORTESubsProp *sp) {
   ps->parameterID=PID_TOPIC;
   len=strlen(sp->topic);
   ps->parameter=(int8_t*)MALLOC(len+8);
-  *(u_int32_t*)ps->parameter=len+1;
+  *(uint32_t*)ps->parameter=len+1;
   strncpy((4+ps->parameter),sp->topic,len);
-  *(u_int32_t*)(ps->parameter+len+4)=0;
+  *(uint32_t*)(ps->parameter+len+4)=0;
   ps->parameterLength=len+8;
   CSChangeAttributes_insert(csChange,ps);
   ps++;  
   /* typeCheckSum */
   ps->parameterID=PID_TYPE_CHECKSUM;
   ps->parameterLength=4;
-  *(u_int32_t*)ps->parameterLocal=sp->typeChecksum;
+  *(uint32_t*)ps->parameterLocal=sp->typeChecksum;
   ps->parameter=NULL;
   CSChangeAttributes_insert(csChange,ps);
   ps++;
@@ -389,9 +389,9 @@ parameterUpdateCSChangeFromSubscription(CSChange *csChange,ORTESubsProp *sp) {
   ps->parameterID=PID_TYPE_NAME;
   len=strlen(sp->typeName);
   ps->parameter=(int8_t*)MALLOC(len+8);
-  *(u_int32_t*)ps->parameter=len+1;
+  *(uint32_t*)ps->parameter=len+1;
   strncpy((4+ps->parameter),sp->typeName,len);
-  *(u_int32_t*)(ps->parameter+len+4)=0;
+  *(uint32_t*)(ps->parameter+len+4)=0;
   ps->parameterLength=len+8;
   CSChangeAttributes_insert(csChange,ps);
   ps++;  
@@ -420,7 +420,7 @@ parameterUpdateApplication(CSChange *csChange,AppParams *ap) {
         break;
       case PID_MANAGER_KEY:
         ap->managerKeyList[ap->managerKeyCount]=
-            *(u_int32_t*)ps->parameterLocal;
+            *(uint32_t*)ps->parameterLocal;
         ap->managerKeyCount++;
         break;
       case PID_MATATRAFFIC_MULTICAST_IPADDRESS:
@@ -508,10 +508,10 @@ parameterUpdateSubscription(CSChange *csChange,ORTESubsProp *sp) {
         sp->minimumSeparation=*(NtpTime*)&ps->parameterLocal;
       break;
       case PID_RECV_QUEUE_SIZE:
-        sp->recvQueueSize=*(u_int32_t*)&ps->parameterLocal;
+        sp->recvQueueSize=*(uint32_t*)&ps->parameterLocal;
       break;
       case PID_RELIABILITY_REQUESTED:
-        sp->reliabilityRequested=*(u_int32_t*)&ps->parameterLocal;
+        sp->reliabilityRequested=*(uint32_t*)&ps->parameterLocal;
       break;
       case PID_TOPIC:
         if (ps->parameterLength>MAX_PARAMETER_LOCAL_LENGTH)
index 720e993db553b6700c41bd099d9f95de4b9e89fc..a54229d9204ec3cb4037c428be5fe5f99273371b 100644 (file)
@@ -84,7 +84,7 @@ sock_getsockopt(sock_t *sock,int optname,char *optval, int *optlen) {
 
 /*********************************************************************/
 int
-sock_bind(sock_t *sock,u_int16_t port) {
+sock_bind(sock_t *sock,uint16_t port) {
   struct sockaddr_in name;
   int size;
 
index 8176fb34778d11ef996a2fda1fecbded4ded91e7..46bb39da5eef43186cbf7b12ac970c0c32ca9716 100644 (file)
@@ -6,6 +6,9 @@ if CONFIG_ORTE_RT
 else
 bin_PROGRAMS = ortemanager
 ortemanager_SOURCES = ortemanager.c
+if CONFIG_ORTE_WIN
+  ortemanager_SOURCES += service.c
+endif
 if CONFIG_ORTE_MINGW
   win_libs= $(top_srcdir)/orte/contrib/win_pthread/libpthreadGC.a 
 endif
index b6f088e676d3d798dfd1cd9d13e6346ae967c564..c479ed376406e605ed737b76ee5967fd3184a4da 100644 (file)
@@ -36,6 +36,7 @@ NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
 host_triplet = @host@
+@CONFIG_ORTE_RT_FALSE@@CONFIG_ORTE_WIN_TRUE@am__append_1 = service.c
 ACLOCAL = @ACLOCAL@
 AMDEP_FALSE = @AMDEP_FALSE@
 AMDEP_TRUE = @AMDEP_TRUE@
@@ -172,7 +173,7 @@ target_vendor = @target_vendor@
 @CONFIG_ORTE_RT_TRUE@rt_ortemanager_ko_SOURCES = ortemanager.c  
 @CONFIG_ORTE_RT_TRUE@rt_ortemanager_ko_LINK = $(top_builddir)/modtool --link -o $@
 @CONFIG_ORTE_RT_FALSE@bin_PROGRAMS = ortemanager
-@CONFIG_ORTE_RT_FALSE@ortemanager_SOURCES = ortemanager.c
+@CONFIG_ORTE_RT_FALSE@ortemanager_SOURCES = ortemanager.c $(am__append_1)
 @CONFIG_ORTE_MINGW_TRUE@@CONFIG_ORTE_RT_FALSE@win_libs = $(top_srcdir)/orte/contrib/win_pthread/libpthreadGC.a 
 @CONFIG_ORTE_RT_FALSE@ortemanager_LDADD = ../liborte/liborte.a $(win_libs)
 subdir = orte/manager
@@ -186,8 +187,11 @@ CONFIG_CLEAN_FILES =
 @CONFIG_ORTE_RT_FALSE@module_PROGRAMS =
 PROGRAMS = $(bin_PROGRAMS) $(module_PROGRAMS)
 
-am__ortemanager_SOURCES_DIST = ortemanager.c
-@CONFIG_ORTE_RT_FALSE@am_ortemanager_OBJECTS = ortemanager.$(OBJEXT)
+am__ortemanager_SOURCES_DIST = ortemanager.c service.c
+@CONFIG_ORTE_RT_FALSE@@CONFIG_ORTE_WIN_TRUE@am__objects_1 = \
+@CONFIG_ORTE_RT_FALSE@@CONFIG_ORTE_WIN_TRUE@   service.$(OBJEXT)
+@CONFIG_ORTE_RT_FALSE@am_ortemanager_OBJECTS = ortemanager.$(OBJEXT) \
+@CONFIG_ORTE_RT_FALSE@ $(am__objects_1)
 ortemanager_OBJECTS = $(am_ortemanager_OBJECTS)
 @CONFIG_ORTE_MINGW_FALSE@@CONFIG_ORTE_RT_TRUE@ortemanager_DEPENDENCIES =
 @CONFIG_ORTE_MINGW_FALSE@@CONFIG_ORTE_RT_FALSE@ortemanager_DEPENDENCIES = \
@@ -209,7 +213,8 @@ DEFAULT_INCLUDES =  -I. -I$(srcdir) -I$(top_builddir)/orte/include
 depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
 am__depfiles_maybe = depfiles
 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/ortemanager.Po \
-@AMDEP_TRUE@   ./$(DEPDIR)/rt_ortemanager_ko-ortemanager.Po
+@AMDEP_TRUE@   ./$(DEPDIR)/rt_ortemanager_ko-ortemanager.Po \
+@AMDEP_TRUE@   ./$(DEPDIR)/service.Po
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
@@ -290,6 +295,7 @@ distclean-compile:
 
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ortemanager.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_ortemanager_ko-ortemanager.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/service.Po@am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
index ae34d7360799234f6753c637e63c21b7bc0e164e..e02029abc9e047ee6f7ad95b1e0f4bf6f50a1555 100644 (file)
@@ -17,13 +17,13 @@ CC=             $(MSCDIR)\bin\cl
 LINK=          $(MSCDIR)\bin\link
 LIBRARIAN=     $(MSCDIR)\bin\lib
 
-TARGETS=ORTEManager.exe
+TARGETS=ortemanager.exe
 
 all :  default
 
 default : $(TARGETS)
 
-ORTEManager.exe: ..\ORTEManager.obj getopt.obj getopt_long.obj
+ortemanager.exe: ..\service.obj ..\ortemanager.obj getopt.obj getopt_long.obj
 
 # ---------------------------------------------------------------------
 # Generic Compilation Rules
@@ -36,7 +36,7 @@ ORTEManager.exe: ..\ORTEManager.obj getopt.obj getopt_long.obj
        $(CC) $(CFLAGS) $< -Fo$*.obj
 
 .obj.exe:
-       $(LINK) -out:$@ getopt.obj getopt_long.obj $(ORTELIB) $< $(LIBS)
+       $(LINK) -out:$@ ..\service.obj getopt.obj getopt_long.obj $(ORTELIB) $< $(LIBS)
 
 clean :
     del *.obj
index d483e548672f72de58020b3afc25a06190aba378..724f8086e260b206966d5ab8baddc1e608be2375 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  $Id: ORTEManager.c,v 0.0.0.1        2003/10/07
+ *  $Id: ortemanager.c,v 0.0.0.1        2003/10/07
  *
  *  DEBUG:  section                     Manager
  *  AUTHOR: Petr Smolik                 petr.smolik@wo.cz
 #include "orte.h"
 
 #ifndef CONFIG_ORTE_RT
+//global variables
+ORTEDomain          *d;
+ORTEDomainProp      dp;
+int32_t             opt,domain=ORTE_DEFAULT_DOMAIN;
+Boolean             orteDaemon=ORTE_FALSE;
+Boolean             orteWinService=ORTE_FALSE;
+ORTEDomainAppEvents *events=NULL;
+
+//event system
 Boolean
 onMgrAppRemoteNew(const struct ORTEAppInfo *appInfo, void *param) {
   printf("%s 0x%x-0x%x was accepted\n",
@@ -37,7 +46,28 @@ onMgrAppDelete(const struct ORTEAppInfo *appInfo, void *param) {
          appInfo->hostId,appInfo->appId);
 }
 
+#ifdef _WIN32
+//Windows service support
+void serviceDispatchTable(void);  //forward declaration
+void removeService(void);         //forward declaration
+void installService(void);        //forward declaration
+int managerInit(void) {
+  d=ORTEDomainMgrCreate(domain,&dp,events,ORTE_TRUE);
+  if (d==NULL) return -1;
+  return 0;
+}
+int managerStart(void) {
+  ORTEDomainStart(d,ORTE_TRUE,ORTE_FALSE,ORTE_TRUE);
+  return 0;
+}
+int managerStop(void) {
+  ORTEDomainMgrDestroy(d);
+  return 0;
+}
+#endif
+
 #ifdef CONFIG_ORTE_UNIX
+//Unix daemon support
 pthread_mutex_t     mutex;
 void sig_usr(int signo) {
   if ((signo==SIGTERM) || (signo==SIGINT)) {
@@ -51,7 +81,7 @@ void waitForEndingCommand(void) {
   signal(SIGINT,sig_usr);
   pthread_mutex_lock(&mutex);
 }
-static int daemon_init(void) {
+static int daemonInit(void) {
   pid_t pid;
 
   if ((pid = fork()) < 0) {
@@ -71,7 +101,7 @@ static int daemon_init(void) {
 #endif
 
 static void usage(void) {
-  printf("usage: ORTEManager <parameters> \n");
+  printf("usage: ortemanager <parameters> \n");
   printf("  -p, --peer <IPAdd:IPAdd:...>  possible locations of fellow managers\n");
   printf("  -k, --key  <IPAdd:IPAdd:...>  manualy assigned manager's keys\n");
   printf("  -d, --domain <domain>         working manager domain\n");
@@ -87,10 +117,15 @@ static void usage(void) {
   printf("  -e, --events                  register event system\n");
   printf("  -l, --logfile <filename>      set log file name\n");
   printf("  -V, --version                 show version\n");
+#ifdef _WIN32
+  printf("  -i, --install_service         install service into service manager on Windows\n");
+  printf("  -r, --remove_service          remove service from service manager on Windows\n");
+#endif
   printf("  -h, --help                    this usage screen\n");
 }
 
 int main(int argc,char *argv[]) {
+#if defined HAVE_GETOPT_LONG || defined HAVE_GETOPT_LONG_ORTE
   static struct option long_opts[] = {
     { "peer",1,0, 'p' },
     { "key",1,0, 'k' },
@@ -105,19 +140,21 @@ int main(int argc,char *argv[]) {
     { "events",0,0, 'e' },
     { "logfile",1,0, 'l' },
     { "version",0,0, 'V' },
+    { "install_service",0,0, 'i' },
+    { "remove_service",0,0, 'r' },
     { "help",  0, 0, 'h' },
     { 0, 0, 0, 0}
   };
-  ORTEDomain         *d;
-  ORTEDomainProp      dp;
-  int32_t             opt,domain=ORTE_DEFAULT_DOMAIN;
-  Boolean            daemon=ORTE_FALSE;
-  ORTEDomainAppEvents *events=NULL;
+#endif
 
   ORTEInit();
   ORTEDomainPropDefaultGet(&dp);
 
-  while ((opt = getopt_long(argc, argv, "k:p:d:v:R:E:P:l:VhDe",&long_opts[0], NULL)) != EOF) {
+#if defined HAVE_GETOPT_LONG || defined HAVE_GETOPT_LONG_ORTE
+  while ((opt = getopt_long(argc, argv, "k:p:d:v:R:E:P:l:VhDesir",&long_opts[0], NULL)) != EOF) {
+#else
+  while ((opt = getopt(argc, argv, "k:p:d:v:R:E:P:l:VhDesir")) != EOF) {
+#endif
     switch (opt) {
       case 'p':
         dp.mgrs=strdup(optarg);
@@ -156,22 +193,40 @@ int main(int argc,char *argv[]) {
         exit(0);
         break;
       case 'D':
-        daemon=ORTE_TRUE;
+        orteDaemon=ORTE_TRUE;
+        break;
+      #ifdef _WIN32
+      case 's':
+        serviceDispatchTable();
+        exit(0);
         break;
+      case 'i':
+        installService();
+        orteWinService=ORTE_TRUE;
+        break;
+      case 'r':
+        removeService();
+        exit(0);
+        break;
+      #endif
       case 'h':
       default:
         usage();
         exit(opt == 'h' ? 0 : 1);
     }
   }
-
+  
+  if (orteWinService) { 
+    exit(0);
+  }
+  
   d=ORTEDomainMgrCreate(domain,&dp,events,ORTE_TRUE);
   if (!d)
     exit(1);
 
   #ifdef CONFIG_ORTE_UNIX
-  if (daemon)
-    daemon_init();
+  if (orteDaemon)
+    daemonInit();
   #endif
 
   ORTEDomainStart(d,ORTE_TRUE,ORTE_FALSE,ORTE_FALSE);
diff --git a/orte/manager/service.c b/orte/manager/service.c
new file mode 100644 (file)
index 0000000..82dcc73
--- /dev/null
@@ -0,0 +1,213 @@
+#include "orte.h"
+
+HANDLE                         killServiceEvent = NULL;
+static SERVICE_STATUS          ssStatus;       // current status of the service
+static SERVICE_STATUS_HANDLE   sshStatusHandle;
+static DWORD                   dwErr = 0;
+static char                    szErr[1024] = "";
+
+char                           *name_service="ortemanager";
+char                           *name_service_disp="ortemanager";
+
+int managerInit(void);         //forward declaration
+int managerStart(void);        //forward declaration
+int managerStop(void);         //forward declaration
+
+static void AddToMessageLog(char *lpszMsg) {
+  char    szMsg[2048];
+  HANDLE  hEventSource;
+  char *  lpszStrings[2];
+
+  dwErr = GetLastError();
+  hEventSource = RegisterEventSource(NULL, name_service);
+  sprintf(szMsg, "%s error: %li", name_service, dwErr);
+  lpszStrings[0] = szMsg;
+  lpszStrings[1] = lpszMsg;
+  if(hEventSource != NULL) {
+    ReportEvent(hEventSource, // handle of event source
+                EVENTLOG_ERROR_TYPE,  // event type
+                0,                    // event category
+                0,                    // event ID
+                NULL,                 // current user's SID
+                2,                    // strings in lpszStrings
+                0,                    // no bytes of raw data
+                (LPCSTR*)lpszStrings, // array of error strings
+                NULL);                // no raw data
+    DeregisterEventSource(hEventSource);
+  }
+}
+
+BOOL ReportStatusToSCMgr(DWORD dwCurrentState,DWORD dwWin32ExitCode,
+                         DWORD dwWaitHint) {
+  static DWORD dwCheckPoint = 1;
+  BOOL fResult = TRUE;
+
+  if(dwCurrentState == SERVICE_START_PENDING) ssStatus.dwControlsAccepted = 0;
+  else ssStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;
+  ssStatus.dwCurrentState = dwCurrentState;
+  ssStatus.dwWin32ExitCode = dwWin32ExitCode;
+  ssStatus.dwWaitHint = dwWaitHint;
+  if((dwCurrentState == SERVICE_RUNNING) || (dwCurrentState == SERVICE_STOPPED)) ssStatus.dwCheckPoint = 0;
+  else ssStatus.dwCheckPoint = dwCheckPoint++;
+  if(!(fResult = SetServiceStatus(sshStatusHandle, &ssStatus))) {
+    AddToMessageLog("SetServiceStatus");
+  }
+  return fResult;
+}
+
+void WINAPI service_ctrl(DWORD dwCtrlCode) {
+  switch(dwCtrlCode) {
+    case SERVICE_CONTROL_STOP:
+      ssStatus.dwCurrentState = SERVICE_STOP_PENDING;
+      managerStop();
+      SetEvent(killServiceEvent);
+      break;
+    case SERVICE_CONTROL_INTERROGATE:
+      break;
+    default:
+      break;
+  }
+  ReportStatusToSCMgr(ssStatus.dwCurrentState, NO_ERROR, 0);
+}
+
+void WINAPI service_main(DWORD dwArgc, char **lpszArgv) {
+  int       err;
+  sshStatusHandle = RegisterServiceCtrlHandler(name_service, service_ctrl);
+  if(sshStatusHandle) {
+    ssStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
+    ssStatus.dwServiceSpecificExitCode = 0;
+    killServiceEvent = CreateEvent( NULL, TRUE, FALSE, NULL );
+    if (!killServiceEvent) goto cleanup;
+    if(!ReportStatusToSCMgr(SERVICE_START_PENDING,NO_ERROR,3000)) goto cleanup;
+    err=managerInit();
+    if (err<0) {
+      AddToMessageLog("Starting communication");
+      dwErr=NO_ERROR;
+      goto cleanup;
+    }
+    managerStart();
+    if(!ReportStatusToSCMgr(SERVICE_RUNNING,NO_ERROR, 0 )) goto cleanup;
+    WaitForSingleObject(killServiceEvent,INFINITE);
+    CloseHandle(killServiceEvent);
+  }
+cleanup:
+  if(sshStatusHandle) {
+    ReportStatusToSCMgr(SERVICE_STOP_PENDING,dwErr,0);
+    ReportStatusToSCMgr(SERVICE_STOPPED,dwErr,0);
+  }
+}
+
+void serviceDispatchTable(void) {
+  SERVICE_TABLE_ENTRY dispatchTable[] = {
+      { name_service, (LPSERVICE_MAIN_FUNCTION)service_main },
+      { NULL, NULL }
+  };
+  if(!StartServiceCtrlDispatcher(dispatchTable)) {
+    AddToMessageLog("StartServiceCtrlDispatcher failed.");
+  }
+}
+
+char *GetLastErrorText( char *lpszBuf, DWORD dwSize ) {
+  DWORD dwRet;
+  char *lpszTemp = NULL;
+
+  dwRet = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |FORMAT_MESSAGE_ARGUMENT_ARRAY,
+                        NULL,
+                        GetLastError(),
+                        LANG_NEUTRAL,
+                        (char *)&lpszTemp,
+                        0,
+                        NULL);
+  // supplied buffer is not long enough
+  if(!dwRet || ((long)dwSize < (long)dwRet+14)) {
+    lpszBuf[0] = '\0';
+  } else {
+    lpszTemp[lstrlen(lpszTemp)-2] = '\0';  //remove cr and newline character
+    sprintf(lpszBuf, "%s (%li)", lpszTemp, GetLastError());
+  }
+  if(lpszTemp) LocalFree((HLOCAL) lpszTemp );
+  return lpszBuf;
+}
+
+void installService(void) {
+  SC_HANDLE   schService;
+  SC_HANDLE   schSCManager;
+  TCHAR       szPath[512];
+
+  if(GetModuleFileName( NULL, szPath, sizeof(szPath) - 1) == 0) {
+     printf("Unable to install %s - %s\n",
+             name_service,
+             GetLastErrorText(szErr, sizeof(szErr)));
+     return;
+  }
+  strcat(szPath," -s");
+  schSCManager = OpenSCManager(NULL,  // machine (NULL == local)
+                               NULL,  // database (NULL == default)
+                               SC_MANAGER_ALL_ACCESS);   // access required
+  if(schSCManager) {
+    schService = CreateService(schSCManager,               // SCManager database
+                               name_service,               // name of service
+                               name_service_disp,          // name to display
+                               SERVICE_ALL_ACCESS,         // desired access
+                               SERVICE_WIN32_OWN_PROCESS,  // service type
+                               SERVICE_AUTO_START,         // start type
+                               SERVICE_ERROR_NORMAL,       // error control type
+                               szPath,                     // service's binary
+                               NULL,                       // no load ordering group
+                               NULL,                       // no tag identifier
+                               NULL,                       // dependencies
+                               NULL,                       // LocalSystem account
+                               NULL);                      // no password
+    if(schService) {
+      CloseServiceHandle(schSCManager);
+      printf("Service name (%s) instaled!\n",name_service);
+    } else {
+       printf("OpenSCManager failed - %s\n", GetLastErrorText(szErr, sizeof(szErr)));
+    }
+  }
+}
+
+void removeService(void) {
+  SC_HANDLE   schService;
+  SC_HANDLE   schSCManager;
+
+  schSCManager = OpenSCManager(NULL,          // machine (NULL == local)
+                               NULL,          // database (NULL == default)
+                               SC_MANAGER_ALL_ACCESS );  // access required
+  if(schSCManager) {
+    schService = OpenService(schSCManager, name_service, SERVICE_ALL_ACCESS);
+    if(schService) {
+      // try to stop the service
+      if(ControlService( schService, SERVICE_CONTROL_STOP, &ssStatus )) {
+        printf("Stopping %s.", name_service);
+        Sleep(100);
+        while(QueryServiceStatus(schService, &ssStatus )) {
+          if(ssStatus.dwCurrentState == SERVICE_STOP_PENDING) {
+            printf(".");
+            Sleep(100);
+          } else {
+             break;
+          }
+        }
+        if(ssStatus.dwCurrentState == SERVICE_STOPPED) {
+          printf("\n%s stopped.\n", name_service);
+        } else {
+          printf("\n%s failed to stop.\n", name_service);
+        }
+      }
+      // now remove the service
+      if(DeleteService(schService)) {
+        printf("%s removed.\n", name_service);
+      } else {
+        printf("DeleteService failed - %s\n", GetLastErrorText(szErr, sizeof(szErr)));
+      }
+      CloseServiceHandle(schService);
+    } else {
+      printf("OpenService failed - %s\n", GetLastErrorText(szErr, sizeof(szErr)));
+    }
+    CloseServiceHandle(schSCManager);
+  } else {
+    printf("OpenSCManager failed - %s\n", GetLastErrorText(szErr, sizeof(szErr)));
+  }
+}
+
diff --git a/readme b/readme
index 9cbadac40b25deb6014966f11b6c392aff473e51..1a6929eacc3947c68c09ed1a714261a425121f6a 100644 (file)
--- a/readme
+++ b/readme
@@ -8,11 +8,15 @@ RTPS is new application layer protocol targeted to real-time communication
 area, which is build on top of standard UDP stack.
 
 Which targets are supported by ORTE?
---------------------------
-Linux
+-----------------------------------
+UNIX - Linux, Solars, MacOS
 Windows - MinGW, CygWin, MSVC
-RTLinux
-RTAI - RTNet
+RTLinux - with preliminary UDP stack
+RTAI - with RTNet
+
+note: was tested on
+sparc-sun-solaris2.9
+powerpc-apple-darwin6.8
 
 How to install it?
 ------------------