openslp-1.2.1/0000755033442200000310000000000010641470757013073 5ustar rganesanfloppyopenslp-1.2.1/ltmain.sh0000644033442200000310000055031410641470757014723 0ustar rganesanfloppy# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" ##################################### # Shell function definitions: # This seems to be the best place for them # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` if test "X$win32_nmres" = "Ximport" ; then win32_libid_type="x86 archive import" else win32_libid_type="x86 archive static" fi fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $echo $win32_libid_type } # End of Shell function definitions ##################################### # Parse our command line options once, thoroughly. while test "$#" -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; tag) tagname="$arg" preserve_args="${preserve_args}=$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 exit 1 ;; esac case $tagname in CC) # Don't test for the "default" C tag, as we know, it's there, but # not specially marked. ;; *) if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`" else $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi ;; esac ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" $echo $echo "Copyright (C) 2003 Free Software Foundation, Inc." $echo "This is free software; see the source for copying conditions. There is NO" $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit 0 ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 # Now print the configurations for the tags. for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0" done exit 0 ;; --debug) $echo "$progname: enabling shell trace mode" set -x preserve_args="$preserve_args $arg" ;; --dry-run | -n) run=: ;; --features) $echo "host: $host" if test "$build_libtool_libs" = yes; then $echo "enable shared libraries" else $echo "disable shared libraries" fi if test "$build_old_libs" = yes; then $echo "enable static libraries" else $echo "disable static libraries" fi exit 0 ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: preserve_args="$preserve_args $arg" ;; --tag) prevopt="--tag" prev=tag ;; --tag=*) set tag "$optarg" ${1+"$@"} shift prev=tag preserve_args="$preserve_args --tag" ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit 1 ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit 1 fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= for arg do case "$arg_mode" in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit 1 fi arg_mode=target continue ;; -static | -prefer-pic | -prefer-non-pic) later="$later $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. base_compile="$base_compile $lastarg" continue ;; * ) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" done # for arg case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" exit 1 ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit 1 ;; *) # Get the name of the library object. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.ii) xform=ii ;; *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; *.java) xform=java ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit 1 ;; esac # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. if test -n "$available_tags" && test -z "$tagname"; then case $base_compile in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" case "$base_compile " in "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit 1 # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi for arg in $later; do case $arg in -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir= else xdir=$xdir/ fi lobj=${xdir}$objdir/$objname if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit 1 fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi $run $rm $removelist trap "$run $rm $removelist; exit 1" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit 1" 1 2 15 else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$0" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi $echo $srcfile > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi $run $rm "$libobj" "${libobj}T" # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then $show "$mv $output_obj $lobj" if $run $mv $output_obj $lobj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the PIC object to the libtool object file. test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <> ${libobj}T < /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" case $base_compile in "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) # The compiler in $compile_command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit 1 # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi # We need to know -static, to get the right output filenames. for arg do case $arg in -all-static | -static) if test "X$arg" = "X-all-static"; then if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi fi build_libtool_libs=no build_old_libs=yes prefer_static_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit 1 fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat $save_arg` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit 1 fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit 1 else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi done else $echo "$modename: link input file \`$save_arg' does not exist" exit 1 fi arg=$save_arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit 1 ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit 1 fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 exit 1 fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-mingw* | *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) deplibs="$deplibs $arg" continue ;; -module) module=yes continue ;; # gcc -m* arguments should be passed to the linker via $compiler_flags # in order to pass architecture information to the linker # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo # but this is not reliable with gcc because gcc may use -mfoo to # select a different linker, different libraries, etc, while # -Wl,-mfoo simply passes -mfoo to the linker. -m*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" if test "$with_gcc" = "yes" ; then compiler_flags="$compiler_flags $arg" fi continue ;; -shrext) prev=shrext continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit 1 ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit 1 fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit 1 else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? if test "$status" -ne 0 && test ! -d "$output_objdir"; then exit $status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit 1 ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplcations in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) duplicate_compiler_generated_deps=$duplicate_deps ;; esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit 1 ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do for search_ext in .la $shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then library_names= old_library= case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) if test "$deplibs_check_method" != pass_all; then $echo $echo "*** Warning: Trying to link with static lib archive $deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because the file extensions .$libext of this argument makes me believe" $echo "*** that it is just a static archive that I should not used here." else $echo $echo "*** Warning: Linking the shared library $output against the" $echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib'" 1>&2 exit 1 fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit 1 fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit 1 fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit 1 fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit 1 fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit 1 fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var"; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $dir" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi # This is a shared library # Warn about portability, can't link against -module's on some systems (darwin) if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi $echo "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`$echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5* ) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against it, someone # is ignoring the new warnings I added if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo $echo "** And there doesn't seem to be a static archive available" $echo "** The link will probably fail, sorry" else add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit 1 fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $echo $echo "*** Warning: This system can not link to static lib archive $lib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $echo "*** But as you try to build a module library, libtool will still create " $echo "*** a static module, that should work as long as the dlopening application" $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else convenience="$convenience $dir/$old_library" old_convenience="$old_convenience $dir/$old_library" deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="$absdir" fi depdepl= case $host in *-*-darwin*) # we do not want to link against static libs, but need to link against shared eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$path/$depdepl" ; then depdepl="$path/$depdepl" fi # do not add paths which are already there case " $newlib_search_path " in *" $path "*) ;; *) newlib_search_path="$newlib_search_path $path";; esac fi path="" ;; *) path="-L$path" ;; esac ;; -l*) case $host in *-*-darwin*) # Again, we only want to link against shared libraries eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` for tmp in $newlib_search_path ; do if test -f "$tmp/lib$tmp_libs.dylib" ; then eval depdepl="$tmp/lib$tmp_libs.dylib" break fi done path="" ;; *) continue ;; esac ;; *) continue ;; esac case " $deplibs " in *" $depdepl "*) ;; *) deplibs="$deplibs $depdepl" ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$deplibs $path" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval shared_ext=\"$shrext\" eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit 1 fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval shared_ext=\"$shrext\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit 1 else $echo $echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit 1 fi # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$2" number_minor="$3" number_revision="$4" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) current=`expr $number_major + $number_minor - 1` age="$number_minor" revision="$number_minor" ;; esac ;; no) current="$2" revision="$3" age="$4" ;; esac # Check that each of the things are valid numbers. case $current in 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac case $revision in 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac case $age in 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) major=`expr $current - $age + 1` case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$echo "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi removelist="$removelist $p" ;; *) ;; esac done if test -n "$removelist"; then $show "${rm}r $removelist" $run ${rm}r $removelist fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. for path in $notinst_path; do lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for file magic test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval $echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` done fi if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ | grep . >/dev/null; then $echo if test "X$deplibs_check_method" = "Xnone"; then $echo "*** Warning: inter-library dependencies are not supported in this platform." else $echo "*** Warning: inter-library dependencies are not known to be supported." fi $echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $echo $echo "*** Warning: libtool could not satisfy all declared inter-library" $echo "*** dependencies of module $libname. Therefore, libtool will create" $echo "*** a static module, that should work as long as the dlopening" $echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $echo "*** The inter-library dependencies that have been dropped here will be" $echo "*** automatically added whenever a program is linked with this library" $echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $echo $echo "*** Since this library must not contain undefined symbols," $echo "*** because either the platform does not support them or" $echo "*** it was explicitly requested with -no-undefined," $echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi test -z "$dlname" && dlname=$soname shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? skipped_export=false else # The command line is too long to execute in one step. $show "using reloadable object file for export list..." skipped_export=: fi done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "$mkdir $xdir" $run $mkdir "$xdir" status=$? if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi # We will extract separately just the conflicting names and we will no # longer touch any unique names. It is faster to leave these extract # automatically by $AR in one run. $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 $AR t "$xabs" | sort | uniq -cd | while read -r count name do i=1 while test "$i" -le "$count" do # Put our $i before any first dot (extension) # Never overwrite any file name_to="$name" while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" do name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` done $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? i=`expr $i + 1` done done fi libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise. $echo "creating reloadable object files..." # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= delfiles= last_robj= k=1 output=$output_objdir/$save_output-${k}.$objext # Loop over the list of objects to be linked. for obj in $save_libobjs do eval test_cmds=\"$reload_cmds $objlist $last_robj\" if test "X$objlist" = X || { len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi last_robj=$output_objdir/$save_output-${k}.$objext k=`expr $k + 1` output=$output_objdir/$save_output-${k}.$objext objlist=$obj len=1 fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output # Append the command to create the export file. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi # Set up a command to remove the reloadale object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" done $echo "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi # Append the command to remove the reloadable object files # to the just-reset $cmds. eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? exit 0 fi # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? exit 0 fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit 1 fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "$mkdir $xdir" $run $mkdir "$xdir" status=$? if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi # We will extract separately just the conflicting names and we will no # longer touch any unique names. It is faster to leave these extract # automatically by $AR in one run. $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 $AR t "$xabs" | sort | uniq -cd | while read -r count name do i=1 while test "$i" -le "$count" do # Put our $i before any first dot (extension) # Never overwrite any file name_to="$name" while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" do name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` done $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? i=`expr $i + 1` done done fi reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit 0 fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $run eval "echo timestamp > $libobj" || exit $? exit 0 fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit 0 ;; prog) case $host in *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors if test "$tagname" = CXX ; then compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" fi ;; esac compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$output.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' else $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval '$echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else $echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit 1 ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit 0 fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $0 --fallback-echo"; then case $0 in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; *) qecho="$SHELL `pwd`/$0 --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) cwrappersource=`$echo ${objdir}/lt-${output}.c` cwrapper=`$echo ${output}.exe` $rm $cwrappersource $cwrapper trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15 cat > $cwrappersource <> $cwrappersource<<"EOF" #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef DIR_SEPARATOR #define DIR_SEPARATOR '/' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) #define HAVE_DOS_BASED_FILE_SYSTEM #ifndef DIR_SEPARATOR_2 #define DIR_SEPARATOR_2 '\\' #endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); char * basename (const char *name); char * fnqualify(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); int main (int argc, char *argv[]) { char **newargz; int i; program_name = (char *) xstrdup ((char *) basename (argv[0])); newargz = XMALLOC(char *, argc+2); EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" newargz[1] = fnqualify(argv[0]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" } void * xmalloc (size_t num) { void * p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL ; } char * basename (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha (name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return (char *) base; } char * fnqualify(const char *path) { size_t size; char *p; char tmp[LT_PATHMAX + 1]; assert(path != NULL); /* Is it qualified already? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha (path[0]) && path[1] == ':') return xstrdup (path); #endif if (IS_DIR_SEPARATOR (path[0])) return xstrdup (path); /* prepend the current directory */ /* doesn't handle '~' */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ p = XMALLOC(char, size); sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); return p; } char * strendzap(char *str, const char *pat) { size_t len, patlen; assert(str != NULL); assert(pat != NULL); len = strlen(str); patlen = strlen(pat); if (patlen <= len) { str += len - patlen; if (strcmp(str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char * mode, const char * message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $run $LTCC -s -o $cwrapper $cwrappersource ;; esac $rm $output trap "$rm $output; exit 1" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" $echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit 1 fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else $echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 ${SED} $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \$progdir\\\\\$program \${1+\"\$@\"} " ;; *) $echo >> $output "\ exec \$progdir/\$program \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit 1 fi else # The program doesn't exist. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " chmod +x $output fi exit 0 ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" # Add in members from convenience archives. for xlib in $addlibs; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "$mkdir $xdir" $run $mkdir "$xdir" status=$? if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi # We will extract separately just the conflicting names and we will no # longer touch any unique names. It is faster to leave these extract # automatically by $AR in one run. $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 $AR t "$xabs" | sort | uniq -cd | while read -r count name do i=1 while test "$i" -le "$count" do # Put our $i before any first dot (extension) # Never overwrite any file name_to="$name" while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" do name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` done $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? i=`expr $i + 1` done done fi oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` done fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs # GNU ar 2.10+ was changed to match POSIX; thus no paths are # encoded into archives. This makes 'ar r' malfunction in # this piecewise linking case whenever conflicting object # names appear in distinct ar calls; check, warn and compensate. if (for obj in $save_oldobjs do $echo "X$obj" | $Xsed -e 's%^.*/%%' done | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2 AR_FLAGS=cq fi # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done for obj in $save_oldobjs do oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" if len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do eval cmd=\"$cmd\" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $0 $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit 0 ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg="$nonopt" fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest="$arg" continue fi case $arg in -d) isdir=yes ;; -f) prev="-f" ;; -g) prev="-g" ;; -m) prev="-m" ;; -o) prev="-o" ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest="$arg" continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit 1 fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit 1 fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit 1 fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit 1 fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit 1 fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit 0 ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then file=`$echo $file|${SED} 's,.exe$,,'` stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # To insure that "foo" is sourced, and not "foo.exe", # finese the cygwin/MSYS system by explicitly sourcing "foo." # which disallows the automatic-append-.exe behavior. case $build in *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; *) wrapperdot=${wrapper} ;; esac # If there is no directory component, then add one. case $file in */* | *\\*) . ${wrapperdot} ;; *) . ./${wrapperdot} ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit 1 fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # To insure that "foo" is sourced, and not "foo.exe", # finese the cygwin/MSYS system by explicitly sourcing "foo." # which disallows the automatic-append-.exe behavior. case $build in *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; *) wrapperdot=${wrapper} ;; esac # If there is no directory component, then add one. case $file in */* | *\\*) . ${wrapperdot} ;; *) . ./${wrapperdot} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir="/tmp" test -n "$TMPDIR" && tmpdir="$TMPDIR" if tmpdir=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null`; then : else tmpdir="$tmpdir/libtool-$$" if $mkdir "$tmpdir" && chmod 700 "$tmpdir"; then : else $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi fi file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyways case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $0 $preserve_args --finish$current_libdirs' else exit 0 fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = ":" && exit 0 $echo "----------------------------------------------------------------------" $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" done $echo $echo "If you ever happen to want to link against installed libraries" $echo "in a given directory, LIBDIR, you must either use libtool, and" $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" $echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" $echo " during execution" fi if test -n "$runpath_var"; then $echo " - add LIBDIR to the \`$runpath_var' environment variable" $echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "----------------------------------------------------------------------" exit 0 ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit 1 fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit 1 fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit 1 fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit 1 fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # Now prepare to actually exec the command. exec_cmd="\"\$cmd\"$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi eval \$echo \"\$cmd\"$args exit 0 fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit 1 fi rmdirs= origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$origobjdir" else objdir="$dir/$origobjdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" if test "$mode" = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. fi fi ;; *.lo) # Possibly a libtool object, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file . $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" \ && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" \ && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit 1 ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit 1 fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit 1 fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --tag=TAG use configuration variables from tag TAG --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE. Report bugs to ." exit 0 ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." exit 0 # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: openslp-1.2.1/INSTALL0000644033442200000310000001742507332025333014122 0ustar rganesanfloppyBasic Installation ================== These are generic installation instructions. Please read more detailed documentation at: http://www.openslp.org/doc/html/UsersGuide/Installation.html The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./autogen.sh' then `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. openslp-1.2.1/README.W320000644033442200000310000000661510204465511014320 0ustar rganesanfloppyAnnouncement (Updated 8 Feb 2005) --------------------------------- The reasons for full Win32 support are _still_ valid: Namely, primarily that Microsoft insists on supporting location protocols other than the one designed by the IETF. The hope is that by offering a really good port of OpenSLP, Microsoft enslaved developers and partners will have some ammunition to fight proprietary or otherwise non-interoperable protocols. Current State ------------- Currently the OpenSLP code base does work on Win32 with the same functionality as OpenSLP on Linux, with one exception. The lex/yacc files that were originally written by Michael Day, which define the attribute language parser are not used on Win32 (for lack of tools). Rather, the original hand-coded version of this parser is being used. I'd be grateful if someone would please help me get a version of the gbod stuff working - one way or another :) Schedule -------- Maintain simultaneous development with linux/unix from now on. Building -------- As of OpenSLP 1.2.1, an MS Visual Studio .NET 2003 "solution" (openslp.sln) and associated project files (*.vcproj) are provided in the win32 directory structure. The older MSVC 6.0 workspace and project files still exist, but need to be updated in minor ways. Please feel free to help if you wish. I no longer have time to maintain the older VC6 project files. They will be removed eventually - especially now that MS is giving away newer versions of their tools. (see http://msdn.microsoft.com/visualc/vctoolkit2003). From the command line, within the win32 directory, you may run the "m.bat" script to build the default "Release" configuration. If you want a full debug build, add "Debug" as an argument. This will invoke nmake for the appropriate project under vc6 (again, I'm not sure if this still works), or if you have VC7x installed, m.bat will detect it through the presence of the DevEnvDir environment variable, and run the DevEnv.exe utility with the /build command-line option. NOTE: For some unknown reason, on my system, if I invoke the DevEnv utility from a batch file in this manner, it compiles very quietly - that is, there is _no_ output, but it works. If you invoke "DevEnv openslp.sln /build" directly from the command line, you will see each file name as it's compiled. I'm sure there's some logical reasoning behind this design decision... Installing ---------- There is currently still no installation application for OpenSLP on Windows. Hopefully, there will be time to write one in the 1.3.0 developer line before we transition to a full release in 1.4.0. Right now, for the library, all you have to do is copy the slp.h slp.lib and slp.dll files to the appropriate locations for your client application code to consume them. slpd is pretty trivial to install now that we have a command line interface to the service registry, so it's easy as 1, 2, 3 (literally): 1. Copy slp.reg and slp.conf to %SystemRoot% 2. Copy slpd.exe to %SystemRoot%/System32 3. From this location, execute: "slpd.exe --install [auto]" Note that the log file (slpd.log) will be created in %SystemRoot%. Credits ------- The work currently being done on the Win32 port in no way invalidates the tremendous contribution of Matthieu Desmons who did the original port of the 0.7.x codebase. Most of the actual code changes can still be attributed to him -- not to mention the initive to to show that the port was actually possible. openslp-1.2.1/Makefile.am0000644033442200000310000000217610207715265015127 0ustar rganesanfloppy# # Makefile # Note the install script, it is not pretty, but it works. # SUBDIRS = common libslpattr slpd libslp slptool test EXTRA_DIST = win32 doc etc README.W32 FAQ DOC_DIR = $(prefix)/doc/openslp-$(VERSION) install-data-local: mkdir -p $(DESTDIR)$(sysconfdir) file=$(DESTDIR)$(sysconfdir)/slp.reg; \ if [ -f $$file ]; then true; \ else cp -f $(srcdir)/etc/slp.reg $(DESTDIR)$(sysconfdir); \ fi file=$(DESTDIR)$(sysconfdir)/slp.conf; \ if [ -f $$file ]; then true; \ else cp -f $(srcdir)/etc/slp.conf $(DESTDIR)$(sysconfdir);\ fi file=$(DESTDIR)$(sysconfdir)/slp.spi; \ if [ -f $$file ]; then true; \ else cp -f $(srcdir)/etc/slp.spi $(DESTDIR)$(sysconfdir); \ fi rm -rf $(DESTDIR)$(DOC_DIR) mkdir -p $(DESTDIR)$(DOC_DIR) cp -r $(srcdir)/doc/* $(DESTDIR)$(DOC_DIR) rm -rf `find $(DESTDIR)$(DOC_DIR) -name CVS` dist-hook: -rm -rf `find $(distdir)/doc -name CVS` -rm -rf `find $(distdir)/etc -name CVS` -rm -rf `find $(distdir)/win32 -name CVS` chmod -R og-w $(distdir) openslp-1.2.1/AUTHORS0000644033442200000310000000367210207720370014136 0ustar rganesanfloppy========================================================================== AUTHORS OpenSLP recognizes the following OpenSLP individuals and organizations for their source code contributions. The following are also those that have or have had CVS commit access to the OpenSLP source code ========================================================================== Caldera Systems, Inc 240 West Center St Orem, Utah 84057 http://www.calderasystems.com ----------------------------- Funded original development of OpenSLP source code and continues to fund maintenance and enhancement of the OpenSLP project Matthew Peterson ----------------------------------------------- Original OpenSLP maintainer and principal author of code contributed by Caldera Systems, Inc. Ganesan Rajagopal -------------------------------------------- Author of the SLPv1 compatibility code, the OpenSLP make system, numerous platform and architecture ports (including 64-bit), and countless bug fixes. David McCormack ------------------------------------------------ Author of original test suite, some libslp features and many bug fixes Evan Hughes ------------------------------ Contributed all of the predicate parsing and LDAPv3 filter code Matthieu Desmons -------------------------------- Contributed major code changes for the original Win32 port Praveen Kumar Amritaluru ----------------------------------------------- Has provided extremely good testing coverage and continues to submits patches from time to time that fix otherwise hard to find bugs John Calcote ---------------------------------- Excellent DHCP code and Win32 porting work! Michael Schroeder ------------------------------- Has submitted chroot functionality to plug security holes and provide zeroconf functionality. openslp-1.2.1/slptool/0000755033442200000310000000000010211377553014560 5ustar rganesanfloppyopenslp-1.2.1/slptool/Makefile.am0000644033442200000310000000045410202047562016611 0ustar rganesanfloppy# # Makefile.am # Automake File # The linked in library libslp is from ../libslp # EXTRA_DIST = bin_PROGRAMS = slptool INCLUDES = -I$(top_srcdir)/libslp slptool_SOURCES = slptool.c slptool.h slptool_LDADD = ../libslp/libslp.la ../common/libcommonlibslp.la ../common/libcommonslpd.la openslp-1.2.1/slptool/slptool.c0000644033442200000310000007243610207404661016430 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP command line UA wrapper */ /* */ /* File: slptool.c */ /* */ /* Abstract: Command line wrapper for OpenSLP */ /* */ /* Requires: OpenSLP installation */ /* */ /* Author(s): Matt Peterson */ /* */ /* Copyright (c) 1995, 1999 Caldera Systems, Inc. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU Lesser General Public License as published */ /* by the Free Software Foundation; either version 2.1 of the License, or */ /* (at your option) any later version. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* You should have received a copy of the GNU Lesser General Public */ /* License along with this program; see the file COPYING. If not, */ /* please obtain a copy from http://www.gnu.org/copyleft/lesser.html */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to maintainer of http://www.openslp.org */ /* */ /***************************************************************************/ #include "slptool.h" #ifdef _WIN32 # define strncasecmp(String1, String2, Num) strnicmp(String1, String2, Num) # define strcasecmp(String1, String2) stricmp(String1, String2) # define inet_aton(opt,bind) ((bind)->s_addr = inet_addr(opt)) #else # ifdef HAVE_CONFIG_H # include "config.h" # define SLP_VERSION VERSION # else # define SLP_VERSION 1.2.1 # endif # ifndef HAVE_STRNCASECMP int strncasecmp(const char *s1, const char *s2, size_t len); # endif # ifndef HAVE_STRCASECMP int strcasecmp(const char *s1, const char *s2); # endif #endif /*=========================================================================*/ SLPBoolean mySrvTypeCallback( SLPHandle hslp, const char* srvtypes, SLPError errcode, void* cookie ) /*=========================================================================*/ { char* cpy; char* slider1; char* slider2; if(errcode == SLP_OK && *srvtypes) { cpy = strdup(srvtypes); if(cpy) { slider1 = slider2 = cpy; slider1 = strchr(slider2,','); while(slider1) { *slider1 = 0; printf("%s\n",slider2); slider1 ++; slider2 = slider1; slider1 = strchr(slider2,','); } /* print the final itam */ printf("%s\n",slider2); free(cpy); } } return SLP_TRUE; } /*=========================================================================*/ void FindSrvTypes(SLPToolCommandLine* cmdline) /*=========================================================================*/ { SLPError result; SLPHandle hslp; if(SLPOpen(cmdline->lang,SLP_FALSE,&hslp) == SLP_OK) { if(cmdline->cmdparam1) { result = SLPFindSrvTypes(hslp, cmdline->cmdparam1, cmdline->scopes, mySrvTypeCallback, 0); } else { result = SLPFindSrvTypes(hslp, "*", cmdline->scopes, mySrvTypeCallback, 0); } if(result != SLP_OK) { printf("errorcode: %i\n",result); } SLPClose(hslp); } } #ifndef UNICAST_NOT_SUPPORTED /*=========================================================================*/ void UnicastFindSrvTypes(SLPToolCommandLine* cmdline) /*=========================================================================*/ { SLPError result; SLPHandle hslp; if(SLPOpen(cmdline->lang,SLP_FALSE,&hslp) == SLP_OK) { if((result = SLPAssociateIP(hslp, cmdline->cmdparam3)) != SLP_OK) { printf("errorcode: %i\n",result); SLPClose(hslp); return; } if(cmdline->cmdparam1) { result = SLPFindSrvTypes(hslp, cmdline->cmdparam1, cmdline->scopes, mySrvTypeCallback, 0); } else { result = SLPFindSrvTypes(hslp, "*", cmdline->scopes, mySrvTypeCallback, 0); } if(result != SLP_OK) { printf("errorcode: %i\n",result); } SLPClose(hslp); } } #endif #ifndef MI_NOT_SUPPORTED /*=========================================================================*/ void FindSrvTypesUsingIFList(SLPToolCommandLine* cmdline) /*=========================================================================*/ { SLPError result; SLPHandle hslp; if(SLPOpen(cmdline->lang,SLP_FALSE,&hslp) == SLP_OK) { if((result = SLPAssociateIFList(hslp, cmdline->cmdparam3)) != SLP_OK) { printf("errorcode: %i\n",result); SLPClose(hslp); return; } if(cmdline->cmdparam1) { result = SLPFindSrvTypes(hslp, cmdline->cmdparam1, cmdline->scopes, mySrvTypeCallback, 0); } else { result = SLPFindSrvTypes(hslp, "*", cmdline->scopes, mySrvTypeCallback, 0); } if(result != SLP_OK) { printf("errorcode: %i\n",result); } SLPClose(hslp); } } #endif /* MI_NOT_SUPPORTED */ /*=========================================================================*/ SLPBoolean myAttrCallback(SLPHandle hslp, const char* attrlist, SLPError errcode, void* cookie ) /*=========================================================================*/ { if(errcode == SLP_OK) { printf("%s\n",attrlist); } return SLP_TRUE; } /*=========================================================================*/ void FindAttrs(SLPToolCommandLine* cmdline) /*=========================================================================*/ { SLPError result; SLPHandle hslp; if(SLPOpen(cmdline->lang,SLP_FALSE,&hslp) == SLP_OK) { result = SLPFindAttrs(hslp, cmdline->cmdparam1, cmdline->scopes, cmdline->cmdparam2, myAttrCallback, 0); if(result != SLP_OK) { printf("errorcode: %i\n",result); } SLPClose(hslp); } } #ifndef UNICAST_NOT_SUPPORTED /*=========================================================================*/ void UnicastFindAttrs(SLPToolCommandLine* cmdline) /*=========================================================================*/ { SLPError result; SLPHandle hslp; if(SLPOpen(cmdline->lang,SLP_FALSE,&hslp) == SLP_OK) { if((result = SLPAssociateIP(hslp, cmdline->cmdparam3)) != SLP_OK) { printf("errorcode: %i\n",result); SLPClose(hslp); return; } result = SLPFindAttrs(hslp, cmdline->cmdparam1, cmdline->scopes, cmdline->cmdparam2, myAttrCallback, 0); if(result != SLP_OK) { printf("errorcode: %i\n",result); } SLPClose(hslp); } } #endif #ifndef MI_NOT_SUPPORTED /*=========================================================================*/ void FindAttrsUsingIFList(SLPToolCommandLine* cmdline) /*=========================================================================*/ { SLPError result; SLPHandle hslp; if(SLPOpen(cmdline->lang,SLP_FALSE,&hslp) == SLP_OK) { if((result = SLPAssociateIFList(hslp, cmdline->cmdparam3)) != SLP_OK) { printf("errorcode: %i\n",result); SLPClose(hslp); return; } result = SLPFindAttrs(hslp, cmdline->cmdparam1, cmdline->scopes, cmdline->cmdparam2, myAttrCallback, 0); if(result != SLP_OK) { printf("errorcode: %i\n",result); } SLPClose(hslp); } } #endif /* MI_NOT_SUPPORTED */ /*=========================================================================*/ SLPBoolean mySrvUrlCallback( SLPHandle hslp, const char* srvurl, unsigned short lifetime, SLPError errcode, void* cookie ) /*=========================================================================*/ { if(errcode == SLP_OK) { printf("%s,%i\n",srvurl,lifetime); } return SLP_TRUE; } /*=========================================================================*/ void FindSrvs(SLPToolCommandLine* cmdline) /*=========================================================================*/ { SLPError result; SLPHandle hslp; if(SLPOpen(cmdline->lang,SLP_FALSE,&hslp) == SLP_OK) { result = SLPFindSrvs(hslp, cmdline->cmdparam1, cmdline->scopes, cmdline->cmdparam2, mySrvUrlCallback, 0); if(result != SLP_OK) { printf("errorcode: %i\n",result); } SLPClose(hslp); } } #ifndef MI_NOT_SUPPORTED /*=========================================================================*/ void FindSrvsUsingIFList(SLPToolCommandLine* cmdline) /*=========================================================================*/ { SLPError result; SLPHandle hslp; if(SLPOpen(cmdline->lang,SLP_FALSE,&hslp) == SLP_OK) { if((result = SLPAssociateIFList(hslp, cmdline->cmdparam3)) != SLP_OK) { printf("errorcode: %i\n",result); SLPClose(hslp); return; } result = SLPFindSrvs(hslp, cmdline->cmdparam1, cmdline->scopes, cmdline->cmdparam2, mySrvUrlCallback, 0); if(result != SLP_OK) { printf("errorcode: %i\n",result); } SLPClose(hslp); } } #endif /* MI_NOT_SUPPORTED */ #ifndef UNICAST_NOT_SUPPORTED /*=========================================================================*/ void UnicastFindSrvs(SLPToolCommandLine* cmdline) /*=========================================================================*/ { SLPError result; SLPHandle hslp; if(SLPOpen(cmdline->lang,SLP_FALSE,&hslp) == SLP_OK) { if((result = SLPAssociateIP(hslp, cmdline->cmdparam3)) != SLP_OK) { printf("errorcode: %i\n",result); SLPClose(hslp); return; } result = SLPFindSrvs(hslp, cmdline->cmdparam1, cmdline->scopes, cmdline->cmdparam2, mySrvUrlCallback, 0); if(result != SLP_OK) { printf("errorcode: %i\n",result); } SLPClose(hslp); } } #endif /*=========================================================================*/ void FindScopes(SLPToolCommandLine* cmdline) /*=========================================================================*/ { SLPError result; SLPHandle hslp; char* scopes; if(SLPOpen(cmdline->lang,SLP_FALSE,&hslp) == SLP_OK) { result = SLPFindScopes(hslp,&scopes); if(result == SLP_OK) { printf("%s\n",scopes); SLPFree(scopes); } SLPClose(hslp); } } /*-------------------------------------------------------------------------*/ void mySLPRegReport(SLPHandle hslp, SLPError errcode, void* cookie) { if (errcode) printf("(de)registration errorcode %d\n", errcode); } /*=========================================================================*/ void Register(SLPToolCommandLine* cmdline) /*=========================================================================*/ { SLPError result; SLPHandle hslp; char srvtype[80] = "", *s; int len = 0; if (strncasecmp(cmdline->cmdparam1, "service:", 8) == 0) len = 8; s = strchr(cmdline->cmdparam1 + len, ':'); if (!s) { printf("Invalid URL: %s\n", cmdline->cmdparam1); return; } len = s - cmdline->cmdparam1; strncpy(srvtype, cmdline->cmdparam1, len); srvtype[len] = 0; if(SLPOpen(cmdline->lang,SLP_FALSE,&hslp) == SLP_OK) { result = SLPReg(hslp, cmdline->cmdparam1, SLP_LIFETIME_MAXIMUM, srvtype, cmdline->cmdparam2, SLP_TRUE, mySLPRegReport, 0); if(result != SLP_OK) { printf("errorcode: %i\n",result); } SLPClose(hslp); } } /*=========================================================================*/ void Deregister(SLPToolCommandLine* cmdline) /*=========================================================================*/ { SLPError result; SLPHandle hslp; if(SLPOpen(cmdline->lang,SLP_FALSE,&hslp) == SLP_OK) { result = SLPDereg(hslp, cmdline->cmdparam1, mySLPRegReport, 0); if(result != SLP_OK) { printf("errorcode: %i\n",result); } SLPClose(hslp); } } /*=========================================================================*/ void PrintVersion(SLPToolCommandLine* cmdline) /*=========================================================================*/ { printf("slptool version = %s\n", SLP_VERSION); printf("libslp version = %s\n", SLPGetProperty("net.slp.OpenSLPVersion")); printf("libslp configuration file = %s\n", SLPGetProperty("net.slp.OpenSLPConfigFile")); } /*=========================================================================*/ void GetProperty(SLPToolCommandLine* cmdline) /*=========================================================================*/ { const char* propertyValue; propertyValue = SLPGetProperty(cmdline->cmdparam1); printf("%s = %s\n", cmdline->cmdparam1, propertyValue == 0 ? "" : propertyValue); } /*=========================================================================*/ int ParseCommandLine(int argc,char* argv[], SLPToolCommandLine* cmdline) /* Returns Zero on success. Non-zero on error. */ /*=========================================================================*/ { int i; if(argc < 2) { /* not enough arguments */ return 1; } for (i=1;icmd = PRINT_VERSION; return 0; } else { return 1; } } else if( strcasecmp(argv[i],"-s") == 0 || strcasecmp(argv[i],"--scopes") == 0 ) { i++; if(i < argc) { cmdline->scopes = argv[i]; } else { return 1; } } else if( strcasecmp(argv[i],"-l") == 0 || strcasecmp(argv[i],"--lang") == 0 ) { i++; if(i < argc) { cmdline->lang = argv[i]; } else { return 1; } } else if(strcasecmp(argv[i],"findsrvs") == 0) { cmdline->cmd = FINDSRVS; /* service type */ i++; if(i < argc) { cmdline->cmdparam1 = argv[i]; } else { return 1; } /* (optional) filter */ i++; if(i < argc) { cmdline->cmdparam2 = argv[i]; } break; } #ifndef MI_NOT_SUPPORTED else if(strcasecmp(argv[i],"findsrvsusingiflist") == 0) { cmdline->cmd = FINDSRVSUSINGIFLIST; /* (required) IFList */ i++; if(i < argc) { cmdline->cmdparam3 = argv[i]; } else { return 1; } /* service type */ i++; if(i < argc) { cmdline->cmdparam1 = argv[i]; } else { return 1; } /* (optional) filter */ i++; if(i < argc) { cmdline->cmdparam2 = argv[i]; } break; } #endif /* MI_NOT_SUPPORTED */ #ifndef UNICAST_NOT_SUPPORTED else if(strcasecmp(argv[i],"unicastfindsrvs") == 0) { cmdline->cmd = UNICASTFINDSRVS; i++; if(i < argc) { cmdline->cmdparam3 = argv[i]; } else { return 1; } /* service type */ i++; if(i < argc) { cmdline->cmdparam1 = argv[i]; } else { return 1; } /* optional filter */ i++; if(i < argc) { cmdline->cmdparam2 = argv[i]; } break; } #endif else if(strcasecmp(argv[i],"findattrs") == 0) { cmdline->cmd = FINDATTRS; /* url or service type */ i++; if(i < argc) { cmdline->cmdparam1 = argv[i]; } else { return 1; } /* (optional) attrids */ i++; if(i < argc) { cmdline->cmdparam2 = argv[i]; } } #ifndef UNICAST_NOT_SUPPORTED else if(strcasecmp(argv[i],"unicastfindattrs") == 0) { cmdline->cmd = UNICASTFINDATTRS; /* unicast IP address */ i++; if(i < argc) { cmdline->cmdparam3 = argv[i]; } else { return 1; } /* url or service type */ i++; if(i < argc) { cmdline->cmdparam1 = argv[i]; } else { return 1; } /* optional filter */ i++; if(i < argc) { cmdline->cmdparam2 = argv[i]; } break; } #endif #ifndef MI_NOT_SUPPORTED else if(strcasecmp(argv[i],"findattrsusingiflist") == 0) { cmdline->cmd = FINDATTRSUSINGIFLIST; /* (required) IFList */ i++; if(i < argc) { cmdline->cmdparam3 = argv[i]; } else { return 1; } /* url or service type */ i++; if(i < argc) { cmdline->cmdparam1 = argv[i]; } else { return 1; } /* (optional) attrids */ i++; if(i < argc) { cmdline->cmdparam2 = argv[i]; } } #endif /* MI_NOT_SUPPORTED */ else if(strcasecmp(argv[i],"findsrvtypes") == 0) { cmdline->cmd = FINDSRVTYPES; /* (optional) naming authority */ i++; if(i < argc) { cmdline->cmdparam1 = argv[i]; } } #ifndef UNICAST_NOT_SUPPORTED else if(strcasecmp(argv[i],"unicastfindsrvtypes") == 0) { cmdline->cmd = UNICASTFINDSRVTYPES; /* unicast IP address */ i++; if(i < argc) { cmdline->cmdparam3 = argv[i]; } else { return 1; } /* (optional) naming authority */ i++; if(i < argc) { cmdline->cmdparam1 = argv[i]; } } #endif #ifndef MI_NOT_SUPPORTED else if(strcasecmp(argv[i],"findsrvtypesusingiflist") == 0) { cmdline->cmd = FINDSRVTYPESUSINGIFLIST; /* (required) IFList */ i++; if(i < argc) { cmdline->cmdparam3 = argv[i]; } else { return 1; } /* (optional) naming authority */ i++; if(i < argc) { cmdline->cmdparam1 = argv[i]; } } #endif /* MI_NOT_SUPPORTED */ else if(strcasecmp(argv[i],"findscopes") == 0) { cmdline->cmd = FINDSCOPES; } else if(strcasecmp(argv[i],"register") == 0) { cmdline->cmd = REGISTER; /* url */ i++; if(i < argc) { cmdline->cmdparam1 = argv[i]; } else { return 1; } /* Optional attrids */ i++; if(i < argc) { cmdline->cmdparam2 = argv[i]; } else { cmdline->cmdparam2 = cmdline->cmdparam1 + strlen(cmdline->cmdparam1); } break; } else if(strcasecmp(argv[i],"deregister") == 0) { cmdline->cmd = DEREGISTER; /* url */ i++; if(i < argc) { cmdline->cmdparam1 = argv[i]; } else { return 1; } } else if(strcasecmp(argv[i],"getproperty") == 0) { cmdline->cmd = GETPROPERTY; i++; if(i < argc) { cmdline->cmdparam1 = argv[i]; } else { return 1; } } else { return 1; } } return 0; } /*=========================================================================*/ void DisplayUsage() /*=========================================================================*/ { printf("Usage: slptool [options] command-and-arguments \n"); printf(" options may be:\n"); printf(" -v (or --version) displays version of slptool and OpenSLP\n"); printf(" -s (or --scope) followed by a comma separated list of scopes\n"); printf(" -l (or --language) followed by a language tag\n"); printf(" command-and-arguments may be:\n"); printf(" findsrvs service-type [filter]\n"); #ifndef MI_NOT_SUPPORTED printf(" findsrvsusingiflist interface-list service-type [filter]\n"); #endif /* MI_NOT_SUPPORTED */ #ifndef UNICAST_NOT_SUPPORTED printf(" unicastfindsrvs ip-address service-type [filter]\n"); #endif printf(" findattrs url [attrids]\n"); #ifndef UNICAST_NOT_SUPPORTED printf(" unicastfindattrs ip-address url [attrids]\n"); #endif #ifndef MI_NOT_SUPPORTED printf(" findattrsusingiflist interface-list url [attrids]\n"); #endif /* MI_NOT_SUPPORTED */ printf(" findsrvtypes [authority]\n"); #ifndef UNICAST_NOT_SUPPORTED printf(" unicastfindsrvtypes [authority]\n"); #endif #ifndef MI_NOT_SUPPORTED printf(" findsrvtypesusingiflist interface-list [authority]\n"); #endif /* MI_NOT_SUPPORTED */ printf(" findscopes\n"); printf(" register url [attrs]\n"); printf(" deregister url\n"); printf(" getproperty propertyname\n"); printf("Examples:\n"); printf(" slptool register service:myserv.x://myhost.com \"(attr1=val1),(attr2=val2)\"\n"); printf(" slptool findsrvs service:myserv.x\n"); printf(" slptool findsrvs service:myserv.x \"(attr1=val1)\"\n"); #ifndef MI_NOT_SUPPORTED printf(" slptool findsrvsusingiflist 10.77.13.240,192.168.250.240 service:myserv.x\n"); printf(" slptool findsrvsusingiflist 10.77.13.243 service:myserv.x \"(attr1=val1)\"\n"); #endif /* MI_NOT_SUPPORTED */ #ifndef UNICAST_NOT_SUPPORTED printf(" slptool unicastfindsrvs 10.77.13.237 service:myserv.x\n"); printf(" slptool unicastfindsrvs 10.77.13.237 service:myserv.x \"(attr1=val1)\"\n"); #endif printf(" slptool findattrs service:myserv.x://myhost.com\n"); printf(" slptool findattrs service:myserv.x://myhost.com attr1\n"); #ifndef UNICAST_NOT_SUPPORTED printf(" slptool unicastfindattrs 10.77.13.237 service:myserv.x\n"); printf(" slptool unicastfindattrs 10.77.13.237 service:myserv.x://myhost.com attr1 \n"); #endif #ifndef MI_NOT_SUPPORTED printf(" slptool findattrsusingiflist 10.77.13.240,192.168.250.240 service:myserv.x://myhost.com\n"); printf(" slptool findattrsusingiflist 10.77.13.243 service:myserv.x://myhost.com attr1\n"); #endif /* MI_NOT_SUPPORTED */ printf(" slptool deregister service:myserv.x://myhost.com\n"); printf(" slptool getproperty net.slp.useScopes\n"); } /*=========================================================================*/ int main(int argc, char* argv[]) /*=========================================================================*/ { int result; SLPToolCommandLine cmdline; /* zero out the cmdline */ memset(&cmdline,0,sizeof(cmdline)); /* Parse the command line */ if(ParseCommandLine(argc,argv,&cmdline) == 0) { switch(cmdline.cmd) { case FINDSRVS: FindSrvs(&cmdline); break; #ifndef UNICAST_NOT_SUPPORTED case UNICASTFINDSRVS: UnicastFindSrvs(&cmdline); break; #endif case FINDATTRS: FindAttrs(&cmdline); break; #ifndef UNICAST_NOT_SUPPORTED case UNICASTFINDATTRS: UnicastFindAttrs(&cmdline); break; #endif case FINDSRVTYPES: FindSrvTypes(&cmdline); break; #ifndef UNICAST_NOT_SUPPORTED case UNICASTFINDSRVTYPES: UnicastFindSrvTypes(&cmdline); break; #endif case FINDSCOPES: FindScopes(&cmdline); break; case GETPROPERTY: GetProperty(&cmdline); break; case REGISTER: Register(&cmdline); break; case DEREGISTER: Deregister(&cmdline); break; #ifndef MI_NOT_SUPPORTED case FINDSRVSUSINGIFLIST: FindSrvsUsingIFList(&cmdline); break; case FINDATTRSUSINGIFLIST: FindAttrsUsingIFList(&cmdline); break; case FINDSRVTYPESUSINGIFLIST: FindSrvTypesUsingIFList(&cmdline); break; #endif /* MI_NOT_SUPPORTED */ case PRINT_VERSION: PrintVersion(&cmdline); break; case DUMMY: break; } } else { DisplayUsage(); result = 1; } return 0; } openslp-1.2.1/slptool/Makefile.in0000644033442200000310000003466710211377471016644 0ustar rganesanfloppy# Makefile.in generated by automake 1.8.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # # Makefile.am # Automake File # The linked in library libslp is from ../libslp # SOURCES = $(slptool_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_triplet = @host@ bin_PROGRAMS = slptool$(EXEEXT) subdir = slptool DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(mkdir_p) CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_slptool_OBJECTS = slptool.$(OBJEXT) slptool_OBJECTS = $(am_slptool_OBJECTS) slptool_DEPENDENCIES = ../libslp/libslp.la \ ../common/libcommonlibslp.la ../common/libcommonslpd.la DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/slptool.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(slptool_SOURCES) DIST_SOURCES = $(slptool_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_ASYNC_API_FALSE = @ENABLE_ASYNC_API_FALSE@ ENABLE_ASYNC_API_TRUE = @ENABLE_ASYNC_API_TRUE@ ENABLE_PREDICATES_FALSE = @ENABLE_PREDICATES_FALSE@ ENABLE_PREDICATES_TRUE = @ENABLE_PREDICATES_TRUE@ ENABLE_SLPv1_FALSE = @ENABLE_SLPv1_FALSE@ ENABLE_SLPv1_TRUE = @ENABLE_SLPv1_TRUE@ ENABLE_SLPv2_SECURITY_FALSE = @ENABLE_SLPv2_SECURITY_FALSE@ ENABLE_SLPv2_SECURITY_TRUE = @ENABLE_SLPv2_SECURITY_TRUE@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ EXTRA_DIST = INCLUDES = -I$(top_srcdir)/libslp slptool_SOURCES = slptool.c slptool.h slptool_LDADD = ../libslp/libslp.la ../common/libcommonlibslp.la ../common/libcommonslpd.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu slptool/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu slptool/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done slptool$(EXEEXT): $(slptool_OBJECTS) $(slptool_DEPENDENCIES) @rm -f slptool$(EXEEXT) $(LINK) $(slptool_LDFLAGS) $(slptool_OBJECTS) $(slptool_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slptool.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: openslp-1.2.1/slptool/slptool.h0000644033442200000310000001437210202047562016426 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP command line UA wrapper */ /* */ /* File: slptool.h */ /* */ /* Abstract: Main header for slptool */ /* */ /* Requires: OpenSLP installation */ /* */ /* Author(s): Matt Peterson */ /* */ /* Copyright (c) 1995, 1999 Caldera Systems, Inc. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU Lesser General Public License as published */ /* by the Free Software Foundation; either version 2.1 of the License, or */ /* (at your option) any later version. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* You should have received a copy of the GNU Lesser General Public */ /* License along with this program; see the file COPYING. If not, */ /* please obtain a copy from http://www.gnu.org/copyleft/lesser.html */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to maintainer of http://www.openslp.org */ /* */ /***************************************************************************/ #ifndef _SLPTOOL_H #define _SLPTOOL_H #include #include #include #include /*=========================================================================*/ typedef enum _SLPToolCommand /*=========================================================================*/ { FINDSRVS = 1, FINDATTRS, FINDSRVTYPES, FINDSCOPES, GETPROPERTY, REGISTER, DEREGISTER, PRINT_VERSION, #ifndef MI_NOT_SUPPORTED FINDSRVSUSINGIFLIST, FINDATTRSUSINGIFLIST, FINDSRVTYPESUSINGIFLIST, #endif /* MI_NOT_SUPPORTED */ #ifndef UNICAST_NOT_SUPPORTED UNICASTFINDSRVS, UNICASTFINDATTRS, UNICASTFINDSRVTYPES, #endif DUMMY }SLPToolCommand; /*=========================================================================*/ typedef struct _SLPToolCommandLine /*=========================================================================*/ { SLPToolCommand cmd; const char* lang; const char* scopes; const char* cmdparam1; const char* cmdparam2; const char* cmdparam3; }SLPToolCommandLine; /*=========================================================================*/ void FindSrvs(SLPToolCommandLine* cmdline); /*=========================================================================*/ #ifndef MI_NOT_SUPPORTED /*=========================================================================*/ void FindSrvsUsingIFList(SLPToolCommandLine* cmdline); /*=========================================================================*/ #endif #ifndef UNICAST_NOT_SUPPORTED /*=========================================================================*/ void UnicastFindSrvs(SLPToolCommandLine* cmdline); /*=========================================================================*/ #endif /*=========================================================================*/ void FindAttrs(SLPToolCommandLine* cmdline); /*=========================================================================*/ #ifndef UNICAST_NOT_SUPPORTED /*=========================================================================*/ void UnicastFindAttrs(SLPToolCommandLine* cmdline); /*=========================================================================*/ #endif #ifndef MI_NOT_SUPPORTED /*=========================================================================*/ void FindAttrsUsingIFList(SLPToolCommandLine* cmdline); /*=========================================================================*/ #endif /*=========================================================================*/ void FindSrvTypes(SLPToolCommandLine* cmdline); /*=========================================================================*/ #ifndef UNICAST_NOT_SUPPORTED /*=========================================================================*/ void UnicastFindSrvTypes(SLPToolCommandLine* cmdline); /*=========================================================================*/ #endif #ifndef MI_NOT_SUPPORTED /*=========================================================================*/ void FindSrvTypesUsingIFList(SLPToolCommandLine* cmdline); /*=========================================================================*/ #endif /*=========================================================================*/ void GetProperty(SLPToolCommandLine* cmdline); /*=========================================================================*/ /*=========================================================================*/ void Register(SLPToolCommandLine* cmdline); /*=========================================================================*/ /*=========================================================================*/ void Deregister(SLPToolCommandLine* cmdline); /*=========================================================================*/ #endif openslp-1.2.1/ChangeLog0000644033442200000310000000752010202255530014630 0ustar rganesanfloppy============================================================================ OpenSLP Change Log (HEAD) ------------------------- Please make entries to this log (in addition to the CVS log) that describe major changes to the OpenSLP code base. An entries should be separated by blank lines and include the date, developer's email, and change description. ============================================================================= *** TAG OpenSLP-1.2.1 *** 02/04/2005 jcalcote@novell.com Incorporated various bug fixes from SuSE and others. Updated Autotools files for version 1.5+ *** TAG OpenSLP-1.2.0 *** 02/23/2004 beastham@emware.com Fixed autoconf bug and updated specfile. *** TAG OpenSLP-1.1.5 *** 08/20/2003 smhatre@cisco.com Fixes for the following 2 sourceforge bugs:- 790719 - openslp initscript symlink vulnerability 791210 - Multicast resposne overflow doesnt result in unicast query smhatre@cisco.com *** TAG OpenSLP-1.1.4 *** 07/15/2003 smhatre@cisco.com Support for SLP queries on multiple network interfaces from asigupta@cisco.com Support for SLP query through a unicast from smhatre@cisco.com *** TAG OpenSLP-1.1.3 *** 02/12/03 matt@sco.com Many very good bugfixes. Much very goog new DHCP code from jcalcote@novell.com 02/12/03 matt@sco.com Skipped 1.1.2 release to avoid any rumors that a 1.1.2 release was made unofficially. *** TAG OpenSLP-1.1.2 *** 08/31/02 aaron@clove.org Fixed parsing bug for service URL strings. Made the port default to 80. 08/21/02 aaron@clove.org Added support for Darwin 6.0 (Mac OS X 10.2) 06/11/02 matt@caldera.com Added support for the net.slp.DAHeartBeat setting 04/04/02 matt@caldera.com Added patch from Arun Barboza that makes attribute compares case insensitive as per RFC 2608 *** TAG OpenSLP-1.1.1 *** 02/22/02 matt@caldera.com Added fix from Arun Barboza to make V1 DAAdverts use the same encoding as the request 02/22/02 matt@caldera.com Added patch from Arun Barboza to handle "==" V1 predicates. This allows OpenSLP to be useful in servicing request in Novell NetWare environments. 02/13/02 matt@caldera.com Added PID monitoring. Now when the process that called SLPReg() (with SLP_REG_FLAG_WATCH_PID) dies the registration will automatically be deregistered. 01/25/2002 matt@caldera.com Added relevant fixes from the stable branch: - Applied patch from Garth Bushell that fixes a problem where not enough memory was being allocated to hold an escaped string in SLPEscape(). - Fixed some problems with multicast route handling code in the slpd startup script - Moved Win2000 specific defines inside #ifdef WIN32 - Changed slpd "daemonize" code to chdir() to "/" 01/24/2002 matt@caldera.com Changed the code in slpd_property.c to use the functions in slp_net.c and slp_iface.c to get interface and hostname information 01/24/2002 matt@caldera.com Moved URL parsing code to common code (slp_parse.c) and added a few network utility functions (slp_net.c). Modified slpd code so that DAs are contacted via the IP address in the DAAdvert not the source address of the datagram. *** Tag merged OpenSLP 1.0.6 *** 11/29/01 matt@caldera.com Finished the initial addition of all the new multicast code with significant help from Satya and Venu. *** Tag merged OpenSLP 1.0.5 *** *** Tag merged OpenSLP 1.0.4 *** *** Tag merged OpenSLP 1.0.3 *** *** Tag merged OpenSLP 1.0.2 *** 07/25/01 matt@caldera.com Fixed minor KnownDAEcho problem that resulted in some DAs not getting registrations. 07/25/01 matt@caldera.com Fixed init order so that LOCAL or (API registered) services will be preserved on reset or SIGHUP 07/25/01 matt@caldera.com Applied Michael Sweet's patch to configure.in that allows use of CFLAGS and LDFLAGS 07/25/01 matt@caldera.com Fixed parsing problem in SLPParseSrvURL() that could cause SEGV 07/23/01 matt@caldera.com Branched CVS into stable-1-0 and HEAD *** Tag OpenSLP 1.0.0 **** openslp-1.2.1/THANKS0000644033442200000310000000220510202460263013765 0ustar rganesanfloppy==================================================================== THANKS In addition to those individuals in the AUTHORS file, the OpenSLP project wishes to extend special thanks to the following individuals and organizations ==================================================================== SourceForge.net http://www.sourceforge.net -------------------------- Gracious supplier of disk space and web hosting for OpenSLP and many other OpenSource projects. John Carey ------------------------------- As a senior developer of a real-world OpenSLP enabled product at Caldera Systems, Jon has provided valuable feedback and direction for the OpenSLP project. Susan G Kleinmann ---------------------------------- Provider of extremely helpful documentation review and feedback. Timothy Zurcher ------------------------------------------ Extremely knowledgable programmer who has freely offered numerous bug fixes to the OpenSLP project. Peter Marschall ------------------------------- Several excellent bug fixes and an update of the Autotools scripts to 1.5. openslp-1.2.1/config.guess0000755033442200000310000012546610641470757015431 0ustar rganesanfloppy#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-04-22' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amd64:OpenBSD:*:*) echo x86_64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; cats:OpenBSD:*:*) echo arm-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; luna88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mips64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit 0 ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit 0 ;; *:OS400:*:*) echo powerpc-ibm-os400 exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit 0 ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then # avoid double evaluation of $set_cc_for_build test -n "$CC_FOR_BUILD" || eval $set_cc_for_build if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; amd64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit 0 ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in *86) UNAME_PROCESSOR=i686 ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit 0 ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms && exit 0 ;; I*) echo ia64-dec-vms && exit 0 ;; V*) echo vax-dec-vms && exit 0 ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: openslp-1.2.1/slpd/0000755033442200000310000000000010211377553014026 5ustar rganesanfloppyopenslp-1.2.1/slpd/slpd_incoming.c0000644033442200000310000005704210211370457017023 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_incoming.c */ /* */ /* Abstract: Handles "incoming" network conversations requests made by */ /* other agents to slpd. (slpd_outgoing.c handles reqests */ /* made by slpd to other agents) */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ /*=========================================================================*/ /* slpd includes */ /*=========================================================================*/ #include "slpd_incoming.h" #include "slpd_socket.h" #include "slpd_process.h" #include "slpd_property.h" #include "slpd_log.h" /*=========================================================================*/ /* common code includes */ /*=========================================================================*/ #include "slp_xmalloc.h" #include "slp_message.h" /*=========================================================================*/ SLPList G_IncomingSocketList = {0,0,0}; /*=========================================================================*/ /*-------------------------------------------------------------------------*/ void IncomingDatagramRead(SLPList* socklist, SLPDSocket* sock) /*-------------------------------------------------------------------------*/ { int bytesread; int bytestowrite; int byteswritten; int peeraddrlen = sizeof(struct sockaddr_in); bytesread = recvfrom(sock->fd, sock->recvbuf->start, SLP_MAX_DATAGRAM_SIZE, 0, (struct sockaddr *) &(sock->peeraddr), &peeraddrlen); if (bytesread > 0) { sock->recvbuf->end = sock->recvbuf->start + bytesread; switch (SLPDProcessMessage(&sock->peeraddr, sock->recvbuf, &(sock->sendbuf))) { case SLP_ERROR_PARSE_ERROR: case SLP_ERROR_VER_NOT_SUPPORTED: case SLP_ERROR_MESSAGE_NOT_SUPPORTED: break; default: /* check to see if we should send anything */ bytestowrite = sock->sendbuf->end - sock->sendbuf->start; if (bytestowrite > 0) { byteswritten = sendto(sock->fd, sock->sendbuf->start, bytestowrite, 0, (struct sockaddr *)&(sock->peeraddr), sizeof(struct sockaddr_in)); if (byteswritten != bytestowrite) { SLPDLog("NETWORK_ERROR - %d replying %s\n", errno, inet_ntoa(sock->peeraddr.sin_addr)); } } } } } /*-------------------------------------------------------------------------*/ void IncomingStreamWrite(SLPList* socklist, SLPDSocket* sock) /*-------------------------------------------------------------------------*/ { int byteswritten, flags = 0; #if defined(MSG_DONTWAIT) flags = MSG_DONTWAIT; #endif if (sock->state == STREAM_WRITE_FIRST) { /* make sure that the start and curpos pointers are the same */ sock->sendbuf->curpos = sock->sendbuf->start; sock->state = STREAM_WRITE; } if (sock->sendbuf->end - sock->sendbuf->start != 0) { byteswritten = send(sock->fd, sock->sendbuf->curpos, sock->sendbuf->end - sock->sendbuf->start, flags); if (byteswritten > 0) { /* reset lifetime to max because of activity */ sock->age = 0; sock->sendbuf->curpos += byteswritten; if (sock->sendbuf->curpos == sock->sendbuf->end) { /* message is completely sent */ sock->state = STREAM_READ_FIRST; } } else { #ifdef _WIN32 if (WSAEWOULDBLOCK == WSAGetLastError()) #else if (errno == EWOULDBLOCK) #endif { /* Error occured or connection was closed */ sock->state = SOCKET_CLOSE; } } } } /*-------------------------------------------------------------------------*/ void IncomingStreamRead(SLPList* socklist, SLPDSocket* sock) /*-------------------------------------------------------------------------*/ { int bytesread, recvlen = 0; char peek[16]; int peeraddrlen = sizeof(struct sockaddr_in); if (sock->state == STREAM_READ_FIRST) { /*---------------------------------------------------*/ /* take a peek at the packet to get size information */ /*---------------------------------------------------*/ bytesread = recvfrom(sock->fd, peek, 16, MSG_PEEK, (struct sockaddr *)&(sock->peeraddr), &peeraddrlen); if (bytesread > 0 && bytesread >= (*peek == 2 ? 5 : 4)) { if (*peek == 2) recvlen = AsUINT24(peek + 2); else if (*peek == 1) /* SLPv1 packet */ recvlen = AsUINT16(peek + 2); /* one byte is minimum */ if (recvlen <= 0) recvlen = 1; /* allocate the recvbuf big enough for the whole message */ sock->recvbuf = SLPBufferRealloc(sock->recvbuf,recvlen); if (sock->recvbuf) { sock->state = STREAM_READ; } else { SLPDLog("INTERNAL_ERROR - out of memory!\n"); sock->state = SOCKET_CLOSE; } } else { sock->state = SOCKET_CLOSE; return; } } if (sock->state == STREAM_READ) { /*------------------------------*/ /* recv the rest of the message */ /*------------------------------*/ bytesread = recv(sock->fd, sock->recvbuf->curpos, sock->recvbuf->end - sock->recvbuf->curpos, 0); if (bytesread > 0) { /* reset age to max because of activity */ sock->age = 0; sock->recvbuf->curpos += bytesread; if (sock->recvbuf->curpos == sock->recvbuf->end) { switch (SLPDProcessMessage(&sock->peeraddr, sock->recvbuf, &(sock->sendbuf))) { case SLP_ERROR_PARSE_ERROR: case SLP_ERROR_VER_NOT_SUPPORTED: case SLP_ERROR_MESSAGE_NOT_SUPPORTED: sock->state = SOCKET_CLOSE; break; default: sock->state = STREAM_WRITE_FIRST; IncomingStreamWrite(socklist, sock); } } } else { /* error in recv() or eof */ sock->state = SOCKET_CLOSE; } } } /*-------------------------------------------------------------------------*/ void IncomingSocketListen(SLPList* socklist, SLPDSocket* sock) /*-------------------------------------------------------------------------*/ { int fdflags; sockfd_t fd; SLPDSocket* connsock; struct sockaddr_in peeraddr; socklen_t peeraddrlen; #ifdef _WIN32 const char lowat = SLPD_SMALLEST_MESSAGE; #else const int lowat = SLPD_SMALLEST_MESSAGE; #endif /* Only accept if we can. If we still maximum number of sockets, just*/ /* ignore the connection */ if (socklist->count < SLPD_MAX_SOCKETS) { peeraddrlen = sizeof(peeraddr); fd = accept(sock->fd, (struct sockaddr *) &peeraddr, &peeraddrlen); if (fd >= 0) { connsock = SLPDSocketAlloc(); if (connsock) { /* setup the accepted socket */ connsock->fd = fd; connsock->peeraddr = peeraddr; connsock->state = STREAM_READ_FIRST; /* Set the low water mark on the accepted socket */ setsockopt(connsock->fd,SOL_SOCKET,SO_RCVLOWAT,&lowat,sizeof(lowat)); setsockopt(connsock->fd,SOL_SOCKET,SO_SNDLOWAT,&lowat,sizeof(lowat)); /* set accepted socket to non blocking */ #ifdef _WIN32 fdflags = 1; ioctlsocket(connsock->fd, FIONBIO, &fdflags); #else fdflags = fcntl(connsock->fd, F_GETFL, 0); fcntl(connsock->fd,F_SETFL, fdflags | O_NONBLOCK); #endif SLPListLinkHead(socklist,(SLPListItem*)connsock); } } } } /*=========================================================================*/ void SLPDIncomingHandler(int* fdcount, fd_set* readfds, fd_set* writefds) /* Handles all outgoing requests that are pending on the specified file */ /* discriptors */ /* */ /* fdcount (IN/OUT) number of file descriptors marked in fd_sets */ /* */ /* readfds (IN) file descriptors with pending read IO */ /* */ /* writefds (IN) file descriptors with pending read IO */ /*=========================================================================*/ { SLPDSocket* sock; sock = (SLPDSocket*) G_IncomingSocketList.head; while (sock && *fdcount) { if (FD_ISSET(sock->fd,readfds)) { switch (sock->state) { case SOCKET_LISTEN: IncomingSocketListen(&G_IncomingSocketList,sock); break; case DATAGRAM_UNICAST: case DATAGRAM_MULTICAST: case DATAGRAM_BROADCAST: IncomingDatagramRead(&G_IncomingSocketList,sock); break; case STREAM_READ: case STREAM_READ_FIRST: IncomingStreamRead(&G_IncomingSocketList,sock); break; default: break; } *fdcount = *fdcount - 1; } else if (FD_ISSET(sock->fd,writefds)) { switch (sock->state) { case STREAM_WRITE: case STREAM_WRITE_FIRST: IncomingStreamWrite(&G_IncomingSocketList,sock); break; default: break; } *fdcount = *fdcount - 1; } sock = (SLPDSocket*)sock->listitem.next; } } /*=========================================================================*/ void SLPDIncomingAge(time_t seconds) /*=========================================================================*/ { SLPDSocket* del = 0; SLPDSocket* sock = (SLPDSocket*)G_IncomingSocketList.head; while (sock) { switch (sock->state) { case STREAM_READ_FIRST: case STREAM_READ: case STREAM_WRITE_FIRST: case STREAM_WRITE: if (G_IncomingSocketList.count > SLPD_COMFORT_SOCKETS) { /* Accellerate ageing cause we are low on sockets */ if (sock->age > SLPD_CONFIG_BUSY_CLOSE_CONN) { del = sock; } } else { if (sock->age > SLPD_CONFIG_CLOSE_CONN) { del = sock; } } sock->age = sock->age + seconds; break; default: /* don't age the other sockets at all */ break; } sock = (SLPDSocket*)sock->listitem.next; if (del) { SLPDSocketFree((SLPDSocket*)SLPListUnlink(&G_IncomingSocketList,(SLPListItem*)del)); del = 0; } } } /*=========================================================================*/ int SLPDIncomingInit() /* Initialize incoming socket list to have appropriate sockets for all */ /* network interfaces */ /* */ /* Returns Zero on success non-zero on error */ /*=========================================================================*/ { char* begin = NULL; char* beginSave = NULL; char* end = NULL; int finished; struct in_addr myaddr; struct in_addr mcastaddr; struct in_addr bcastaddr; struct in_addr loaddr; SLPDSocket* sock; /*------------------------------------------------------------*/ /* First, remove all of the sockets that might be in the list */ /*------------------------------------------------------------*/ while (G_IncomingSocketList.count) { SLPDSocketFree((SLPDSocket*)SLPListUnlink(&G_IncomingSocketList,G_IncomingSocketList.head)); } /*--------------------------------------------------*/ /* set up address to use for loopback and broadcast */ /*--------------------------------------------------*/ loaddr.s_addr = htonl(LOOPBACK_ADDRESS); bcastaddr.s_addr = htonl(SLP_BCAST_ADDRESS); mcastaddr.s_addr = htonl(SLP_MCAST_ADDRESS); /*--------------------------------------------------------------------*/ /* Create SOCKET_LISTEN socket for LOOPBACK for the library to talk to*/ /*--------------------------------------------------------------------*/ sock = SLPDSocketCreateListen(&loaddr); if (sock) { SLPListLinkTail(&G_IncomingSocketList,(SLPListItem*)sock); SLPDLog("Listening on loopback...\n"); } else { SLPDLog("NETWORK_ERROR - Could not listen on loopback\n"); SLPDLog("INTERNAL_ERROR - No SLPLIB support will be available\n"); } /*---------------------------------------------------------------------*/ /* Create sockets for all of the interfaces in the interfaces property */ /*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/ /* Copy G_SlpdProperty.interfaces to a temporary buffer to parse the */ /* string in a safety way */ /*---------------------------------------------------------------------*/ if (G_SlpdProperty.interfaces != NULL) { begin = xstrdup((char *) G_SlpdProperty.interfaces); beginSave = begin; /* save pointer for free() operation later */ end = begin; finished = 0; } else { finished = 1; /* if no interface is defined, */ /* don't even enter the parsing loop */ } for (; (finished == 0); begin = ++end) { while (*end && *end != ',') end ++; if (*end == 0) finished = 1; *end = 0; /* Terminate string. */ if (end <= begin) continue; /* Skip empty entries */ /* begin now points to a null terminated ip address string */ myaddr.s_addr = inet_addr(begin); /*------------------------------------------------*/ /* Create TCP_LISTEN that will handle unicast TCP */ /*------------------------------------------------*/ sock = SLPDSocketCreateListen(&myaddr); if (sock) { SLPListLinkTail(&G_IncomingSocketList,(SLPListItem*)sock); SLPDLog("Listening on %s ...\n",inet_ntoa(myaddr)); } /*----------------------------------------------------------------*/ /* Create socket that will handle multicast UDP. */ /*----------------------------------------------------------------*/ sock = SLPDSocketCreateBoundDatagram(&myaddr, &mcastaddr, DATAGRAM_MULTICAST); if (sock) { SLPListLinkTail(&G_IncomingSocketList,(SLPListItem*)sock); SLPDLog("Multicast socket on %s ready\n",inet_ntoa(myaddr)); } else { SLPDLog("Couldn't bind to multicast for interface %s (%s)\n", inet_ntoa(myaddr), strerror(errno)); } #if defined(ENABLE_SLPv1) if (G_SlpdProperty.isDA) { /*------------------------------------------------------------*/ /* Create socket that will handle multicast UDP for SLPv1 DA */ /* Discovery. */ /*------------------------------------------------------------*/ mcastaddr.s_addr = htonl(SLPv1_DA_MCAST_ADDRESS); sock = SLPDSocketCreateBoundDatagram(&myaddr, &mcastaddr, DATAGRAM_MULTICAST); if (sock) { SLPListLinkTail(&G_IncomingSocketList,(SLPListItem*)sock); SLPDLog("SLPv1 DA Discovery Multicast socket on %s ready\n", inet_ntoa(myaddr)); } } #endif /*--------------------------------------------*/ /* Create socket that will handle unicast UDP */ /*--------------------------------------------*/ sock = SLPDSocketCreateBoundDatagram(&myaddr, &myaddr, DATAGRAM_UNICAST); if (sock) { SLPListLinkTail(&G_IncomingSocketList,(SLPListItem*)sock); SLPDLog("Unicast socket on %s ready\n",inet_ntoa(myaddr)); } } if (beginSave) xfree(beginSave); /*--------------------------------------------------------*/ /* Create socket that will handle broadcast UDP */ /*--------------------------------------------------------*/ sock = SLPDSocketCreateBoundDatagram(&myaddr, &bcastaddr, DATAGRAM_BROADCAST); if (sock) { SLPListLinkTail(&G_IncomingSocketList,(SLPListItem*)sock); SLPDLog("Broadcast socket for %s ready\n", inet_ntoa(bcastaddr)); } if (G_IncomingSocketList.count == 0) { SLPDLog("No usable interfaces\n"); return 1; } return 0; } /*=========================================================================*/ int SLPDIncomingDeinit() /* Deinitialize incoming socket list to have appropriate sockets for all */ /* network interfaces */ /* */ /* Returns Zero on success non-zero on error */ /*=========================================================================*/ { SLPDSocket* del = 0; SLPDSocket* sock = (SLPDSocket*)G_IncomingSocketList.head; while (sock) { del = sock; sock = (SLPDSocket*)sock->listitem.next; if (del) { SLPDSocketFree((SLPDSocket*)SLPListUnlink(&G_IncomingSocketList,(SLPListItem*)del)); del = 0; } } return 0; } #ifdef DEBUG /*=========================================================================*/ void SLPDIncomingSocketDump() /*=========================================================================*/ { } #endif openslp-1.2.1/slpd/slpd_log.c0000644033442200000310000005506110202047547016001 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_log.c */ /* */ /* Abstract: slpd logging functions */ /* */ /* WARNING: NOT thread safe! */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ /*=========================================================================*/ /* slpd includes */ /*=========================================================================*/ #include "slpd_log.h" #include "slpd_property.h" #include /********************************************/ /* TODO: Make these functions thread safe!! */ /********************************************/ /*=========================================================================*/ static FILE* G_SlpdLogFile = 0; /*=========================================================================*/ /*=========================================================================*/ int SLPDLogFileOpen(const char* path, int append) /* Prepares the file at the specified path as the log file. */ /* */ /* path - (IN) the path to the log file. If path is the empty string */ /* (""), then we log to stdout. */ /* */ /* append - (IN) if zero log file will be truncated. */ /* */ /* Returns - zero on success. errno on failure. */ /*=========================================================================*/ { if (G_SlpdLogFile) { /* logfile was already open close it */ fclose(G_SlpdLogFile); } if (*path == 0) { /* Log to console. */ G_SlpdLogFile = stdout; } else { /* Log to file. */ #ifndef _WIN32 /* only owner can read/write */ umask(0077); #endif if (append) { G_SlpdLogFile = fopen(path,"a"); } else { G_SlpdLogFile = fopen(path,"w"); } if (G_SlpdLogFile == 0) { /* could not open the log file */ return -1; } } return 0; } #ifdef DEBUG /*=========================================================================*/ int SLPDLogFileClose() /* Releases resources associated with the log file */ /*=========================================================================*/ { fclose(G_SlpdLogFile); return 0; } #endif /*=========================================================================*/ void SLPDLog(const char* msg, ...) /* Logs a message */ /*=========================================================================*/ { va_list ap; if (G_SlpdLogFile) { va_start(ap,msg); vfprintf(G_SlpdLogFile,msg,ap); va_end(ap); fflush(G_SlpdLogFile); } } /*=========================================================================*/ void SLPDFatal(const char* msg, ...) /* Logs a message and halts the process */ /*=========================================================================*/ { va_list ap; if (G_SlpdLogFile) { fprintf(G_SlpdLogFile,"A FATAL Error has occured:\n"); va_start(ap,msg); vfprintf(G_SlpdLogFile,msg,ap); va_end(ap); fflush(G_SlpdLogFile); } else { fprintf(stderr,"A FATAL Error has occured:\n"); va_start(ap,msg); vprintf(msg,ap); va_end(ap); } exit(1); } /*=========================================================================*/ void SLPDLogBuffer(const char* prefix, int bufsize, const char* buf) /* Writes a buffer to the logfile */ /*=========================================================================*/ { if (G_SlpdLogFile) { fprintf(G_SlpdLogFile,"%s",prefix); fwrite(buf,bufsize,1,G_SlpdLogFile); fprintf(G_SlpdLogFile,"\n"); fflush(G_SlpdLogFile); } } /*=========================================================================*/ void SLPDLogTime() /* Logs a timestamp */ /*=========================================================================*/ { time_t curtime = time(NULL); SLPDLog("%s",ctime(&curtime)); } /*-------------------------------------------------------------------------*/ void SLPDLogSrvRqstMessage(SLPSrvRqst* srvrqst) /*-------------------------------------------------------------------------*/ { SLPDLog("Message SRVRQST:\n"); SLPDLogBuffer(" srvtype = ", srvrqst->srvtypelen, srvrqst->srvtype); SLPDLogBuffer(" scopelist = ", srvrqst->scopelistlen, srvrqst->scopelist); SLPDLogBuffer(" predicate = ", srvrqst->predicatelen, srvrqst->predicate); } /*-------------------------------------------------------------------------*/ void SLPDLogSrvRplyMessage(SLPSrvRply* srvrply) /*-------------------------------------------------------------------------*/ { SLPDLog("Message SRVRPLY:\n"); SLPDLog(" errorcode = %i\n",srvrply->errorcode); } /*-------------------------------------------------------------------------*/ void SLPDLogSrvRegMessage(SLPSrvReg* srvreg) /*-------------------------------------------------------------------------*/ { SLPDLog("Message SRVREG:\n"); SLPDLogBuffer(" srvtype = ", srvreg->srvtypelen, srvreg->srvtype); SLPDLogBuffer(" scope = ", srvreg->scopelistlen, srvreg->scopelist); SLPDLogBuffer(" url = ", srvreg->urlentry.urllen, srvreg->urlentry.url); SLPDLogBuffer(" attributes = ", srvreg->attrlistlen, srvreg->attrlist); } /*-------------------------------------------------------------------------*/ void SLPDLogSrvDeRegMessage(SLPSrvDeReg* srvdereg) /*-------------------------------------------------------------------------*/ { SLPDLog("Message SRVDEREG:\n"); SLPDLogBuffer(" scope = ", srvdereg->scopelistlen, srvdereg->scopelist); SLPDLogBuffer(" url = ", srvdereg->urlentry.urllen, srvdereg->urlentry.url); } /*-------------------------------------------------------------------------*/ void SLPDLogSrvAckMessage(SLPSrvAck* srvack) /*-------------------------------------------------------------------------*/ { SLPDLog("Message SRVACK:\n"); SLPDLog(" errorcode = %i\n",srvack->errorcode); } /*-------------------------------------------------------------------------*/ void SLPDLogAttrRqstMessage(SLPAttrRqst* attrrqst) /*-------------------------------------------------------------------------*/ { SLPDLog("Message ATTRRQST:\n"); SLPDLogBuffer(" scope = ", attrrqst->scopelistlen, attrrqst->scopelist); SLPDLogBuffer(" url = ", attrrqst->urllen, attrrqst->url); } /*-------------------------------------------------------------------------*/ void SLPDLogAttrRplyMessage(SLPAttrRply* attrrply) /*-------------------------------------------------------------------------*/ { SLPDLog("Message ATTRRPLY:\n"); SLPDLog(" errorcode = %i\n",attrrply->errorcode); } /*-------------------------------------------------------------------------*/ void SLPDLogDAAdvertMessage(SLPDAAdvert* daadvert) /*-------------------------------------------------------------------------*/ { SLPDLog("Message DAADVERT:\n"); SLPDLogBuffer(" scope = ", daadvert->scopelistlen, daadvert->scopelist); SLPDLogBuffer(" url = ", daadvert->urllen, daadvert->url); SLPDLogBuffer(" attributes = ", daadvert->attrlistlen, daadvert->attrlist); } /*-------------------------------------------------------------------------*/ void SLPDLogSrvTypeRqstMessage(SLPSrvTypeRqst* srvtyperqst) /*-------------------------------------------------------------------------*/ { SLPDLog("Message SRVTYPERQST:\n"); SLPDLogBuffer(" namingauth = ", srvtyperqst->namingauthlen, srvtyperqst->namingauth); SLPDLogBuffer(" scope = ", srvtyperqst->scopelistlen, srvtyperqst->scopelist); } /*-------------------------------------------------------------------------*/ void SLPDLogSrvTypeRplyMessage(SLPSrvTypeRply* srvtyperply) /*-------------------------------------------------------------------------*/ { SLPDLog("Message SRVTYPERPLY:\n"); SLPDLog(" errorcode = %i\n",srvtyperply->errorcode); } /*-------------------------------------------------------------------------*/ void SLPDLogSAAdvertMessage(SLPSAAdvert* saadvert) /*-------------------------------------------------------------------------*/ { SLPDLog("Message SAADVERT:\n"); SLPDLogBuffer(" scope = ", saadvert->scopelistlen, saadvert->scopelist); SLPDLogBuffer(" url = ", saadvert->urllen, saadvert->url); SLPDLogBuffer(" attributes = ", saadvert->attrlistlen, saadvert->attrlist); } /*-------------------------------------------------------------------------*/ void SLPDLogPeerAddr(struct sockaddr_in* peeraddr) /*-------------------------------------------------------------------------*/ { SLPDLog("Peer IP address: %s\n", inet_ntoa(peeraddr->sin_addr)); } /*=========================================================================*/ void SLPDLogMessageInternals(SLPMessage message) /*=========================================================================*/ { SLPDLog("Peer: \n"); SLPDLog(" IP address: %s\n", inet_ntoa(message->peer.sin_addr)); SLPDLog("Header:\n"); SLPDLog(" version = %i\n",message->header.version); SLPDLog(" functionid = %i\n",message->header.functionid); SLPDLog(" length = %i\n",message->header.length); SLPDLog(" flags = %i\n",message->header.flags); SLPDLog(" extoffset = %i\n",message->header.extoffset); SLPDLog(" xid = %i\n",message->header.xid); SLPDLogBuffer(" langtag = ", message->header.langtaglen, message->header.langtag); switch (message->header.functionid) { case SLP_FUNCT_SRVRQST: SLPDLogSrvRqstMessage(&(message->body.srvrqst)); break; case SLP_FUNCT_SRVRPLY: SLPDLogSrvRplyMessage(&(message->body.srvrply)); break; case SLP_FUNCT_SRVREG: SLPDLogSrvRegMessage(&(message->body.srvreg)); break; case SLP_FUNCT_SRVDEREG: SLPDLogSrvDeRegMessage(&(message->body.srvdereg)); break; case SLP_FUNCT_SRVACK: SLPDLogSrvAckMessage(&(message->body.srvack)); break; case SLP_FUNCT_ATTRRQST: SLPDLogAttrRqstMessage(&(message->body.attrrqst)); break; case SLP_FUNCT_ATTRRPLY: SLPDLogAttrRplyMessage(&(message->body.attrrply)); break; case SLP_FUNCT_DAADVERT: SLPDLogDAAdvertMessage(&(message->body.daadvert)); break; case SLP_FUNCT_SRVTYPERQST: SLPDLogSrvTypeRqstMessage(&(message->body.srvtyperqst)); break; case SLP_FUNCT_SRVTYPERPLY: SLPDLogSrvTypeRplyMessage(&(message->body.srvtyperply)); break; case SLP_FUNCT_SAADVERT: SLPDLogSAAdvertMessage(&(message->body.saadvert)); break; default: SLPDLog("Message %i UNKNOWN:\n",message->header.functionid); SLPDLog(" This is really bad\n"); break; } } /*=========================================================================*/ void SLPDLogMessage(int msglogflags, struct sockaddr_in* peerinfo, SLPBuffer buf) /* Log record of receiving or sending an SLP Message. Logging will only */ /* occur if message logging is enabled G_SlpProperty.traceMsg != 0 */ /* */ /* msglogflags (IN) What type of message to log */ /* */ /* peerinfo (IN) the source or destination peer */ /* */ /* msg (IN) the message to log */ /* */ /* Returns: none */ /*=========================================================================*/ { SLPMessage msg; if (peerinfo == NULL || buf == NULL) { return; } if ((G_SlpdProperty.traceMsg && (msglogflags & SLPDLOG_TRACEMSG)) || (G_SlpdProperty.traceDrop && (msglogflags & SLPDLOG_TRACEDROP)) ) { /* Don't log localhost traffic since it is probably IPC */ /* and don't log empty messages */ if (!ISLOCAL(peerinfo->sin_addr) && buf->end != buf->start) { msg = SLPMessageAlloc(); if (msg) { SLPDLog("\n"); SLPDLogTime(); SLPDLog("MESSAGE - "); if (msglogflags == SLPDLOG_TRACEMSG_OUT) { SLPDLog("Trace message (OUT)\n"); } else if (msglogflags == SLPDLOG_TRACEMSG_IN) { SLPDLog("Trace message (IN)\n"); } else if (msglogflags == SLPDLOG_TRACEDROP) { SLPDLog("Dropped message (following message silently ignored)\n"); } else { SLPDLog("\n"); } if (SLPMessageParseBuffer(peerinfo,buf,msg) == 0) { SLPDLogMessageInternals(msg); } else { SLPDLog("Message parsing failed\n"); SLPDLog("Peer: \n"); SLPDLog(" IP address: %s\n", inet_ntoa(msg->peer.sin_addr)); } SLPMessageFree(msg); } } } } /*=========================================================================*/ void SLPDLogRegistration(const char* prefix, SLPDatabaseEntry* entry) /* Log record of having added a registration to the database. Logging of */ /* registraions will only occur if registration trace is enabled */ /* G_SlpProperty.traceReg != 0 */ /* */ /* prefix (IN) an informative prefix for the log entry */ /* */ /* entry (IN) the database entry that was affected */ /* */ /* Returns: none */ /*=========================================================================*/ { if (prefix == NULL || entry == NULL) { return; } if (G_SlpdProperty.traceReg) { SLPDLog("\n"); SLPDLogTime(); SLPDLog("DATABASE - %s:\n",prefix); SLPDLog(" SA address = "); switch (entry->msg->body.srvreg.source) { case SLP_REG_SOURCE_UNKNOWN: SLPDLog("\n"); break; case SLP_REG_SOURCE_REMOTE: SLPDLog("remote (%s)\n", inet_ntoa(entry->msg->peer.sin_addr)); break; case SLP_REG_SOURCE_LOCAL: SLPDLog("IPC (libslp)\n"); break; case SLP_REG_SOURCE_STATIC: SLPDLog("static (slp.reg)\n"); break; } SLPDLogBuffer(" service-url = ", entry->msg->body.srvreg.urlentry.urllen, entry->msg->body.srvreg.urlentry.url); SLPDLogBuffer(" scope = ", entry->msg->body.srvreg.scopelistlen, entry->msg->body.srvreg.scopelist); SLPDLogBuffer(" attributes = ", entry->msg->body.srvreg.attrlistlen, entry->msg->body.srvreg.attrlist); } } /*=========================================================================*/ void SLPDLogDAAdvertisement(const char* prefix, SLPDatabaseEntry* entry) /* Log record of addition or removal of a DA to the store of known DAs. */ /* Will only occur if DA Advertisment message logging is enabled */ /* G_SlpProperty.traceDATraffic != 0 */ /* */ /* prefix (IN) an informative prefix for the log entry */ /* */ /* entry (IN) the database entry that was affected */ /* */ /* Returns: none */ /*=========================================================================*/ { if (prefix == NULL || entry == NULL) { return; } if (G_SlpdProperty.traceDATraffic) { SLPDLog("\n"); SLPDLogTime(); SLPDLog("KNOWNDA - %s:\n",prefix); SLPDLog(" DA address = %s\n",inet_ntoa(entry->msg->peer.sin_addr)); SLPDLogBuffer(" directory-agent-url = ", entry->msg->body.daadvert.urllen, entry->msg->body.daadvert.url); SLPDLog(" bootstamp = %x\n",entry->msg->body.daadvert.bootstamp); SLPDLogBuffer(" scope = ", entry->msg->body.daadvert.scopelistlen, entry->msg->body.daadvert.scopelist); SLPDLogBuffer(" attributes = ", entry->msg->body.daadvert.attrlistlen, entry->msg->body.daadvert.attrlist); #ifdef ENABLE_SLPV2_SECURITY SLPDLogBuffer(" SPI list = ", entry->msg->body.daadvert.spilistlen, entry->msg->body.daadvert.spilist); #endif /*ENABLE_SLPV2_SECURITY*/ } } /*=========================================================================*/ void SLPDLogParseWarning(struct sockaddr_in* peeraddr, SLPBuffer buf) /* Log a parsing error warning and dumps the invalid message. */ /*=========================================================================*/ { unsigned char* curpos; int i = 0; if (peeraddr == NULL || buf == NULL) { return; } SLPDLog("\n"); SLPDLogTime(); SLPDLog("*** WARNING Parse Error ***\n"); SLPDLogPeerAddr(peeraddr); SLPDLog("message size = %i\n",buf->end - buf->start); SLPDLog("message dump follows:\n"); for (curpos = buf->start; curpos < buf->end; curpos++) { SLPDLog("0x%02x",*curpos); if (*curpos < 0x20 || *curpos > 0x7f) { SLPDLog("(' ') "); } else { SLPDLog("('%c') ",*curpos); } /* newline every 70 columns */ i++; if (i==10) { i=0; SLPDLog("\n"); } } SLPDLog("\n"); } openslp-1.2.1/slpd/Makefile.am0000644033442200000310000000245110207404661016060 0ustar rganesanfloppy# # Makefile.am # Automake File # The linked in library libcommonslpd, which is from ../common # containing exacts functions which are required. # EXTRA_DIST = slpd_win32.h slpd_win32.c sbin_PROGRAMS = slpd INCLUDES = -I$(top_srcdir)/common -I$(top_srcdir)/libslpattr \ -I$(srcdir) -I$(top_srcdir)/libslp \ -DETCDIR=\"$(sysconfdir)\" -DVARDIR=\"$(localstatedir)\" if ENABLE_PREDICATES slp_predicate_SRCS = slpd_predicate.h slpd_predicate.c endif if ENABLE_SLPv1 slpd_v1process_SRCS = slpd_v1process.c endif if ENABLE_SLPv2_SECURITY slpd_security_SRCS = slpd_spi.c slpd_spi.h endif slpd_SOURCES = \ $(slp_predicate_SRCS) \ $(slpd_v1process_SRCS) \ $(slpd_security_SRCS) \ slpd_log.c \ slpd_socket.c \ slpd_database.c \ slpd_main.c \ slpd_process.c \ slpd_cmdline.c \ slpd_property.c \ slpd_regfile.c \ slpd_knownda.c \ slpd_incoming.c \ slpd_outgoing.c \ slpd.h \ slpd_knownda.h \ slpd_process.h \ slpd_unistd.h \ slpd_cmdline.h \ slpd_log.h \ slpd_property.h \ slpd_database.h \ slpd_outgoing.h \ slpd_regfile.h \ slpd_incoming.h \ slpd_socket.h #if you're building on Irix, exchange commented and uncommented lines #slpd_LDADD = ../common/libcommonslpd.a ../libslpattr/libslpattr.a slpd_LDADD = ../common/libcommonslpd.la ../libslpattr/libslpattr.la openslp-1.2.1/slpd/slpd_v1process.c0000644033442200000310000010205110211370457017134 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_v1process.c */ /* */ /* Abstract: Processes incoming SLP messages */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ /*=========================================================================*/ /* slpd includes */ /*=========================================================================*/ #include "slpd_process.h" #include "slpd_property.h" #include "slpd_database.h" #include "slpd_knownda.h" #include "slpd_log.h" /*=========================================================================*/ /* common code includes */ /*=========================================================================*/ #include "slp_xmalloc.h" #include "slp_message.h" #include "slp_v1message.h" #include "slp_utf8.h" #include "slp_compare.h" #include /*-------------------------------------------------------------------------*/ int v1ProcessDASrvRqst(struct sockaddr_in* peeraddr, SLPMessage message, SLPBuffer* sendbuf, int errorcode) /*-------------------------------------------------------------------------*/ { if (G_SlpdProperty.isDA) { if (message->body.srvrqst.scopelistlen == 0 || SLPIntersectStringList(message->body.srvrqst.scopelistlen, message->body.srvrqst.scopelist, G_SlpdProperty.useScopesLen, G_SlpdProperty.useScopes)) { /* fill out real structure */ errorcode = SLPDKnownDAGenerateMyV1DAAdvert(errorcode, message->header.encoding, message->header.xid, sendbuf); } else { errorcode = SLP_ERROR_SCOPE_NOT_SUPPORTED; } } else { errorcode = SLP_ERROR_MESSAGE_NOT_SUPPORTED; } /* don't return errorcodes to multicast messages */ if (errorcode != 0) { if (message->header.flags & SLP_FLAG_MCAST || ISMCAST(peeraddr->sin_addr)) { (*sendbuf)->end = (*sendbuf)->start; return errorcode; } } return errorcode; } /*-------------------------------------------------------------------------*/ int v1ProcessSrvRqst(struct sockaddr_in* peeraddr, SLPMessage message, SLPBuffer* sendbuf, int errorcode) /*-------------------------------------------------------------------------*/ { int i; int urllen; int size = 0; SLPDDatabaseSrvRqstResult* db = 0; SLPBuffer result = *sendbuf; /*--------------------------------------------------------------*/ /* If errorcode is set, we can not be sure that message is good */ /* Go directly to send response code */ /*--------------------------------------------------------------*/ if (errorcode) { goto RESPOND; } /*-------------------------------------------------*/ /* Check for one of our IP addresses in the prlist */ /*-------------------------------------------------*/ if (SLPIntersectStringList(message->body.srvrqst.prlistlen, message->body.srvrqst.prlist, G_SlpdProperty.interfacesLen, G_SlpdProperty.interfaces)) { result->end = result->start; goto FINISHED; } /*------------------------------------------------*/ /* Check to to see if a this is a special SrvRqst */ /*------------------------------------------------*/ if (SLPCompareString(message->body.srvrqst.srvtypelen, message->body.srvrqst.srvtype, 15, "directory-agent") == 0) { errorcode = v1ProcessDASrvRqst(peeraddr, message, sendbuf, errorcode); return errorcode; } /*------------------------------------*/ /* Make sure that we handle the scope */ /*------ -----------------------------*/ if (SLPIntersectStringList(message->body.srvrqst.scopelistlen, message->body.srvrqst.scopelist, G_SlpdProperty.useScopesLen, G_SlpdProperty.useScopes) != 0) { /*-------------------------------*/ /* Find services in the database */ /*-------------------------------*/ errorcode = SLPDDatabaseSrvRqstStart(message, &db); } else { errorcode = SLP_ERROR_SCOPE_NOT_SUPPORTED; } RESPOND: /*----------------------------------------------------------------*/ /* Do not send error codes or empty replies to multicast requests */ /*----------------------------------------------------------------*/ if (message->header.flags & SLP_FLAG_MCAST) { if (errorcode != 0 || db->urlcount == 0) { result->end = result->start; goto FINISHED; } } /*-------------------------------------------------------------*/ /* ensure the buffer is big enough to handle the whole srvrply */ /*-------------------------------------------------------------*/ size = 16; /* 12 bytes for header, 2 bytes for error code, 2 bytes for url count */ if (errorcode == 0) { for (i = 0; i < db->urlcount; i++) { urllen = INT_MAX; errorcode = SLPv1ToEncoding(0, &urllen, message->header.encoding, db->urlarray[i]->url, db->urlarray[i]->urllen); if (errorcode) break; size += urllen + 4; /* 2 bytes for lifetime, 2 bytes for urllen */ } result = SLPBufferRealloc(result,size); if (result == 0) { errorcode = SLP_ERROR_INTERNAL_ERROR; } } /*----------------*/ /* Add the header */ /*----------------*/ /*version*/ *(result->start) = 1; /*function id*/ *(result->start + 1) = SLP_FUNCT_SRVRPLY; /*length*/ ToUINT16(result->start + 2, size); /*flags - TODO set the flags correctly */ *(result->start + 4) = message->header.flags | (size > SLP_MAX_DATAGRAM_SIZE ? SLPv1_FLAG_OVERFLOW : 0); /*dialect*/ *(result->start + 5) = 0; /*language code*/ memcpy(result->start + 6, message->header.langtag, 2); ToUINT16(result->start + 8, message->header.encoding); /*xid*/ ToUINT16(result->start + 10, message->header.xid); /*-------------------------*/ /* Add rest of the SrvRply */ /*-------------------------*/ result->curpos = result->start + 12; /* error code*/ ToUINT16(result->curpos, errorcode); result->curpos = result->curpos + 2; if (errorcode == 0) { /* urlentry count */ ToUINT16(result->curpos, db->urlcount); result->curpos = result->curpos + 2; for (i = 0; i < db->urlcount; i++) { /* url-entry lifetime */ ToUINT16(result->curpos, db->urlarray[i]->lifetime); result->curpos = result->curpos + 2; /* url-entry url and urllen */ urllen = size; errorcode = SLPv1ToEncoding(result->curpos + 2, &urllen, message->header.encoding, db->urlarray[i]->url, db->urlarray[i]->urllen); ToUINT16(result->curpos, urllen); result->curpos = result->curpos + 2 + urllen; } } else { /* urlentry count */ ToUINT16(result->curpos, 0); result->curpos = result->curpos + 2; } FINISHED: SLPDDatabaseSrvRqstEnd(db); *sendbuf = result; return errorcode; } /*-------------------------------------------------------------------------*/ int v1ProcessSrvReg(struct sockaddr_in* peeraddr, SLPMessage message, SLPBuffer recvbuf, SLPBuffer* sendbuf, int errorcode) /* */ /* Returns: non-zero if message should be silently dropped */ /*-------------------------------------------------------------------------*/ { SLPBuffer result = *sendbuf; /*--------------------------------------------------------------*/ /* If errorcode is set, we can not be sure that message is good */ /* Go directly to send response code also do not process mcast */ /* srvreg or srvdereg messages */ /*--------------------------------------------------------------*/ if (errorcode || message->header.flags & SLP_FLAG_MCAST) { goto RESPOND; } /*------------------------------------*/ /* Make sure that we handle the scope */ /*------ -----------------------------*/ if (SLPIntersectStringList(message->body.srvreg.scopelistlen, message->body.srvreg.scopelist, G_SlpdProperty.useScopesLen, G_SlpdProperty.useScopes)) { /*---------------------------------*/ /* put the service in the database */ /*---------------------------------*/ if (ISLOCAL(message->peer.sin_addr)) { message->body.srvreg.source= SLP_REG_SOURCE_LOCAL; } else { message->body.srvreg.source = SLP_REG_SOURCE_REMOTE; } errorcode = SLPDDatabaseReg(message,recvbuf); } else { errorcode = SLP_ERROR_SCOPE_NOT_SUPPORTED; } RESPOND: /*--------------------------------------------------------------------*/ /* don't send back reply anything multicast SrvReg (set result empty) */ /*--------------------------------------------------------------------*/ if (message->header.flags & SLP_FLAG_MCAST) { result->end = result->start; goto FINISHED; } /*------------------------------------------------------------*/ /* ensure the buffer is big enough to handle the whole srvack */ /*------------------------------------------------------------*/ result = SLPBufferRealloc(result, 14); if (result == 0) { errorcode = SLP_ERROR_INTERNAL_ERROR; goto FINISHED; } /*----------------*/ /* Add the header */ /*----------------*/ /*version*/ *(result->start) = 1; /*function id*/ *(result->start + 1) = SLP_FUNCT_SRVACK; /*length*/ ToUINT16(result->start + 2, 14); /*flags - TODO set the flags correctly */ *(result->start + 4) = 0; /*dialect*/ *(result->start + 5) = 0; /*language code*/ memcpy(result->start + 6, message->header.langtag, 2); ToUINT16(result->start + 8, message->header.encoding); /*xid*/ ToUINT16(result->start + 10, message->header.xid); /*-------------------*/ /* Add the errorcode */ /*-------------------*/ ToUINT16(result->start + 12, errorcode); FINISHED: *sendbuf = result; return errorcode; } /*-------------------------------------------------------------------------*/ int v1ProcessSrvDeReg(struct sockaddr_in* peeraddr, SLPMessage message, SLPBuffer* sendbuf, int errorcode) /* */ /* Returns: non-zero if message should be silently dropped */ /*-------------------------------------------------------------------------*/ { SLPBuffer result = *sendbuf; /*--------------------------------------------------------------*/ /* If errorcode is set, we can not be sure that message is good */ /* Go directly to send response code also do not process mcast */ /* srvreg or srvdereg messages */ /*--------------------------------------------------------------*/ if (errorcode || message->header.flags & SLP_FLAG_MCAST) { goto RESPOND; } /*------------------------------------*/ /* Make sure that we handle the scope */ /*------------------------------------*/ if (SLPIntersectStringList(message->body.srvdereg.scopelistlen, message->body.srvdereg.scopelist, G_SlpdProperty.useScopesLen, G_SlpdProperty.useScopes)) { /*--------------------------------------*/ /* remove the service from the database */ /*--------------------------------------*/ errorcode = SLPDDatabaseDeReg(message); } else { errorcode = SLP_ERROR_SCOPE_NOT_SUPPORTED; } RESPOND: /*---------------------------------------------------------*/ /* don't do anything multicast SrvDeReg (set result empty) */ /*---------------------------------------------------------*/ if (message->header.flags & SLP_FLAG_MCAST) { result->end = result->start; goto FINISHED; } /*------------------------------------------------------------*/ /* ensure the buffer is big enough to handle the whole srvack */ /*------------------------------------------------------------*/ result = SLPBufferRealloc(result, 14); if (result == 0) { errorcode = SLP_ERROR_INTERNAL_ERROR; goto FINISHED; } /*----------------*/ /* Add the header */ /*----------------*/ /*version*/ *(result->start) = 1; /*function id*/ *(result->start + 1) = SLP_FUNCT_SRVACK; /*length*/ ToUINT16(result->start + 2, 14); /*flags - TODO set the flags correctly */ *(result->start + 4) = 0; /*dialect*/ *(result->start + 5) = 0; /*language code*/ memcpy(result->start + 6, message->header.langtag, 2); ToUINT16(result->start + 8, message->header.encoding); /*xid*/ ToUINT16(result->start + 10, message->header.xid); /*-------------------*/ /* Add the errorcode */ /*-------------------*/ ToUINT16(result->start + 12, errorcode); FINISHED: *sendbuf = result; return errorcode; } /*-------------------------------------------------------------------------*/ int v1ProcessAttrRqst(struct sockaddr_in* peeraddr, SLPMessage message, SLPBuffer* sendbuf, int errorcode) /*-------------------------------------------------------------------------*/ { SLPDDatabaseAttrRqstResult* db = 0; int attrlen = 0; int size = 0; SLPBuffer result = *sendbuf; /*--------------------------------------------------------------*/ /* If errorcode is set, we can not be sure that message is good */ /* Go directly to send response code */ /*--------------------------------------------------------------*/ if (errorcode) { goto RESPOND; } /*-------------------------------------------------*/ /* Check for one of our IP addresses in the prlist */ /*-------------------------------------------------*/ if (SLPIntersectStringList(message->body.attrrqst.prlistlen, message->body.attrrqst.prlist, G_SlpdProperty.interfacesLen, G_SlpdProperty.interfaces)) { result->end = result->start; goto FINISHED; } /*------------------------------------*/ /* Make sure that we handle the scope */ /*------ -----------------------------*/ if (SLPIntersectStringList(message->body.attrrqst.scopelistlen, message->body.attrrqst.scopelist, G_SlpdProperty.useScopesLen, G_SlpdProperty.useScopes)) { /*---------------------------------*/ /* Find attributes in the database */ /*---------------------------------*/ errorcode = SLPDDatabaseAttrRqstStart(message,&db); } else { errorcode = SLP_ERROR_SCOPE_NOT_SUPPORTED; } RESPOND: /*----------------------------------------------------------------*/ /* Do not send error codes or empty replies to multicast requests */ /*----------------------------------------------------------------*/ if (message->header.flags & SLP_FLAG_MCAST) { if (errorcode != 0 || db->attrlistlen == 0) { result->end = result->start; goto FINISHED; } } /*--------------------------------------------------------------*/ /* ensure the buffer is big enough to handle the whole attrrply */ /*--------------------------------------------------------------*/ size = 16; /* 12 bytes for header, 2 bytes for error code, 2 bytes for attr-list len */ if (errorcode == 0) { attrlen = INT_MAX; errorcode = SLPv1ToEncoding(0, &attrlen, message->header.encoding, db->attrlist, db->attrlistlen); size += attrlen; } /*-------------------*/ /* Alloc the buffer */ /*-------------------*/ result = SLPBufferRealloc(result,size); if (result == 0) { errorcode = SLP_ERROR_INTERNAL_ERROR; goto FINISHED; } /*----------------*/ /* Add the header */ /*----------------*/ /*version*/ *(result->start) = 1; /*function id*/ *(result->start + 1) = SLP_FUNCT_ATTRRPLY; /*length*/ ToUINT16(result->start + 2, size); /*flags - TODO set the flags correctly */ *(result->start + 4) = message->header.flags | (size > SLP_MAX_DATAGRAM_SIZE ? SLPv1_FLAG_OVERFLOW : 0); /*dialect*/ *(result->start + 5) = 0; /*language code*/ memcpy(result->start + 6, message->header.langtag, 2); ToUINT16(result->start + 8, message->header.encoding); /*xid*/ ToUINT16(result->start + 10, message->header.xid); /*--------------------------*/ /* Add rest of the AttrRply */ /*--------------------------*/ result->curpos = result->start + 12; /* error code*/ ToUINT16(result->curpos, errorcode); result->curpos = result->curpos + 2; if (errorcode == 0) { /* attr-list len */ ToUINT16(result->curpos, attrlen); result->curpos = result->curpos + 2; attrlen = size; SLPv1ToEncoding(result->curpos, &attrlen, message->header.encoding, db->attrlist, db->attrlistlen); result->curpos = result->curpos + attrlen; } FINISHED: *sendbuf = result; if (db) SLPDDatabaseAttrRqstEnd(db); return errorcode; } /*-------------------------------------------------------------------------*/ int v1ProcessSrvTypeRqst(struct sockaddr_in* peeraddr, SLPMessage message, SLPBuffer* sendbuf, int errorcode) /*-------------------------------------------------------------------------*/ { char* type; char* end; char* slider; int i; int typelen; int numsrvtypes = 0; int size = 0; SLPDDatabaseSrvTypeRqstResult* db = 0; SLPBuffer result = *sendbuf; /*-------------------------------------------------*/ /* Check for one of our IP addresses in the prlist */ /*-------------------------------------------------*/ if (SLPIntersectStringList(message->body.srvtyperqst.prlistlen, message->body.srvtyperqst.prlist, G_SlpdProperty.interfacesLen, G_SlpdProperty.interfaces)) { result->end = result->start; goto FINISHED; } /*------------------------------------*/ /* Make sure that we handle the scope */ /*------------------------------------*/ if (SLPIntersectStringList(message->body.srvtyperqst.scopelistlen, message->body.srvtyperqst.scopelist, G_SlpdProperty.useScopesLen, G_SlpdProperty.useScopes) != 0) { /*------------------------------------*/ /* Find service types in the database */ /*------------------------------------*/ errorcode = SLPDDatabaseSrvTypeRqstStart(message, &db); } else { errorcode = SLP_ERROR_SCOPE_NOT_SUPPORTED; } /*----------------------------------------------------------------*/ /* Do not send error codes or empty replies to multicast requests */ /*----------------------------------------------------------------*/ if (message->header.flags & SLP_FLAG_MCAST) { if (errorcode != 0 || db->srvtypelistlen == 0) { result->end = result->start; goto FINISHED; } } /*-----------------------------------------------------------------*/ /* ensure the buffer is big enough to handle the whole srvtyperply */ /*-----------------------------------------------------------------*/ size = 16; /* 12 bytes for header, 2 bytes for error code, 2 bytes for num of service types */ if (errorcode == 0) { if (db->srvtypelistlen) { /* there has to be at least one service type*/ numsrvtypes = 1; /* count the rest of the service types */ type = db->srvtypelist; for (i=0; i< db->srvtypelistlen; i++) { if (type[i] == ',') { numsrvtypes += 1; } } /* figure out how much memory is required for srvtype strings */ typelen = INT_MAX; errorcode = SLPv1ToEncoding(0, &typelen, message->header.encoding, db->srvtypelist, db->srvtypelistlen); /* TRICKY: we add in the numofsrvtypes + 1 to make room for the */ /* type length. We can do this because the ',' of the comma */ /* delimited list is one byte. */ size = size + typelen + numsrvtypes + 1; } else { numsrvtypes = 0; } } /*-----------------*/ /* Allocate memory */ /*-----------------*/ result = SLPBufferRealloc(result,size); if (result == 0) { errorcode = SLP_ERROR_INTERNAL_ERROR; goto FINISHED; } /*----------------*/ /* Add the header */ /*----------------*/ /*version*/ *(result->start) = 1; /*function id*/ *(result->start + 1) = SLP_FUNCT_SRVTYPERPLY; /*length*/ ToUINT16(result->start + 2, size); /*flags - TODO set the flags correctly */ *(result->start + 4) = message->header.flags | (size > SLP_MAX_DATAGRAM_SIZE ? SLPv1_FLAG_OVERFLOW : 0); /*dialect*/ *(result->start + 5) = 0; /*language code*/ memcpy(result->start + 6, message->header.langtag, 2); ToUINT16(result->start + 8, message->header.encoding); /*xid*/ ToUINT16(result->start + 10, message->header.xid); /*-----------------------------*/ /* Add rest of the SrvTypeRply */ /*-----------------------------*/ result->curpos = result->start + 12; /* error code*/ ToUINT16(result->curpos, errorcode); result->curpos += 2; if (errorcode == 0) { /* num of service types */ ToUINT16(result->curpos, numsrvtypes); result->curpos += 2; /* service type strings */ type = db->srvtypelist; slider = db->srvtypelist; end = &(type[db->srvtypelistlen]); for (i=0;icurpos + 2, &typelen, message->header.encoding, type, slider - type); /* slip in the typelen */ ToUINT16(result->curpos, typelen); result->curpos += 2; result->curpos += typelen; slider ++; /* skip comma */ type = slider; } /* TODO - make sure we don't return generic types */ } FINISHED: if (db) SLPDDatabaseSrvTypeRqstEnd(db); *sendbuf = result; return errorcode; } /*=========================================================================*/ int SLPDv1ProcessMessage(struct sockaddr_in* peeraddr, SLPBuffer recvbuf, SLPBuffer* sendbuf) /* Processes the SLPv1 message and places the results in sendbuf */ /* */ /* peeraddr - the socket the message was received on */ /* */ /* recvbuf - message to process */ /* */ /* sendbuf - results of the processed message */ /* */ /* Returns - zero on success SLP_ERROR_PARSE_ERROR or */ /* SLP_ERROR_INTERNAL_ERROR on ENOMEM. */ /*=========================================================================*/ { SLPHeader header; SLPMessage message; int errorcode = 0; if (!G_SlpdProperty.isDA) { /* SLPv1 messages are handled only by DAs */ errorcode = SLP_ERROR_VER_NOT_SUPPORTED; return errorcode; } /* Parse just the message header the reset the buffer "curpos" pointer */ recvbuf->curpos = recvbuf->start; errorcode = SLPv1MessageParseHeader(recvbuf, &header); if (errorcode != 0) { return errorcode; } /* TRICKY: Duplicate SRVREG recvbufs *before* parsing them */ /* it because we are going to keep them in the */ if (header.functionid == SLP_FUNCT_SRVREG) { recvbuf = SLPBufferDup(recvbuf); if (recvbuf == NULL) { return SLP_ERROR_INTERNAL_ERROR; } } /* Allocate the message descriptor */ message = SLPMessageAlloc(); if (message) { /* Parse the message and fill out the message descriptor */ errorcode = SLPv1MessageParseBuffer(peeraddr,recvbuf, message); if (errorcode == 0) { /* Process messages based on type */ switch (message->header.functionid) { case SLP_FUNCT_SRVRQST: errorcode = v1ProcessSrvRqst(peeraddr, message, sendbuf, errorcode); break; case SLP_FUNCT_SRVREG: errorcode = v1ProcessSrvReg(peeraddr, message, recvbuf, sendbuf, errorcode); if (errorcode == 0) { SLPDKnownDAEcho(message, recvbuf); } break; case SLP_FUNCT_SRVDEREG: errorcode = v1ProcessSrvDeReg(peeraddr, message, sendbuf, errorcode); if (errorcode == 0) { SLPDKnownDAEcho(message, recvbuf); } break; case SLP_FUNCT_ATTRRQST: errorcode = v1ProcessAttrRqst(peeraddr, message, sendbuf, errorcode); break; case SLP_FUNCT_SRVTYPERQST: errorcode = v1ProcessSrvTypeRqst(peeraddr, message, sendbuf, errorcode); break; case SLP_FUNCT_DAADVERT: /* we are a SLPv2 DA, ignore other v1 DAs */ (*sendbuf)->end = (*sendbuf)->start; break; default: /* Should never happen... but we're paranoid */ errorcode = SLP_ERROR_PARSE_ERROR; break; } } if (header.functionid == SLP_FUNCT_SRVREG) { /* TRICKY: Do not free the message descriptor for SRVREGs */ /* because we are keeping them in the database */ /* unless there is an error then we free memory */ if (errorcode) { SLPMessageFree(message); SLPBufferFree(recvbuf); } } else { SLPMessageFree(message); } } else { /* out of memory */ errorcode = SLP_ERROR_INTERNAL_ERROR; } return errorcode; } openslp-1.2.1/slpd/slpd.h0000644033442200000310000001371210202054046015132 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd.h */ /* */ /* Abstract: Makes all declarations used by slpd. Included by all slpd */ /* source files */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLPD_H_INCLUDED #define SLPD_H_INCLUDED /*=========================================================================*/ /* Include platform specific headers files */ /*=========================================================================*/ #ifdef _WIN32 # include "slpd_win32.h" #else # ifdef HAVE_CONFIG_H # include "config.h" # endif # include "slpd_unistd.h" #endif /*=========================================================================*/ /* Misc "adjustable" constants (I would not adjust the if I were you) */ /*=========================================================================*/ #define SLPD_CONFIG_MAX_RECONN 2 /* max number tcp of reconnects */ /* to complete an outgoing */ /* transaction */ #define SLPD_MAX_SOCKETS 128 /* maximum number of sockets */ #define SLPD_COMFORT_SOCKETS 64 /* a "comfortable" number of */ /* of sockets. Exceeding this */ /* number will indicate a busy */ /* agent */ #define SLPD_CONFIG_CLOSE_CONN 900 /* max idle time (60 min) when */ /* not busy */ #define SLPD_CONFIG_BUSY_CLOSE_CONN 30 /* max idle time (30 sec) when */ /* busy */ #define SLPD_CONFIG_DA_FIND 900 /* minimum delay between active */ /* discovery requests (15 min) */ #define SLPD_AGE_INTERVAL 15 /* age every 15 seconds */ /*=========================================================================*/ /* Global variables representing signals */ /*=========================================================================*/ extern int G_SIGALRM; extern int G_SIGTERM; extern int G_SIGHUP; extern int G_SIGINT; #endif /*(!defined SLPD_H_INCLUDED) */ openslp-1.2.1/slpd/slpd_win32.c0000644033442200000310000006577110202047550016165 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_win32.c */ /* */ /* Abstract: Win32 specific part, to make SLPD run as a "service" */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slpd.h" /*=========================================================================*/ /* slpd includes */ /*=========================================================================*/ #include "slpd_cmdline.h" #include "slpd_log.h" #include "slpd_property.h" #include "slpd_database.h" #include "slpd_socket.h" #include "slpd_incoming.h" #include "slpd_outgoing.h" #include "slpd_knownda.h" /*=========================================================================*/ /* common code includes */ /*=========================================================================*/ #include "slp_linkedlist.h" #include "slp_xid.h" SERVICE_STATUS ssStatus; /* current status of the service */ SERVICE_STATUS_HANDLE sshStatusHandle; BOOL bDebug = FALSE; TCHAR szErr[256]; /*-------------------------------------------------------------------------*/ extern int G_SIGTERM; /* see slpd_main.c */ /*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/ void LoadFdSets(SLPList* socklist, int* highfd, fd_set* readfds, fd_set* writefds); /* see slpd_main.c */ /*-------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/ void HandleSigTerm(); /* see slpd_main.c */ /*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/ void HandleSigAlrm(); /* see slpd_main.c */ /*------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/ BOOL ReportStatusToSCMgr(DWORD dwCurrentState, DWORD dwWin32ExitCode, DWORD dwWaitHint) /* */ /* PURPOSE: Sets the current status of the service and */ /* reports it to the Service Control Manager */ /* */ /* PARAMETERS: */ /* dwCurrentState - the state of the service */ /* dwWin32ExitCode - error code to report */ /* dwWaitHint - worst case estimate to next checkpoint */ /* */ /* RETURN VALUE: */ /* TRUE - success */ /* FALSE - failure */ /* */ /*--------------------------------------------------------------------------*/ { static DWORD dwCheckPoint = 1; BOOL fResult = TRUE; /* when debugging we don't report to the SCM */ if(G_SlpdCommandLine.action != SLPD_DEBUG) { 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++; } /* Report the status of the service to the service control manager.*/ if(!(fResult = SetServiceStatus( sshStatusHandle, &ssStatus))) { SLPDLog("SetServiceStatus failed"); } } return fResult; } /*--------------------------------------------------------------------------*/ LPTSTR GetLastErrorText( LPTSTR lpszBuf, DWORD dwSize ) /* */ /* PURPOSE: copies error message text to string */ /* */ /* PARAMETERS: */ /* lpszBuf - destination buffer */ /* dwSize - size of buffer */ /* */ /* RETURN VALUE: */ /* destination buffer */ /* */ /*--------------------------------------------------------------------------*/ { DWORD dwRet; LPTSTR lpszTemp = NULL; dwRet = FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ARGUMENT_ARRAY, NULL, GetLastError(), LANG_NEUTRAL, (LPTSTR)&lpszTemp, 0, NULL ); /* supplied buffer is not long enough */ if(!dwRet || ( (long)dwSize < (long)dwRet+14 )) { lpszBuf[0] = TEXT('\0'); } else { lpszTemp[lstrlen(lpszTemp)-2] = TEXT('\0'); sprintf( lpszBuf, "%s (0x%x)", lpszTemp, GetLastError() ); } if(lpszTemp) { LocalFree((HLOCAL) lpszTemp ); } return lpszBuf; } /*--------------------------------------------------------------------------*/ void ServiceStop() /*--------------------------------------------------------------------------*/ { G_SIGTERM = 1; ReportStatusToSCMgr(SERVICE_STOPPED, /* service state */ NO_ERROR, /* exit code */ 3000); /* wait hint */ } /*--------------------------------------------------------------------------*/ void ServiceStart (int argc, char **argv) /*--------------------------------------------------------------------------*/ { fd_set readfds; fd_set writefds; int highfd; int fdcount = 0; time_t curtime; time_t alarmtime; struct timeval timeout; WSADATA wsaData; WORD wVersionRequested = MAKEWORD(1,1); /*------------------------*/ /* Service initialization */ /*------------------------*/ if(!ReportStatusToSCMgr(SERVICE_START_PENDING, /* service state*/ NO_ERROR, /* exit code */ 3000)) /* wait hint */ { goto cleanup; } if(WSAStartup(wVersionRequested, &wsaData) != 0) { (void)ReportStatusToSCMgr(SERVICE_STOP_PENDING, NO_ERROR, 0); goto cleanup; } /*------------------------*/ /* Parse the command line */ /*------------------------*/ if(SLPDParseCommandLine(argc,argv)) { ReportStatusToSCMgr(SERVICE_STOP_PENDING, /* service state */ NO_ERROR, /* exit code */ 0); /* wait hint */ goto cleanup_winsock; } if(!ReportStatusToSCMgr(SERVICE_START_PENDING, /* service state */ NO_ERROR, /* exit code */ 3000)) /* wait hint */ { goto cleanup_winsock; } /*------------------------------*/ /* Initialize the log file */ /*------------------------------*/ if(SLPDLogFileOpen(G_SlpdCommandLine.logfile, 1)) { SLPDLog("Could not open logfile %s\n",G_SlpdCommandLine.logfile); goto cleanup_winsock; } /*------------------------*/ /* Seed the XID generator */ /*------------------------*/ SLPXidSeed(); /*---------------------*/ /* Log startup message */ /*---------------------*/ SLPDLog("****************************************\n"); SLPDLogTime(); SLPDLog("SLPD daemon started\n"); SLPDLog("****************************************\n"); SLPDLog("Command line = %s\n",argv[0]); SLPDLog("Using configuration file = %s\n",G_SlpdCommandLine.cfgfile); SLPDLog("Using registration file = %s\n",G_SlpdCommandLine.regfile); if(!ReportStatusToSCMgr(SERVICE_START_PENDING, /* service state */ NO_ERROR, /* exit code */ 3000)) /* wait hint */ { goto cleanup_winsock; } /*--------------------------------------------------*/ /* Initialize for the first time */ /*--------------------------------------------------*/ if(SLPDPropertyInit(G_SlpdCommandLine.cfgfile) || SLPDDatabaseInit(G_SlpdCommandLine.regfile) || SLPDIncomingInit() || SLPDOutgoingInit() || SLPDKnownDAInit()) { SLPDLog("slpd initialization failed\n"); goto cleanup_winsock; } SLPDLog("Agent Interfaces = %s\n",G_SlpdProperty.interfaces); SLPDLog("Agent URL = %s\n",G_SlpdProperty.myUrl); /* Service is now running, perform work until shutdown */ if(!ReportStatusToSCMgr(SERVICE_RUNNING, /* service state */ NO_ERROR, /* exit code */ 0)) /* wait hint */ { goto cleanup_winsock; } /*-----------*/ /* Main loop */ /*-----------*/ SLPDLog("Startup complete entering main run loop ...\n\n"); G_SIGTERM = 0; curtime = time(&alarmtime); alarmtime = curtime + SLPD_AGE_INTERVAL; while(G_SIGTERM == 0) { /*--------------------------------------------------------*/ /* Load the fdsets up with all valid sockets in the list */ /*--------------------------------------------------------*/ highfd = 0; FD_ZERO(&readfds); FD_ZERO(&writefds); LoadFdSets(&G_IncomingSocketList, &highfd, &readfds,&writefds); LoadFdSets(&G_OutgoingSocketList, &highfd, &readfds,&writefds); /*--------------------------------------------------*/ /* Before select(), check to see if we got a signal */ /*--------------------------------------------------*/ if(G_SIGALRM) { goto HANDLE_SIGNAL; } /*-------------*/ /* Main select */ /*-------------*/ timeout.tv_sec = SLPD_AGE_INTERVAL; timeout.tv_usec = 0; fdcount = select(highfd+1,&readfds,&writefds,0,&timeout); if(fdcount > 0) /* fdcount will be < 0 when timed out */ { SLPDIncomingHandler(&fdcount,&readfds,&writefds); SLPDOutgoingHandler(&fdcount,&readfds,&writefds); } /*----------------*/ /* Handle signals */ /*----------------*/ HANDLE_SIGNAL: curtime = time(&curtime); if(curtime >= alarmtime) { HandleSigAlrm(); alarmtime = curtime + SLPD_AGE_INTERVAL; } } /* End of main loop */ /* Got SIGTERM */ HandleSigTerm(); cleanup_winsock: WSACleanup(); cleanup: ; } /*==========================================================================*/ BOOL WINAPI ControlHandler ( DWORD dwCtrlType ) /* */ /* PURPOSE: Handled console control events */ /* */ /* PARAMETERS: */ /* dwCtrlType - type of control event */ /* */ /* RETURN VALUE: */ /* True - handled */ /* False - unhandled */ /* */ /*==========================================================================*/ { switch(dwCtrlType) { case CTRL_BREAK_EVENT: /* use Ctrl+C or Ctrl+Break to simulate */ case CTRL_C_EVENT: /* SERVICE_CONTROL_STOP in debug mode */ printf("Stopping %s.\n", G_SERVICEDISPLAYNAME); ServiceStop(); return TRUE; break; } return FALSE; } /*==========================================================================*/ VOID WINAPI ServiceCtrl(DWORD dwCtrlCode) /* */ /* PURPOSE: This function is called by the SCM whenever */ /* ControlService() is called on this service. */ /* */ /* PARAMETERS: */ /* dwCtrlCode - type of control requested */ /* */ /* RETURN VALUE: */ /* none */ /* */ /*==========================================================================*/ { /* Handle the requested control code. */ /* */ switch(dwCtrlCode) { /* Stop the service. */ case SERVICE_CONTROL_STOP: ReportStatusToSCMgr(SERVICE_STOP_PENDING, NO_ERROR, 0); ServiceStop(); return; /* Update the service status. */ case SERVICE_CONTROL_INTERROGATE: break; /* invalid control code */ default: break; } ReportStatusToSCMgr(ssStatus.dwCurrentState, NO_ERROR, 0); } /*==========================================================================*/ void WINAPI SLPDServiceMain(DWORD argc, LPTSTR *argv) /*==========================================================================*/ { /* register our service control handler: */ sshStatusHandle = RegisterServiceCtrlHandler( G_SERVICENAME, ServiceCtrl); if(sshStatusHandle != 0) { /* SERVICE_STATUS members that don't change */ ssStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; ssStatus.dwServiceSpecificExitCode = 0; /* report the status to the service control manager. */ if(ReportStatusToSCMgr(SERVICE_START_PENDING, /* service state */ NO_ERROR, /* exit code */ 3000)) /* wait hint */ { ServiceStart(argc, argv); } } /* try to report the stopped status to the service control manager. */ if(sshStatusHandle) (void)ReportStatusToSCMgr(SERVICE_STOPPED, 0, 0); } /*--------------------------------------------------------------------------*/ void SLPDCmdInstallService(int automatic) /*--------------------------------------------------------------------------*/ { SC_HANDLE schService; SC_HANDLE schSCManager; DWORD start_type; TCHAR szPath[512]; if(GetModuleFileName( NULL, szPath, 512 ) == 0) { printf("Unable to install %s - %s\n", G_SERVICEDISPLAYNAME, GetLastErrorText(szErr, 256)); return; } if(automatic) { start_type = SERVICE_AUTO_START; } else { start_type = SERVICE_DEMAND_START; } schSCManager = OpenSCManager( NULL, /* machine (NULL == local) */ NULL, /* database (NULL == default) */ SC_MANAGER_ALL_ACCESS); /* access required */ if(schSCManager) { schService = CreateService( schSCManager, /* SCManager database */ G_SERVICENAME, /* name of service */ G_SERVICEDISPLAYNAME, /* name to display */ SERVICE_ALL_ACCESS, /* desired access */ SERVICE_WIN32_OWN_PROCESS, /* service type */ start_type, /* start type */ SERVICE_ERROR_NORMAL, /* error control type */ szPath, /* service's binary */ NULL, /* no load ordering group */ NULL, /* no tag identifier */ "", /* dependencies */ NULL, /* LocalSystem account */ NULL); /* no password */ if(schService) { printf("%s installed.\n", G_SERVICEDISPLAYNAME ); CloseServiceHandle(schService); } else { printf("CreateService failed - %s\n", GetLastErrorText(szErr, 256)); } CloseServiceHandle(schSCManager); } else printf("OpenSCManager failed - %s\n", GetLastErrorText(szErr,256)); } static void SLPDHlpStopService(SC_HANDLE schService) { /* try to stop the service */ if(ControlService(schService, SERVICE_CONTROL_STOP, &ssStatus)) { printf("Stopping %s.", G_SERVICEDISPLAYNAME); Sleep(1000); while(QueryServiceStatus(schService, &ssStatus)) { if(ssStatus.dwCurrentState == SERVICE_STOP_PENDING) { printf("."); Sleep(1000); } else break; } if(ssStatus.dwCurrentState == SERVICE_STOPPED) printf("\n%s stopped.\n", G_SERVICEDISPLAYNAME); else printf("\n%s failed to stop.\n", G_SERVICEDISPLAYNAME); } } /*--------------------------------------------------------------------------*/ void SLPDCmdRemoveService() /*--------------------------------------------------------------------------*/ { 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, G_SERVICENAME, SERVICE_ALL_ACCESS); if(schService) { SLPDHlpStopService(schService); /* now remove the service */ if(DeleteService(schService)) printf("%s removed.\n", G_SERVICEDISPLAYNAME ); else printf("DeleteService failed - %s\n", GetLastErrorText(szErr,256)); CloseServiceHandle(schService); } else printf("OpenService failed - %s\n", GetLastErrorText(szErr,256)); CloseServiceHandle(schSCManager); } else printf("OpenSCManager failed - %s\n", GetLastErrorText(szErr,256)); } /*--------------------------------------------------------------------------*/ void SLPDCmdStartService() /*--------------------------------------------------------------------------*/ { 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, G_SERVICENAME, SERVICE_ALL_ACCESS); if(schService) { if( !StartService(schService, 0, NULL)) { printf("OpenService failed - %s\n", GetLastErrorText(szErr,256)); } CloseServiceHandle(schService); } else { printf("OpenService failed - %s\n", GetLastErrorText(szErr,256)); } CloseServiceHandle(schSCManager); } else { printf("OpenSCManager failed - %s\n", GetLastErrorText(szErr,256)); } } /*--------------------------------------------------------------------------*/ void SLPDCmdStopService() /*--------------------------------------------------------------------------*/ { 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, G_SERVICENAME, SERVICE_ALL_ACCESS); if(schService) { SLPDHlpStopService(schService); CloseServiceHandle(schService); } else { printf("OpenService failed - %s\n", GetLastErrorText(szErr,256)); } CloseServiceHandle(schSCManager); } else { printf("OpenSCManager failed - %s\n", GetLastErrorText(szErr,256)); } } /*--------------------------------------------------------------------------*/ void SLPDCmdDebugService(int argc, char ** argv) /*--------------------------------------------------------------------------*/ { printf("Debugging %s.\n", G_SERVICEDISPLAYNAME); SetConsoleCtrlHandler( ControlHandler, TRUE ); ServiceStart( argc, argv ); } /*==========================================================================*/ void __cdecl main(int argc, char **argv) /*==========================================================================*/ { SERVICE_TABLE_ENTRY dispatchTable[] = { { G_SERVICENAME, (LPSERVICE_MAIN_FUNCTION)SLPDServiceMain}, { NULL, NULL} }; /*------------------------*/ /* Parse the command line */ /*------------------------*/ if(SLPDParseCommandLine(argc,argv)) { SLPDFatal("Invalid command line\n"); } switch(G_SlpdCommandLine.action) { case SLPD_DEBUG: SLPDCmdDebugService(argc, argv); break; case SLPD_INSTALL: SLPDCmdInstallService(G_SlpdCommandLine.autostart); break; case SLPD_REMOVE: SLPDCmdRemoveService(); break; case SLPD_START: SLPDCmdStartService(); break; case SLPD_STOP: SLPDCmdStopService(); break; default: SLPDPrintUsage(); StartServiceCtrlDispatcher(dispatchTable); break; } } openslp-1.2.1/slpd/slpd_knownda.h0000644033442200000310000003650410202047550016661 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_knownda.h */ /* */ /* Abstract: Keeps track of known DAs */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLPD_KNOWNDA_H_INCLUDED #define SLPD_KNOWNDA_H_INCLUDED #include "slpd.h" /*=========================================================================*/ /* common code includes */ /*=========================================================================*/ #include "slp_buffer.h" #include "slp_message.h" /*=========================================================================*/ int SLPDKnownDAInit(); /* Initializes the KnownDA list. Removes all entries and adds entries */ /* that are statically configured. */ /* */ /* returns zero on success, Non-zero on failure */ /*=========================================================================*/ /*=========================================================================*/ int SLPDKnownDADeinit(); /* Deinitializes the KnownDA list. Removes all entries and deregisters */ /* all services. */ /* */ /* returns zero on success, Non-zero on failure */ /*=========================================================================*/ /*=========================================================================*/ int SLPDKnownDAAdd(SLPMessage msg, SLPBuffer buf); /* Adds a DA to the known DA list if it is new, removes it if DA is going */ /* down or adjusts entry if DA changed. */ /* */ /* msg (IN) DAAdvert Message descriptor */ /* */ /* buf (IN) The DAAdvert message buffer */ /* */ /* returns Zero on success, Non-zero on error */ /*=========================================================================*/ /*=========================================================================*/ void SLPDKnownDARemove(struct in_addr* addr); /* Removes known DAs that sent DAAdverts from the specified in_addr */ /*=========================================================================*/ /*=========================================================================*/ void* SLPDKnownDAEnumStart(); /* Start an enumeration of all Known DAs */ /* */ /* Returns: An enumeration handle that is passed to subsequent calls to */ /* SLPDKnownDAEnum(). Returns NULL on failure. Returned */ /* enumeration handle (if not NULL) must be passed to */ /* SLPDKnownDAEnumEnd() when you are done with it. */ /*=========================================================================*/ /*=========================================================================*/ SLPMessage SLPDKnownDAEnum(void* eh, SLPMessage* msg, SLPBuffer* buf); /* Enumerate through all Known DAs */ /* */ /* eh (IN) pointer to opaque data that is used to maintain */ /* enumerate entries. Pass in a pointer to NULL to start */ /* enumeration. */ /* */ /* msg (OUT) pointer to the DAAdvert message descriptor */ /* */ /* buf (OUT) pointer to the DAAdvert message buffer */ /* */ /* returns: Pointer to enumerated entry or NULL if end of enumeration */ /*=========================================================================*/ /*=========================================================================*/ void SLPDKnownDAEnumEnd(void* eh); /* End an enumeration started by SLPDKnownDAEnumStart() */ /* */ /* Parameters: eh (IN) The enumeration handle returned by */ /* SLPDKnownDAEnumStart() */ /*=========================================================================*/ /*=========================================================================*/ int SLPDKnownDAGenerateMyDAAdvert(int errorcode, int deadda, int xid, SLPBuffer* sendbuf); /* Pack a buffer with a DAAdvert using information from a SLPDAentry */ /* */ /* errorcode (IN) the errorcode for the DAAdvert */ /* */ /* xid (IN) the xid to for the DAAdvert */ /* */ /* daentry (IN) pointer to the daentry that contains the rest of the info */ /* to make the DAAdvert */ /* */ /* sendbuf (OUT) pointer to the SLPBuffer that will be packed with a */ /* DAAdvert */ /* */ /* returns: zero on success, non-zero on error */ /*=========================================================================*/ #if defined(ENABLE_SLPv1) /*=========================================================================*/ int SLPDKnownDAGenerateMyV1DAAdvert(int errorcode, int encoding, unsigned int xid, SLPBuffer* sendbuf); /* Pack a buffer with a v1 DAAdvert using information from a SLPDAentry */ /* */ /* errorcode (IN) the errorcode for the DAAdvert */ /* */ /* encoding (IN) the SLPv1 language encoding for the DAAdvert */ /* */ /* xid (IN) the xid to for the DAAdvert */ /* */ /* sendbuf (OUT) pointer to the SLPBuffer that will be packed with a */ /* DAAdvert */ /* */ /* returns: zero on success, non-zero on error */ /*=========================================================================*/ #endif /*=========================================================================*/ void SLPDKnownDAEcho(SLPMessage msg, SLPBuffer buf); /* Echo a srvreg message to a known DA */ /* */ /* msg (IN) the SrvReg message descriptor */ /* */ /* buf (IN) the SrvReg message buffer to echo */ /* */ /* Returns: none */ /*=========================================================================*/ /*=========================================================================*/ void SLPDKnownDAActiveDiscovery(int seconds); /* Add a socket to the outgoing list to do active DA discovery SrvRqst */ /* */ /* Returns: none */ /*=========================================================================*/ /*=========================================================================*/ void SLPDKnownDAPassiveDAAdvert(int seconds, int dadead); /* Send passive daadvert messages if properly configured and running as */ /* a DA */ /* */ /* seconds (IN) number seconds that elapsed since the last call to this */ /* function */ /* */ /* dadead (IN) nonzero if the DA is dead and a bootstamp of 0 should be */ /* sent */ /* */ /* Returns: none */ /*=========================================================================*/ /*=========================================================================*/ void SLPDKnownDAImmortalRefresh(int seconds); /* Refresh all SLP_LIFETIME_MAXIMUM services */ /* */ /* seconds (IN) time in seconds since last call */ /*=========================================================================*/ /*=========================================================================*/ void SLPDKnownDADeRegisterWithAllDas(SLPMessage msg, SLPBuffer buf); /* Deregister the registration described by the specified message with all */ /* known DAs */ /* */ /* msg (IN) A message descriptor for a SrvReg or SrvDereg message to */ /* deregister */ /* */ /* buf (IN) Message buffer associated with msg */ /* */ /* Returns: None */ /*=========================================================================*/ /*=========================================================================*/ void SLPDKnownDARegisterWithAllDas(SLPMessage msg, SLPBuffer buf); /* Register the registration described by the specified message with all */ /* known DAs */ /* */ /* msg (IN) A message descriptor for a SrvReg or SrvDereg message to */ /* deregister */ /* */ /* buf (IN) Message buffer associated with msg */ /* */ /* Returns: None */ /*=========================================================================*/ #ifdef DEBUG /*=========================================================================*/ void SLPDKnownDADump(); /*=========================================================================*/ #endif #endif openslp-1.2.1/slpd/slpd_cmdline.c0000644033442200000310000002353010202047547016627 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_cmdline.c */ /* */ /* Abstract: Simple command line processor */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ /*=========================================================================*/ /* slpd includes */ /*=========================================================================*/ #include "slpd_cmdline.h" /*=========================================================================*/ /* Make sure ETCDIR and VARDIR are defined */ /*=========================================================================*/ #if !defined(ETCDIR) #define ETCDIR "/etc" #endif #if !defined(VARDIR) #define VARDIR "/var" #endif #if !defined(VERSION) #define VERSION "unknown" #endif /*=========================================================================*/ SLPDCommandLine G_SlpdCommandLine; /* Global variable containing command line options */ /*=========================================================================*/ /*=========================================================================*/ void SLPDPrintUsage() /* Displays available command line options of SLPD */ /*=========================================================================*/ { #ifdef _WIN32 fprintf(stderr,"USAGE: slpd -install [auto]|-remove|-start|-stop|-debug [-d] [-c conf file] [-l log file] [-s spi file] [-r reg file] [-v version]\n"); #else fprintf(stderr,"USAGE: slpd [-d] [-c conf file] [-l log file] [-r reg file] [-s spi file] [-v version]\n"); #endif } /*=========================================================================*/ int SLPDParseCommandLine(int argc,char* argv[]) /* Must be called to initialize the command line */ /* */ /* argc (IN) the argc as passed to main() */ /* */ /* argv (IN) the argv as passed to main() */ /* */ /* Returns - zero on success. non-zero on usage error */ /*=========================================================================*/ { int i; /* Set defaults */ memset(&G_SlpdCommandLine,0,sizeof(SLPDCommandLine)); #ifndef _WIN32 strcpy(G_SlpdCommandLine.cfgfile,SLPD_CONFFILE); strcpy(G_SlpdCommandLine.logfile,SLPD_LOGFILE); strcpy(G_SlpdCommandLine.regfile,SLPD_REGFILE); strcpy(G_SlpdCommandLine.pidfile,SLPD_PIDFILE); #ifdef ENABLE_SLPv2_SECURITY strcpy(G_SlpdCommandLine.spifile,SLPD_SPIFILE); #endif #else ExpandEnvironmentStrings(SLPD_CONFFILE,G_SlpdCommandLine.cfgfile,MAX_PATH); ExpandEnvironmentStrings(SLPD_LOGFILE,G_SlpdCommandLine.logfile,MAX_PATH); ExpandEnvironmentStrings(SLPD_REGFILE,G_SlpdCommandLine.regfile,MAX_PATH); ExpandEnvironmentStrings(SLPD_PIDFILE,G_SlpdCommandLine.pidfile,MAX_PATH); #ifdef ENABLE_SLPv2_SECURITY ExpandEnvironmentStrings(SLPD_SPIFILE,G_SlpdCommandLine.spifile,MAX_PATH); #endif G_SlpdCommandLine.action = -1; #endif G_SlpdCommandLine.detach = 1; for(i=1; i= argc) goto USAGE; strncpy(G_SlpdCommandLine.logfile,argv[i],MAX_PATH-1); } else if(strcmp(argv[i],"-r") == 0) { i++; if(i >= argc) goto USAGE; strncpy(G_SlpdCommandLine.regfile,argv[i],MAX_PATH-1); } else if(strcmp(argv[i],"-c") == 0) { i++; if(i >= argc) goto USAGE; strncpy(G_SlpdCommandLine.cfgfile,argv[i],MAX_PATH-1); } #ifdef ENABLE_SLPv2_SECURITY else if(strcmp(argv[i],"-s") == 0) { i++; if(i >= argc) goto USAGE; strncpy(G_SlpdCommandLine.spifile,argv[i],MAX_PATH-1); } #endif else if(strcmp(argv[i],"-p") == 0) { i++; if(i >= argc) goto USAGE; strncpy(G_SlpdCommandLine.pidfile,argv[i],MAX_PATH-1); } else if(strcmp(argv[i],"-d") == 0) { G_SlpdCommandLine.detach = 0; } else if((strcmp(argv[i], "-v") == 0) || (strcmp(argv[i], "-V") == 0) || (strcmp(argv[i], "--version") == 0) || (strcmp(argv[i], "-version") == 0)) { #ifdef _WIN32 fprintf(stderr,"slpd version: %s\n", SLP_VERSION); #else /* UNIX */ fprintf(stderr,"slpd version: %s\n", VERSION); #endif /* Show options. */ fprintf(stderr,"compile options:\n" " debugging: " #ifdef DEBUG "enabled" #else "disabled" #endif /* NDEBUG */ "\n" " predicates: " #ifdef ENABLE_PREDICATES "enabled" #else "disabled" #endif /* ENABLE_PREDICATES */ "\n" " slpv1 compatability: " #ifdef ENABLE_SLPv1 "enabled" #else "disabled" #endif /* ENABLE_SLPv1 */ "\n" " slpv2 security: " #ifdef ENABLE_SLPv2_SECURITY "enabled" #else "disabled" #endif /* ENABLE_SLPv2_SECURITY */ "\n" ); exit(1); } else { goto USAGE; } } return 0; USAGE: SLPDPrintUsage(); return 1; } openslp-1.2.1/slpd/slpd_predicate.h0000644033442200000310000001615310202047550017156 0ustar rganesanfloppy /***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_predicate.h */ /* */ /* Abstract: This files contains an implementation of LDAPv3 search */ /* filters for SLP (as specified in RFC 2254). */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLPD_PREDICATE_H_INCLUDED #define SLPD_PREDICATE_H_INCLUDED #include "slpd.h" #define SLPD_ATTR_RECURSION_DEPTH 50 /* max recursion depth for attr */ /* parser */ /*=========================================================================*/ int SLPDPredicateTest(int version, int attrlistlen, const char* attrlist, int predicatelen, const char* predicate); /* Determine whether the specified attribute list satisfies */ /* the specified predicate */ /* */ /* version (IN) SLP version of the predicate string (should always be */ /* 2 since we don't handle SLPv1 predicates yet) */ /* */ /* attrlistlen (IN) length of attrlist */ /* */ /* attr (IN) attribute list to test */ /* */ /* predicatelen (IN) length of the predicate string */ /* */ /* predicate (IN) the predicate string */ /* */ /* Returns: Boolean value. Zero of test fails. Non-zero if test fails */ /* or if there is a parse error in the predicate string */ /*=========================================================================*/ /*=========================================================================*/ int SLPDFilterAttributes(int attrlistlen, const char* attrlist, int taglistlen, const char* taglist, int* resultlen, char** result); /* Copies attributes from the specified attribute list to a result string */ /* according to the taglist as described by section 10.4. of RFC 2608 */ /* */ /* version (IN) SLP version of the predicate string (should always be */ /* 2 since we don't handle SLPv1 predicates yet) */ /* */ /* attrlistlen (IN) length of attrlist */ /* */ /* attr (IN) attribute list to test */ /* */ /* predicatelen (IN) length of the predicate string */ /* */ /* predicate (IN) the predicate string */ /* */ /* Returns: Zero on success. Nonzero on failure */ /*=========================================================================*/ #endif openslp-1.2.1/slpd/slpd_win32.h0000644033442200000310000001672010207404661016165 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_win32.h */ /* */ /* Abstract: Win32 specific header file */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLPD_WIN32_H_INCLUDED #define SLPD_WIN32_H_INCLUDED #define WIN32_LEAN_AND_MEAN #include #include #include #include #include #include #include #include #if(_WIN32_WINNT >= 0x0400 && _WIN32_WINNT < 0x0500) #include #endif /* internal name of the service */ #define G_SERVICENAME "slpd" /* displayed name of the service */ #define G_SERVICEDISPLAYNAME "Service Location Protocol" #if(!defined MAX_PATH) #define MAX_PATH 256 #endif typedef DWORD pid_t; typedef DWORD uid_t; typedef int socklen_t; typedef DWORD gid_t; typedef SOCKET sockfd_t; /* enum detailing what to do with SLPD when launching it : run in the console for debug, install it as a service or uninstall it */ typedef enum SLPDAction { SLPD_DEBUG = 0, SLPD_INSTALL = 1, SLPD_REMOVE = 2, SLPD_START = 3, SLPD_STOP = 4 } SLPDAction; /* definition for inet_aton() since Microsoft does not have this yet */ #define inet_aton(opt,bind) ((bind)->s_addr = inet_addr(opt)) /*=========================================================================*/ VOID WINAPI SLPDServiceMain(DWORD argc, LPTSTR *argv); /* Performs actual initialization of the service */ /* This routine performs the service initialization and then calls the */ /* user defined ServiceStart() routine to perform majority of the work */ /* */ /* argc (IN) number of command line arguments */ /* */ /* argv (IN) array of command line arguments */ /* */ /* returns none */ /* */ /*=========================================================================*/ /*=========================================================================*/ VOID SLPDCmdInstallService(int automatic); /* Installs the SLPD service in the system */ /* */ /* automatic boolean specifying whether service should start automatically */ /* */ /* returns none */ /*=========================================================================*/ /*=========================================================================*/ VOID SLPDCmdRemoveService(); /* Removes the SLPD service from the system */ /* */ /* returns none */ /*=========================================================================*/ /*=========================================================================*/ VOID SLPDCmdDebugService(int argc, char **argv); /* Runs SLPD in a terminal, to help debugging */ /* */ /* argc (IN) number of command line arguments */ /* */ /* argv (IN) array of command line arguments */ /* */ /* returns none */ /*=========================================================================*/ #endif /* SLPD_WIN32_H_INCLUDED */ openslp-1.2.1/slpd/slpd_incoming.h0000644033442200000310000001537610202047550017027 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_incoming.c */ /* */ /* Abstract: Handles "incoming" network conversations requests made by */ /* other agents to slpd. (slpd_outgoing.c handles reqests */ /* made by slpd to other agents) */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLPD_INCOMING_H_INCLUDE #define SLPD_INCOMING_H_INCLUDE #include "slpd.h" /*=========================================================================*/ /* common code includes */ /*=========================================================================*/ #include "slp_linkedlist.h" /*=========================================================================*/ extern SLPList G_IncomingSocketList; /*=========================================================================*/ /*=========================================================================*/ void SLPDIncomingAge(time_t seconds); /* Age the sockets in the incoming list by the specified number of seconds.*/ /* */ /* seconds (IN) seconds to age each entry of the list */ /*=========================================================================*/ /*=========================================================================*/ void SLPDIncomingHandler(int* fdcount, fd_set* readfds, fd_set* writefds); /* Handles all outgoing requests that are pending on the specified file */ /* discriptors */ /* */ /* fdcount (IN/OUT) number of file descriptors marked in fd_sets */ /* */ /* readfds (IN) file descriptors with pending read IO */ /* */ /* writefds (IN) file descriptors with pending read IO */ /*=========================================================================*/ /*=========================================================================*/ int SLPDIncomingInit(); /* Initialize incoming socket list to have appropriate sockets for all */ /* network interfaces */ /* */ /* Returns Zero on success non-zero on error */ /*=========================================================================*/ /*=========================================================================*/ int SLPDIncomingDeinit(); /* Deinitialize incoming socket list to have appropriate sockets for all */ /* network interfaces */ /* */ /* Returns Zero on success non-zero on error */ /*=========================================================================*/ #ifdef DEBUG /*=========================================================================*/ void SLPDIncomingSocketDump(); /*=========================================================================*/ #endif #endif openslp-1.2.1/slpd/slpd_predicate.c0000644033442200000310000015464310202047550017160 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_database.c */ /* */ /* Abstract: This files contains an implementation of LDAPv3 search */ /* filters for SLP (as specified in RFC 2254). */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ /*********/ /* TODO: The current implementation reparses the predicate string every */ /* time it is evaluated. This implementation should be refactored to */ /* parse the predicate string once, build some sort of data- */ /* structure out of that, and then compare the predicate DS with the */ /* attribute DS. */ /*********/ /********* * * Assumptions: * - If a tag specified in the query string does not exist, that's a FALSE * - The "Undefined" value mentioned in the LDAPv3 RFC (2251) is synonymous * with "false". * - The "Approx" operator matches as an equal operator. * - Variable matching on type is strict: ie, the right-hand-side of an * operator must evaluate to the same type as the tag referenced on the * left-hand-side. * * Known Bugs/TODO: * - If trash follows the last operand to a binary argument, it will be * ignored if the operand is not evaluated due to short circuiting: * ie, in "(&(first=*)(second<=3)trash)", "trash" will be silently * ignored _if_ "(first=*)" is true. * - Escaped '*' characters are treated as wildcards in the string equality * operator: ie, in "(string=abc\2axyz)" will match the literal string * "abc\2axyz" instead of "abc*xyz". * - No operations can be performed on opaque data types. *********/ #include #include #include #include "slpd_predicate.h" #include "../libslpattr/libslpattr.h" #include "../libslpattr/libslpattr_internal.h" /* The character that is a wildcard. */ #define WILDCARD ('*') #define BRACKET_OPEN '(' #define BRACKET_CLOSE ')' #ifndef MIN #define MIN(x,y) (x < y ? x : y) #endif /************************* ***********************/ /* Tests a character to see if it reserved (as defined in RFC 2608, p11). */ #define IS_RESERVED(x) (((x) == '(' || (x) == ')' || (x) == ',' || (x) == '\\' || (x) == '!' || (x) == '<' || (x) == '=' || (x) == '>' || (x) == '~') || ((((char)0x01 <= (x)) && ((char)0x1F >= (x))) || ((x) == (char)0x7F))) #define IS_INVALID_VALUE_CHAR(x) IS_RESERVED(x) #define IS_INVALID_TAG_CHAR(x) (IS_RESERVED(x) || ((x) == '*') || ((x) == (char)0x0D) || ((x) == (char)0x0A) || ((x) == (char)0x09) || ((x) == '_')) #define IS_VALID_TAG_CHAR(x) (!IS_INVALID_TAG_CHAR(x)) /************************* ***********************/ /*--------------------------------------------------------------------------*/ const char *substr(const char *haystack, const char *needle, int needle_len) /* Does a case insensitive substring match for needle in haystack. */ /* */ /* Returns pointer to the start of the substring. NULL if the substring is */ /* not found. */ /* FIXME This implementation isn't exactly blazingly fast... */ /*--------------------------------------------------------------------------*/ { const char *hs_cur; for(hs_cur = haystack; *hs_cur != 0; hs_cur++) { if(strncasecmp(hs_cur, needle, needle_len) == 0) { return hs_cur; } } return NULL; } /*--------------------------------------------------------------------------*/ typedef enum { FR_UNSET /* Placeholder. Used to detect errors. */, FR_INTERNAL_SYSTEM_ERROR /* Internal error. */, FR_PARSE_ERROR /* Parse error detected. */, FR_MEMORY_ALLOC_FAILED /* Ran out of memory. */, FR_EVAL_TRUE /* Expression successfully evaluated to true. */, FR_EVAL_FALSE /* Expression successfully evaluated to false. */ } FilterResult; /*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/ int escaped_verify(char *escaped, int len, int *punescaped_len) /* Verifies and finds the length of an escaped string */ /* */ /* Params: */ /* escaped -- (IN) string of escaped characters */ /* len -- (IN) length of escaped */ /* unescaped_len -- (OUT) pointer to location to write the unescaped */ /* length of escaped to */ /* */ /* Returns: */ /* 1 if valid string, 0 if invalid. If 0, then punescaped_count will not */ /* be set */ /*--------------------------------------------------------------------------*/ { int i; int unescaped_len; int seq_pos; /* Position in the current escape sequence. Set to zero when not in escape seq. */ seq_pos = 0; for(i = unescaped_len = 0; i < len; i++) { /* Verify escape sequences. */ if(seq_pos == 1 || seq_pos == 2) { if(!isxdigit((int) escaped[i])) { return 0; } if(seq_pos == 2) { seq_pos = 0; } else { seq_pos++; } } else { unescaped_len++; } /* Check for escape sequences. */ if(escaped[i] == '\\') { seq_pos = 1; } } if(punescaped_len) { *punescaped_len = unescaped_len; } return 1; } /*--------------------------------------------------------------------------*/ int unescape_check(char d1, char d2, char *val) /* Unescape the character represented by the two given hex values. */ /* */ /* Params: */ /* d1 -- (IN) First hex char */ /* d1 -- (IN) second hex char */ /* val -- (OUT) the value of the character is written to here */ /* */ /* Returns: */ /* 1 on successful conversion, 0 if one or more of the hex digits are */ /* invalid */ /*--------------------------------------------------------------------------*/ { if(!isxdigit((int) d1) || !isxdigit((int) d2)) { return 0; } if((d1 >= 'A') && (d1 <= 'F')) d1 = d1 - 'A' + 0x0A; else d1 = d1 - '0'; if((d2 >= 'A') && (d2 <= 'F')) d2 = d2 - 'A' + 0x0A; else d2 = d2 - '0'; *val = d2 + (d1 * 0x10); return 1; } /*--------------------------------------------------------------------------*/ FilterResult unescape_cmp(const char *escaped, int escaped_len, const char *verbatim, int verbatim_len, SLPBoolean strict_len, int *punescaped_count) /* Compares two strings that (potentially) contain escaped characters */ /* */ /* Params: */ /* escaped -- escaped string to compare */ /* escaped_len -- length of the escaped string (including esc chars) */ /* verbatim -- string to compare against (not escaped) */ /* verbatim_len -- length of the verbatim string */ /* strict_len -- if TRUE, the number of characters in verbatim that match */ /* must be _exactly_ verbatim_len. If FALSE, at most verbatim_len*/ /* characters may match */ /* unescaped_count -- (OUT) the number of unescaped characters. Can be */ /* NULL */ /* */ /*--------------------------------------------------------------------------*/ { char unesc; /* Holder for unescaped characters. */ int esc_i; /* Index into escaped. */ int ver_i; /* Index into verbatim. */ int unescaped_count; unescaped_count = esc_i = ver_i = 0; /***** Compare every pair of characters. *****/ while(1) { /**** Check for string end. ****/ if(esc_i >= escaped_len) { if(punescaped_count != NULL) { *punescaped_count = unescaped_count; } if(strict_len == SLP_TRUE) { if(ver_i >= verbatim_len) { return FR_EVAL_TRUE; } else { return FR_EVAL_FALSE; } } return FR_EVAL_TRUE; } /**** Check for escaping ****/ if(escaped[esc_i] == '\\') { /*** Check for truncated escape values. ***/ if(esc_i + 2 >= escaped_len) { return FR_PARSE_ERROR; } /*** Unescape. ***/ if(!unescape_check(escaped[esc_i+1], escaped[esc_i+2], &unesc)) { return FR_PARSE_ERROR; } /*** Increment. ***/ esc_i += 2; } else { unesc = escaped[esc_i]; } if(unesc != verbatim[ver_i]) /* quick check for equality*/ { if(! isascii(unesc) /* case insensitive check */ || ! isalpha(unesc) || ! isalpha(verbatim[ver_i]) || tolower(unesc) != tolower(verbatim[ver_i])) { return FR_EVAL_FALSE; } } unescaped_count++; esc_i++; ver_i++; } } /*--------------------------------------------------------------------------*/ void *my_memmem(char *haystack, int haystack_len, char *needle, int needle_len, int *punescaped_len) /* locate an (escaped) substring */ /* */ /* Params: */ /* haystack -- (IN) unescaped memory to look in */ /* haystack_len -- (IN) length of haystack */ /* needle -- (IN) escaped memory to search for */ /* needle_len -- (IN) length of needle */ /* punescaped_len -- (OUT) the size of the unescaped needle. invalid if */ /* NULL is returned */ /* */ /* Returns: */ /* pointer to substring. NULL if there is no substring */ /*--------------------------------------------------------------------------*/ { int offset; int search_len; if(escaped_verify(haystack, haystack_len, &search_len) == 0) { return NULL; } for(offset = 0; offset <= search_len; offset++) { FilterResult err; err = unescape_cmp(needle, needle_len, haystack + offset, haystack_len - offset, SLP_FALSE, punescaped_len); if(err == FR_EVAL_TRUE) { return(void *)(haystack + offset); } else if(err != FR_EVAL_FALSE) { return NULL; } } return NULL; } /*--------------------------------------------------------------------------*/ FilterResult wildcard_wc_str(char *pattern, int pattern_len, char *str, int str_len) /* */ /* Params: */ /* pattern -- the pattern to evaluate */ /* pattern_len -- the length of the pattern (in bytes) */ /* str -- the string to test the pattern on */ /* str_len -- the length of the string */ /* */ /* Returns: */ /* -1 error, 0 success, 1 failure */ /*--------------------------------------------------------------------------*/ { char *text_start; /* Pointer to the text following the WC(s) */ int text_len; /* Length of the text. */ char *found; /* The start of a string found in a search. */ char *rem_start; /* Start of the remaining characters being searched for. */ int rem_len; /* Length of the remaining charcters being searched for. */ if(pattern_len == 0 && str_len == 0) { return FR_EVAL_TRUE; } if(pattern_len == 0) { return FR_EVAL_FALSE; } /***** Find text following wildcard *****/ /**** Find end of WCs ****/ text_start = pattern; text_len = 0; while(*text_start == WILDCARD) { text_start++; if(text_start == pattern + pattern_len) { /* No following text. Therefore we match. */ return FR_EVAL_TRUE; } } /**** Find end of text. ****/ found = memchr(text_start, WILDCARD, pattern_len - text_len); if(found == NULL) { /* No trailing WC. Set to end. */ found = pattern + pattern_len; } text_len = found - text_start; /***** Look for the text in the source string *****/ rem_start = str; rem_len = str_len; while(1) { int result; int match_len; found = my_memmem(rem_start, rem_len, text_start, text_len, &match_len); assert(found == NULL || ((found >= rem_start) && (found <= rem_start + rem_len))); if(found == NULL) { /* Desired text is not in the string. */ return FR_EVAL_FALSE; } rem_len = str_len - (found - str); rem_start = found + 1; /**** Make recursive call. ****/ result = wildcard_wc_str(text_start + text_len, (pattern + pattern_len) - (text_start + text_len), found + text_len, rem_len - match_len); if(result != FR_EVAL_FALSE) { return result; } } /*NOTREACHED*/ assert(0); } /*--------------------------------------------------------------------------*/ FilterResult wildcard(const char *pattern, int pattern_len, const char *str, int str_len) /* Check the pattern against the given string. Public interface to wildcard */ /* functionality. */ /* */ /* Params: */ /* pattern -- the pattern to evaluate */ /* pattern_len -- the length of the pattern (in bytes) */ /* str -- the string to test the pattern on */ /* str_len -- the length of the string */ /* */ /* Returns: */ /* -1 error, 0 success, 1 failure */ /* */ /* Implementation: */ /* This is the interface to wildcard finding. It actually just prepares */ /* for repeated calls to wildcard_wc_str() */ /*--------------------------------------------------------------------------*/ { char *first_wc; /* Position of the first WC in the pattern. */ int first_wc_len; /* Position of first_wc in pattern. */ int unescaped_first_wc_len; /* Position of first_wc in unescaped version of pattern. */ /***** Check text up to first WC *****/ /**** Get text ****/ first_wc = memchr(pattern, WILDCARD, pattern_len); if(first_wc == NULL) { /* No wc */ return unescape_cmp(pattern, pattern_len, str, str_len, SLP_TRUE, NULL); } else { first_wc_len = first_wc - pattern; } /**** Compare. ****/ unescaped_first_wc_len = first_wc_len; if(first_wc_len > 0) { FilterResult err; err = unescape_cmp(pattern, first_wc_len, str, str_len, SLP_FALSE, &unescaped_first_wc_len); if(err != FR_EVAL_TRUE) { /* The leading text is different. */ return err; } } /***** Start recursive call. *****/ return wildcard_wc_str(first_wc, pattern_len - first_wc_len, (char *)str + unescaped_first_wc_len, str_len - unescaped_first_wc_len); } /*--------------------------------------------------------------------------*/ int is_bool_string(const char *str, int str_len, SLPBoolean *val) /* Tests a string to see if it is a boolean. */ /*--------------------------------------------------------------------------*/ { if(str_len == 4 && memcmp(str, "true", 4) == 0) /* 4 -> length of string "true" */ { *val = SLP_TRUE; return 1; } if(str_len == 5 && memcmp(str, "false", 5) == 0) /* 5 -> len of "false" */ { *val = SLP_FALSE; return 1; } return 0; } /*--------------------------------------------------------------------------*/ typedef enum { EQUAL, APPROX, GREATER, LESS, PRESENT } Operation; /*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/ FilterResult int_op(SLPAttributes slp_attr, char *tag, int tag_len, char *rhs, Operation op) /* Perform an integer operation. */ /*--------------------------------------------------------------------------*/ { int rhs_val; /* The converted value of rhs. */ char *end; /* Pointer to the end of op. */ var_t *var; /* Pointer to the variable named by tag. */ value_t *value; /* A value in var. */ FilterResult result; /* Value to return. */ assert(op != PRESENT); result = FR_UNSET; /* For verification. */ /* TODO Only do this in debug. */ /***** Verify and convert rhs. *****/ rhs_val = strtol(rhs, &end, 10); if(*end != 0 && *end != BRACKET_CLOSE) { /* Trying to compare an int with a non-int. */ return FR_EVAL_FALSE; } /***** Get variable. *****/ var = attr_val_find_str((struct xx_SLPAttributes *)slp_attr, tag, tag_len); if(var == NULL) { return FR_EVAL_FALSE; } /**** Check type. ****/ if(var->type != SLP_INTEGER) { return FR_EVAL_FALSE; } /***** Compare. *****/ value = var->list; assert(value != NULL); assert(op != PRESENT); switch(op) { case(EQUAL): result = FR_EVAL_FALSE; for(; value; value = value->next) { if(value->data.va_int == rhs_val) { result = FR_EVAL_TRUE; break; } } break; case(APPROX): assert(0); /* TODO: Figure out how this works later. */ result = FR_EVAL_FALSE; break; case(GREATER): result = FR_EVAL_FALSE; for(; value; value = value->next) { if(value->data.va_int >= rhs_val) { result = FR_EVAL_TRUE; break; } } break; case(LESS): result = FR_EVAL_FALSE; for(; value; value = value->next) { if(value->data.va_int <= rhs_val) { result = FR_EVAL_TRUE; break; } } break; default: assert(0); } assert(result != FR_UNSET); return result; } /*--------------------------------------------------------------------------*/ FilterResult keyw_op(SLPAttributes slp_attr, char *tag, char *rhs, Operation op) /* Perform a keyword operation. */ /*--------------------------------------------------------------------------*/ { /* Note that the only test keywords are allowed to undergo is PRESENT, * also note that PRESENT is handled by our calling function. * * We are therefore quite justified in saying: */ assert(op != PRESENT); return FR_EVAL_FALSE; } /*--------------------------------------------------------------------------*/ FilterResult bool_op(SLPAttributes slp_attr, char *tag, int tag_len, char *rhs, int rhs_len, Operation op) /* Perform a boolean operation. */ /*--------------------------------------------------------------------------*/ { SLPBoolean rhs_val; /* The value of the rhs. */ var_t *var; FilterResult result; assert(op != PRESENT); result = FR_UNSET; /* Note that the only valid non-PRESENT operator is EQUAL. */ if(op != EQUAL) { return FR_EVAL_FALSE; } /***** Get and check the rhs value. *****/ if(!is_bool_string(rhs, rhs_len, &rhs_val)) { return FR_EVAL_FALSE; } /***** Get the tag value. *****/ var = attr_val_find_str((struct xx_SLPAttributes *)slp_attr, tag, tag_len); if(var == NULL) { return FR_EVAL_FALSE; } /**** Check type. ****/ if(var->type != SLP_BOOLEAN) { return FR_EVAL_FALSE; } /***** Compare. *****/ if(var->list->data.va_bool == rhs_val) { result = FR_EVAL_TRUE; } else { result = FR_EVAL_FALSE; } assert(result != FR_UNSET); return result; } /*--------------------------------------------------------------------------*/ FilterResult str_op(SLPAttributes slp_attr, char *tag, int tag_len, char *rhs, int rhs_len, Operation op) /* Perform a string operation. */ /*--------------------------------------------------------------------------*/ { char *str_val; /* Converted value of rhs. */ int str_len; /* Length of converted value. */ var_t *var; assert(op != PRESENT); /***** Verify rhs. *****/ str_val = rhs; str_len = rhs_len; /***** Get tag value. *****/ var = attr_val_find_str((struct xx_SLPAttributes *)slp_attr, tag, tag_len); if(var == NULL) { return FR_EVAL_FALSE; } /**** Check type. ****/ if(var->type != SLP_STRING) { return FR_EVAL_FALSE; } /***** Compare. *****/ assert(op != PRESENT); if(op == APPROX) { assert(0); /* TODO: Figure out how this works later. */ } else if(op == EQUAL) { int result; value_t *value; for(value = var->list; value; value = value->next) { result = wildcard(str_val, str_len, value->data.va_str, value->unescaped_len); /* We only keep going if the test fails. Let caller handle other problems. */ if(result != FR_EVAL_FALSE) { return result; } } } else { value_t *value; /* We know that the op must be comparative. */ assert(op == LESS || op == GREATER); for(value = var->list; value; value = value->next) { int result; result = memcmp(value->data.va_str, str_val, MIN(str_len, value->unescaped_len)); if( (result <= 0 && op == LESS) || (result >= 0 && op == GREATER) ) { return FR_EVAL_TRUE; } } } return FR_EVAL_FALSE; } /*--------------------------------------------------------------------------*/ FilterResult opaque_op(SLPAttributes slp_attr, char *tag, int tag_len, char *rhs, int rhs_len, Operation op) /* Perform an opaque operation. */ /*--------------------------------------------------------------------------*/ { char *str_val; /* Converted value of rhs. */ int str_len; /* Length of converted value. */ var_t *var; assert(op != PRESENT); /***** Verify and convert rhs. *****/ str_val = rhs; str_len = rhs_len; /***** Get tag value. *****/ var = attr_val_find_str((struct xx_SLPAttributes *)slp_attr, tag, tag_len); if(var == NULL) { return FR_EVAL_FALSE; } /**** Check type. ****/ if(var->type != SLP_OPAQUE) { return FR_EVAL_FALSE; } /***** Compare. *****/ assert(op != PRESENT); if(op == APPROX) { assert(0); /* TODO: Figure out how this works later. */ } else if(op == EQUAL) { int result; value_t *value; for(value = var->list; value; value = value->next) { result = wildcard(str_val, str_len, value->data.va_str, value->unescaped_len); /* We only keep going if the test fails. Let caller handle other problems. */ if(result != FR_EVAL_FALSE) { return result; } } } else { value_t *value; /* We know that the op must be comparative. */ assert(op == LESS || op == GREATER); for(value = var->list; value; value = value->next) { int result; result = memcmp(value->data.va_str, str_val, MIN(str_len, value->unescaped_len)); if( (result <= 0 && op == LESS) || (result >= 0 && op == GREATER) ) { return FR_EVAL_TRUE; } } } return FR_EVAL_FALSE; } /*--------------------------------------------------------------------------*/ int is_int_string(const char *str) /* Tests a string to see if it consists wholly of numeric characters. */ /*--------------------------------------------------------------------------*/ { int i; for(i=0; str[i] != '\0'; i++) { if(!((!isdigit((int)str[i])) || str[i] == '-')) { return 0; } } return 1; } /*--------------------------------------------------------------------------*/ char *find_substr(char *src, int src_len, char *to_find) /* Returns ptr to start of substring, or null. */ /*--------------------------------------------------------------------------*/ { int i; for(i = 0; i < src_len; i++) { if(src[i] == *to_find) { int old_i = i; /* Save the old start. */ int find_index; for(find_index = 0; (to_find[find_index] != '\0') && (i < src_len) && (to_find[find_index] == src[i]); to_find++, i++) { } if(to_find[find_index] == '\0') { return src + i; } i = old_i; /* Restor the old start. */ } } return 0; } /*--------------------------------------------------------------------------*/ char *find_bracket_end(const char *str) /* Finds a bracket matched to this one. Returns 0 if there isn't one. */ /*--------------------------------------------------------------------------*/ { int open_count; const char *cur; if(*str != BRACKET_OPEN) { return 0; } open_count = 0; /***** Count brackets. *****/ for(cur = str; *cur != '\0'; cur++) { assert(open_count >= 0); /**** Check current character. ****/ if(*cur == BRACKET_OPEN) { open_count++; } else if(*cur == BRACKET_CLOSE) { open_count--; } /**** Check if we've found bracket end. ****/ if(open_count == 0) { return(char *)cur; } } return 0; } /*--------------------------------------------------------------------------*/ struct pair /* Represents a string and its length. */ { char *start; char *end; /* Stop reading _BEFORE_ end. ie, at end-1. */ }; /*--------------------------------------------------------------------------*/ #if defined(ENABLE_SLPv1) /*--------------------------------------------------------------------------*/ FilterResult filterv1(const char *start, const char **end, SLPAttributes slp_attr, int recursion_depth) /* Parameters: */ /* start -- (IN) The start of the string to work in. */ /* end -- (OUT) The end of the string processed. After successful processing*/ /* (ie, no PARSE_ERRORs), this will be pointed at the character*/ /* following the last char in this level of the expression. */ /* slp_attr -- (IN) The attributes handle to compare on. */ /* return_value -- (OUT) The result of the search. Only valid if SLP_OK was */ /* returned. */ /* */ /* Returns: SLP_OK on successful search (ie, the search was do-able). */ /* SLP_PARSE_ERROR on search error. The end of the expression is */ /* returned through end. */ /* NOTE: This attempt only implements one comparision operator (==) */ /*--------------------------------------------------------------------------*/ { char *operator; /* Pointer to the operator substring. */ const char *cur; /* Current working character. */ const char *last_char; /* The last character in the working string. */ FilterResult err = FR_UNSET; /* The result of an evaluation. */ FilterResult stop_condition = FR_UNSET; if(recursion_depth <= 0) { return FR_PARSE_ERROR; } recursion_depth--; if(*start == 0) { *end = start; return FR_EVAL_TRUE; } if(*start != BRACKET_OPEN) { return FR_PARSE_ERROR; } /***** Get the current expression. *****/ last_char = *end = find_bracket_end(start); if(*end == 0) { return FR_PARSE_ERROR; } (*end)++; /* Move the end pointer past the closing bracket. */ /**** * Check for the three legal characters that can follow an expression, * if the following character isn't one of those, the following character * is trash. ****/ if(!(**end == BRACKET_OPEN || **end == BRACKET_CLOSE || **end == '\0')) { return FR_PARSE_ERROR; } /***** check for boolean op. *****/ cur = start; cur++; switch(*cur) { case('&'): /***** And. *****/ case('|'): /***** Or. *****/ { if(*cur == '&') { stop_condition = FR_EVAL_FALSE; } else if(*cur == '|') { stop_condition = FR_EVAL_TRUE; } cur++; /* Move past operator. */ /*** Ensure that we have at least one operator. ***/ if(*cur != BRACKET_OPEN || cur >= last_char) { return FR_PARSE_ERROR; } /*** Evaluate each operand. ***/ /* NOTE: Due to the condition on the above "if", we are guarenteed that the first iteration of the loop is valid. */ do { err = filterv1(cur, &cur, slp_attr, recursion_depth); /*** Propagate errors. ***/ if(err != FR_EVAL_TRUE && err != FR_EVAL_FALSE) { return err; } /*** Short circuit. ***/ if(err == stop_condition) { return stop_condition; } } while(*cur == BRACKET_OPEN && cur < last_char); /*** If we ever get here, it means we've evaluated every operand without short circuiting -- meaning that the operation failed. ***/ return(stop_condition == FR_EVAL_TRUE ? FR_EVAL_FALSE : FR_EVAL_TRUE); } case('!'): /***** Not. *****/ /**** Child. ****/ cur++; err = filterv1(cur, &cur, slp_attr, recursion_depth); /*** Return errors. ***/ if(err != FR_EVAL_TRUE && err != FR_EVAL_FALSE) { return err; } /*** Perform "not". ***/ return(err == FR_EVAL_TRUE ? FR_EVAL_FALSE : FR_EVAL_TRUE); default: /***** Unknown operator. *****/ ; /* We don't do anything here because this will catch the first character of every leaf predicate. */ } /***** Check for leaf operator. *****/ if(IS_VALID_TAG_CHAR(*cur)) { Operation op; char *lhs, *rhs; /* The two operands. */ char *val_start; /* The character after the operator. ie, the start of the rhs. */ int lhs_len, rhs_len; /* Length of the lhs/rhs. */ SLPType type; SLPError slp_err; /**** Demux leaf op. ****/ /* Support only "==", we look for the equals * sign, and then poke around on either side of that for the real * value. */ operator = (char *)memchr(cur, '=', last_char - cur); if(operator == 0 || *(operator + 1) != '=') { /**** No search operator. ****/ return FR_PARSE_ERROR; } /* The rhs always follows the operator. (This doesn't really make sense for PRESENT ops, but ignore that). */ val_start = operator + 2; if(operator == cur) {/* Check that we can poke back one char. */ return FR_PARSE_ERROR; } op = EQUAL; /***** Get operands. *****/ /**** Left. ****/ lhs_len = operator - cur; lhs = (char *)cur; /**** Right ****/ rhs_len = last_char - val_start; rhs = val_start; /***** Do leaf operation. *****/ /**** Check that tag exists. ****/ slp_err = SLPAttrGetType_len(slp_attr, lhs, lhs_len, &type); if(slp_err == SLP_TAG_ERROR) { /* Tag doesn't exist. */ return FR_EVAL_FALSE; } else if(slp_err == SLP_OK) { /* Tag exists. */ /**** Do operation. *****/ if(op == PRESENT) { /*** Since the PRESENT operation is the same for all types, do that now. ***/ return FR_EVAL_TRUE; } else { /*** A type-specific operation. ***/ switch(type) { case(SLP_BOOLEAN): err = bool_op(slp_attr, lhs, lhs_len, rhs, rhs_len, op); break; case(SLP_INTEGER): err = int_op(slp_attr, lhs, lhs_len, rhs, op); break; case(SLP_KEYWORD): err = keyw_op(slp_attr, lhs, rhs, op); break; case(SLP_STRING): err = str_op(slp_attr, lhs, lhs_len, rhs, rhs_len, op); break; case(SLP_OPAQUE): assert(0); /* Opaque is not yet supported. */ } } } else { /* Some other tag-related error. */ err = FR_INTERNAL_SYSTEM_ERROR; } assert(err != FR_UNSET); return err; } /***** No operator. *****/ return FR_PARSE_ERROR; } #endif /*--------------------------------------------------------------------------*/ FilterResult filter(const char *start, const char **end, SLPAttributes slp_attr, int recursion_depth) /* Parameters: */ /* start -- (IN) The start of the string to work in. */ /* end -- (OUT) The end of the string processed. After successful processing*/ /* (ie, no PARSE_ERRORs), this will be pointed at the character*/ /* following the last char in this level of the expression. */ /* slp_attr -- (IN) The attributes handle to compare on. */ /* return_value -- (OUT) The result of the search. Only valid if SLP_OK was */ /* returned. */ /* */ /* Returns: SLP_OK on successful search (ie, the search was do-able). */ /* SLP_PARSE_ERROR on search error. The end of the expression is */ /* returned through end. */ /*--------------------------------------------------------------------------*/ { char *operator; /* Pointer to the operator substring. */ const char *cur; /* Current working character. */ const char *last_char; /* The last character in the working string. */ FilterResult err = FR_UNSET; /* The result of an evaluation. */ FilterResult stop_condition = FR_UNSET; if(recursion_depth <= 0) { return FR_PARSE_ERROR; } recursion_depth--; if(*start != BRACKET_OPEN) { return FR_PARSE_ERROR; } /***** Get the current expression. *****/ last_char = *end = find_bracket_end(start); if(*end == 0) { return FR_PARSE_ERROR; } (*end)++; /* Move the end pointer past the closing bracket. */ /**** * Check for the three legal characters that can follow an expression, * if the following character isn't one of those, the following character * is trash. ****/ if(!(**end == BRACKET_OPEN || **end == BRACKET_CLOSE || **end == '\0')) { return FR_PARSE_ERROR; } /***** check for boolean op. *****/ cur = start; cur++; switch(*cur) { case('&'): /***** And. *****/ case('|'): /***** Or. *****/ { if(*cur == '&') { stop_condition = FR_EVAL_FALSE; } else if(*cur == '|') { stop_condition = FR_EVAL_TRUE; } cur++; /* Move past operator. */ /*** Ensure that we have at least one operator. ***/ if(*cur != BRACKET_OPEN || cur >= last_char) { return FR_PARSE_ERROR; } /*** Evaluate each operand. ***/ /* NOTE: Due to the condition on the above "if", we are guarenteed that the first iteration of the loop is valid. */ do { err = filter(cur, &cur, slp_attr, recursion_depth); /*** Propagate errors. ***/ if(err != FR_EVAL_TRUE && err != FR_EVAL_FALSE) { return err; } /*** Short circuit. ***/ if(err == stop_condition) { return stop_condition; } } while(*cur == BRACKET_OPEN && cur < last_char); /*** If we ever get here, it means we've evaluated every operand without short circuiting -- meaning that the operation failed. ***/ return(stop_condition == FR_EVAL_TRUE ? FR_EVAL_FALSE : FR_EVAL_TRUE); } case('!'): /***** Not. *****/ /**** Child. ****/ cur++; err = filter(cur, &cur, slp_attr, recursion_depth); /*** Return errors. ***/ if(err != FR_EVAL_TRUE && err != FR_EVAL_FALSE) { return err; } /*** Perform "not". ***/ return(err == FR_EVAL_TRUE ? FR_EVAL_FALSE : FR_EVAL_TRUE); default: /***** Unknown operator. *****/ ; /* We don't do anything here because this will catch the first character of every leaf predicate. */ } /***** Check for leaf operator. *****/ if(IS_VALID_TAG_CHAR(*cur)) { Operation op; char *lhs, *rhs; /* The two operands. */ char *val_start; /* The character after the operator. ie, the start of the rhs. */ int lhs_len, rhs_len; /* Length of the lhs/rhs. */ SLPType type; SLPError slp_err; /**** Demux leaf op. ****/ /* Since all search operators contain a "=", we look for the equals * sign, and then poke around on either side of that for the real * value. */ operator = (char *)memchr(cur, '=', last_char - cur); if(operator == 0) { /**** No search operator. ****/ return FR_PARSE_ERROR; } /* The rhs always follows the operator. (This doesn't really make sense for PRESENT ops, but ignore that). */ val_start = operator + 1; /* Check for APPROX, GREATER, or LESS. Note that we shuffle the operator pointer back to point at the start of the op. */ if(operator == cur) {/* Check that we can poke back one char. */ return FR_PARSE_ERROR; } switch(*(operator - 1)) { case('~'): op = EQUAL; /* See Assumptions. */ operator--; break; case('>'): op = GREATER; operator--; break; case('<'): op = LESS; operator--; break; default: /* No prefix to the '='. */ /**** Check for PRESENT. ****/ if((operator == last_char - 2) && (*(operator+1) == '*')) { op = PRESENT; } /**** It's none of the above: therefore it's EQUAL. ****/ else { op = EQUAL; } } /***** Get operands. *****/ /**** Left. ****/ lhs_len = operator - cur; lhs = (char *)cur; /**** Right ****/ rhs_len = last_char - val_start; rhs = val_start; /***** Do leaf operation. *****/ /**** Check that tag exists. ****/ slp_err = SLPAttrGetType_len(slp_attr, lhs, lhs_len, &type); if(slp_err == SLP_TAG_ERROR) { /* Tag doesn't exist. */ return FR_EVAL_FALSE; } else if(slp_err == SLP_OK) { /* Tag exists. */ /**** Do operation. *****/ if(op == PRESENT) { /*** Since the PRESENT operation is the same for all types, do that now. ***/ return FR_EVAL_TRUE; } else { /*** A type-specific operation. ***/ switch(type) { case(SLP_BOOLEAN): err = bool_op(slp_attr, lhs, lhs_len, rhs, rhs_len, op); break; case(SLP_INTEGER): err = int_op(slp_attr, lhs, lhs_len, rhs, op); break; case(SLP_KEYWORD): err = keyw_op(slp_attr, lhs, rhs, op); break; case(SLP_STRING): err = str_op(slp_attr, lhs, lhs_len, rhs, rhs_len, op); break; case(SLP_OPAQUE): assert(0); /* Opaque is not yet supported. */ } } } else { /* Some other tag-related error. */ err = FR_INTERNAL_SYSTEM_ERROR; } assert(err != FR_UNSET); return err; } /***** No operator. *****/ return FR_PARSE_ERROR; } /*=========================================================================*/ int SLPDPredicateTest(int version, int attrlistlen, const char* attrlist, int predicatelen, const char* predicate) /* Determine whether the specified attribute list satisfies */ /* the specified predicate */ /* */ /* version (IN) SLP version of the predicate string (should always be */ /* 2 since we don't handle SLPv1 predicates yet) */ /* */ /* attrlistlen (IN) length of attrlist */ /* */ /* attr (IN) attribute list to test */ /* */ /* predicatelen (IN) length of the predicate string */ /* */ /* predicate (IN) the predicate string */ /* */ /* Returns: Boolean value. Zero of test fails. Non-zero if test fails */ /* or if there is a parse error in the predicate string */ /*=========================================================================*/ { SLPAttributes attr; const char *end; /* Pointer to the end of the parsed attribute string. */ FilterResult err; char attrnull; char prednull; int result = 0; /* An NULL or empty string is always true. */ if(predicate == 0 || *(char *)predicate == 0) { return 1; } /* Attempt v1 too. */ if(version != 2 #if defined(ENABLE_SLPv1) && version != 1 #endif ) { return 1; } /* TRICKY: Temporarily NULL terminate the attribute list */ /* and the predicate string. We can do this because */ /* there is room in the corresponding SLPv2 SRVREG */ /* and SRVRQST messages. Basically we are squashing */ /* the authcount and the spi string length. Don't */ /* worry, we fix things up later and it is MUCH */ /* faster than a malloc() for a new buffer 1 byte */ /* longer! */ prednull = predicate[predicatelen]; ((char*)predicate)[predicatelen] = 0; attrnull = attrlist[attrlistlen]; ((char*)attrlist)[attrlistlen] = 0; /* Generate an SLPAttr from the comma delimited list */ if(SLPAttrAlloc("en", NULL, SLP_FALSE, &attr) == 0) { if(SLPAttrFreshen(attr, attrlist) == 0) { switch(version) { #if defined(ENABLE_SLPv1) case 1: err=filterv1(predicate, &end, attr, SLPD_ATTR_RECURSION_DEPTH); break; #endif default: err=filter(predicate, &end, attr, SLPD_ATTR_RECURSION_DEPTH); break; } /* Check for trailing trash data. */ if((err == FR_EVAL_TRUE || err == FR_EVAL_FALSE) && *end != 0) { result = 0; } else if(err == FR_EVAL_TRUE) { result = 1; } } SLPAttrFree(attr); } /* Un null terminate */ ((char*)predicate)[predicatelen] = prednull; ((char*)attrlist)[attrlistlen] = attrnull; return result; } /*=========================================================================*/ int SLPDFilterAttributes(int attrlistlen, const char* attrlist, int taglistlen, const char* taglist, int* resultlen, char** result) /* Copies attributes from the specified attribute list to a result string */ /* according to the taglist as described by section 10.4. of RFC 2608 */ /* */ /* version (IN) SLP version of the predicate string (should always be */ /* 2 since we don't handle SLPv1 predicates yet) */ /* */ /* attrlistlen (IN) length of attrlist */ /* */ /* attr (IN) attribute list to test */ /* */ /* predicatelen (IN) length of the predicate string */ /* */ /* predicate (IN) the predicate string */ /* */ /* Returns: Zero on success. Nonzero on failure */ /*=========================================================================*/ { SLPAttributes attr; FilterResult err; char attrnull; char tagnull; *result = 0; *resultlen = 0; /* TRICKY: Temporarily NULL terminate the attribute list */ /* and the tag string. We can do this because */ /* there is room in the corresponding SLPv2 SRVREG */ /* and ATTRRQST messages. Basically we are squashing */ /* the authcount and the spi string length. Don't */ /* worry, we fix things up later and it is MUCH */ /* faster than a malloc() for a new buffer 1 byte */ /* longer! */ tagnull = taglist[taglistlen]; ((char*)taglist)[taglistlen] = 0; attrnull = attrlist[attrlistlen]; ((char*)attrlist)[attrlistlen] = 0; /* Generate an SLPAttr from the comma delimited list */ err = 1; if(SLPAttrAlloc("en", NULL, SLP_FALSE, &attr) == 0) { if(SLPAttrFreshen(attr, attrlist) == 0) { err = SLPAttrSerialize(attr, taglist, result, *resultlen, resultlen, SLP_FALSE); } SLPAttrFree(attr); } /* SLPAttrSerialize counts the NULL terminator which we don't care about*/ if(*resultlen) { *resultlen -= 1; } /* Un null terminate */ ((char*)taglist)[taglistlen] = tagnull; ((char*)attrlist)[attrlistlen] = attrnull; return(*resultlen == 0); } openslp-1.2.1/slpd/slpd_main.c0000644033442200000310000004634710202245105016141 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_main.c */ /* */ /* Abstract: Main daemon loop */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slpd.h" /*=========================================================================*/ /* slpd includes */ /*=========================================================================*/ #include "slpd_log.h" #include "slpd_socket.h" #include "slpd_incoming.h" #include "slpd_outgoing.h" #include "slpd_database.h" #include "slpd_cmdline.h" #include "slpd_knownda.h" #include "slpd_property.h" #ifdef ENABLE_SLPv2_SECURITY #include "slpd_spi.h" #endif /*=========================================================================*/ /* common code includes */ /*=========================================================================*/ #include "slp_xmalloc.h" #include "slp_xid.h" /*==========================================================================*/ int G_SIGALRM; int G_SIGTERM; int G_SIGHUP; #ifdef DEBUG int G_SIGINT; /* Signal being used for dumping registrations */ #endif /*==========================================================================*/ /*-------------------------------------------------------------------------*/ void LoadFdSets(SLPList* socklist, int* highfd, fd_set* readfds, fd_set* writefds) /*-------------------------------------------------------------------------*/ { SLPDSocket* sock = 0; SLPDSocket* del = 0; sock = (SLPDSocket*)socklist->head; while(sock) { if(sock->fd > *highfd) { *highfd = sock->fd; } switch(sock->state) { case DATAGRAM_UNICAST: case DATAGRAM_MULTICAST: case DATAGRAM_BROADCAST: FD_SET(sock->fd,readfds); break; case SOCKET_LISTEN: if(socklist->count < SLPD_MAX_SOCKETS) { FD_SET(sock->fd,readfds); } break; case STREAM_READ: case STREAM_READ_FIRST: FD_SET(sock->fd,readfds); break; case STREAM_WRITE: case STREAM_WRITE_FIRST: case STREAM_CONNECT_BLOCK: FD_SET(sock->fd,writefds); break; case SOCKET_CLOSE: del = sock; break; default: break; } sock = (SLPDSocket*)sock->listitem.next; if(del) { SLPDSocketFree((SLPDSocket*)SLPListUnlink(socklist,(SLPListItem*)del)); del = 0; } } } /*------------------------------------------------------------------------*/ void HandleSigTerm() /*------------------------------------------------------------------------*/ { struct timeval timeout; fd_set readfds; fd_set writefds; int highfd = 0; int fdcount = 0; SLPDLog("****************************************\n"); SLPDLogTime(); SLPDLog("SLPD daemon shutting down\n"); SLPDLog("****************************************\n"); /* close all incoming sockets */ SLPDIncomingDeinit(); /* unregister with all DAs */ SLPDKnownDADeinit(); timeout.tv_sec = 5; timeout.tv_usec = 0; /* Do a dead DA passive advert to tell everyone we're goin' down */ SLPDKnownDAPassiveDAAdvert(0, 1); /* if possible wait until all outgoing socket are done and closed */ while(SLPDOutgoingDeinit(1)) { FD_ZERO(&writefds); FD_ZERO(&readfds); LoadFdSets(&G_OutgoingSocketList, &highfd, &readfds,&writefds); fdcount = select(highfd+1,&readfds,&writefds,0,&timeout); if(fdcount == 0) { break; } SLPDOutgoingHandler(&fdcount,&readfds,&writefds); } SLPDOutgoingDeinit(0); SLPDLog("****************************************\n"); SLPDLogTime(); SLPDLog("SLPD daemon shut down\n"); SLPDLog("****************************************\n"); #ifdef DEBUG #ifdef ENABLE_SLPv2_SECURITY SLPDSpiDeinit(); #endif SLPDDatabaseDeinit(); SLPDPropertyDeinit(); SLPDLogFileClose(); xmalloc_deinit(); #endif } /*------------------------------------------------------------------------*/ void HandleSigHup() /*------------------------------------------------------------------------*/ { /* Reinitialize */ SLPDLog("****************************************\n"); SLPDLogTime(); SLPDLog("SLPD daemon reset by SIGHUP\n"); SLPDLog("****************************************\n\n"); /* unregister with all DAs */ SLPDKnownDADeinit(); /* re-read properties */ SLPDPropertyInit(G_SlpdCommandLine.cfgfile); #ifdef ENABLE_SLPv2_SECURITY /* Re-initialize SPI stuff*/ SLPDSpiInit(G_SlpdCommandLine.spifile); #endif /* Re-read the static registration file (slp.reg)*/ SLPDDatabaseReInit(G_SlpdCommandLine.regfile); /* Rebuild Known DA database */ SLPDKnownDAInit(); SLPDLog("****************************************\n"); SLPDLogTime(); SLPDLog("SLPD daemon reset finished\n"); SLPDLog("****************************************\n\n"); } /*------------------------------------------------------------------------*/ void HandleSigAlrm() /*------------------------------------------------------------------------*/ { SLPDIncomingAge(SLPD_AGE_INTERVAL); SLPDOutgoingAge(SLPD_AGE_INTERVAL); SLPDKnownDAImmortalRefresh(SLPD_AGE_INTERVAL); SLPDKnownDAPassiveDAAdvert(SLPD_AGE_INTERVAL,0); SLPDKnownDAActiveDiscovery(SLPD_AGE_INTERVAL); SLPDDatabaseAge(SLPD_AGE_INTERVAL,G_SlpdProperty.isDA); } #ifdef DEBUG /*--------------------------------------------------------------------------*/ void HandleSigInt() /*--------------------------------------------------------------------------*/ { SLPDIncomingSocketDump(); SLPDOutgoingSocketDump(); SLPDKnownDADump(); SLPDDatabaseDump(); } #endif #ifndef _WIN32 /*-------------------------------------------------------------------------*/ int CheckPid(const char* pidfile) /* Check a pid file to see if slpd is already running */ /* */ /* Returns: 0 on success. non-zero on failure */ /*-------------------------------------------------------------------------*/ { pid_t pid; FILE* fd; char pidstr[14]; /*------------------------------------------*/ /* make sure that we're not running already */ /*------------------------------------------*/ /* read the pid from the file */ fd = fopen(pidfile,"r"); if(fd) { memset(pidstr,0,14); fread(pidstr,13,1,fd); pid = atoi(pidstr); if(pid) { if(kill(pid,0) == 0) { /* we are already running */ return -1; } } fclose(fd); } return 0; } /*-------------------------------------------------------------------------*/ int WritePid(const char* pidfile, pid_t pid) /* Write the pid file */ /* */ /* Returns: 0 on success. non-zero on failure */ /*-------------------------------------------------------------------------*/ { FILE* fd; char pidstr[14]; /* write my pid to the pidfile */ fd = fopen(pidfile,"w"); if(fd) { sprintf(pidstr,"%i",(int)pid); fwrite(pidstr,strlen(pidstr),1,fd); fclose(fd); } return 0; } /*-------------------------------------------------------------------------*/ int Daemonize(const char* pidfile) /* Turn the calling process into a daemon (detach from tty setuid(), etc */ /* */ /* Returns: zero on success non-zero if slpd could not daemonize (or if */ /* slpd is already running . */ /*-------------------------------------------------------------------------*/ { FILE* fd; struct passwd* pwent; pid_t pid; char pidstr[14]; /* fork() if we should detach */ if(G_SlpdCommandLine.detach) { pid = fork(); } else { pid = getpid(); } /* parent or child? */ switch(pid) { case -1: return -1; case 0: /* child lives */ break; default: /* parent writes pid (or child) pid file and dies */ fd = fopen(pidfile,"w"); if(fd) { sprintf(pidstr,"%i",(int)pid); fwrite(pidstr,strlen(pidstr),1,fd); fclose(fd); } if(G_SlpdCommandLine.detach) { exit(0); } break; } close(0); close(1); close(2); setsid(); /* will only fail if we are already the process group leader */ /*----------------*/ /* suid to daemon */ /*----------------*/ /* TODO: why do the following lines mess up my signal handlers? */ pwent = getpwnam("daemon"); if(pwent) { if(setgroups(1, &pwent->pw_gid) < 0 || setgid(pwent->pw_gid) < 0 || setuid(pwent->pw_uid) < 0) { /* TODO: should we log here and return fail */ exit(1); } } else exit(1); /*--------------------*/ /* Set cwd to / (root)*/ /*--------------------*/ chdir("/"); return 0; } /*--------------------------------------------------------------------------*/ void SignalHandler(int signum) /*--------------------------------------------------------------------------*/ { switch(signum) { case SIGALRM: G_SIGALRM = 1; break; case SIGTERM: G_SIGTERM = 1; break; case SIGHUP: G_SIGHUP = 1; break; #ifdef DEBUG case SIGINT: G_SIGINT = 1; break; #endif case SIGPIPE: default: break; } } /*-------------------------------------------------------------------------*/ int SetUpSignalHandlers() /*-------------------------------------------------------------------------*/ { int result; struct sigaction sa; sa.sa_handler = SignalHandler; sigemptyset(&sa.sa_mask); sa.sa_flags = 0;//SA_ONESHOT; #if defined(HAVE_SA_RESTORER) sa.sa_restorer = 0; #endif result = sigaction(SIGALRM,&sa,0); result |= sigaction(SIGTERM,&sa,0); result |= sigaction(SIGPIPE,&sa,0); #ifdef DEBUG result |= sigaction(SIGINT,&sa,0); #endif signal(SIGHUP,SignalHandler); //result |= sigaction(SIGHUP,&sa,0); return result; } /*=========================================================================*/ int main(int argc, char* argv[]) /*=========================================================================*/ { fd_set readfds; fd_set writefds; int highfd; int fdcount = 0; #ifdef DEBUG xmalloc_init("/var/log/slpd_xmalloc.log",0); #endif /*------------------------*/ /* Parse the command line */ /*------------------------*/ if(SLPDParseCommandLine(argc,argv)) { SLPDFatal("Invalid command line\n"); } /*------------------------------*/ /* Make sure we are root */ /*------------------------------*/ if(getuid() != 0) { SLPDFatal("slpd must be started by root\n"); } /*--------------------------------------*/ /* Make sure we are not already running */ /*--------------------------------------*/ if(CheckPid(G_SlpdCommandLine.pidfile)) { SLPDFatal("slpd is already running. Check %s\n", G_SlpdCommandLine.pidfile); } /*------------------------------*/ /* Initialize the log file */ /*------------------------------*/ if(SLPDLogFileOpen(G_SlpdCommandLine.logfile, 1)) { SLPDFatal("Could not open logfile %s\n",G_SlpdCommandLine.logfile); } /*------------------------*/ /* Seed the XID generator */ /*------------------------*/ SLPXidSeed(); /*---------------------*/ /* Log startup message */ /*---------------------*/ SLPDLog("****************************************\n"); SLPDLogTime(); SLPDLog("SLPD daemon started\n"); SLPDLog("****************************************\n"); SLPDLog("Command line = %s\n",argv[0]); SLPDLog("Using configuration file = %s\n",G_SlpdCommandLine.cfgfile); SLPDLog("Using registration file = %s\n",G_SlpdCommandLine.regfile); #ifdef ENABLE_SLPv2_SECURITY SLPDLog("Using SPI file = %s\n",G_SlpdCommandLine.spifile); #endif /*--------------------------------------------------*/ /* Initialize for the first time */ /*--------------------------------------------------*/ if(SLPDPropertyInit(G_SlpdCommandLine.cfgfile) || #ifdef ENABLE_SLPv2_SECURITY SLPDSpiInit(G_SlpdCommandLine.spifile) || #endif SLPDDatabaseInit(G_SlpdCommandLine.regfile) || SLPDIncomingInit() || SLPDOutgoingInit() || SLPDKnownDAInit()) { SLPDFatal("slpd initialization failed\n"); } SLPDLog("Agent Interfaces = %s\n",G_SlpdProperty.interfaces); SLPDLog("Agent URL = %s\n",G_SlpdProperty.myUrl); /*---------------------------*/ /* make slpd run as a daemon */ /*---------------------------*/ if(Daemonize(G_SlpdCommandLine.pidfile)) { SLPDFatal("Could not daemonize\n"); } /*-----------------------*/ /* Setup signal handlers */ /*-----------------------*/ if(SetUpSignalHandlers()) { SLPDFatal("Error setting up signal handlers.\n"); } /*------------------------------*/ /* Set up alarm to age database */ /*------------------------------*/ alarm(SLPD_AGE_INTERVAL); /*-----------*/ /* Main loop */ /*-----------*/ SLPDLog("Startup complete entering main run loop ...\n\n"); G_SIGALRM = 0; G_SIGTERM = 0; G_SIGHUP = 0; #ifdef DEBUG G_SIGINT = 0; #endif while(G_SIGTERM == 0) { /*--------------------------------------------------------*/ /* Load the fdsets up with all valid sockets in the list */ /*--------------------------------------------------------*/ highfd = 0; FD_ZERO(&readfds); FD_ZERO(&writefds); LoadFdSets(&G_IncomingSocketList, &highfd, &readfds,&writefds); LoadFdSets(&G_OutgoingSocketList, &highfd, &readfds,&writefds); /*--------------------------------------------------*/ /* Before select(), check to see if we got a signal */ /*--------------------------------------------------*/ if(G_SIGALRM || G_SIGHUP) { goto HANDLE_SIGNAL; } /*-------------*/ /* Main select */ /*-------------*/ fdcount = select(highfd+1,&readfds,&writefds,0,0); if(fdcount > 0) /* fdcount will be < 0 when interrupted by a signal */ { SLPDIncomingHandler(&fdcount,&readfds,&writefds); SLPDOutgoingHandler(&fdcount,&readfds,&writefds); } /*----------------*/ /* Handle signals */ /*----------------*/ HANDLE_SIGNAL: if(G_SIGHUP) { HandleSigHup(); G_SIGHUP = 0; } if(G_SIGALRM) { HandleSigAlrm(); G_SIGALRM = 0; alarm(SLPD_AGE_INTERVAL); } #ifdef DEBUG if (G_SIGINT) { HandleSigInt(); G_SIGINT = 0; } #endif } /* End of main loop */ /* Got SIGTERM */ HandleSigTerm(); return 0; } #endif /*ifndef _WIN32 */ openslp-1.2.1/slpd/slpd_cmdline.h0000644033442200000310000001465510202047550016636 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_cmdline.h */ /* */ /* Abstract: Simple command line processor */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLPD_CMDLINE_H_INCLUDED #define SLPD_CMDLINE_H_INCLUDED #include "slpd.h" /*=========================================================================*/ /* Filename constants */ /*=========================================================================*/ #ifndef _WIN32 #define SLPD_CONFFILE ETCDIR "/slp.conf" #define SLPD_LOGFILE VARDIR "/log/slpd.log" #define SLPD_REGFILE ETCDIR "/slp.reg" #define SLPD_PIDFILE VARDIR "/run/slpd.pid" #define SLPD_SPIFILE ETCDIR "/slp.spi" #else #define SLPD_CONFFILE "%WINDIR%\\slp.conf" #define SLPD_LOGFILE "%WINDIR%\\slpd.log" #define SLPD_REGFILE "%WINDIR%\\slp.reg" #define SLPD_PIDFILE "%WINDIR%\\slpd.pid" #define SLPD_SPIFILE "%WINDIR%\\slp.spi" #endif /*=========================================================================*/ /* Make sure MAX_PATH is defined */ /*=========================================================================*/ #if(!defined MAX_PATH) #define MAX_PATH 256 #endif /*=========================================================================*/ typedef struct _SLPDCommandLine /* Holds values of parameters read from the command line */ /*=========================================================================*/ { char cfgfile[MAX_PATH]; char regfile[MAX_PATH]; char logfile[MAX_PATH]; char pidfile[MAX_PATH]; #ifdef ENABLE_SLPv2_SECURITY char spifile[MAX_PATH]; #endif int action; int autostart; int detach; }SLPDCommandLine; /*=========================================================================*/ extern SLPDCommandLine G_SlpdCommandLine; /* Global variable containing command line options */ /*=========================================================================*/ /*=========================================================================*/ void SLPDPrintUsage(); /* Displays available command line options of SLPD */ /*=========================================================================*/ /*=========================================================================*/ int SLPDParseCommandLine(int argc,char* argv[]); /* Must be called to initialize the command line */ /* */ /* argc (IN) the argc as passed to main() */ /* */ /* argv (IN) the argv as passed to main() */ /* */ /* Returns - zero on success. non-zero on usage error */ /*=========================================================================*/ #endif openslp-1.2.1/slpd/slpd_spi.h0000644033442200000310000001126110202047550016004 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_spi.h */ /* */ /* Abstract: Functions and variables for slpd usage of common SPI code */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLPD_SPI_H_INCLUDED /*=========================================================================*/ /* slpd includes */ /*=========================================================================*/ #include "slpd.h" /*=========================================================================*/ /* Common code code includes */ /*=========================================================================*/ #include "slp_spi.h" /*=========================================================================*/ extern SLPSpiHandle G_SlpdSpiHandle; /*=========================================================================*/ /*=========================================================================*/ int SLPDSpiInit(const char* spifile); /*=========================================================================*/ /*=========================================================================*/ void SLPDSpiDeinit(); /*=========================================================================*/ #endif openslp-1.2.1/slpd/slpd_database.c0000644033442200000310000011474010202047547016764 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_database.c */ /* */ /* Abstract: Implements database abstraction. Currently a simple */ /* double linked list (common/slp_database.c) is used for the */ /* underlying storage. */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ /*=========================================================================*/ /* slpd includes */ /*=========================================================================*/ #include "slpd_database.h" #include "slpd_regfile.h" #include "slpd_property.h" #include "slpd_log.h" #include "slpd_knownda.h" #ifdef ENABLE_PREDICATES #include "slpd_predicate.h" #endif /*=========================================================================*/ /* common code includes */ /*=========================================================================*/ #include "slp_compare.h" #include "slp_xmalloc.h" #include "slp_pid.h" /*=========================================================================*/ SLPDDatabase G_SlpdDatabase; /* slpd database global */ /*=========================================================================*/ /*=========================================================================*/ void SLPDDatabaseAge(int seconds, int ageall) /* Ages the database entries and clears new and deleted entry lists */ /* */ /* seconds (IN) the number of seconds to age each entry by */ /* */ /* ageall (IN) age even entries with SLP_LIFETIME_MAXIMUM */ /* */ /* Returns - None */ /*=========================================================================*/ { SLPDatabaseHandle dh; SLPDatabaseEntry* entry; SLPSrvReg* srvreg; dh = SLPDatabaseOpen(&G_SlpdDatabase.database); if ( dh ) { while ( 1 ) { entry = SLPDatabaseEnum(dh); if ( entry == NULL ) break; /* srvreg is the SrvReg message from the database */ srvreg = &(entry->msg->body.srvreg); if ( srvreg->urlentry.lifetime == SLP_LIFETIME_MAXIMUM ) { if ( srvreg->source == SLP_REG_SOURCE_LOCAL || srvreg->source == SLP_REG_SOURCE_STATIC ) { /* entries that were made from local registrations */ /* and entries made from static registration file */ /* that have a lifetime of SLP_LIFETIME_MAXIMUM must */ /* NEVER be aged */ continue; } if ( ageall == 0 ) { /* Don't age any services that have a lifetime of */ /* SLP_LIFETIME_MAXIMUM unless explicitly told to */ continue; } } /* Age entry */ srvreg->urlentry.lifetime -= seconds; /* Remove entries that have timed out */ if ( srvreg->urlentry.lifetime <= 0 ) { SLPDLogRegistration("Timeout",entry); SLPDatabaseRemove(dh,entry); } } SLPDatabaseClose(dh); } } /*=========================================================================*/ int SLPDDatabaseReg(SLPMessage msg, SLPBuffer buf) /* Add a service registration to the database */ /* */ /* msg (IN) SLPMessage of a SrvReg message as returned by */ /* SLPMessageParse() */ /* */ /* buf (IN) Otherwise unreferenced buffer interpreted by the msg */ /* structure */ /* */ /* Returns - Zero on success. Nonzero on error */ /* */ /* NOTE: All registrations are treated as fresh */ /*=========================================================================*/ { SLPDatabaseHandle dh; SLPDatabaseEntry* entry; SLPSrvReg* entryreg; SLPSrvReg* reg; int result; /* reg is the SrvReg message being registered */ reg = &(msg->body.srvreg); /* check service-url syntax */ if ( SLPCheckServiceUrlSyntax(reg->urlentry.url, reg->urlentry.urllen) ) { return SLP_ERROR_INVALID_REGISTRATION; } /* check attr-list syntax */ if ( reg->attrlistlen && SLPCheckAttributeListSyntax(reg->attrlist,reg->attrlistlen) ) { return SLP_ERROR_INVALID_REGISTRATION; } dh = SLPDatabaseOpen(&G_SlpdDatabase.database); if ( dh ) { /*-----------------------------------------------------*/ /* Check to see if there is already an identical entry */ /*-----------------------------------------------------*/ while ( 1 ) { entry = SLPDatabaseEnum(dh); if ( entry == NULL ) break; /* entry reg is the SrvReg message from the database */ entryreg = &(entry->msg->body.srvreg); if ( SLPCompareString(entryreg->urlentry.urllen, entryreg->urlentry.url, reg->urlentry.urllen, reg->urlentry.url) == 0 ) { if ( SLPIntersectStringList(entryreg->scopelistlen, entryreg->scopelist, reg->scopelistlen, reg->scopelist) > 0 ) { /* Check to ensure the source addr is the same */ /* as the original */ if ( G_SlpdProperty.checkSourceAddr && memcmp(&(entry->msg->peer.sin_addr), &(msg->peer.sin_addr), sizeof(struct in_addr)) ) { SLPDatabaseClose(dh); return SLP_ERROR_AUTHENTICATION_FAILED; } #ifdef ENABLE_SLPv2_SECURITY if ( entryreg->urlentry.authcount && entryreg->urlentry.authcount != reg->urlentry.authcount ) { SLPDatabaseClose(dh); return SLP_ERROR_AUTHENTICATION_FAILED; } #endif /* Remove the identical entry */ SLPDatabaseRemove(dh,entry); break; } } } /*------------------------------------*/ /* Add the new srvreg to the database */ /*------------------------------------*/ entry = SLPDatabaseEntryCreate(msg,buf); if ( entry ) { /* set the source (allows for quicker aging ) */ if ( msg->body.srvreg.source == SLP_REG_SOURCE_UNKNOWN ) { if ( ISLOCAL(msg->peer.sin_addr) ) { msg->body.srvreg.source = SLP_REG_SOURCE_LOCAL; } else { msg->body.srvreg.source = SLP_REG_SOURCE_REMOTE; } } /* add to database */ SLPDatabaseAdd(dh, entry); SLPDLogRegistration("Registration",entry); /* SUCCESS! */ result = 0; } else { result = SLP_ERROR_INTERNAL_ERROR; } SLPDatabaseClose(dh); } else { result = SLP_ERROR_INTERNAL_ERROR; } return result; } /*=========================================================================*/ int SLPDDatabaseDeReg(SLPMessage msg) /* Remove a service registration from the database */ /* */ /* msg - (IN) message interpreting an SrvDereg message */ /* */ /* Returns - Zero on success. Non-zero on failure */ /*=========================================================================*/ { SLPDatabaseHandle dh; SLPDatabaseEntry* entry; SLPSrvReg* entryreg; SLPSrvDeReg* dereg; dh = SLPDatabaseOpen(&G_SlpdDatabase.database); if ( dh ) { /* dereg is the SrvDereg being deregistered */ dereg = &(msg->body.srvdereg); /*---------------------------------------------*/ /* Check to see if there is an identical entry */ /*---------------------------------------------*/ while ( 1 ) { entry = SLPDatabaseEnum(dh); if ( entry == NULL ) break; /* entry reg is the SrvReg message from the database */ entryreg = &(entry->msg->body.srvreg); if ( SLPCompareString(entryreg->urlentry.urllen, entryreg->urlentry.url, dereg->urlentry.urllen, dereg->urlentry.url) == 0 ) { if ( SLPIntersectStringList(entryreg->scopelistlen, entryreg->scopelist, dereg->scopelistlen, dereg->scopelist) > 0 ) { /* Check to ensure the source addr is the same as */ /* the original */ if ( G_SlpdProperty.checkSourceAddr && memcmp(&(entry->msg->peer.sin_addr), &(msg->peer.sin_addr), sizeof(struct in_addr)) ) { SLPDatabaseClose(dh); return SLP_ERROR_AUTHENTICATION_FAILED; } #ifdef ENABLE_SLPv2_SECURITY if ( entryreg->urlentry.authcount && entryreg->urlentry.authcount != dereg->urlentry.authcount ) { SLPDatabaseClose(dh); return SLP_ERROR_AUTHENTICATION_FAILED; } #endif /* remove the registration from the database */ SLPDLogRegistration("Deregistration",entry); SLPDatabaseRemove(dh,entry); break; } } } SLPDatabaseClose(dh); if ( entry==NULL ) { return SLP_ERROR_INVALID_REGISTRATION; } } return 0; } /*=========================================================================*/ int SLPDDatabaseSrvRqstStart(SLPMessage msg, SLPDDatabaseSrvRqstResult** result) /* Find services in the database */ /* */ /* msg (IN) the SrvRqst to find. */ /* */ /* result (OUT) pointer result structure */ /* */ /* Returns - Zero on success. Non-zero on failure */ /* */ /* Note: Caller must pass *result to SLPDDatabaseSrvRqstEnd() to free */ /*=========================================================================*/ { SLPDatabaseHandle dh; SLPDatabaseEntry* entry; SLPSrvReg* entryreg; SLPSrvRqst* srvrqst; #ifdef ENABLE_SLPv2_SECURITY int i; #endif /* start with the result set to NULL just to be safe */ *result = NULL; dh = SLPDatabaseOpen(&G_SlpdDatabase.database); if ( dh ) { /* srvrqst is the SrvRqst being made */ srvrqst = &(msg->body.srvrqst); while ( 1 ) { /*-----------------------------------------------------------*/ /* Allocate result with generous array of url entry pointers */ /*-----------------------------------------------------------*/ *result = (SLPDDatabaseSrvRqstResult*) xrealloc(*result, sizeof(SLPDDatabaseSrvRqstResult) + (sizeof(SLPUrlEntry*) * G_SlpdDatabase.urlcount)); if ( *result == NULL ) { /* out of memory */ SLPDatabaseClose(dh); return SLP_ERROR_INTERNAL_ERROR; } (*result)->urlarray = (SLPUrlEntry**)((*result) + 1); (*result)->urlcount = 0; (*result)->reserved = dh; /*-------------------------------------------------*/ /* Rewind enumeration in case we had to reallocate */ /*-------------------------------------------------*/ SLPDatabaseRewind(dh); /*-----------------------------------------*/ /* Check to see if there is matching entry */ /*-----------------------------------------*/ while ( 1 ) { entry = SLPDatabaseEnum(dh); if ( entry == NULL ) { /* This is the only successful way out */ return 0; } /* entry reg is the SrvReg message from the database */ entryreg = &(entry->msg->body.srvreg); /* check the service type */ if ( SLPCompareSrvType(srvrqst->srvtypelen, srvrqst->srvtype, entryreg->srvtypelen, entryreg->srvtype) == 0 && SLPIntersectStringList(entryreg->scopelistlen, entryreg->scopelist, srvrqst->scopelistlen, srvrqst->scopelist) > 0 ) { #ifdef ENABLE_PREDICATES if ( SLPDPredicateTest(msg->header.version, entryreg->attrlistlen, entryreg->attrlist, srvrqst->predicatelen, srvrqst->predicate) ) #endif { #ifdef ENABLE_SLPv2_SECURITY if ( srvrqst->spistrlen ) { for ( i=0; i< entryreg->urlentry.authcount;i++ ) { if ( SLPCompareString(srvrqst->spistrlen, srvrqst->spistr, entryreg->urlentry.autharray[i].spistrlen, entryreg->urlentry.autharray[i].spistr) == 0 ) { break; } } if ( i == entryreg->urlentry.authcount ) { continue; } } #endif if ( (*result)->urlcount + 1 > G_SlpdDatabase.urlcount ) { /* Oops we did not allocate a big enough result */ G_SlpdDatabase.urlcount *= 2; break; } (*result)->urlarray[(*result)->urlcount] = &(entryreg->urlentry); (*result)->urlcount ++; } } } } } return 0; } /*=========================================================================*/ void SLPDDatabaseSrvRqstEnd(SLPDDatabaseSrvRqstResult* result) /* Find services in the database */ /* */ /* result (IN) pointer result structure previously passed to */ /* SLPDDatabaseSrvRqstStart */ /* */ /* Returns - None */ /*=========================================================================*/ { if ( result ) { SLPDatabaseClose((SLPDatabaseHandle)result->reserved); xfree(result); } } /*=========================================================================*/ int SLPDDatabaseSrvTypeRqstStart(SLPMessage msg, SLPDDatabaseSrvTypeRqstResult** result) /* Find service types in the database */ /* */ /* msg (IN) the SrvTypRqst to find. */ /* */ /* result (OUT) pointer result structure */ /* */ /* Returns - Zero on success. Non-zero on failure */ /* */ /* Note: Caller must pass *result to SLPDDatabaseSrvtypeRqstEnd() to */ /* free */ /*=========================================================================*/ { SLPDatabaseHandle dh; SLPDatabaseEntry* entry; SLPSrvReg* entryreg; SLPSrvTypeRqst* srvtyperqst; dh = SLPDatabaseOpen(&G_SlpdDatabase.database); if ( dh ) { /* srvtyperqst is the SrvTypeRqst being made */ srvtyperqst = &(msg->body.srvtyperqst); while ( 1 ) { /*-----------------------------------------------------------------*/ /* Allocate result with generous srvtypelist of url entry pointers */ /*-----------------------------------------------------------------*/ *result = (SLPDDatabaseSrvTypeRqstResult*) xrealloc(*result, sizeof(SLPDDatabaseSrvTypeRqstResult) + G_SlpdDatabase.srvtypelistlen); if ( *result == NULL ) { /* out of memory */ SLPDatabaseClose(dh); return SLP_ERROR_INTERNAL_ERROR; } (*result)->srvtypelist = (char*)((*result) + 1); (*result)->srvtypelistlen = 0; (*result)->reserved = dh; /*-------------------------------------------------*/ /* Rewind enumeration in case we had to reallocate */ /*-------------------------------------------------*/ SLPDatabaseRewind(dh); while ( 1 ) { entry = SLPDatabaseEnum(dh); if ( entry == NULL ) { /* This is the only successful way out */ return 0; } /* entry reg is the SrvReg message from the database */ entryreg = &(entry->msg->body.srvreg); if ( SLPCompareNamingAuth(entryreg->srvtypelen, entryreg->srvtype, srvtyperqst->namingauthlen, srvtyperqst->namingauth) == 0 && SLPIntersectStringList(srvtyperqst->scopelistlen, srvtyperqst->scopelist, entryreg->scopelistlen, entryreg->scopelist) && SLPContainsStringList((*result)->srvtypelistlen, (*result)->srvtypelist, entryreg->srvtypelen, entryreg->srvtype) == 0 ) { /* Check to see if we allocated a big enough srvtypelist */ if ( (*result)->srvtypelistlen + entryreg->srvtypelen > G_SlpdDatabase.srvtypelistlen ) { /* Oops we did not allocate a big enough result */ G_SlpdDatabase.srvtypelistlen *= 2; break; } /* Append a comma if needed */ if ( (*result)->srvtypelistlen ) { (*result)->srvtypelist[(*result)->srvtypelistlen] = ','; (*result)->srvtypelistlen += 1; } /* Append the service type */ memcpy(((*result)->srvtypelist) + (*result)->srvtypelistlen, entryreg->srvtype, entryreg->srvtypelen); (*result)->srvtypelistlen += entryreg->srvtypelen; } } } SLPDatabaseClose(dh); } return 0; } /*=========================================================================*/ void SLPDDatabaseSrvTypeRqstEnd(SLPDDatabaseSrvTypeRqstResult* result) /* Release resources used to find service types in the database */ /* */ /* result (IN) pointer result structure previously passed to */ /* SLPDDatabaseSrvTypeRqstStart */ /* */ /* Returns - None */ /*=========================================================================*/ { if ( result ) { SLPDatabaseClose((SLPDatabaseHandle)result->reserved); xfree(result); } } /*=========================================================================*/ int SLPDDatabaseAttrRqstStart(SLPMessage msg, SLPDDatabaseAttrRqstResult** result) /* Find attributes in the database */ /* */ /* msg (IN) the AttrRqst to find. */ /* */ /* result (OUT) pointer result structure */ /* */ /* Returns - Zero on success. Non-zero on failure */ /* */ /* Note: Caller must pass *result to SLPDDatabaseAttrRqstEnd() to */ /* free */ /*=========================================================================*/ { SLPDatabaseHandle dh; SLPDatabaseEntry* entry; SLPSrvReg* entryreg; SLPAttrRqst* attrrqst; #ifdef ENABLE_SLPv2_SECURITY int i; #endif *result = xmalloc(sizeof(SLPDDatabaseAttrRqstResult)); if ( *result == NULL ) { return SLP_ERROR_INTERNAL_ERROR; } memset(*result,0,sizeof(SLPDDatabaseAttrRqstResult)); dh = SLPDatabaseOpen(&G_SlpdDatabase.database); if ( dh ) { (*result)->reserved = dh; /* attrrqst is the AttrRqst being made */ attrrqst = &(msg->body.attrrqst); while ( 1 ) { entry = SLPDatabaseEnum(dh); if ( entry == NULL ) { return 0; } /* entry reg is the SrvReg message from the database */ entryreg = &(entry->msg->body.srvreg); if ( SLPCompareString(attrrqst->urllen, attrrqst->url, entryreg->urlentry.urllen, entryreg->urlentry.url) == 0 || SLPCompareSrvType(attrrqst->urllen, attrrqst->url, entryreg->srvtypelen, entryreg->srvtype) == 0 ) { if ( SLPIntersectStringList(attrrqst->scopelistlen, attrrqst->scopelist, entryreg->scopelistlen, entryreg->scopelist) ) { if ( attrrqst->taglistlen == 0 ) { #ifdef ENABLE_SLPv2_SECURITY if ( attrrqst->spistrlen ) { for ( i=0; i< entryreg->authcount;i++ ) { if ( SLPCompareString(attrrqst->spistrlen, attrrqst->spistr, entryreg->autharray[i].spistrlen, entryreg->autharray[i].spistr) == 0 ) { break; } } if ( i == entryreg->authcount ) { continue; } } #endif /* Send back what was registered */ (*result)->attrlistlen = entryreg->attrlistlen; (*result)->attrlist = (char*)entryreg->attrlist; (*result)->authcount = entryreg->authcount; (*result)->autharray = entryreg->autharray; } #ifdef ENABLE_PREDICATES else { /* Send back a partial list as specified by taglist */ if ( SLPDFilterAttributes(entryreg->attrlistlen, entryreg->attrlist, attrrqst->taglistlen, attrrqst->taglist, &(*result)->attrlistlen, &(*result)->attrlist) == 0 ) { (*result)->ispartial = 1; break; } } #endif } } } } return 0; } /*=========================================================================*/ void SLPDDatabaseAttrRqstEnd(SLPDDatabaseAttrRqstResult* result) /* Release resources used to find attributes in the database */ /* */ /* result (IN) pointer result structure previously passed to */ /* SLPDDatabaseSrvTypeRqstStart */ /* */ /* Returns - None */ /*=========================================================================*/ { if ( result ) { SLPDatabaseClose((SLPDatabaseHandle)result->reserved); if ( result->ispartial && result->attrlist ) free(result->attrlist); xfree(result); } } /*=========================================================================*/ void* SLPDDatabaseEnumStart() /* Start an enumeration of the entire database */ /* */ /* Returns: An enumeration handle that is passed to subsequent calls to */ /* SLPDDatabaseEnum(). Returns NULL on failure. Returned */ /* enumeration handle (if not NULL) must be passed to */ /* SLPDDatabaseEnumEnd() when you are done with it. */ /*=========================================================================*/ { return SLPDatabaseOpen(&G_SlpdDatabase.database); } /*=========================================================================*/ SLPMessage SLPDDatabaseEnum(void* eh, SLPMessage* msg, SLPBuffer* buf) /* Enumerate through all entries of the database */ /* */ /* eh (IN) pointer to opaque data that is used to maintain */ /* enumerate entries. Pass in a pointer to NULL to start */ /* enumeration. */ /* */ /* msg (OUT) pointer to the SrvReg message that discribes buf */ /* */ /* buf (OUT) pointer to the SrvReg message buffer */ /* */ /* returns: Pointer to enumerated entry or NULL if end of enumeration */ /*=========================================================================*/ { SLPDatabaseEntry* entry; entry = SLPDatabaseEnum((SLPDatabaseHandle) eh); if ( entry ) { *msg = entry->msg; *buf = entry->buf; } else { *msg = 0; *buf = 0; } return *msg; } /*=========================================================================*/ void SLPDDatabaseEnumEnd(void* eh) /* End an enumeration started by SLPDDatabaseEnumStart() */ /* */ /* Parameters: eh (IN) The enumeration handle returned by */ /* SLPDDatabaseEnumStart() */ /*=========================================================================*/ { if ( eh ) { SLPDatabaseClose((SLPDatabaseHandle)eh); } } /*=========================================================================*/ int SLPDDatabaseIsEmpty() /* Returns an boolean value indicating whether the database is empty */ /*=========================================================================*/ { int result = 1; SLPDatabaseHandle dh; dh = SLPDatabaseOpen(&G_SlpdDatabase.database); { result = SLPDatabaseCount(dh) == 0; SLPDatabaseClose(dh); } return result; } /*=========================================================================*/ int SLPDDatabaseInit(const char* regfile) /* Initialize the database with registrations from a regfile. */ /* */ /* regfile (IN) the regfile to register. Pass in NULL for no regfile */ /* */ /* Returns - zero on success or non-zero on error. */ /*=========================================================================*/ { /* Set initial values */ memset(&G_SlpdDatabase,0,sizeof(G_SlpdDatabase)); G_SlpdDatabase.urlcount = SLPDDATABASE_INITIAL_URLCOUNT; G_SlpdDatabase.srvtypelistlen = SLPDDATABASE_INITIAL_SRVTYPELISTLEN; SLPDatabaseInit(&G_SlpdDatabase.database); /* Call the reinit function */ return SLPDDatabaseReInit(regfile); } /*=========================================================================*/ int SLPDDatabaseReInit(const char* regfile) /* Re-initialize the database with changed registrations from a regfile. */ /* */ /* regfile (IN) the regfile to register. */ /* */ /* Returns - zero on success or non-zero on error. */ /*=========================================================================*/ { SLPDatabaseHandle dh; SLPDatabaseEntry* entry; SLPMessage msg; SLPBuffer buf; FILE* fd; /*------------------------------------------------------------------*/ /* open the database handle and remove all the static registrations */ /* (the registrations from the /etc/slp.reg) file. */ /*------------------------------------------------------------------*/ dh = SLPDatabaseOpen(&G_SlpdDatabase.database); if ( dh ) { while ( 1 ) { entry = SLPDatabaseEnum(dh); if ( entry == NULL ) break; if ( entry->msg->body.srvreg.source == SLP_REG_SOURCE_STATIC ) { SLPDatabaseRemove(dh,entry); } } SLPDatabaseClose(dh); } /*--------------------------------------*/ /* Read static registration file if any */ /*--------------------------------------*/ if ( regfile ) { fd = fopen(regfile,"rb"); if ( fd ) { while ( SLPDRegFileReadSrvReg(fd, &msg, &buf) == 0 ) { SLPDDatabaseReg(msg, buf); } fclose(fd); } } return 0; } #ifdef DEBUG /*=========================================================================*/ void SLPDDatabaseDeinit(void) /* Cleans up all resources used by the database */ /*=========================================================================*/ { SLPDatabaseDeinit(&G_SlpdDatabase.database); } /*=========================================================================*/ void SLPDDatabaseDump(void) /* Dumps currently valid service registrations present with slpd */ /*=========================================================================*/ { SLPMessage msg; SLPBuffer buf; void* eh; eh = SLPDDatabaseEnumStart(); if ( eh ) { SLPDLog("\n========================================================================\n"); SLPDLog("Dumping Registrations\n"); SLPDLog("========================================================================\n"); while ( SLPDDatabaseEnum(eh, &msg, &buf) ) { SLPDLogMessageInternals(msg); SLPDLog("\n"); } SLPDDatabaseEnumEnd(eh); } } #endif openslp-1.2.1/slpd/slpd_outgoing.h0000644033442200000310000002043710202047550017051 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_outgoing.h */ /* */ /* Abstract: Handles "outgoing" network conversations requests made by */ /* other agents to slpd. (slpd_incoming.c handles reqests */ /* made by other agents to slpd) */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLPD_OUTGOING_H_INCLUDED #include "slpd.h" /*=========================================================================*/ /* slpd includes */ /*=========================================================================*/ #include "slpd_socket.h" /*=========================================================================*/ extern SLPList G_OutgoingSocketList; /*=========================================================================*/ /*=========================================================================*/ void SLPDOutgoingAge(time_t seconds); /* Age the sockets in the outgoing list by the specified number of seconds.*/ /* */ /* seconds (IN) seconds to age each entry of the list */ /*=========================================================================*/ /*=========================================================================*/ void SLPDOutgoingHandler(int* fdcount, fd_set* readfds, fd_set* writefds); /* Handles all incoming requests that are pending on the specified file */ /* discriptors */ /* */ /* fdcount (IN/OUT) number of file descriptors marked in fd_sets */ /* */ /* readfds (IN) file descriptors with pending read IO */ /* */ /* writefds (IN) file descriptors with pending read IO */ /*=========================================================================*/ /*=========================================================================*/ void SLPDOutgoingDatagramWrite(SLPDSocket* sock); /* Add a ready to write outgoing datagram socket to the outgoing list. */ /* The datagram will be written then sit in the list until it ages out */ /* (after net.slp.unicastMaximumWait) */ /* */ /* sock (IN) the socket that will belong on the outgoing list */ /*=========================================================================*/ /*=========================================================================*/ SLPDSocket* SLPDOutgoingConnect(struct in_addr* addr); /* Get a pointer to a connected socket that is associated with the */ /* outgoing socket list. If a connected socket already exists on the */ /* outgoing list, a pointer to it is returned, otherwise a new connection */ /* is made and added to the outgoing list */ /* */ /* addr (IN) the address of the peer a connection is desired for */ /* */ /* returns: pointer to socket or null on error */ /*=========================================================================*/ /*=========================================================================*/ int SLPDOutgoingInit(); /* Initialize outgoing socket list to have appropriate sockets for all */ /* network interfaces */ /* */ /* Returns Zero on success non-zero on error */ /*=========================================================================*/ /*=========================================================================*/ int SLPDOutgoingDeinit(int graceful); /* Deinitialize incoming socket list to have appropriate sockets for all */ /* network interfaces */ /* */ /* graceful (IN) Do not close sockets with pending writes */ /* */ /* Returns Zero on success non-zero when pending writes remain */ /*=========================================================================*/ #ifdef DEBUG /*=========================================================================*/ void SLPDOutgoingSocketDump(); /*=========================================================================*/ #endif #endif openslp-1.2.1/slpd/slpd_socket.c0000644033442200000310000005545710202252312016505 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_socket.c */ /* */ /* Abstract: Socket specific functions implementation */ /* */ /* WARNING: NOT thread safe! */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ /*=========================================================================*/ /* slpd includes */ /*=========================================================================*/ #include "slpd_socket.h" #include "slpd_property.h" /*=========================================================================*/ /* common code includes */ /*=========================================================================*/ #include "slp_message.h" #include "slp_xmalloc.h" /*-------------------------------------------------------------------------*/ int EnableBroadcast(sockfd_t sockfd) /* Sets the socket options to receive broadcast traffic */ /* */ /* sockfd - the socket file descriptor to set option on */ /* */ /* returns - zero on success */ /*-------------------------------------------------------------------------*/ { #ifdef _WIN32 const char on = 1; #else const int on = 1; #endif return setsockopt(sockfd,SOL_SOCKET,SO_BROADCAST,&on,sizeof(on)); } /*-------------------------------------------------------------------------*/ int SetMulticastTTL(sockfd_t sockfd, int ttl) /* Set the socket options for ttl */ /* */ /* sockfd - the socket file descriptor to set option on */ /* */ /* returns - zero on success */ /*-------------------------------------------------------------------------*/ { #if defined(linux) int optarg = ttl; #else /* Solaris and Tru64 expect a unsigned char parameter */ unsigned char optarg = (unsigned char)ttl; #endif #ifdef _WIN32 BOOL Reuse = TRUE; int TTLArg; struct sockaddr_in mysockaddr; memset(&mysockaddr, 0, sizeof(mysockaddr)); mysockaddr.sin_family = AF_INET; mysockaddr.sin_port = 0; TTLArg = ttl; if(setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (const char *)&Reuse, sizeof(Reuse)) || bind(sockfd, (struct sockaddr *)&mysockaddr, sizeof(mysockaddr)) || setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL, (char *)&TTLArg, sizeof(TTLArg))) { return -1; } #else if(setsockopt(sockfd,IPPROTO_IP,IP_MULTICAST_TTL,&optarg,sizeof(optarg))) { return -1; } #endif return 0; } /*-------------------------------------------------------------------------*/ int JoinSLPMulticastGroup(sockfd_t sockfd, struct in_addr* maddr, struct in_addr* addr) /* Sets the socket options to receive multicast traffic from the specified */ /* interface. */ /* */ /* sockfd - the socket file descriptor to set the options on. */ /* */ /* maddr - pointer to multicast group to join */ /* */ /* addr - pointer to address of the interface to join on */ /* */ /* returns - zero on success */ /*-------------------------------------------------------------------------*/ { struct ip_mreq mreq; /* join using the multicast address passed in */ memcpy(&mreq.imr_multiaddr, maddr, sizeof(struct in_addr)); /* join with specified interface */ memcpy(&mreq.imr_interface, addr, sizeof(struct in_addr)); return setsockopt(sockfd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char*)&mreq, sizeof(mreq)); } /*-------------------------------------------------------------------------*/ int DropSLPMulticastGroup(sockfd_t sockfd, struct in_addr* maddr, struct in_addr* addr) /* Sets the socket options to not receive multicast traffic from the */ /* specified interface. */ /* */ /* sockfd - the socket file descriptor to set the options on. */ /* */ /* maddr - pointer to the multicast address */ /* */ /* addr - pointer to the multicast address */ /*-------------------------------------------------------------------------*/ { struct ip_mreq mreq; /* drop from the multicast group passed in */ memcpy(&mreq.imr_multiaddr, maddr, sizeof(struct in_addr)); /* drop for the specified interface */ memcpy(&mreq.imr_interface,addr,sizeof(addr)); return setsockopt(sockfd, IPPROTO_IP, IP_DROP_MEMBERSHIP, (char*)&mreq,sizeof(mreq)); } /*-------------------------------------------------------------------------*/ int BindSocketToInetAddr(int sock, struct in_addr* addr) /* Binds the specified socket to the SLP port and interface. */ /* */ /* sock - the socket to be bound */ /* */ /* addr - the in_addr to bind to. */ /* */ /* Returns - zero on success, -1 on error. */ /*-------------------------------------------------------------------------*/ { int result; #ifdef _WIN32 char lowat; BOOL reuse = TRUE; #else int lowat; int reuse = 1; #endif struct sockaddr_in mysockaddr; memset(&mysockaddr, 0, sizeof(mysockaddr)); mysockaddr.sin_family = AF_INET; mysockaddr.sin_port = htons(SLP_RESERVED_PORT); setsockopt(sock,SOL_SOCKET,SO_REUSEADDR,(const char *)&reuse,sizeof(reuse)); if(addr != NULL) { mysockaddr.sin_addr = *addr; } else { mysockaddr.sin_addr.s_addr = INADDR_ANY; } result = bind(sock, (struct sockaddr *) &mysockaddr,sizeof(mysockaddr)); if(result == 0) { /* set the receive and send buffer low water mark to 18 bytes (the length of the smallest slpv2 message) */ lowat = 18; setsockopt(sock,SOL_SOCKET,SO_RCVLOWAT,&lowat,sizeof(lowat)); setsockopt(sock,SOL_SOCKET,SO_SNDLOWAT,&lowat,sizeof(lowat)); } return result; } /*-------------------------------------------------------------------------*/ int BindSocketToLoopback(int sock) /* Binds the specified socket to the specified port of the loopback */ /* interface. */ /* */ /* sock - the socket to be bound */ /* */ /* Returns - zero on success, -1 on error. */ /*-------------------------------------------------------------------------*/ { struct in_addr loaddr; loaddr.s_addr = htonl(LOOPBACK_ADDRESS); return BindSocketToInetAddr(sock,&loaddr); } /*=========================================================================*/ SLPDSocket* SLPDSocketAlloc() /* Allocate memory for a new SLPDSocket. */ /* */ /* Returns: pointer to a newly allocated SLPDSocket, or NULL if out of */ /* memory. */ /*=========================================================================*/ { SLPDSocket* sock; sock = (SLPDSocket*)xmalloc(sizeof(SLPDSocket)); if(sock) { memset(sock,0,sizeof(SLPDSocket)); sock->fd = -1; } return sock; } /*=========================================================================*/ void SLPDSocketFree(SLPDSocket* sock) /* Frees memory associated with the specified SLPDSocket */ /* */ /* sock (IN) pointer to the socket to free */ /*=========================================================================*/ { /* close the socket descriptor */ CloseSocket(sock->fd); /* free receive buffer */ if(sock->recvbuf) { SLPBufferFree(sock->recvbuf); } /* free send buffer(s) */ if(sock->sendlist.count) { while(sock->sendlist.count) { SLPBufferFree((SLPBuffer)SLPListUnlink(&(sock->sendlist), sock->sendlist.head)); } } if(sock->sendbuf) { SLPBufferFree(sock->sendbuf); } /* free the actual socket structure */ xfree(sock); } /*==========================================================================*/ SLPDSocket* SLPDSocketCreateDatagram(struct in_addr* peeraddr, int type) /* myaddr - (IN) the address of the interface to join mcast on */ /* */ /* peeraddr - (IN) the address of the peer to connect to */ /* */ /* type (IN) DATAGRAM_UNICAST, DATAGRAM_MULTICAST, DATAGRAM_BROADCAST */ /* */ /* Returns: A datagram socket SLPDSocket->state will be set to */ /* DATAGRAM_UNICAST, DATAGRAM_MULTICAST, or DATAGRAM_BROADCAST */ /*==========================================================================*/ { SLPDSocket* sock; sock = SLPDSocketAlloc(); if(sock) { /* SLP_MAX_DATAGRAM_SIZE is as big as a datagram SLP */ /* can be. */ sock->recvbuf = SLPBufferAlloc(SLP_MAX_DATAGRAM_SIZE); sock->sendbuf = SLPBufferAlloc(SLP_MAX_DATAGRAM_SIZE); if(sock->recvbuf && sock->sendbuf) { sock->fd = socket(PF_INET, SOCK_DGRAM, 0); if(sock->fd >=0) { switch(type) { case DATAGRAM_BROADCAST: EnableBroadcast(sock->fd); break; case DATAGRAM_MULTICAST: SetMulticastTTL(sock->fd,G_SlpdProperty.multicastTTL); break; default: break; } sock->peeraddr.sin_family = AF_INET; sock->peeraddr.sin_addr = *peeraddr; sock->peeraddr.sin_port = htons(SLP_RESERVED_PORT); sock->state = type; } else { SLPDSocketFree(sock); sock = 0; } } else { SLPDSocketFree(sock); sock = 0; } } return sock; } /*==========================================================================*/ SLPDSocket* SLPDSocketCreateBoundDatagram(struct in_addr* myaddr, struct in_addr* peeraddr, int type) /* myaddr - (IN) the address of the interface to join mcast on */ /* */ /* peeraddr - (IN) the address of the peer to connect to */ /* */ /* type (IN) DATAGRAM_UNICAST, DATAGRAM_MULTICAST, DATAGRAM_BROADCAST */ /* */ /* Returns: A datagram socket SLPDSocket->state will be set to */ /* DATAGRAM_UNICAST, DATAGRAM_MULTICAST, or DATAGRAM_BROADCAST */ /*==========================================================================*/ { SLPDSocket* sock; struct in_addr* bindaddr; /*------------------------------------------*/ /* Adjust for multicast binding differences */ /*------------------------------------------*/ #ifdef LINUX bindaddr = peeraddr; #else if(type == DATAGRAM_MULTICAST) bindaddr = NULL; /* must bind to INADDR_ANY for multicast */ else bindaddr = peeraddr; #endif /*------------------------*/ /* Create and bind socket */ /*------------------------*/ sock = SLPDSocketAlloc(); if(sock) { sock->recvbuf = SLPBufferAlloc(SLP_MAX_DATAGRAM_SIZE); sock->sendbuf = SLPBufferAlloc(SLP_MAX_DATAGRAM_SIZE); sock->fd = socket(PF_INET, SOCK_DGRAM, 0); if(sock->fd >=0) { if(myaddr != NULL) sock->ifaddr.sin_addr = *myaddr; if(BindSocketToInetAddr(sock->fd, bindaddr) == 0) { if(peeraddr != NULL) { sock->peeraddr.sin_addr = *peeraddr; } switch(type) { case DATAGRAM_MULTICAST: if(JoinSLPMulticastGroup(sock->fd, peeraddr, myaddr) == 0) { sock->state = DATAGRAM_MULTICAST; goto SUCCESS; } break; case DATAGRAM_BROADCAST: if(EnableBroadcast(sock->fd) == 0) { sock->state = DATAGRAM_BROADCAST; goto SUCCESS; } break; case DATAGRAM_UNICAST: default: sock->state = DATAGRAM_UNICAST; goto SUCCESS; break; } } } } if(sock) { SLPDSocketFree(sock); } sock = 0; SUCCESS: return sock; } /*==========================================================================*/ SLPDSocket* SLPDSocketCreateListen(struct in_addr* peeraddr) /* */ /* peeraddr - (IN) the address of the peer to connect to */ /* */ /* type (IN) DATAGRAM_UNICAST, DATAGRAM_MULTICAST, DATAGRAM_BROADCAST */ /* */ /* Returns: A listening socket. SLPDSocket->state will be set to */ /* SOCKET_LISTEN. Returns NULL on error */ /*==========================================================================*/ { int fdflags; SLPDSocket* sock; sock = SLPDSocketAlloc(); if(sock) { sock->fd = socket(PF_INET, SOCK_STREAM, 0); if(sock->fd >= 0) { if(peeraddr != NULL) sock->ifaddr.sin_addr = *peeraddr; if(BindSocketToInetAddr(sock->fd, peeraddr) >= 0) { if(listen(sock->fd,5) == 0) { /* Set socket to non-blocking so subsequent calls to */ /* accept will *never* block */ #ifdef _WIN32 fdflags = 1; ioctlsocket(sock->fd, FIONBIO, &fdflags); #else fdflags = fcntl(sock->fd, F_GETFL, 0); fcntl(sock->fd,F_SETFL, fdflags | O_NONBLOCK); #endif sock->state = SOCKET_LISTEN; return sock; } } } } if(sock) { SLPDSocketFree(sock); } return 0; } /*==========================================================================*/ SLPDSocket* SLPDSocketCreateConnected(struct in_addr* addr) /* */ /* addr - (IN) the address of the peer to connect to */ /* */ /* Returns: A connected socket or a socket in the process of being connected*/ /* if the socket was connected the SLPDSocket->state will be set */ /* to writable. If the connect would block, SLPDSocket->state will*/ /* be set to connect. Return NULL on error */ /*==========================================================================*/ { #ifdef _WIN32 char lowat; u_long fdflags; #else int lowat; int fdflags; #endif SLPDSocket* sock = 0; sock = SLPDSocketAlloc(); if(sock == 0) { goto FAILURE; } /* create the stream socket */ sock->fd = socket(PF_INET,SOCK_STREAM,0); if(sock->fd < 0) { goto FAILURE; } /* set the socket to non-blocking */ #ifdef _WIN32 fdflags = 1; ioctlsocket(sock->fd, FIONBIO, &fdflags); #else fdflags = fcntl(sock->fd, F_GETFL, 0); fcntl(sock->fd,F_SETFL, fdflags | O_NONBLOCK); #endif /* zero then set peeraddr to connect to */ sock->peeraddr.sin_family = AF_INET; sock->peeraddr.sin_port = htons(SLP_RESERVED_PORT); sock->peeraddr.sin_addr = *addr; /* set the receive and send buffer low water mark to 18 bytes (the length of the smallest slpv2 message) */ lowat = 18; setsockopt(sock->fd,SOL_SOCKET,SO_RCVLOWAT,&lowat,sizeof(lowat)); setsockopt(sock->fd,SOL_SOCKET,SO_SNDLOWAT,&lowat,sizeof(lowat)); /* non-blocking connect */ if(connect(sock->fd, (struct sockaddr *) &(sock->peeraddr), sizeof(sock->peeraddr)) == 0) { /* Connection occured immediately */ sock->state = STREAM_CONNECT_IDLE; } else { #ifdef _WIN32 if(WSAEWOULDBLOCK == WSAGetLastError()) #else if(errno == EINPROGRESS) #endif { /* Connect would have blocked */ sock->state = STREAM_CONNECT_BLOCK; } else { goto FAILURE; } } return sock; /* cleanup on failure */ FAILURE: if(sock) { SLPDSocketFree(sock); sock = 0; } return sock; } openslp-1.2.1/slpd/slpd_spi.c0000644033442200000310000001120410202047550015774 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_spi.c */ /* */ /* Abstract: Functions and variables for slpd usage of common SPI code */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ /*=========================================================================*/ /* slpd includes */ /*=========================================================================*/ #include "slpd_spi.h" /*=========================================================================*/ SLPSpiHandle G_SlpdSpiHandle = 0; /*=========================================================================*/ /*=========================================================================*/ int SLPDSpiInit(const char* spifile) /*=========================================================================*/ { if(G_SlpdSpiHandle) { SLPSpiClose(G_SlpdSpiHandle); G_SlpdSpiHandle = 0; } G_SlpdSpiHandle = SLPSpiOpen(spifile,1); return (G_SlpdSpiHandle == 0); } #ifdef DEBUG /*=========================================================================*/ void SLPDSpiDeinit() /*=========================================================================*/ { SLPSpiClose(G_SlpdSpiHandle); } #endif openslp-1.2.1/slpd/slpd_knownda.c0000644033442200000310000017001710202047547016660 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_knownda.c */ /* */ /* Abstract: Keeps track of known DAs */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slpd.h" /*=========================================================================*/ /* slpd includes */ /*=========================================================================*/ #include "slpd_knownda.h" #include "slpd_property.h" #include "slpd_database.h" #include "slpd_socket.h" #include "slpd_outgoing.h" #include "slpd_log.h" #ifdef ENABLE_SLPv2_SECURITY #include "slpd_spi.h" #endif /*=========================================================================*/ /* common code includes */ /*=========================================================================*/ #include "slp_xmalloc.h" #include "slp_v1message.h" #include "slp_utf8.h" #include "slp_compare.h" #include "slp_xid.h" #include "slp_dhcp.h" #include "slp_parse.h" #include "slp_net.h" #ifdef ENABLE_SLPv2_SECURITY #include "slp_auth.h" #include "slp_spi.h" #endif #include /*=========================================================================*/ SLPDatabase G_SlpdKnownDAs; /* The database of DAAdverts from DAs known to slpd. */ /*=========================================================================*/ /*=========================================================================*/ int G_KnownDATimeSinceLastRefresh = 0; /*=========================================================================*/ /*-------------------------------------------------------------------------*/ int MakeActiveDiscoveryRqst(int ismcast, SLPBuffer* buffer) /* Pack a buffer with service:directory-agent SrvRqst * * * * Caller must free buffer * *-------------------------------------------------------------------------*/ { size_t size; void* eh; SLPMessage msg; char* prlist = 0; size_t prlistlen = 0; int errorcode = 0; SLPBuffer tmp = 0; SLPBuffer result = *buffer; /*-------------------------------------------------*/ /* Generate a DA service request buffer to be sent */ /*-------------------------------------------------*/ /* determine the size of the fixed portion of the SRVRQST */ size = 47; /* 14 bytes for the header */ /* 2 bytes for the prlistlen */ /* 2 bytes for the srvtype length */ /* 23 bytes for "service:directory-agent" srvtype */ /* 2 bytes for scopelistlen */ /* 2 bytes for predicatelen */ /* 2 bytes for sprstrlen */ /* figure out what our Prlist will be by going through our list of */ /* known DAs */ prlistlen = 0; prlist = xmalloc(SLP_MAX_DATAGRAM_SIZE); if ( prlist == 0 ) { /* out of memory */ errorcode = SLP_ERROR_INTERNAL_ERROR; goto FINISHED; } *prlist = 0; /* Don't send active discoveries to DAs we already know about */ eh = SLPDKnownDAEnumStart(); if ( eh ) { while ( 1 ) { if ( SLPDKnownDAEnum(eh, &msg, &tmp) == 0 ) { break; } strcat(prlist,inet_ntoa(msg->peer.sin_addr)); strcat(prlist,","); prlistlen = strlen(prlist); } SLPDKnownDAEnumEnd(eh); } /* Allocate the send buffer */ size += G_SlpdProperty.localeLen + prlistlen; result = SLPBufferRealloc(result, size); if ( result == 0 ) { /* out of memory */ errorcode = SLP_ERROR_INTERNAL_ERROR; goto FINISHED; } /*------------------------------------------------------------*/ /* Build a buffer containing the fixed portion of the SRVRQST */ /*------------------------------------------------------------*/ /*version*/ *(result->start) = 2; /*function id*/ *(result->start + 1) = SLP_FUNCT_SRVRQST; /*length*/ ToUINT24(result->start + 2, size); /*flags*/ ToUINT16(result->start + 5, (ismcast ? SLP_FLAG_MCAST : 0)); /*ext offset*/ ToUINT24(result->start + 7,0); /*xid*/ ToUINT16(result->start + 10, SLPXidGenerate()); /* TODO: generate a real XID */ /*lang tag len*/ ToUINT16(result->start + 12, G_SlpdProperty.localeLen); /*lang tag*/ memcpy(result->start + 14, G_SlpdProperty.locale, G_SlpdProperty.localeLen); result->curpos = result->start + G_SlpdProperty.localeLen + 14; /* Prlist */ ToUINT16(result->curpos,prlistlen); result->curpos = result->curpos + 2; memcpy(result->curpos,prlist,prlistlen); result->curpos = result->curpos + prlistlen; /* service type */ ToUINT16(result->curpos,23); result->curpos = result->curpos + 2; /* 23 is the length of SLP_DA_SERVICE_TYPE */ memcpy(result->curpos,SLP_DA_SERVICE_TYPE,23); result->curpos = result->curpos + 23; /* scope list zero length */ ToUINT16(result->curpos,0); result->curpos = result->curpos + 2; /* predicate zero length */ ToUINT16(result->curpos,0); result->curpos = result->curpos + 2; /* spi list zero length */ ToUINT16(result->curpos,0); result->curpos = result->curpos + 2; *buffer = result; FINISHED: if ( prlist ) { xfree(prlist); } return 0; } /*-------------------------------------------------------------------------*/ void SLPDKnownDARegisterAll(SLPMessage daadvert, int immortalonly) /* registers all services with specified DA */ /*-------------------------------------------------------------------------*/ { SLPBuffer buf; SLPMessage msg; SLPSrvReg* srvreg; SLPDSocket* sock; SLPBuffer sendbuf = 0; void* handle = 0; /*---------------------------------------------------------------*/ /* Check to see if the database is empty and open an enumeration */ /* handle if it is not empty */ /*---------------------------------------------------------------*/ if ( SLPDDatabaseIsEmpty() ) { return; } /*--------------------------------------*/ /* Never do a Register All to ourselves */ /*--------------------------------------*/ if ( SLPCompareString(G_SlpdProperty.myUrlLen, G_SlpdProperty.myUrl, daadvert->body.daadvert.urllen, daadvert->body.daadvert.url) == 0 ) { return; } handle = SLPDDatabaseEnumStart(); if ( handle == 0 ) { return; } /*----------------------------------------------*/ /* Establish a new connection with the known DA */ /*----------------------------------------------*/ sock = SLPDOutgoingConnect(&(daadvert->peer.sin_addr)); if ( sock ) { while ( 1 ) { msg = SLPDDatabaseEnum(handle, &msg, &buf); if ( msg == NULL ) break; srvreg = &(msg->body.srvreg); /*-----------------------------------------------*/ /* If so instructed, skip mortal registrations */ /*-----------------------------------------------*/ if ( immortalonly && srvreg->urlentry.lifetime < SLP_LIFETIME_MAXIMUM ) { continue; } /*---------------------------------------------------------*/ /* Only register local (or static) registrations of scopes */ /* supported by peer DA */ /*---------------------------------------------------------*/ if ( ( srvreg->source == SLP_REG_SOURCE_LOCAL || srvreg->source == SLP_REG_SOURCE_STATIC ) && SLPIntersectStringList(srvreg->scopelistlen, srvreg->scopelist, srvreg->scopelistlen, srvreg->scopelist) ) { sendbuf = SLPBufferDup(buf); if ( sendbuf ) { /*--------------------------------------------------*/ /* link newly constructed buffer to socket sendlist */ /*--------------------------------------------------*/ SLPListLinkTail(&(sock->sendlist),(SLPListItem*)sendbuf); if ( sock->state == STREAM_CONNECT_IDLE ) { sock->state = STREAM_WRITE_FIRST; } } } } } SLPDDatabaseEnumEnd(handle); } /*-------------------------------------------------------------------------*/ int MakeSrvderegFromSrvReg(SLPMessage msg, SLPBuffer inbuf, SLPBuffer* outbuf) /* Pack a buffer with a SrvDereg message using information from an existing * SrvReg message * * Caller must free outbuf *-------------------------------------------------------------------------*/ { int size; SLPBuffer sendbuf; SLPSrvReg* srvreg; srvreg = &(msg->body.srvreg); /*-------------------------------------------------------------*/ /* ensure the buffer is big enough to handle the whole srvdereg*/ /*-------------------------------------------------------------*/ size = msg->header.langtaglen + 18; /* 14 bytes for header */ /* 2 bytes for scopelen */ /* see below for URLEntry */ /* 2 bytes for taglist len */ if ( srvreg->urlentry.opaque ) { size += srvreg->urlentry.opaquelen; } else { size += 6; /* +6 for the static portion of the url-entry */ size += srvreg->urlentry.urllen; } size += srvreg->scopelistlen; /* taglistlen is always 0 */ *outbuf = sendbuf = SLPBufferAlloc(size); if (*outbuf == NULL) { return SLP_ERROR_INTERNAL_ERROR; } /*----------------------*/ /* Construct a SrvDereg */ /*----------------------*/ /*version*/ *(sendbuf->start) = 2; /*function id*/ *(sendbuf->start + 1) = SLP_FUNCT_SRVDEREG; /*length*/ ToUINT24(sendbuf->start + 2, size); /*flags*/ ToUINT16(sendbuf->start + 5, (size > SLP_MAX_DATAGRAM_SIZE ? SLP_FLAG_OVERFLOW : 0)); /*ext offset*/ ToUINT24(sendbuf->start + 7,0); /*xid*/ ToUINT16(sendbuf->start + 10,SLPXidGenerate()); /*lang tag len*/ ToUINT16(sendbuf->start + 12,msg->header.langtaglen); /*lang tag*/ memcpy(sendbuf->start + 14, msg->header.langtag, msg->header.langtaglen); sendbuf->curpos = sendbuf->start + 14 + msg->header.langtaglen; /* scope list */ ToUINT16(sendbuf->curpos, srvreg->scopelistlen); sendbuf->curpos = sendbuf->curpos + 2; memcpy(sendbuf->curpos,srvreg->scopelist,srvreg->scopelistlen); sendbuf->curpos = sendbuf->curpos + srvreg->scopelistlen; /* the urlentry */ #ifdef ENABLE_SLPv1 if ( srvreg->urlentry.opaque == 0 ) { /* url-entry reserved */ *sendbuf->curpos = 0; sendbuf->curpos += 1; /* url-entry lifetime */ ToUINT16(sendbuf->curpos,srvreg->urlentry.lifetime); sendbuf->curpos = sendbuf->curpos + 2; /* url-entry urllen */ ToUINT16(sendbuf->curpos,srvreg->urlentry.urllen); sendbuf->curpos += 2; /* url-entry url */ memcpy(sendbuf->curpos, srvreg->urlentry.url, srvreg->urlentry.urllen); sendbuf->curpos += srvreg->urlentry.urllen; /* url-entry authcount */ *sendbuf->curpos = 0; sendbuf->curpos += 1; } else #endif /* ENABLE_SLPv1 */ { memcpy(sendbuf->curpos, srvreg->urlentry.opaque, srvreg->urlentry.opaquelen); sendbuf->curpos += srvreg->urlentry.opaquelen; } /* taglist (always 0) */ ToUINT16(sendbuf->curpos,0); sendbuf->curpos += 1; return 0; } /*-------------------------------------------------------------------------*/ void SLPDKnownDADeregisterAll(SLPMessage daadvert) /* de-registers all services with specified DA */ /*-------------------------------------------------------------------------*/ { SLPBuffer buf; SLPMessage msg; SLPSrvReg* srvreg; SLPDSocket* sock; SLPBuffer sendbuf = 0; void* handle = 0; /*---------------------------------------------------------------*/ /* Check to see if the database is empty and open an enumeration */ /* handle if it is not empty */ /*---------------------------------------------------------------*/ if ( SLPDDatabaseIsEmpty() ) { return; } handle = SLPDDatabaseEnumStart(); if ( handle == 0 ) { return; } /* Establish a new connection with the known DA */ sock = SLPDOutgoingConnect(&(daadvert->peer.sin_addr)); if ( sock ) { while ( 1 ) { msg = SLPDDatabaseEnum(handle, &msg, &buf); if ( msg == NULL ) break; srvreg = &(msg->body.srvreg); /*-------------------------------------------------*/ /* Deregister all local (and static) registrations */ /*-------------------------------------------------*/ if ( srvreg->source == SLP_REG_SOURCE_LOCAL || srvreg->source == SLP_REG_SOURCE_STATIC ) { if(MakeSrvderegFromSrvReg(msg,buf,&sendbuf) == 0) { /*--------------------------------------------------*/ /* link newly constructed buffer to socket sendlist */ /*--------------------------------------------------*/ SLPListLinkTail(&(sock->sendlist),(SLPListItem*)sendbuf); if ( sock->state == STREAM_CONNECT_IDLE ) { sock->state = STREAM_WRITE_FIRST; } } } } } SLPDDatabaseEnumEnd(handle); } /*=========================================================================*/ int SLPDKnownDAFromDHCP() /* Queries DHCP for configured DA's. */ /* */ /* returns zero on success, Non-zero on failure */ /*=========================================================================*/ { SLPBuffer buf; DHCPContext ctx; SLPDSocket* sock; struct in_addr daaddr; unsigned char * alp; unsigned char dhcpOpts[] = {TAG_SLP_SCOPE, TAG_SLP_DA}; *ctx.scopelist = 0; ctx.addrlistlen = 0; DHCPGetOptionInfo(dhcpOpts, sizeof(dhcpOpts), DHCPParseSLPTags, &ctx); alp = ctx.addrlist; while(ctx.addrlistlen >= 4) { memcpy(&daaddr.s_addr, alp, 4); if (daaddr.s_addr) { /*-------------------------------------------------------- Get an outgoing socket to the DA and set it up to make the service:directoryagent request --------------------------------------------------------*/ sock = SLPDOutgoingConnect(&daaddr); if (sock) { buf = 0; if (MakeActiveDiscoveryRqst(0,&buf) == 0) { if (sock->state == STREAM_CONNECT_IDLE) sock->state = STREAM_WRITE_FIRST; SLPListLinkTail(&(sock->sendlist),(SLPListItem*)buf); if (sock->state == STREAM_CONNECT_IDLE) sock->state = STREAM_WRITE_FIRST; } } } ctx.addrlistlen -= 4; alp += 4; } return 0; } /*=========================================================================*/ int SLPKnownDAFromProperties() /* Queries static configuration for DA's. */ /* */ /* returns zero on success, Non-zero on failure */ /*=========================================================================*/ { char* temp; char* tempend; char* slider1; char* slider2; struct hostent* he; struct in_addr daaddr; SLPDSocket* sock; SLPBuffer buf; if (G_SlpdProperty.DAAddresses && *G_SlpdProperty.DAAddresses) { temp = slider1 = xstrdup(G_SlpdProperty.DAAddresses); if (temp) { tempend = temp + strlen(temp); while (slider1 < tempend) { while (*slider1 && *slider1 == ' ') slider1++; slider2 = slider1; while (*slider2 && *slider2 != ',') slider2++; *slider2++ = 0; daaddr.s_addr = 0; if(inet_aton(slider1, &daaddr) == 0) { he = gethostbyname(slider1); if (he) daaddr.s_addr = *((unsigned int*)(he->h_addr_list[0])); } if(daaddr.s_addr) { /*--------------------------------------------------------*/ /* Get an outgoing socket to the DA and set it up to make */ /* the service:directoryagent request */ /*--------------------------------------------------------*/ sock = SLPDOutgoingConnect(&daaddr); if (sock) { buf = 0; if (MakeActiveDiscoveryRqst(0,&buf) == 0) { if (sock->state == STREAM_CONNECT_IDLE) sock->state = STREAM_WRITE_FIRST; SLPListLinkTail(&(sock->sendlist),(SLPListItem*)buf); if (sock->state == STREAM_CONNECT_IDLE) sock->state = STREAM_WRITE_FIRST; } } } slider1 = slider2; } xfree(temp); } } return 0; } /*=========================================================================*/ int SLPDKnownDAInit() /* Initializes the KnownDA list. Removes all entries and adds entries */ /* that are statically configured. Adds entries configured through DHCP. */ /* */ /* returns zero on success, Non-zero on failure */ /*=========================================================================*/ { /*--------------------------------------*/ /* Set initialize the DAAdvert database */ /*--------------------------------------*/ SLPDatabaseInit(&G_SlpdKnownDAs); /*-----------------------------------------------------------------*/ /* Added statically configured DAs to the Known DA List by sending */ /* active DA discovery requests directly to them */ /*-----------------------------------------------------------------*/ SLPKnownDAFromProperties(); /*-----------------------------------------------------------------*/ /* Discover DHCP DA's and add them to the active discovery list. */ /*-----------------------------------------------------------------*/ SLPDKnownDAFromDHCP(); /*----------------------------------------*/ /* Lastly, Perform first active discovery */ /*----------------------------------------*/ SLPDKnownDAActiveDiscovery(0); return 0; } /*=========================================================================*/ int SLPDKnownDADeinit() /* Deinitializes the KnownDA list. Removes all entries and deregisters */ /* all services. */ /* */ /* returns zero on success, Non-zero on failure */ /*=========================================================================*/ { SLPDatabaseHandle dh; SLPDatabaseEntry* entry; dh = SLPDatabaseOpen(&G_SlpdKnownDAs); if ( dh ) { /*------------------------------------*/ /* Unregister all local registrations */ /*------------------------------------*/ while ( 1 ) { entry = SLPDatabaseEnum(dh); if ( entry == NULL ) break; SLPDKnownDADeregisterAll(entry->msg); } SLPDatabaseClose(dh); } SLPDatabaseDeinit(&G_SlpdKnownDAs); return 0; } /*=========================================================================*/ int SLPDKnownDAAdd(SLPMessage msg, SLPBuffer buf) /* Adds a DA to the known DA list if it is new, removes it if DA is going */ /* down or adjusts entry if DA changed. */ /* */ /* msg (IN) DAAdvert Message descriptor */ /* */ /* buf (IN) The DAAdvert message buffer */ /* */ /* returns Zero on success, Non-zero on error */ /*=========================================================================*/ { SLPDatabaseEntry* entry; SLPDAAdvert* entrydaadvert; SLPDAAdvert* daadvert; struct in_addr daaddr; SLPParsedSrvUrl* parsedurl = NULL; int result = 0; SLPDatabaseHandle dh = NULL; dh = SLPDatabaseOpen(&G_SlpdKnownDAs); if ( dh == NULL ) { result = SLP_ERROR_INTERNAL_ERROR; goto CLEANUP; } /* daadvert is the DAAdvert message being added */ daadvert = &(msg->body.daadvert); /* -------------------------------------------------------- * Make sure that the peer address in the DAAdvert matches * the host in the DA service URL. *--------------------------------------------------------- */ if (SLPParseSrvUrl(daadvert->urllen, daadvert->url, &parsedurl)) { /* could not parse the DA service url */ result = SLP_ERROR_PARSE_ERROR; goto CLEANUP; } if (SLPNetResolveHostToAddr(parsedurl->host,&daaddr)) { /* Unable to resolve the host in the DA advert to an address */ xfree(parsedurl); result = SLP_ERROR_PARSE_ERROR; goto CLEANUP; } /* free the parsed url created in call to SLPParseSrvUrl() */ xfree(parsedurl); /* set the peer address in the DAAdvert message so that it matches * the address the DA service URL resolves to */ msg->peer.sin_addr = daaddr; /*-----------------------------------------------------*/ /* Check to see if there is already an identical entry */ /*-----------------------------------------------------*/ while ( 1 ) { entry = SLPDatabaseEnum(dh); if ( entry == NULL ) break; /* entrydaadvert is the DAAdvert message from the database */ entrydaadvert = &(entry->msg->body.daadvert); /* Assume DAs are identical if their URLs match */ if ( SLPCompareString(entrydaadvert->urllen, entrydaadvert->url, daadvert->urllen, daadvert->url) == 0 ) { #ifdef ENABLE_SLPv2_SECURITY if ( G_SlpdProperty.checkSourceAddr && memcmp(&(entry->msg->peer.sin_addr), &(msg->peer.sin_addr), sizeof(struct in_addr)) ) { SLPDatabaseClose(dh); result = SLP_ERROR_AUTHENTICATION_FAILED; goto CLEANUP; } /* make sure an unauthenticated DAAdvert can't replace */ /* an authenticated one */ if ( entrydaadvert->authcount && entrydaadvert->authcount != daadvert->authcount ) { SLPDatabaseClose(dh); result = SLP_ERROR_AUTHENTICATION_FAILED; goto CLEANUP; } #endif if ( daadvert->bootstamp != 0 && daadvert->bootstamp <= entrydaadvert->bootstamp ) { /* Advertising DA must have went down then came back up */ SLPDKnownDARegisterAll(msg,0); } /* Remove the entry that is the same as the advertised entry */ /* so that we can put the new advertised entry back in */ SLPDatabaseRemove(dh,entry); break; } } /* Make sure the DA is not dying */ if (daadvert->bootstamp != 0) { if ( entry == 0 ) { /* create a new database entry using the DAAdvert message */ entry = SLPDatabaseEntryCreate(msg,buf); if (entry) { SLPDatabaseAdd(dh, entry); /* register all the services we know about with this new DA */ SLPDKnownDARegisterAll(msg,0); /* log the addition of a new DA */ SLPDLogDAAdvertisement("Addition",entry); } else { /* Could not create a new entry */ result = SLP_ERROR_INTERNAL_ERROR; goto CLEANUP; } } else { /* The advertising DA is not new to us, but the old entry */ /* has been deleted from our database so that the new entry */ /* with its up to date time stamp can be put back in. */ /* create a new database entry using the DAAdvert message */ entry = SLPDatabaseEntryCreate(msg,buf); if (entry) { SLPDatabaseAdd(dh, entry); } else { /* Could not create a new entry */ result = SLP_ERROR_INTERNAL_ERROR; goto CLEANUP; } } SLPDatabaseClose(dh); return result; } else { /* DA is dying */ if (entry) { /* Dying DA was found in our KnownDA database. Log that it * was removed. */ SLPDLogDAAdvertisement("Removed",entry); } } CLEANUP: /* If we are here, we need to cleanup the message descriptor and the */ /* message buffer because they were not added to the database and not */ /* cleaning them up would result in a memory leak */ /* We also need to make sure the Database handle is closed. */ SLPMessageFree(msg); SLPBufferFree(buf); if (dh) SLPDatabaseClose(dh); return result; } /*=========================================================================*/ void SLPDKnownDARemove(struct in_addr* addr) /* Removes known DAs that sent DAAdverts from the specified in_addr */ /*=========================================================================*/ { SLPDatabaseHandle dh; SLPDatabaseEntry* entry; dh = SLPDatabaseOpen(&G_SlpdKnownDAs); if ( dh ) { /*-----------------------------------------------------*/ /* Check to see if there is already an identical entry */ /*-----------------------------------------------------*/ while ( 1 ) { entry = SLPDatabaseEnum(dh); if ( entry == NULL ) break; /* Assume DAs are identical if their peer match */ if ( memcmp(addr,&(entry->msg->peer.sin_addr),sizeof(*addr)) == 0 ) { SLPDatabaseRemove(dh,entry); SLPDLogDAAdvertisement("Removal",entry); break; } } SLPDatabaseClose(dh); } } /*=========================================================================*/ void* SLPDKnownDAEnumStart() /* Start an enumeration of all Known DAs */ /* */ /* Returns: An enumeration handle that is passed to subsequent calls to */ /* SLPDKnownDAEnum(). Returns NULL on failure. Returned */ /* enumeration handle (if not NULL) must be passed to */ /* SLPDKnownDAEnumEnd() when you are done with it. */ /*=========================================================================*/ { return SLPDatabaseOpen(&G_SlpdKnownDAs); } /*=========================================================================*/ SLPMessage SLPDKnownDAEnum(void* eh, SLPMessage* msg, SLPBuffer* buf) /* Enumerate through all Known DAs */ /* */ /* eh (IN) pointer to opaque data that is used to maintain */ /* enumerate entries. Pass in a pointer to NULL to start */ /* enumeration. */ /* */ /* msg (OUT) pointer to the DAAdvert message descriptor */ /* */ /* buf (OUT) pointer to the DAAdvert message buffer */ /* */ /* returns: Pointer to enumerated entry or NULL if end of enumeration */ /*=========================================================================*/ { SLPDatabaseEntry* entry; entry = SLPDatabaseEnum((SLPDatabaseHandle) eh); if ( entry ) { *msg = entry->msg; *buf = entry->buf; } else { *msg = 0; *buf = 0; } return *msg; } /*=========================================================================*/ void SLPDKnownDAEnumEnd(void* eh) /* End an enumeration started by SLPDKnownDAEnumStart() */ /* */ /* Parameters: eh (IN) The enumeration handle returned by */ /* SLPDKnownDAEnumStart() */ /*=========================================================================*/ { if ( eh ) { SLPDatabaseClose((SLPDatabaseHandle)eh); } } /*=========================================================================*/ int SLPDKnownDAGenerateMyDAAdvert(int errorcode, int deadda, int xid, SLPBuffer* sendbuf) /* Pack a buffer with a DAAdvert using information from a SLPDAentry */ /* */ /* errorcode (IN) the errorcode for the DAAdvert */ /* */ /* xid (IN) the xid to for the DAAdvert */ /* */ /* daentry (IN) pointer to the daentry that contains the rest of the info */ /* to make the DAAdvert */ /* */ /* sendbuf (OUT) pointer to the SLPBuffer that will be packed with a */ /* DAAdvert */ /* */ /* returns: zero on success, non-zero on error */ /*=========================================================================*/ { int size; SLPBuffer result = *sendbuf; #ifdef ENABLE_SLPv2_SECURITY int daadvertauthlen = 0; unsigned char* daadvertauth = 0; int spistrlen = 0; char* spistr = 0; G_SlpdProperty.DATimestamp += 1; if ( G_SlpdProperty.securityEnabled ) { SLPSpiGetDefaultSPI(G_SlpdSpiHandle, SLPSPI_KEY_TYPE_PRIVATE, &spistrlen, &spistr); SLPAuthSignDAAdvert(G_SlpdSpiHandle, spistrlen, spistr, G_SlpdProperty.DATimestamp, G_SlpdProperty.myUrlLen, G_SlpdProperty.myUrl, 0, 0, G_SlpdProperty.useScopesLen, G_SlpdProperty.useScopes, spistrlen, spistr, &daadvertauthlen, &daadvertauth); } #else G_SlpdProperty.DATimestamp += 1; #endif /*-------------------------------------------------------------*/ /* ensure the buffer is big enough to handle the whole srvrply */ /*-------------------------------------------------------------*/ size = G_SlpdProperty.localeLen + 29; /* 14 bytes for header */ /* 2 errorcode */ /* 4 bytes for timestamp */ /* 2 bytes for url len */ /* 2 bytes for scope list len */ /* 2 bytes for attr list len */ /* 2 bytes for spi str len */ /* 1 byte for authblock count */ size += G_SlpdProperty.myUrlLen; size += G_SlpdProperty.useScopesLen; #ifdef ENABLE_SLPv2_SECURITY size += spistrlen; size += daadvertauthlen; #endif result = SLPBufferRealloc(result, size); if ( result == 0 ) { /* Out of memory, what should we do here! */ errorcode = SLP_ERROR_INTERNAL_ERROR; goto FINISHED; } /*----------------*/ /* Add the header */ /*----------------*/ /*version*/ *(result->start) = 2; /*function id*/ *(result->start + 1) = SLP_FUNCT_DAADVERT; /*length*/ ToUINT24(result->start + 2, size); /*flags*/ ToUINT16(result->start + 5, (size > SLP_MAX_DATAGRAM_SIZE ? SLP_FLAG_OVERFLOW : 0)); /*ext offset*/ ToUINT24(result->start + 7,0); /*xid*/ ToUINT16(result->start + 10,xid); /*lang tag len*/ ToUINT16(result->start + 12, G_SlpdProperty.localeLen); /*lang tag*/ memcpy(result->start + 14, G_SlpdProperty.locale, G_SlpdProperty.localeLen); result->curpos = result->start + 14 + G_SlpdProperty.localeLen; /*--------------------------*/ /* Add rest of the DAAdvert */ /*--------------------------*/ /* error code */ ToUINT16(result->curpos,errorcode); result->curpos = result->curpos + 2; if ( errorcode == 0 ) { /* timestamp */ if ( deadda ) { ToUINT32(result->curpos,0); } else { ToUINT32(result->curpos,G_SlpdProperty.DATimestamp); } result->curpos = result->curpos + 4; /* url len */ ToUINT16(result->curpos, G_SlpdProperty.myUrlLen); result->curpos = result->curpos + 2; /* url */ memcpy(result->curpos, G_SlpdProperty.myUrl, G_SlpdProperty.myUrlLen); result->curpos = result->curpos + G_SlpdProperty.myUrlLen; /* scope list len */ ToUINT16(result->curpos, G_SlpdProperty.useScopesLen); result->curpos = result->curpos + 2; /* scope list */ memcpy(result->curpos, G_SlpdProperty.useScopes, G_SlpdProperty.useScopesLen); result->curpos = result->curpos + G_SlpdProperty.useScopesLen; /* attr list len */ ToUINT16(result->curpos, 0); result->curpos = result->curpos + 2; /* attr list */ /* memcpy(result->start, ???, 0); */ /* result->curpos = result->curpos + daentry->attrlistlen; */ /* SPI List */ #ifdef ENABLE_SLPv2_SECURITY ToUINT16(result->curpos,spistrlen); result->curpos = result->curpos + 2; memcpy(result->curpos,spistr,spistrlen); result->curpos = result->curpos + spistrlen; #else ToUINT16(result->curpos,0); result->curpos = result->curpos + 2; #endif /* authblock count */ #ifdef ENABLE_SLPv2_SECURITY if ( daadvertauth ) { /* authcount */ *(result->curpos) = 1; result->curpos = result->curpos + 1; /* authblock */ memcpy(result->curpos,daadvertauth,daadvertauthlen); result->curpos = result->curpos + daadvertauthlen; } else #endif { *(result->curpos) = 0; result->curpos = result->curpos + 1; } } FINISHED: #ifdef ENABLE_SLPv2_SECURITY if ( daadvertauth ) xfree(daadvertauth); if ( spistr ) xfree(spistr); #endif *sendbuf = result; return errorcode; } #if defined(ENABLE_SLPv1) /*=========================================================================*/ int SLPDKnownDAGenerateMyV1DAAdvert(int errorcode, int encoding, unsigned int xid, SLPBuffer* sendbuf) /* Pack a buffer with a v1 DAAdvert using information from a SLPDAentry */ /* */ /* errorcode (IN) the errorcode for the DAAdvert */ /* */ /* encoding (IN) the SLPv1 language encoding for the DAAdvert */ /* */ /* xid (IN) the xid to for the DAAdvert */ /* */ /* sendbuf (OUT) pointer to the SLPBuffer that will be packed with a */ /* DAAdvert */ /* */ /* returns: zero on success, non-zero on error */ /*=========================================================================*/ { int size = 0; int urllen = INT_MAX; int scopelistlen = INT_MAX; SLPBuffer result = *sendbuf; /*-------------------------------------------------------------*/ /* ensure the buffer is big enough to handle the whole srvrply */ /*-------------------------------------------------------------*/ size = 18; /* 12 bytes for header */ /* 2 errorcode */ /* 2 bytes for url len */ /* 2 bytes for scope list len */ if ( !errorcode ) { errorcode = SLPv1ToEncoding(0, &urllen, encoding, G_SlpdProperty.myUrl, G_SlpdProperty.myUrlLen); if ( !errorcode ) { size += urllen; #ifndef FAKE_UNSCOPED_DA errorcode = SLPv1ToEncoding(0, &scopelistlen, encoding, G_SlpdProperty.useScopes, G_SlpdProperty.useScopesLen); #else scopelistlen = 0; /* pretend that we're unscoped */ #endif if ( !errorcode ) { size += scopelistlen; } } } else { /* don't add these */ urllen = scopelistlen = 0; } result = SLPBufferRealloc(result, size); if ( result == 0 ) { /* TODO: out of memory, what should we do here! */ errorcode = SLP_ERROR_INTERNAL_ERROR; goto FINISHED; } /*----------------*/ /* Add the header */ /*----------------*/ /*version*/ *(result->start) = 1; /*function id*/ *(result->start + 1) = SLP_FUNCT_DAADVERT; /*length*/ ToUINT16(result->start + 2, size); /*flags - TODO we have to handle monoling and all that crap */ ToUINT16(result->start + 4, (size > SLP_MAX_DATAGRAM_SIZE ? SLPv1_FLAG_OVERFLOW : 0)); /*dialect*/ *(result->start + 5) = 0; /*language code*/ if ( G_SlpdProperty.locale ) { memcpy(result->start + 6, G_SlpdProperty.locale, 2); } ToUINT16(result->start + 8, encoding); /*xid*/ ToUINT16(result->start + 10,xid); result->curpos = result->start + 12; /*--------------------------*/ /* Add rest of the DAAdvert */ /*--------------------------*/ /* error code */ ToUINT16(result->curpos,errorcode); result->curpos = result->curpos + 2; ToUINT16(result->curpos, urllen); result->curpos = result->curpos + 2; /* url */ SLPv1ToEncoding(result->curpos, &urllen, encoding, G_SlpdProperty.myUrl, G_SlpdProperty.myUrlLen); result->curpos = result->curpos + urllen; /* scope list len */ ToUINT16(result->curpos, scopelistlen); result->curpos = result->curpos + 2; /* scope list */ #ifndef FAKE_UNSCOPED_DA SLPv1ToEncoding(result->curpos, &scopelistlen, encoding, G_SlpdProperty.useScopes, G_SlpdProperty.useScopesLen); #endif result->curpos = result->curpos + scopelistlen; FINISHED: *sendbuf = result; return errorcode; } #endif /*=========================================================================*/ void SLPDKnownDAEcho(SLPMessage msg, SLPBuffer buf) /* Echo a srvreg message to a known DA */ /* */ /* msg (IN) the SrvReg message descriptor */ /* */ /* buf (IN) the SrvReg message buffer to echo */ /* */ /* Returns: none */ /*=========================================================================*/ { SLPBuffer dup; SLPDatabaseHandle dh; SLPDatabaseEntry* entry; SLPDAAdvert* entrydaadvert; SLPDSocket* sock; const char* msgscope; int msgscopelen; /* Do not echo registrations if we are a DA unless they were made */ /* local through the API! */ if ( G_SlpdProperty.isDA && !ISLOCAL(msg->peer.sin_addr) ) { return; } if ( msg->header.functionid == SLP_FUNCT_SRVREG ) { msgscope = msg->body.srvreg.scopelist; msgscopelen = msg->body.srvreg.scopelistlen; } else if ( msg->header.functionid == SLP_FUNCT_SRVDEREG ) { msgscope = msg->body.srvdereg.scopelist; msgscopelen = msg->body.srvdereg.scopelistlen; } else { /* We only echo SRVREG and SRVDEREG */ return; } dh = SLPDatabaseOpen(&G_SlpdKnownDAs); if ( dh ) { /*-----------------------------------------------------*/ /* Check to see if there is already an identical entry */ /*-----------------------------------------------------*/ while ( 1 ) { entry = SLPDatabaseEnum(dh); if ( entry == NULL ) break; /* entrydaadvert is the DAAdvert message from the database */ entrydaadvert = &(entry->msg->body.daadvert); /* Send to all DAs that have matching scope */ if ( SLPIntersectStringList(msgscopelen, msgscope, entrydaadvert->scopelistlen, entrydaadvert->scopelist) ) { /* Do not echo to ourselves if we are a DA*/ if ( G_SlpdProperty.isDA && SLPCompareString(G_SlpdProperty.myUrlLen, G_SlpdProperty.myUrl, entrydaadvert->urllen, entrydaadvert->url) == 0 ) { /* don't do anything because it makes no sense to echo */ /* to myself */ } else { /*------------------------------------------*/ /* Load the socket with the message to send */ /*------------------------------------------*/ sock = SLPDOutgoingConnect(&(entry->msg->peer.sin_addr)); if ( sock ) { dup = SLPBufferDup(buf); if ( dup ) { SLPListLinkTail(&(sock->sendlist),(SLPListItem*)dup); if ( sock->state == STREAM_CONNECT_IDLE ) { sock->state = STREAM_WRITE_FIRST; } } else { sock->state = SOCKET_CLOSE; } } } } } SLPDatabaseClose(dh); } } /*=========================================================================*/ void SLPDKnownDAActiveDiscovery(int seconds) /* Add a socket to the outgoing list to do active DA discovery SrvRqst */ /* */ /* seconds (IN) number of seconds that expired since last call */ /* */ /* Returns: none */ /*=========================================================================*/ { struct in_addr peeraddr; SLPDSocket* sock; /* Check to see if we should perform active DA detection */ if ( G_SlpdProperty.DAActiveDiscoveryInterval == 0 ) { return; } /* When activeDiscoveryXmits is < 0 then we should not xmit any more */ if (G_SlpdProperty.activeDiscoveryXmits < 0) { return ; } if ( G_SlpdProperty.nextActiveDiscovery <= 0 ) { if ( G_SlpdProperty.activeDiscoveryXmits == 0) { if (G_SlpdProperty.DAActiveDiscoveryInterval == 1) {/* ensures xmit on first call */ /* don't xmit any more */ G_SlpdProperty.activeDiscoveryXmits = -1; } else { G_SlpdProperty.nextActiveDiscovery = G_SlpdProperty.DAActiveDiscoveryInterval; G_SlpdProperty.activeDiscoveryXmits = 3; } } G_SlpdProperty.activeDiscoveryXmits --; /*--------------------------------------------------*/ /* Create new DATAGRAM socket with appropriate peer */ /*--------------------------------------------------*/ if ( G_SlpdProperty.isBroadcastOnly == 0 ) { peeraddr.s_addr = htonl(SLP_MCAST_ADDRESS); sock = SLPDSocketCreateDatagram(&peeraddr,DATAGRAM_MULTICAST); } else { peeraddr.s_addr = htonl(SLP_BCAST_ADDRESS); sock = SLPDSocketCreateDatagram(&peeraddr,DATAGRAM_BROADCAST); } if ( sock ) { /*----------------------------------------------------------*/ /* Make the srvrqst and add the socket to the outgoing list */ /*----------------------------------------------------------*/ MakeActiveDiscoveryRqst(1,&(sock->sendbuf)); SLPDOutgoingDatagramWrite(sock); } } else { G_SlpdProperty.nextActiveDiscovery = G_SlpdProperty.nextActiveDiscovery - seconds; } } /*=========================================================================*/ void SLPDKnownDAPassiveDAAdvert(int seconds, int dadead) /* Send passive daadvert messages if properly configured and running as */ /* a DA */ /* */ /* seconds (IN) number seconds that elapsed since the last call to this */ /* function */ /* */ /* dadead (IN) nonzero if the DA is dead and a bootstamp of 0 should be */ /* sent */ /* */ /* Returns: none */ /*=========================================================================*/ { struct in_addr peeraddr; SLPDSocket* sock; #ifdef ENABLE_SLPv1 SLPDSocket* v1sock; #endif /* SAs don't send passive DAAdverts */ if ( G_SlpdProperty.isDA == 0) { return; } /* Check to see if we should perform passive DA detection */ if ( G_SlpdProperty.passiveDADetection == 0 ) { return; } if ( G_SlpdProperty.nextPassiveDAAdvert <= 0 || dadead ) { G_SlpdProperty.nextPassiveDAAdvert = G_SlpdProperty.DAHeartBeat; /*--------------------------------------------------*/ /* Create new DATAGRAM socket with appropriate peer */ /*--------------------------------------------------*/ if ( G_SlpdProperty.isBroadcastOnly == 0 ) { peeraddr.s_addr = htonl(SLP_MCAST_ADDRESS); sock = SLPDSocketCreateDatagram(&peeraddr,DATAGRAM_MULTICAST); #ifdef ENABLE_SLPv1 if ( !dadead ) { peeraddr.s_addr = htonl(SLPv1_DA_MCAST_ADDRESS); v1sock = SLPDSocketCreateDatagram(&peeraddr, DATAGRAM_MULTICAST); } else { v1sock = NULL; } #endif } else { peeraddr.s_addr = htonl(SLP_BCAST_ADDRESS); sock = SLPDSocketCreateDatagram(&peeraddr,DATAGRAM_BROADCAST); #ifdef ENABLE_SLPv1 if ( !dadead ) { v1sock = SLPDSocketCreateDatagram(&peeraddr,DATAGRAM_BROADCAST); } else { v1sock = NULL; } #endif } /* Generate the DAAdvert and link it to the write list */ if ( sock ) { if (SLPDKnownDAGenerateMyDAAdvert(0,dadead,0,&(sock->sendbuf)) == 0) { SLPDOutgoingDatagramWrite(sock); } else { SLPDSocketFree(sock); } } #ifdef ENABLE_SLPv1 if ( v1sock ) { /* SLPv1 does not support shutdown messages */ /* Generate the DAAdvert and write it */ if (SLPDKnownDAGenerateMyV1DAAdvert(0, SLP_CHAR_UTF8, SLPXidGenerate(), &(v1sock->sendbuf)) == 0) { SLPDOutgoingDatagramWrite(v1sock); } else { SLPDSocketFree(v1sock); } } #endif } else { G_SlpdProperty.nextPassiveDAAdvert = G_SlpdProperty.nextPassiveDAAdvert - seconds; } } /*=========================================================================*/ void SLPDKnownDAImmortalRefresh(int seconds) /* Refresh all SLP_LIFETIME_MAXIMUM services */ /* */ /* seconds (IN) time in seconds since last call */ /*=========================================================================*/ { SLPDatabaseHandle dh; SLPDatabaseEntry* entry; SLPDAAdvert* entrydaadvert; G_KnownDATimeSinceLastRefresh += seconds; if ( G_KnownDATimeSinceLastRefresh >= SLP_LIFETIME_MAXIMUM - seconds ) { /* Refresh all SLP_LIFETIME_MAXIMUM registrations */ dh = SLPDatabaseOpen(&G_SlpdKnownDAs); if(dh) { /*-----------------------------------------------------*/ /* Check to see if there is already an identical entry */ /*-----------------------------------------------------*/ while ( 1 ) { entry = SLPDatabaseEnum(dh); if ( entry == NULL ) break; /* entrydaadvert is the DAAdvert message from the database */ entrydaadvert = &(entry->msg->body.daadvert); /* Assume DAs are identical if their URLs match */ if ( SLPCompareString(entrydaadvert->urllen, entrydaadvert->url, G_SlpdProperty.myUrlLen, G_SlpdProperty.myUrl) ) { SLPDKnownDARegisterAll(entry->msg,1); } } SLPDatabaseClose(dh); } G_KnownDATimeSinceLastRefresh = 0; } } /*=========================================================================*/ void SLPDKnownDADeRegisterWithAllDas(SLPMessage msg, SLPBuffer buf) /* Deregister the registration described by the specified message */ /* */ /* msg (IN) A message descriptor for a SrvReg or SrvDereg message to */ /* deregister */ /* */ /* buf (IN) Message buffer associated with msg */ /* */ /* Returns: None */ /*=========================================================================*/ { SLPBuffer sendbuf; if(msg->header.functionid == SLP_FUNCT_SRVREG) { if(MakeSrvderegFromSrvReg(msg,buf, &sendbuf) == 0) { SLPDKnownDAEcho(msg,sendbuf); SLPBufferFree(sendbuf); } } else if (msg->header.functionid == SLP_FUNCT_SRVDEREG) { /* Simply echo the message through as is */ SLPDKnownDAEcho(msg,buf); } } /*=========================================================================*/ void SLPDKnownDARegisterWithAllDas(SLPMessage msg, SLPBuffer buf) /* Register the registration described by the specified message with all */ /* known DAs */ /* */ /* msg (IN) A message descriptor for a SrvReg or SrvDereg message to */ /* register */ /* */ /* buf (IN) Message buffer associated with msg */ /* */ /* Returns: None */ /*=========================================================================*/ { if (msg->header.functionid == SLP_FUNCT_SRVREG) { /* Simply echo the message through as is */ SLPDKnownDAEcho(msg,buf); } } #ifdef DEBUG /*=========================================================================*/ void SLPDKnownDADump() /*=========================================================================*/ { SLPMessage msg; SLPBuffer buf; void* eh; eh = SLPDKnownDAEnumStart(); if ( eh ) { SLPDLog("========================================================================\n"); SLPDLog("Dumping KnownDAs \n"); SLPDLog("========================================================================\n"); while ( SLPDKnownDAEnum(eh, &msg, &buf) ) { SLPDLogMessageInternals(msg); SLPDLog("\n"); } SLPDKnownDAEnumEnd(eh); } } #endif openslp-1.2.1/slpd/slpd_regfile.h0000644033442200000310000001325210202047550016630 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_regfile.c */ /* */ /* Abstract: Reads service registrations from a file */ /* */ /* WARNING: NOT thread safe! */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLP_REGFILE_H_INCLUDE #define SLP_REGFILE_H_INCLUDE #include "slpd.h" /*=========================================================================*/ /* common code includes */ /*=========================================================================*/ #include "slp_buffer.h" #include "slp_message.h" /*=========================================================================*/ int SLPDRegFileReadSrvReg(FILE* fd, SLPMessage* msg, SLPBuffer* buf); /* A really big and nasty function that reads an service registration from */ /* from a file. Don't look at this too hard or you'll be sick. This is by */ /* the most horrible code in OpenSLP. Please volunteer to rewrite it! */ /* */ /* "THANK GOODNESS this function is only called at startup" -- Matt */ /* */ /* */ /* fd (IN) file to read from */ /* */ /* msg (OUT) message describing the SrvReg in buf */ /* */ /* buf (OUT) buffer containing the SrvReg */ /* */ /* Returns: zero on success. > 0 on error. < 0 if EOF */ /* */ /* Note: Eventually the caller needs to call SLPBufferFree() and */ /* SLPMessageFree() to free memory */ /*=========================================================================*/ #endif openslp-1.2.1/slpd/slpd_outgoing.c0000644033442200000310000006144610211370457017056 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_outgoing.c */ /* */ /* Abstract: Handles "outgoing" network conversations requests made by */ /* other agents to slpd. (slpd_incoming.c handles reqests */ /* made by other agents to slpd) */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ /*=========================================================================*/ /* slpd includes */ /*=========================================================================*/ #include "slpd_outgoing.h" #include "slpd_property.h" #include "slpd_process.h" #include "slpd_log.h" #include "slpd_knownda.h" /*=========================================================================*/ /* common code includes */ /*=========================================================================*/ #include "slp_message.h" /*=========================================================================*/ SLPList G_OutgoingSocketList = {0,0,0}; /*=========================================================================*/ /*-------------------------------------------------------------------------*/ void OutgoingDatagramRead(SLPList* socklist, SLPDSocket* sock) /*-------------------------------------------------------------------------*/ { int bytesread; int peeraddrlen = sizeof(struct sockaddr_in); bytesread = recvfrom(sock->fd, sock->recvbuf->start, SLP_MAX_DATAGRAM_SIZE, 0, (struct sockaddr *) &(sock->peeraddr), &peeraddrlen); if ( bytesread > 0 ) { sock->recvbuf->end = sock->recvbuf->start + bytesread; SLPDProcessMessage(&(sock->peeraddr), sock->recvbuf, &(sock->sendbuf)); /* Completely ignore the message */ } } /*-------------------------------------------------------------------------*/ void OutgoingStreamReconnect(SLPList* socklist, SLPDSocket* sock) /*-------------------------------------------------------------------------*/ { #ifdef _WIN32 u_long fdflags; #else int fdflags; #endif /*-----------------------------------------------------------------*/ /* If socket is already being reconnected but is reconnect blocked */ /* just return. Blocking connect sockets will eventually time out */ /*-----------------------------------------------------------------*/ if(sock->state == STREAM_CONNECT_BLOCK) { return; } #ifdef DEBUG /* Log that reconnect warning */ SLPDLog("WARNING: Reconnect to agent at %s. Agent may not be making efficient \n" " use of TCP.\n", inet_ntoa(sock->peeraddr.sin_addr)); #endif /*----------------------------------------------------------------*/ /* Make sure we have not reconnected too many times */ /* We only allow SLPD_CONFIG_MAX_RECONN reconnection retries */ /* before we stop */ /*----------------------------------------------------------------*/ sock->reconns += 1; if ( sock->reconns > SLPD_CONFIG_MAX_RECONN ) { sock->state = SOCKET_CLOSE; SLPDLog("WARNING: Reconnect tries to agent at %s exceeded maximum. It\n" " is possible that the agent is malicious. Check it out!\n", inet_ntoa(sock->peeraddr.sin_addr)); return; } /*----------------------------------------------------------------*/ /* Close the existing socket to clean the stream and open an new */ /* socket */ /*----------------------------------------------------------------*/ CloseSocket(sock->fd); sock->fd = socket(PF_INET,SOCK_STREAM,0); if ( sock->fd < 0 ) { sock->state = SOCKET_CLOSE; return; } /*---------------------------------------------*/ /* Set the new socket to enable nonblocking IO */ /*---------------------------------------------*/ #ifdef _WIN32 fdflags = 1; ioctlsocket(sock->fd, FIONBIO, &fdflags); #else fdflags = fcntl(sock->fd, F_GETFL, 0); fcntl(sock->fd,F_SETFL, fdflags | O_NONBLOCK); #endif /*--------------------------*/ /* Connect a the new socket */ /*--------------------------*/ if ( connect(sock->fd, (struct sockaddr *)&(sock->peeraddr), sizeof(struct sockaddr_in)) ) { #ifdef _WIN32 if ( WSAEWOULDBLOCK == WSAGetLastError() ) #else if ( errno == EINPROGRESS ) #endif { /* Connect blocked */ sock->state = STREAM_CONNECT_BLOCK; return; } } /* Connection occured immediately. Set to WRITE_FIRST so whole */ /* packet will be written */ sock->state = STREAM_WRITE_FIRST; } /*-------------------------------------------------------------------------*/ void OutgoingStreamRead(SLPList* socklist, SLPDSocket* sock) /*-------------------------------------------------------------------------*/ { int bytesread, recvlen; char peek[16]; int peeraddrlen = sizeof(struct sockaddr_in); if ( sock->state == STREAM_READ_FIRST ) { /*---------------------------------------------------*/ /* take a peek at the packet to get size information */ /*---------------------------------------------------*/ bytesread = recvfrom(sock->fd, peek, 16, MSG_PEEK, (struct sockaddr *)&(sock->peeraddr), &peeraddrlen); if ( bytesread >= 5 && *peek == 2 ) { recvlen = AsUINT24(peek + 2); /* one byte is minimum */ if (recvlen <= 0) recvlen = 1; /* allocate the recvbuf big enough for the whole message */ sock->recvbuf = SLPBufferRealloc(sock->recvbuf, recvlen); if ( sock->recvbuf ) { sock->state = STREAM_READ; } else { SLPDLog("INTERNAL_ERROR - out of memory!\n"); sock->state = SOCKET_CLOSE; } } else if ( bytesread == -1 ) { #ifdef _WIN32 if ( WSAEWOULDBLOCK != WSAGetLastError() ) #else if ( errno != EWOULDBLOCK ) #endif { /* Error occured or connection was closed. Try to reconnect */ /* Socket will be closed if connect times out */ OutgoingStreamReconnect(socklist,sock); } } else { sock->state = SOCKET_CLOSE; } } if ( sock->state == STREAM_READ ) { /*------------------------------*/ /* recv the rest of the message */ /*------------------------------*/ bytesread = recv(sock->fd, sock->recvbuf->curpos, sock->recvbuf->end - sock->recvbuf->curpos, 0); if ( bytesread > 0 ) { /* reset age because of activity */ sock->age = 0; /* move buffer pointers */ sock->recvbuf->curpos += bytesread; /* check to see if everything was read */ if ( sock->recvbuf->curpos == sock->recvbuf->end ) { switch ( SLPDProcessMessage(&(sock->peeraddr), sock->recvbuf, &(sock->sendbuf)) ) { case SLP_ERROR_DA_BUSY_NOW: sock->state = STREAM_WRITE_WAIT; break; case SLP_ERROR_PARSE_ERROR: case SLP_ERROR_VER_NOT_SUPPORTED: sock->state = SOCKET_CLOSE; break; default: /* End of outgoing message exchange. Unlink */ /* send buf from to do list and free it */ SLPBufferFree(sock->sendbuf); sock->sendbuf = NULL; sock->state = STREAM_WRITE_FIRST; /* clear the reconnection count since we actually * transmitted a successful message exchange */ sock->reconns = 0; break; } } } else { #ifdef _WIN32 if ( WSAEWOULDBLOCK != WSAGetLastError() ) #else if ( errno != EWOULDBLOCK ) #endif { /* Error occured or connection was closed. Try to reconnect */ /* Socket will be closed if connect times out */ OutgoingStreamReconnect(socklist,sock); } } } } /*-------------------------------------------------------------------------*/ void OutgoingStreamWrite(SLPList* socklist, SLPDSocket* sock) /*-------------------------------------------------------------------------*/ { int byteswritten; int flags = 0; #if defined(MSG_DONTWAIT) flags = MSG_DONTWAIT; #endif if ( sock->state == STREAM_WRITE_FIRST ) { /* set sendbuf to the first item in the send list if it is not set */ if(sock->sendbuf == NULL) { sock->sendbuf = (SLPBuffer)sock->sendlist.head; if ( sock->sendbuf == NULL ) { /* there is nothing in the to do list */ sock->state = STREAM_CONNECT_IDLE; return; } /* Unlink the send buffer we are sending from the send list */ SLPListUnlink(&(sock->sendlist),(SLPListItem*)(sock->sendbuf)); } /* make sure that the start and curpos pointers are the same */ sock->sendbuf->curpos = sock->sendbuf->start; sock->state = STREAM_WRITE; } if ( sock->sendbuf->end - sock->sendbuf->start > 0 ) { byteswritten = send(sock->fd, sock->sendbuf->curpos, sock->sendbuf->end - sock->sendbuf->start, flags); if ( byteswritten > 0 ) { /* reset age because of activity */ sock->age = 0; /* move buffer pointers */ sock->sendbuf->curpos += byteswritten; /* check to see if everything was written */ if ( sock->sendbuf->curpos == sock->sendbuf->end ) { /* Message is completely sent. Set state to read the reply */ sock->state = STREAM_READ_FIRST; } } else { #ifdef _WIN32 if ( WSAEWOULDBLOCK != WSAGetLastError() ) #else if ( errno != EWOULDBLOCK ) #endif { /* Error occured or connection was closed. Try to reconnect */ /* Socket will be closed if connect times out */ OutgoingStreamReconnect(socklist,sock); } } } else { /* nothing to write */ #ifdef DEBUG SLPDLog("yikes, an empty socket is being written!\n"); #endif sock->state = SOCKET_CLOSE; } } /*=========================================================================*/ SLPDSocket* SLPDOutgoingConnect(struct in_addr* addr) /* Get a pointer to a connected socket that is associated with the */ /* outgoing socket list. If a connected socket already exists on the */ /* outgoing list, a pointer to it is returned, otherwise a new connection */ /* is made and added to the outgoing list */ /* */ /* addr (IN) the address of the peer a connection is desired for */ /* */ /* returns: pointer to socket or null on error */ /*=========================================================================*/ { SLPDSocket* sock = (SLPDSocket*)G_OutgoingSocketList.head; while ( sock ) { if ( sock->state == STREAM_CONNECT_IDLE || sock->state > SOCKET_PENDING_IO ) { if ( sock->peeraddr.sin_addr.s_addr == addr->s_addr ) { break; } } sock = (SLPDSocket*)sock->listitem.next; } if ( sock == 0 ) { sock = SLPDSocketCreateConnected(addr); if(sock) { SLPListLinkTail(&(G_OutgoingSocketList),(SLPListItem*)sock); } } return sock; } /*=========================================================================*/ void SLPDOutgoingDatagramWrite(SLPDSocket* sock) /* Add a ready to write outgoing datagram socket to the outgoing list. */ /* The datagram will be written then sit in the list until it ages out */ /* (after net.slp.unicastMaximumWait) */ /* */ /* sock (IN) the socket that will belong on the outgoing list */ /*=========================================================================*/ { if ( sendto(sock->fd, sock->sendbuf->start, sock->sendbuf->end - sock->sendbuf->start, 0, (struct sockaddr *) &(sock->peeraddr), sizeof(struct sockaddr_in)) >= 0 ) { /* Link the socket into the outgoing list so replies will be */ /* processed */ SLPListLinkHead(&G_OutgoingSocketList,(SLPListItem*)(sock)); } else { #ifdef DEBUG SLPDLog("ERROR: Data could not send() in SLPDOutgoingDatagramWrite()"); #endif SLPDSocketFree(sock); } } /*=========================================================================*/ void SLPDOutgoingHandler(int* fdcount, fd_set* readfds, fd_set* writefds) /* Handles all outgoing requests that are pending on the specified file */ /* discriptors */ /* */ /* fdcount (IN/OUT) number of file descriptors marked in fd_sets */ /* */ /* readfds (IN) file descriptors with pending read IO */ /* */ /* writefds (IN) file descriptors with pending read IO */ /*=========================================================================*/ { SLPDSocket* sock; sock = (SLPDSocket*)G_OutgoingSocketList.head; while ( sock && *fdcount ) { if ( FD_ISSET(sock->fd,readfds) ) { switch ( sock->state ) { case DATAGRAM_MULTICAST: case DATAGRAM_BROADCAST: case DATAGRAM_UNICAST: OutgoingDatagramRead(&G_OutgoingSocketList,sock); break; case STREAM_READ: case STREAM_READ_FIRST: OutgoingStreamRead(&G_OutgoingSocketList,sock); break; default: /* No SOCKET_LISTEN sockets should exist */ break; } *fdcount = *fdcount - 1; } else if ( FD_ISSET(sock->fd,writefds) ) { switch ( sock->state ) { case STREAM_CONNECT_BLOCK: sock->age = 0; sock->state = STREAM_WRITE_FIRST; case STREAM_WRITE: case STREAM_WRITE_FIRST: OutgoingStreamWrite(&G_OutgoingSocketList,sock); break; default: break; } *fdcount = *fdcount - 1; } sock = (SLPDSocket*)sock->listitem.next; } } /*=========================================================================*/ void SLPDOutgoingAge(time_t seconds) /*=========================================================================*/ { SLPDSocket* del = 0; SLPDSocket* sock = (SLPDSocket*)G_OutgoingSocketList.head; while ( sock ) { switch ( sock->state ) { case DATAGRAM_MULTICAST: case DATAGRAM_BROADCAST: case DATAGRAM_UNICAST: if ( sock->age > G_SlpdProperty.unicastMaximumWait / 1000 ) { del = sock; } sock->age = sock->age + seconds; break; case STREAM_READ_FIRST: case STREAM_WRITE_FIRST: sock->age = 0; break; case STREAM_CONNECT_BLOCK: case STREAM_READ: case STREAM_WRITE: if ( G_OutgoingSocketList.count > SLPD_COMFORT_SOCKETS ) { /* Accelerate ageing cause we are low on sockets */ if ( sock->age > SLPD_CONFIG_BUSY_CLOSE_CONN ) { /* Remove peer from KnownDAs since it might be dead */ SLPDKnownDARemove(&(sock->peeraddr.sin_addr)); del = sock; } } else { if ( sock->age > SLPD_CONFIG_CLOSE_CONN ) { /* Remove peer from KnownDAs since it might be dead */ SLPDKnownDARemove(&(sock->peeraddr.sin_addr)); del = sock; } } sock->age = sock->age + seconds; break; case STREAM_CONNECT_IDLE: if ( G_OutgoingSocketList.count > SLPD_COMFORT_SOCKETS ) { /* Accelerate ageing cause we are low on sockets */ if ( sock->age > SLPD_CONFIG_BUSY_CLOSE_CONN ) { del = sock; } } else { if ( sock->age > SLPD_CONFIG_CLOSE_CONN ) { del = sock; } } sock->age = sock->age + seconds; break; case STREAM_WRITE_WAIT: /* this when we are talking to a busy DA */ sock->age = 0; sock->state = STREAM_WRITE_FIRST; break; default: /* don't age the other sockets at all */ break; } sock = (SLPDSocket*)sock->listitem.next; if ( del ) { SLPDSocketFree((SLPDSocket*)SLPListUnlink(&G_OutgoingSocketList,(SLPListItem*)del)); del = 0; } } } /*=========================================================================*/ int SLPDOutgoingInit() /* Initialize outgoing socket list to have appropriate sockets for all */ /* network interfaces */ /* */ /* list (IN/OUT) pointer to a socket list to be filled with sockets */ /* */ /* Returns Zero on success non-zero on error */ /*=========================================================================*/ { /*------------------------------------------------------------*/ /* First, remove all of the sockets that might be in the list */ /*------------------------------------------------------------*/ while ( G_OutgoingSocketList.count ) { SLPDSocketFree((SLPDSocket*)SLPListUnlink(&G_OutgoingSocketList,(SLPListItem*)G_OutgoingSocketList.head)); } return 0; } /*=========================================================================*/ int SLPDOutgoingDeinit(int graceful) /* Deinitialize incoming socket list to have appropriate sockets for all */ /* network interfaces */ /* */ /* graceful (IN) Do not close sockets with pending writes */ /* */ /* Returns Zero on success non-zero when pending writes remain */ /*=========================================================================*/ { SLPDSocket* del = 0; SLPDSocket* sock = (SLPDSocket*)G_OutgoingSocketList.head; while ( sock ) { /* graceful only closes sockets without pending I/O */ if ( graceful == 0 ) { del = sock; } else if ( sock->state < SOCKET_PENDING_IO ) { del = sock; } sock = (SLPDSocket*)sock->listitem.next; if ( del ) { SLPDSocketFree((SLPDSocket*)SLPListUnlink(&G_OutgoingSocketList,(SLPListItem*)del)); del = 0; } } return G_OutgoingSocketList.count; } #ifdef DEBUG /*=========================================================================*/ void SLPDOutgoingSocketDump() /*=========================================================================*/ { } #endif openslp-1.2.1/slpd/slpd_log.h0000644033442200000310000002354310202047550016000 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_log.h */ /* */ /* Abstract: slpd logging functions */ /* */ /* WARNING: NOT thread safe! */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLPD_LOG_H_INCLUDED #define SLPD_LOG_H_INCLUDED #include "slpd.h" /*=========================================================================*/ /* common code includes */ /*=========================================================================*/ #include "slp_message.h" #include "slp_database.h" #define SLPDLOG_TRACEMSG 0x80000000 #define SLPDLOG_TRACEDROP 0x40000000 #define SLPDLOG_TRACEMSG_IN (SLPDLOG_TRACEMSG | 0x00000001) #define SLPDLOG_TRACEMSG_OUT (SLPDLOG_TRACEMSG | 0x00000002) /*=========================================================================*/ int SLPDLogFileOpen(const char* path, int append); /* Prepares the file at the specified path as the log file. */ /* */ /* path - (IN) the path to the log file. If path is the empty string */ /* (""), then we log to stdout. */ /* */ /* append - (IN) if zero log file will be truncated. */ /* */ /* Returns - zero on success. errno on failure. */ /*=========================================================================*/ #ifdef DEBUG /*=========================================================================*/ int SLPDLogFileClose(); /* Releases resources associated with the log file */ /*=========================================================================*/ #endif /*=========================================================================*/ void SLPDLogBuffer(const char* prefix, int bufsize, const char* buf); /* Writes a buffer to the logfile */ /*=========================================================================*/ /*=========================================================================*/ void SLPDLog(const char* msg, ...); /* Logs a message */ /*=========================================================================*/ /*=========================================================================*/ void SLPDFatal(const char* msg, ...); /* Logs a message and halts the process */ /*=========================================================================*/ /*=========================================================================*/ void SLPDLogTime(); /* Logs a timestamp */ /*=========================================================================*/ /*=========================================================================*/ void SLPDLogMessageInternals(SLPMessage message); /*=========================================================================*/ /*=========================================================================*/ void SLPDLogMessage(int msglogflags, struct sockaddr_in* peerinfo, SLPBuffer buf); /* Log record of receiving or sending an SLP Message. Logging will only */ /* occur if message logging is enabled G_SlpProperty.traceMsg != 0 */ /* */ /* msglogflags (IN) What type of message to log */ /* */ /* peerinfo (IN) the source or destination peer */ /* */ /* msg (IN) the message to log */ /* */ /* Returns: none */ /*=========================================================================*/ /*=========================================================================*/ void SLPDLogRegistration(const char* prefix, SLPDatabaseEntry* entry); /* Log record of having added a registration to the database. Logging of */ /* registraions will only occur if registration trace is enabled */ /* G_SlpProperty.traceReg != 0 */ /* */ /* prefix (IN) an informative prefix for the log entry */ /* */ /* entry (IN) the database entry that was affected */ /* */ /* Returns: none */ /*=========================================================================*/ /*=========================================================================*/ void SLPDLogDAAdvertisement(const char* prefix, SLPDatabaseEntry* entry); /* Log record of addition or removal of a DA to the store of known DAs. */ /* Will only occur if DA Advertisment message logging is enabled */ /* G_SlpProperty.traceDATraffic != 0 */ /* */ /* prefix (IN) an informative prefix for the log entry */ /* */ /* entry (IN) the database entry that was affected */ /* */ /* Returns: none */ /*=========================================================================*/ /*=========================================================================*/ void SLPDLogParseWarning(struct sockaddr_in* peeraddr, SLPBuffer buf); /* Log a parsing error warning and dumps the invalid message. */ /*=========================================================================*/ #endif openslp-1.2.1/slpd/Makefile.in0000644033442200000310000004343310211377470016100 0ustar rganesanfloppy# Makefile.in generated by automake 1.8.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # # Makefile.am # Automake File # The linked in library libcommonslpd, which is from ../common # containing exacts functions which are required. # SOURCES = $(slpd_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_triplet = @host@ sbin_PROGRAMS = slpd$(EXEEXT) subdir = slpd DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(mkdir_p) CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(sbin_PROGRAMS) am__slpd_SOURCES_DIST = slpd_predicate.h slpd_predicate.c \ slpd_v1process.c slpd_spi.c slpd_spi.h slpd_log.c \ slpd_socket.c slpd_database.c slpd_main.c slpd_process.c \ slpd_cmdline.c slpd_property.c slpd_regfile.c slpd_knownda.c \ slpd_incoming.c slpd_outgoing.c slpd.h slpd_knownda.h \ slpd_process.h slpd_unistd.h slpd_cmdline.h slpd_log.h \ slpd_property.h slpd_database.h slpd_outgoing.h slpd_regfile.h \ slpd_incoming.h slpd_socket.h @ENABLE_PREDICATES_TRUE@am__objects_1 = slpd_predicate.$(OBJEXT) @ENABLE_SLPv1_TRUE@am__objects_2 = slpd_v1process.$(OBJEXT) @ENABLE_SLPv2_SECURITY_TRUE@am__objects_3 = slpd_spi.$(OBJEXT) am_slpd_OBJECTS = $(am__objects_1) $(am__objects_2) $(am__objects_3) \ slpd_log.$(OBJEXT) slpd_socket.$(OBJEXT) \ slpd_database.$(OBJEXT) slpd_main.$(OBJEXT) \ slpd_process.$(OBJEXT) slpd_cmdline.$(OBJEXT) \ slpd_property.$(OBJEXT) slpd_regfile.$(OBJEXT) \ slpd_knownda.$(OBJEXT) slpd_incoming.$(OBJEXT) \ slpd_outgoing.$(OBJEXT) slpd_OBJECTS = $(am_slpd_OBJECTS) slpd_DEPENDENCIES = ../common/libcommonslpd.la \ ../libslpattr/libslpattr.la DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/slpd_cmdline.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/slpd_database.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/slpd_incoming.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/slpd_knownda.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/slpd_log.Po ./$(DEPDIR)/slpd_main.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/slpd_outgoing.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/slpd_predicate.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/slpd_process.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/slpd_property.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/slpd_regfile.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/slpd_socket.Po ./$(DEPDIR)/slpd_spi.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/slpd_v1process.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(slpd_SOURCES) DIST_SOURCES = $(am__slpd_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_ASYNC_API_FALSE = @ENABLE_ASYNC_API_FALSE@ ENABLE_ASYNC_API_TRUE = @ENABLE_ASYNC_API_TRUE@ ENABLE_PREDICATES_FALSE = @ENABLE_PREDICATES_FALSE@ ENABLE_PREDICATES_TRUE = @ENABLE_PREDICATES_TRUE@ ENABLE_SLPv1_FALSE = @ENABLE_SLPv1_FALSE@ ENABLE_SLPv1_TRUE = @ENABLE_SLPv1_TRUE@ ENABLE_SLPv2_SECURITY_FALSE = @ENABLE_SLPv2_SECURITY_FALSE@ ENABLE_SLPv2_SECURITY_TRUE = @ENABLE_SLPv2_SECURITY_TRUE@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ EXTRA_DIST = slpd_win32.h slpd_win32.c INCLUDES = -I$(top_srcdir)/common -I$(top_srcdir)/libslpattr \ -I$(srcdir) -I$(top_srcdir)/libslp \ -DETCDIR=\"$(sysconfdir)\" -DVARDIR=\"$(localstatedir)\" @ENABLE_PREDICATES_TRUE@slp_predicate_SRCS = slpd_predicate.h slpd_predicate.c @ENABLE_SLPv1_TRUE@slpd_v1process_SRCS = slpd_v1process.c @ENABLE_SLPv2_SECURITY_TRUE@slpd_security_SRCS = slpd_spi.c slpd_spi.h slpd_SOURCES = \ $(slp_predicate_SRCS) \ $(slpd_v1process_SRCS) \ $(slpd_security_SRCS) \ slpd_log.c \ slpd_socket.c \ slpd_database.c \ slpd_main.c \ slpd_process.c \ slpd_cmdline.c \ slpd_property.c \ slpd_regfile.c \ slpd_knownda.c \ slpd_incoming.c \ slpd_outgoing.c \ slpd.h \ slpd_knownda.h \ slpd_process.h \ slpd_unistd.h \ slpd_cmdline.h \ slpd_log.h \ slpd_property.h \ slpd_database.h \ slpd_outgoing.h \ slpd_regfile.h \ slpd_incoming.h \ slpd_socket.h #if you're building on Irix, exchange commented and uncommented lines #slpd_LDADD = ../common/libcommonslpd.a ../libslpattr/libslpattr.a slpd_LDADD = ../common/libcommonslpd.la ../libslpattr/libslpattr.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu slpd/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu slpd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ rm -f "$(DESTDIR)$(sbindir)/$$f"; \ done clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done slpd$(EXEEXT): $(slpd_OBJECTS) $(slpd_DEPENDENCIES) @rm -f slpd$(EXEEXT) $(LINK) $(slpd_LDFLAGS) $(slpd_OBJECTS) $(slpd_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slpd_cmdline.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slpd_database.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slpd_incoming.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slpd_knownda.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slpd_log.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slpd_main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slpd_outgoing.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slpd_predicate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slpd_process.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slpd_property.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slpd_regfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slpd_socket.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slpd_spi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slpd_v1process.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-sbinPROGRAMS install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-sbinPROGRAMS .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-sbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-sbinPROGRAMS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-info-am \ uninstall-sbinPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: openslp-1.2.1/slpd/slpd_property.h0000644033442200000310000001435710202256521017106 0ustar rganesanfloppy /***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_property.h */ /* */ /* Abstract: Defines the data structures for global SLP properties */ /* */ /* WARNING: NOT thread safe! */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLPD_PROPERTY_H_INCLUDED #define SLPD_PROPERTY_H_INCLUDED #include "slpd.h" #include "slp_iface.h" /*=========================================================================*/ typedef struct _SLPDProperty /* structure that holds the value of all the properties slpd cares about */ /*=========================================================================*/ { int myUrlLen; const char* myUrl; int myHostnameLen; const char* myHostname; int useScopesLen; const char* useScopes; int DAAddressesLen; const char* DAAddresses; unsigned long DATimestamp; /* here for convenience */ SLPIfaceInfo ifaceInfo; int interfacesLen; const char* interfaces; int updateIfaces; int localeLen; const char* locale; int isBroadcastOnly; int passiveDADetection; int activeDADetection; int DAActiveDiscoveryInterval; int activeDiscoveryXmits; int nextActiveDiscovery; int nextPassiveDAAdvert; int multicastTTL; int multicastMaximumWait; int unicastMaximumWait; int randomWaitBound; int maxResults; int traceMsg; int traceReg; int traceDrop; int traceDATraffic; int isDA; int securityEnabled; int checkSourceAddr; int DAHeartBeat; }SLPDProperty; /*=========================================================================*/ extern SLPDProperty G_SlpdProperty; /* Global variable that holds all of the properties that slpd cares about */ /*=========================================================================*/ /*=========================================================================*/ int SLPDPropertyInit(const char* conffile); /* Called to initialize slp properties. Reads .conf file, etc. */ /* */ /* conffile (IN) the path of the configuration file to use */ /*=========================================================================*/ #ifdef DEBUG /*=========================================================================*/ void SLPDPropertyDeinit(); /* Release all resources used by the properties */ /*=========================================================================*/ #endif #endif openslp-1.2.1/slpd/slpd_process.c0000644033442200000310000015315410202054110016660 0ustar rganesanfloppy/**************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_process.c */ /* */ /* Abstract: Processes incoming SLP messages */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ /*=========================================================================*/ /* slpd includes */ /*=========================================================================*/ #include "slpd_process.h" #include "slpd_property.h" #include "slpd_database.h" #include "slpd_knownda.h" #include "slpd_log.h" #ifdef ENABLE_SLPv2_SECURITY #include "slpd_spi.h" #endif /*=========================================================================*/ /* common code includes */ /*=========================================================================*/ #include "slp_xmalloc.h" #include "slp_message.h" #include "slp_compare.h" #ifdef ENABLE_SLPv2_SECURITY #include "slp_auth.h" #endif /*-------------------------------------------------------------------------*/ int ProcessSASrvRqst(SLPMessage message, SLPBuffer* sendbuf, int errorcode) /*-------------------------------------------------------------------------*/ { int size = 0; SLPBuffer result = *sendbuf; if (message->body.srvrqst.scopelistlen == 0 || SLPIntersectStringList(message->body.srvrqst.scopelistlen, message->body.srvrqst.scopelist, G_SlpdProperty.useScopesLen, G_SlpdProperty.useScopes) != 0) { /*----------------------*/ /* Send back a SAAdvert */ /*----------------------*/ /*--------------------------------------------------------------*/ /* ensure the buffer is big enough to handle the whole SAAdvert */ /*--------------------------------------------------------------*/ size = message->header.langtaglen + 21; /* 14 bytes for header */ /* 2 bytes for url count */ /* 2 bytes for scope list len */ /* 2 bytes for attr list len */ /* 1 byte for authblock count */ size += G_SlpdProperty.myUrlLen; size += G_SlpdProperty.useScopesLen; /* TODO: size += G_SlpdProperty.SAAttributes */ result = SLPBufferRealloc(result,size); if (result == 0) { /* TODO: out of memory, what should we do here! */ errorcode = SLP_ERROR_INTERNAL_ERROR; goto FINISHED; } /*----------------*/ /* Add the header */ /*----------------*/ /*version*/ *(result->start) = 2; /*function id*/ *(result->start + 1) = SLP_FUNCT_SAADVERT; /*length*/ ToUINT24(result->start + 2, size); /*flags*/ ToUINT16(result->start + 5, (size > SLP_MAX_DATAGRAM_SIZE ? SLP_FLAG_OVERFLOW : 0)); /*ext offset*/ ToUINT24(result->start + 7,0); /*xid*/ ToUINT16(result->start + 10,message->header.xid); /*lang tag len*/ ToUINT16(result->start + 12,message->header.langtaglen); /*lang tag*/ memcpy(result->start + 14, message->header.langtag, message->header.langtaglen); /*--------------------------*/ /* Add rest of the SAAdvert */ /*--------------------------*/ result->curpos = result->start + 14 + message->header.langtaglen; /* url len */ ToUINT16(result->curpos, G_SlpdProperty.myUrlLen); result->curpos = result->curpos + 2; /* url */ memcpy(result->curpos,G_SlpdProperty.myUrl,G_SlpdProperty.myUrlLen); result->curpos = result->curpos + G_SlpdProperty.myUrlLen; /* scope list len */ ToUINT16(result->curpos, G_SlpdProperty.useScopesLen); result->curpos = result->curpos + 2; /* scope list */ memcpy(result->curpos,G_SlpdProperty.useScopes,G_SlpdProperty.useScopesLen); result->curpos = result->curpos + G_SlpdProperty.useScopesLen; /* attr list len */ /* ToUINT16(result->curpos,G_SlpdProperty.SAAttributesLen) */ ToUINT16(result->curpos, 0); result->curpos = result->curpos + 2; /* attr list */ /* memcpy(result->start,G_SlpdProperty.SAAttributes,G_SlpdProperty.SAAttributesLen) */ /* authblock count */ *(result->curpos) = 0; } else { errorcode = SLP_ERROR_SCOPE_NOT_SUPPORTED; } FINISHED: *sendbuf = result; return errorcode; } /*-------------------------------------------------------------------------*/ int ProcessDASrvRqst(SLPMessage message, SLPBuffer* sendbuf, int errorcode) /*-------------------------------------------------------------------------*/ { SLPBuffer tmp = 0; SLPMessage msg = 0; void* eh = 0; /*---------------------------------------------------------------------*/ /* Special case for when libslp asks slpd (through the loopback) about */ /* a known DAs. Fill sendbuf with DAAdverts from all known DAs. */ /*---------------------------------------------------------------------*/ if (ISLOCAL(message->peer.sin_addr)) { /* TODO: be smarter about how much memory is allocated here! */ /* 4096 may not be big enough to handle all DAAdverts */ *sendbuf = SLPBufferRealloc(*sendbuf, 4096); if (*sendbuf == 0) { return SLP_ERROR_INTERNAL_ERROR; } if (errorcode == 0) { /* Note: The weird *sendbuf code is making a single SLPBuffer */ /* that contains multiple DAAdverts. This is a special */ /* process that only happens for the DA SrvRqst through */ /* loopback to the SLPAPI */ eh = SLPDKnownDAEnumStart(); if (eh) { while (1) { if (SLPDKnownDAEnum(eh, &msg, &tmp) == 0) { break; } if (((*sendbuf)->curpos) + (tmp->end - tmp->start) > (*sendbuf)->end) { break; } /* TRICKY: fix up the xid */ tmp->curpos = tmp->start + 10; ToUINT16(tmp->curpos, message->header.xid); memcpy((*sendbuf)->curpos, tmp->start, tmp->end - tmp->start); (*sendbuf)->curpos = ((*sendbuf)->curpos) + (tmp->end - tmp->start); } SLPDKnownDAEnumEnd(eh); } /* Tack on a "terminator" DAAdvert */ SLPDKnownDAGenerateMyDAAdvert(SLP_ERROR_INTERNAL_ERROR, 0, message->header.xid, &tmp); if (((*sendbuf)->curpos) + (tmp->end - tmp->start) <= (*sendbuf)->end) { memcpy((*sendbuf)->curpos, tmp->start, tmp->end - tmp->start); (*sendbuf)->curpos = ((*sendbuf)->curpos) + (tmp->end - tmp->start); } /* mark the end of the sendbuf */ (*sendbuf)->end = (*sendbuf)->curpos; if (tmp) { SLPBufferFree(tmp); } } return errorcode; } /*---------------------------------------------------------------------*/ /* Normal case where a remote Agent asks for a DA */ /*---------------------------------------------------------------------*/ *sendbuf = SLPBufferRealloc(*sendbuf, SLP_MAX_DATAGRAM_SIZE); if (*sendbuf == 0) { return SLP_ERROR_INTERNAL_ERROR; } if (G_SlpdProperty.isDA) { if (message->body.srvrqst.scopelistlen == 0 || SLPIntersectStringList(message->body.srvrqst.scopelistlen, message->body.srvrqst.scopelist, G_SlpdProperty.useScopesLen, G_SlpdProperty.useScopes)) { errorcode = SLPDKnownDAGenerateMyDAAdvert(errorcode, 0, message->header.xid, sendbuf); } else { errorcode = SLP_ERROR_SCOPE_NOT_SUPPORTED; } } else { errorcode = SLP_ERROR_MESSAGE_NOT_SUPPORTED; } /*-----------------------------------------------*/ /* don't return errorcodes to multicast messages */ /*-----------------------------------------------*/ if (errorcode != 0) { if (message->header.flags & SLP_FLAG_MCAST || ISMCAST(message->peer.sin_addr)) { (*sendbuf)->end = (*sendbuf)->start; } } return errorcode; } /*-------------------------------------------------------------------------*/ int ProcessSrvRqst(SLPMessage message, SLPBuffer* sendbuf, int errorcode) /*-------------------------------------------------------------------------*/ { int i; SLPUrlEntry* urlentry; SLPDDatabaseSrvRqstResult* db = 0; int size = 0; SLPBuffer result = *sendbuf; #ifdef ENABLE_SLPv2_SECURITY SLPAuthBlock* authblock = 0; int j; #endif /*--------------------------------------------------------------*/ /* If errorcode is set, we can not be sure that message is good */ /* Go directly to send response code */ /*--------------------------------------------------------------*/ if (errorcode) { goto RESPOND; } /*-------------------------------------------------*/ /* Check for one of our IP addresses in the prlist */ /*-------------------------------------------------*/ if (SLPIntersectStringList(message->body.srvrqst.prlistlen, message->body.srvrqst.prlist, G_SlpdProperty.interfacesLen, G_SlpdProperty.interfaces) ) { /* silently ignore */ result->end = result->start; goto FINISHED; } /*------------------------------------------------------------------*/ /* Make sure that we handle at least verify registrations made with */ /* the requested SPI. If we can't then have to return an error */ /* because there is no way we can return URL entries that ares */ /* signed in a way the requester can understand */ /*------------------------------------------------------------------*/ #ifdef ENABLE_SLPv2_SECURITY if (G_SlpdProperty.securityEnabled) { if (SLPSpiCanVerify(G_SlpdSpiHandle, message->body.srvrqst.spistrlen, message->body.srvrqst.spistr) == 0) { errorcode = SLP_ERROR_AUTHENTICATION_UNKNOWN; goto RESPOND; } } else if (message->body.srvrqst.spistrlen) { errorcode = SLP_ERROR_AUTHENTICATION_UNKNOWN; goto RESPOND; } #else if (message->body.srvrqst.spistrlen) { errorcode = SLP_ERROR_AUTHENTICATION_UNKNOWN; goto RESPOND; } #endif /*------------------------------------------------*/ /* Check to to see if a this is a special SrvRqst */ /*------------------------------------------------*/ if (SLPCompareString(message->body.srvrqst.srvtypelen, message->body.srvrqst.srvtype, 23, SLP_DA_SERVICE_TYPE) == 0) { errorcode = ProcessDASrvRqst(message, sendbuf, errorcode); if (errorcode == 0) { // Since we have an errorcode of 0, we were successful, // and have already formed a response packet; return now. return errorcode; } goto RESPOND; } if (SLPCompareString(message->body.srvrqst.srvtypelen, message->body.srvrqst.srvtype, 21, SLP_SA_SERVICE_TYPE) == 0) { errorcode = ProcessSASrvRqst(message, sendbuf, errorcode); if (errorcode == 0) { // Since we have an errorcode of 0, we were successful, // and have already formed a response packet; return now. return errorcode; } goto RESPOND; } /*------------------------------------*/ /* Make sure that we handle the scope */ /*------ -----------------------------*/ if (SLPIntersectStringList(message->body.srvrqst.scopelistlen, message->body.srvrqst.scopelist, G_SlpdProperty.useScopesLen, G_SlpdProperty.useScopes) != 0) { /*-------------------------------*/ /* Find services in the database */ /*-------------------------------*/ errorcode = SLPDDatabaseSrvRqstStart(message, &db); } else { errorcode = SLP_ERROR_SCOPE_NOT_SUPPORTED; } RESPOND: /*----------------------------------------------------------------*/ /* Do not send error codes or empty replies to multicast requests */ /*----------------------------------------------------------------*/ if (errorcode != 0 || db->urlcount == 0) { if (message->header.flags & SLP_FLAG_MCAST || ISMCAST(message->peer.sin_addr)) { result->end = result->start; goto FINISHED; } } /*-------------------------------------------------------------*/ /* ensure the buffer is big enough to handle the whole srvrply */ /*-------------------------------------------------------------*/ size = message->header.langtaglen + 18; /* 14 bytes for header */ /* 2 bytes for error code */ /* 2 bytes for url count */ if (errorcode == 0) { for (i=0;iurlcount;i++) { /* urlentry is the url from the db result */ urlentry = db->urlarray[i]; size += urlentry->urllen + 6; /* 1 byte for reserved */ /* 2 bytes for lifetime */ /* 2 bytes for urllen */ /* 1 byte for authcount */ #ifdef ENABLE_SLPv2_SECURITY /* make room to include the authblock that was asked for */ if (G_SlpdProperty.securityEnabled && message->body.srvrqst.spistrlen ) { for (j=0; jauthcount;j++) { if (SLPCompareString(urlentry->autharray[j].spistrlen, urlentry->autharray[j].spistr, message->body.srvrqst.spistrlen, message->body.srvrqst.spistr) == 0) { authblock = &(urlentry->autharray[j]); size += authblock->length; break; } } } #endif } } /*------------------------------*/ /* Reallocate the result buffer */ /*------------------------------*/ result = SLPBufferRealloc(result,size); if (result == 0) { errorcode = SLP_ERROR_INTERNAL_ERROR; goto FINISHED; } /*----------------*/ /* Add the header */ /*----------------*/ /*version*/ *(result->start) = 2; /*function id*/ *(result->start + 1) = SLP_FUNCT_SRVRPLY; /*length*/ ToUINT24(result->start + 2, size); /*flags*/ ToUINT16(result->start + 5, (size > SLP_MAX_DATAGRAM_SIZE ? SLP_FLAG_OVERFLOW : 0)); /*ext offset*/ ToUINT24(result->start + 7,0); /*xid*/ ToUINT16(result->start + 10,message->header.xid); /*lang tag len*/ ToUINT16(result->start + 12,message->header.langtaglen); /*lang tag*/ memcpy(result->start + 14, message->header.langtag, message->header.langtaglen); /*-------------------------*/ /* Add rest of the SrvRply */ /*-------------------------*/ result->curpos = result->start + 14 + message->header.langtaglen; /* error code*/ ToUINT16(result->curpos, errorcode); result->curpos = result->curpos + 2; if (errorcode == 0) { /* urlentry count */ ToUINT16(result->curpos, db->urlcount); result->curpos = result->curpos + 2; for (i=0;iurlcount;i++) { /* urlentry is the url from the db result */ urlentry = db->urlarray[i]; #ifdef ENABLE_SLPv1 if (urlentry->opaque == 0) { /* url-entry reserved */ *result->curpos = 0; result->curpos = result->curpos + 1; /* url-entry lifetime */ ToUINT16(result->curpos,urlentry->lifetime); result->curpos = result->curpos + 2; /* url-entry urllen */ ToUINT16(result->curpos,urlentry->urllen); result->curpos = result->curpos + 2; /* url-entry url */ memcpy(result->curpos,urlentry->url,urlentry->urllen); result->curpos = result->curpos + urlentry->urllen; /* url-entry auths */ *result->curpos = 0; result->curpos = result->curpos + 1; } else #endif { /* Use an opaque copy if available (and authentication is not being used)*/ /* TRICKY: fix up the lifetime */ ToUINT16(urlentry->opaque + 1,urlentry->lifetime); memcpy(result->curpos,urlentry->opaque,urlentry->opaquelen); result->curpos = result->curpos + urlentry->opaquelen; } } } else { /* set urlentry count to 0*/ ToUINT16(result->curpos, 0); result->curpos = result->curpos + 2; } FINISHED: if (db) SLPDDatabaseSrvRqstEnd(db); *sendbuf = result; return errorcode; } /*-------------------------------------------------------------------------*/ int ProcessSrvReg(SLPMessage message, SLPBuffer recvbuf, SLPBuffer* sendbuf, int errorcode) /* */ /* Returns: non-zero if message should be silently dropped */ /*-------------------------------------------------------------------------*/ { SLPBuffer result = *sendbuf; /*--------------------------------------------------------------*/ /* If errorcode is set, we can not be sure that message is good */ /* Go directly to send response code also do not process mcast */ /* srvreg or srvdereg messages */ /*--------------------------------------------------------------*/ if (errorcode || message->header.flags & SLP_FLAG_MCAST || ISMCAST(message->peer.sin_addr)) { goto RESPOND; } /*------------------------------------*/ /* Make sure that we handle the scope */ /*------ -----------------------------*/ if (SLPIntersectStringList(message->body.srvreg.scopelistlen, message->body.srvreg.scopelist, G_SlpdProperty.useScopesLen, G_SlpdProperty.useScopes)) { #ifdef ENABLE_SLPv2_SECURITY /*-------------------------------*/ /* Validate the authblocks */ /*-------------------------------*/ errorcode = SLPAuthVerifyUrl(G_SlpdSpiHandle, 0, &(message->body.srvreg.urlentry)); if (errorcode == 0) { errorcode = SLPAuthVerifyString(G_SlpdSpiHandle, 0, message->body.srvreg.attrlistlen, message->body.srvreg.attrlist, message->body.srvreg.authcount, message->body.srvreg.autharray); } if (errorcode == 0) #endif { /*--------------------------------------------------------------*/ /* Put the registration in the */ /*--------------------------------------------------------------*/ /* TRICKY: Remember the recvbuf was duplicated back in */ /* SLPDProcessMessage() */ if (ISLOCAL(message->peer.sin_addr)) { message->body.srvreg.source= SLP_REG_SOURCE_LOCAL; } else { message->body.srvreg.source = SLP_REG_SOURCE_REMOTE; } errorcode = SLPDDatabaseReg(message, recvbuf); } } else { errorcode = SLP_ERROR_SCOPE_NOT_SUPPORTED; } RESPOND: /*--------------------------------------------------------------------*/ /* don't send back reply anything multicast SrvReg (set result empty) */ /*--------------------------------------------------------------------*/ if (message->header.flags & SLP_FLAG_MCAST || ISMCAST(message->peer.sin_addr)) { result->end = result->start; goto FINISHED; } /*------------------------------------------------------------*/ /* ensure the buffer is big enough to handle the whole srvack */ /*------------------------------------------------------------*/ result = SLPBufferRealloc(result,message->header.langtaglen + 16); if (result == 0) { errorcode = SLP_ERROR_INTERNAL_ERROR; goto FINISHED; } /*----------------*/ /* Add the header */ /*----------------*/ /*version*/ *(result->start) = 2; /*function id*/ *(result->start + 1) = SLP_FUNCT_SRVACK; /*length*/ ToUINT24(result->start + 2,message->header.langtaglen + 16); /*flags*/ ToUINT16(result->start + 5,0); /*ext offset*/ ToUINT24(result->start + 7,0); /*xid*/ ToUINT16(result->start + 10,message->header.xid); /*lang tag len*/ ToUINT16(result->start + 12,message->header.langtaglen); /*lang tag*/ memcpy(result->start + 14, message->header.langtag, message->header.langtaglen); /*-------------------*/ /* Add the errorcode */ /*-------------------*/ ToUINT16(result->start + 14 + message->header.langtaglen, errorcode); FINISHED: *sendbuf = result; return errorcode; } /*-------------------------------------------------------------------------*/ int ProcessSrvDeReg(SLPMessage message, SLPBuffer* sendbuf, int errorcode) /* */ /* Returns: non-zero if message should be silently dropped */ /*-------------------------------------------------------------------------*/ { SLPBuffer result = *sendbuf; /*--------------------------------------------------------------*/ /* If errorcode is set, we can not be sure that message is good */ /* Go directly to send response code also do not process mcast */ /* srvreg or srvdereg messages */ /*--------------------------------------------------------------*/ if (errorcode || message->header.flags & SLP_FLAG_MCAST) { goto RESPOND; } /*------------------------------------*/ /* Make sure that we handle the scope */ /*------------------------------------*/ if (SLPIntersectStringList(message->body.srvdereg.scopelistlen, message->body.srvdereg.scopelist, G_SlpdProperty.useScopesLen, G_SlpdProperty.useScopes)) { #ifdef ENABLE_SLPv2_SECURITY /*-------------------------------*/ /* Validate the authblocks */ /*-------------------------------*/ errorcode = SLPAuthVerifyUrl(G_SlpdSpiHandle, 0, &(message->body.srvdereg.urlentry)); if (errorcode == 0) #endif { /*--------------------------------------*/ /* remove the service from the database */ /*--------------------------------------*/ errorcode = SLPDDatabaseDeReg(message); } } else { errorcode = SLP_ERROR_SCOPE_NOT_SUPPORTED; } RESPOND: /*---------------------------------------------------------*/ /* don't do anything multicast SrvDeReg (set result empty) */ /*---------------------------------------------------------*/ if (message->header.flags & SLP_FLAG_MCAST || ISMCAST(message->peer.sin_addr)) { result->end = result->start; goto FINISHED; } /*------------------------------------------------------------*/ /* ensure the buffer is big enough to handle the whole srvack */ /*------------------------------------------------------------*/ result = SLPBufferRealloc(result,message->header.langtaglen + 16); if (result == 0) { errorcode = SLP_ERROR_INTERNAL_ERROR; goto FINISHED; } /*----------------*/ /* Add the header */ /*----------------*/ /*version*/ *(result->start) = 2; /*function id*/ *(result->start + 1) = SLP_FUNCT_SRVACK; /*length*/ ToUINT24(result->start + 2,message->header.langtaglen + 16); /*flags*/ ToUINT16(result->start + 5,0); /*ext offset*/ ToUINT24(result->start + 7,0); /*xid*/ ToUINT16(result->start + 10,message->header.xid); /*lang tag len*/ ToUINT16(result->start + 12,message->header.langtaglen); /*lang tag*/ memcpy(result->start + 14, message->header.langtag, message->header.langtaglen); /*-------------------*/ /* Add the errorcode */ /*-------------------*/ ToUINT16(result->start + 14 + message->header.langtaglen, errorcode); FINISHED: *sendbuf = result; return errorcode; } /*-------------------------------------------------------------------------*/ int ProcessSrvAck(SLPMessage message, SLPBuffer* sendbuf, int errorcode) /*-------------------------------------------------------------------------*/ { /* Ignore SrvAck. Just return errorcode to caller */ SLPBuffer result = *sendbuf; result->end = result->start; return 0; } /*-------------------------------------------------------------------------*/ int ProcessAttrRqst(SLPMessage message, SLPBuffer* sendbuf, int errorcode) /*-------------------------------------------------------------------------*/ { SLPDDatabaseAttrRqstResult* db = 0; int size = 0; SLPBuffer result = *sendbuf; #ifdef ENABLE_SLPv2_SECURITY int i; unsigned char* generatedauth = 0; int generatedauthlen = 0; unsigned char* opaqueauth = 0; int opaqueauthlen = 0; #endif /*--------------------------------------------------------------*/ /* If errorcode is set, we can not be sure that message is good */ /* Go directly to send response code */ /*--------------------------------------------------------------*/ if (errorcode) { goto RESPOND; } /*-------------------------------------------------*/ /* Check for one of our IP addresses in the prlist */ /*-------------------------------------------------*/ if (SLPIntersectStringList(message->body.attrrqst.prlistlen, message->body.attrrqst.prlist, G_SlpdProperty.interfacesLen, G_SlpdProperty.interfaces)) { /* Silently ignore */ result->end = result->start; goto FINISHED; } /*------------------------------------*/ /* Make sure that we handle the scope */ /*------ -----------------------------*/ if (SLPIntersectStringList(message->body.attrrqst.scopelistlen, message->body.attrrqst.scopelist, G_SlpdProperty.useScopesLen, G_SlpdProperty.useScopes)) { /*------------------------------------------------------------------*/ /* Make sure that we handle at least verify registrations made with */ /* the requested SPI. If we can't then have to return an error */ /* because there is no way we can return URL entries that ares */ /* signed in a way the requester can understand */ /*------------------------------------------------------------------*/ #ifdef ENABLE_SLPv2_SECURITY if (G_SlpdProperty.securityEnabled) { if (message->body.attrrqst.taglistlen == 0) { /* We can send back entire attribute strings without */ /* generating a new attribute authentication block */ /* we just use the one sent by the registering agent */ /* which we have to have been able to verify */ if (SLPSpiCanVerify(G_SlpdSpiHandle, message->body.attrrqst.spistrlen, message->body.attrrqst.spistr) == 0) { errorcode = SLP_ERROR_AUTHENTICATION_UNKNOWN; goto RESPOND; } } else { /* We have to be able to *generate* (sign) authentication */ /* blocks for attrrqst with taglists since it is possible */ /* that the returned attributes are a subset of what the */ /* original registering agent sent */ if (SLPSpiCanSign(G_SlpdSpiHandle, message->body.attrrqst.spistrlen, message->body.attrrqst.spistr) == 0) { errorcode = SLP_ERROR_AUTHENTICATION_UNKNOWN; goto RESPOND; } } } else { if (message->body.attrrqst.spistrlen) { errorcode = SLP_ERROR_AUTHENTICATION_UNKNOWN; goto RESPOND; } } #else if (message->body.attrrqst.spistrlen) { errorcode = SLP_ERROR_AUTHENTICATION_UNKNOWN; goto RESPOND; } #endif /*---------------------------------*/ /* Find attributes in the database */ /*---------------------------------*/ errorcode = SLPDDatabaseAttrRqstStart(message,&db); } else { errorcode = SLP_ERROR_SCOPE_NOT_SUPPORTED; } RESPOND: /*----------------------------------------------------------------*/ /* Do not send error codes or empty replies to multicast requests */ /*----------------------------------------------------------------*/ if (errorcode != 0 || db->attrlistlen == 0) { if (message->header.flags & SLP_FLAG_MCAST || ISMCAST(message->peer.sin_addr)) { result->end = result->start; goto FINISHED; } } /*--------------------------------------------------------------*/ /* ensure the buffer is big enough to handle the whole attrrply */ /*--------------------------------------------------------------*/ size = message->header.langtaglen + 19; /* 14 bytes for header */ /* 2 bytes for error code */ /* 2 bytes for attr-list len */ /* 1 byte for the authcount */ if(errorcode == 0) { size += db->attrlistlen; #ifdef ENABLE_SLPv2_SECURITY /*------------------------------------------------------------------*/ /* Generate authblock if necessary or just use the one was included */ /* by registering agent. Reserve sufficent space for either case. */ /*------------------------------------------------------------------*/ if (G_SlpdProperty.securityEnabled && message->body.attrrqst.spistrlen ) { if (message->body.attrrqst.taglistlen == 0) { for (i=0; iauthcount;i++) { if (SLPCompareString(db->autharray[i].spistrlen, db->autharray[i].spistr, message->body.attrrqst.spistrlen, message->body.attrrqst.spistr) == 0) { opaqueauth = db->autharray[i].opaque; opaqueauthlen = db->autharray[i].opaquelen; break; } } } else { errorcode = SLPAuthSignString(G_SlpdSpiHandle, message->body.attrrqst.spistrlen, message->body.attrrqst.spistr, db->attrlistlen, db->attrlist, &generatedauthlen, &generatedauth); opaqueauthlen = generatedauthlen; opaqueauth = generatedauth; } size += opaqueauthlen; } #endif } /*-------------------*/ /* Alloc the buffer */ /*-------------------*/ result = SLPBufferRealloc(result,size); if (result == 0) { errorcode = SLP_ERROR_INTERNAL_ERROR; goto FINISHED; } /*----------------*/ /* Add the header */ /*----------------*/ /*version*/ *(result->start) = 2; /*function id*/ *(result->start + 1) = SLP_FUNCT_ATTRRPLY; /*length*/ ToUINT24(result->start + 2,size); /*flags*/ ToUINT16(result->start + 5, (size > SLP_MAX_DATAGRAM_SIZE ? SLP_FLAG_OVERFLOW : 0)); /*ext offset*/ ToUINT24(result->start + 7,0); /*xid*/ ToUINT16(result->start + 10,message->header.xid); /*lang tag len*/ ToUINT16(result->start + 12,message->header.langtaglen); /*lang tag*/ memcpy(result->start + 14, message->header.langtag, message->header.langtaglen); /*--------------------------*/ /* Add rest of the AttrRqst */ /*--------------------------*/ result->curpos = result->start + 14 + message->header.langtaglen; /* error code*/ ToUINT16(result->curpos, errorcode); result->curpos = result->curpos + 2; if (errorcode == 0) { /* attr-list len */ ToUINT16(result->curpos, db->attrlistlen); result->curpos = result->curpos + 2; if (db->attrlistlen) { memcpy(result->curpos, db->attrlist, db->attrlistlen); } result->curpos = result->curpos + db->attrlistlen; /* authentication block */ #ifdef ENABLE_SLPv2_SECURITY if (opaqueauth) { /* authcount */ *(result->curpos) = 1; result->curpos = result->curpos + 1; memcpy(result->curpos, opaqueauth, opaqueauthlen); result->curpos = result->curpos + opaqueauthlen; } else #endif { /* authcount */ *(result->curpos) = 0; result->curpos = result->curpos + 1; } } FINISHED: #ifdef ENABLE_SLPv2_SECURITY /* free the generated authblock if any */ if (generatedauth) xfree(generatedauth); #endif if (db) SLPDDatabaseAttrRqstEnd(db); *sendbuf = result; return errorcode; } /*-------------------------------------------------------------------------*/ int ProcessDAAdvert(SLPMessage message, SLPBuffer recvbuf, SLPBuffer* sendbuf, int errorcode) /*-------------------------------------------------------------------------*/ { SLPBuffer result = *sendbuf; /*--------------------------------------------------------------*/ /* If errorcode is set, we can not be sure that message is good */ /* Go directly to send response code */ /*--------------------------------------------------------------*/ if (errorcode) { goto RESPOND; } /*--------------------------------------------------------------*/ /* If net.slp.passiveDADetection is turned off then we ignore */ /* DAAdverts with xid == 0 */ /*--------------------------------------------------------------*/ if(G_SlpdProperty.passiveDADetection == 0 && message->header.xid == 0) { goto RESPOND; } /*--------------------------------------------------------------*/ /* If net.slp.DAActiveDiscoveryInterval == 0 then we ignore */ /* DAAdverts with xid != 0 */ /*--------------------------------------------------------------*/ if(G_SlpdProperty.DAActiveDiscoveryInterval == 0 && message->header.xid != 0) { goto RESPOND; } /*-------------------------------*/ /* Validate the authblocks */ /*-------------------------------*/ #ifdef ENABLE_SLPv2_SECURITY errorcode = SLPAuthVerifyDAAdvert(G_SlpdSpiHandle, 0, &(message->body.daadvert)); if (errorcode == 0); #endif { /* Only process if errorcode is not set */ if (message->body.daadvert.errorcode == SLP_ERROR_OK) { errorcode = SLPDKnownDAAdd(message,recvbuf); } } RESPOND: /* DAAdverts should never be replied to. Set result buffer to empty*/ result->end = result->start; *sendbuf = result; return errorcode; } /*-------------------------------------------------------------------------*/ int ProcessSrvTypeRqst(SLPMessage message, SLPBuffer* sendbuf, int errorcode) /*-------------------------------------------------------------------------*/ { int size = 0; SLPDDatabaseSrvTypeRqstResult* db = 0; SLPBuffer result = *sendbuf; /*--------------------------------------------------------------*/ /* If errorcode is set, we can not be sure that message is good */ /* Go directly to send response code */ /*--------------------------------------------------------------*/ if (errorcode) { goto RESPOND; } /*-------------------------------------------------*/ /* Check for one of our IP addresses in the prlist */ /*-------------------------------------------------*/ if (SLPIntersectStringList(message->body.srvtyperqst.prlistlen, message->body.srvtyperqst.prlist, G_SlpdProperty.interfacesLen, G_SlpdProperty.interfaces)) { /* Silently ignore */ result->end = result->start; goto FINISHED; } /*------------------------------------*/ /* Make sure that we handle the scope */ /*------ -----------------------------*/ if (SLPIntersectStringList(message->body.srvtyperqst.scopelistlen, message->body.srvtyperqst.scopelist, G_SlpdProperty.useScopesLen, G_SlpdProperty.useScopes) != 0) { /*------------------------------------*/ /* Find service types in the database */ /*------------------------------------*/ errorcode = SLPDDatabaseSrvTypeRqstStart(message, &db); } else { errorcode = SLP_ERROR_SCOPE_NOT_SUPPORTED; } RESPOND: /*----------------------------------------------------------------*/ /* Do not send error codes or empty replies to multicast requests */ /*----------------------------------------------------------------*/ if (errorcode != 0 || db->srvtypelistlen == 0) { if (message->header.flags & SLP_FLAG_MCAST || ISMCAST(message->peer.sin_addr)) { result->end = result->start; goto FINISHED; } } /*-----------------------------------------------------------------*/ /* ensure the buffer is big enough to handle the whole srvtyperply */ /*-----------------------------------------------------------------*/ size = message->header.langtaglen + 18; /* 14 bytes for header */ /* 2 bytes for error code */ /* 2 bytes for srvtype list length */ if(errorcode == 0) { size += db->srvtypelistlen; } /*------------------------------*/ /* Reallocate the result buffer */ /*------------------------------*/ result = SLPBufferRealloc(result,size); if (result == 0) { errorcode = SLP_ERROR_INTERNAL_ERROR; goto FINISHED; } /*----------------*/ /* Add the header */ /*----------------*/ /*version*/ *(result->start) = 2; /*function id*/ *(result->start + 1) = SLP_FUNCT_SRVTYPERPLY; /*length*/ ToUINT24(result->start + 2,size); /*flags*/ ToUINT16(result->start + 5, (size > SLP_MAX_DATAGRAM_SIZE ? SLP_FLAG_OVERFLOW : 0)); /*ext offset*/ ToUINT24(result->start + 7,0); /*xid*/ ToUINT16(result->start + 10,message->header.xid); /*lang tag len*/ ToUINT16(result->start + 12,message->header.langtaglen); /*lang tag*/ memcpy(result->start + 14, message->header.langtag, message->header.langtaglen); /*-----------------------------*/ /* Add rest of the SrvTypeRply */ /*-----------------------------*/ result->curpos = result->start + 14 + message->header.langtaglen; /* error code*/ ToUINT16(result->curpos, errorcode); result->curpos += 2; if (errorcode == 0) { /* length of srvtype-list */ ToUINT16(result->curpos, db->srvtypelistlen); result->curpos += 2; memcpy(result->curpos, db->srvtypelist, db->srvtypelistlen); result->curpos += db->srvtypelistlen; } FINISHED: if (db) SLPDDatabaseSrvTypeRqstEnd(db); *sendbuf = result; return errorcode; } /*-------------------------------------------------------------------------*/ int ProcessSAAdvert(SLPMessage message, SLPBuffer* sendbuf, int errorcode) /*-------------------------------------------------------------------------*/ { /* Ignore all SAADVERTS */ (*sendbuf)->end = (*sendbuf)->start; return errorcode; } /*=========================================================================*/ int SLPDProcessMessage(struct sockaddr_in* peerinfo, SLPBuffer recvbuf, SLPBuffer* sendbuf) /* Processes the recvbuf and places the results in sendbuf */ /* */ /* peerinfo - the socket the message was received on */ /* */ /* recvbuf - message to process */ /* */ /* sendbuf - results of the processed message */ /* */ /* Returns - zero on success if sendbuf contains a response to send. */ /* non-zero if sendbuf does not contain a response to send */ /*=========================================================================*/ { SLPHeader header; SLPMessage message = 0; int errorcode = 0; SLPDLogMessage(SLPDLOG_TRACEMSG_IN,peerinfo,recvbuf); if(!*sendbuf) { *sendbuf = SLPBufferAlloc(SLP_MAX_DATAGRAM_SIZE); if (!*sendbuf) return SLP_ERROR_PARSE_ERROR; } /* set the sendbuf empty */ (*sendbuf)->end = (*sendbuf)->start; /* zero out the header before parsing it */ memset(&header,0,sizeof(header)); /* Parse just the message header */ recvbuf->curpos = recvbuf->start; errorcode = SLPMessageParseHeader(recvbuf,&header); /* Reset the buffer "curpos" pointer so that full message can be * parsed later */ recvbuf->curpos = recvbuf->start; #if defined(ENABLE_SLPv1) /* if version == 1 then parse message as a version 1 message */ if (errorcode == SLP_ERROR_VER_NOT_SUPPORTED && header.version == 1) { errorcode = SLPDv1ProcessMessage(peerinfo, recvbuf, sendbuf); } else #endif if (errorcode == 0) { /* TRICKY: Duplicate SRVREG recvbufs *before* parsing them */ /* we do this because we are going to keep track of */ /* in the registration database */ if (header.functionid == SLP_FUNCT_SRVREG || header.functionid == SLP_FUNCT_DAADVERT ) { recvbuf = SLPBufferDup(recvbuf); if (recvbuf == NULL) { return SLP_ERROR_INTERNAL_ERROR; } } /* Allocate the message descriptor */ message = SLPMessageAlloc(); if (message) { /* Parse the message and fill out the message descriptor */ errorcode = SLPMessageParseBuffer(peerinfo,recvbuf, message); if (errorcode == 0) { /* Process messages based on type */ switch (message->header.functionid) { case SLP_FUNCT_SRVRQST: errorcode = ProcessSrvRqst(message,sendbuf,errorcode); break; case SLP_FUNCT_SRVREG: errorcode = ProcessSrvReg(message,recvbuf,sendbuf,errorcode); if (errorcode == 0) { SLPDKnownDAEcho(message, recvbuf); } break; case SLP_FUNCT_SRVDEREG: errorcode = ProcessSrvDeReg(message,sendbuf,errorcode); if (errorcode == 0) { SLPDKnownDAEcho(message, recvbuf); } break; case SLP_FUNCT_SRVACK: errorcode = ProcessSrvAck(message,sendbuf, errorcode); break; case SLP_FUNCT_ATTRRQST: errorcode = ProcessAttrRqst(message,sendbuf, errorcode); break; case SLP_FUNCT_DAADVERT: errorcode = ProcessDAAdvert(message, recvbuf, sendbuf, errorcode); break; case SLP_FUNCT_SRVTYPERQST: errorcode = ProcessSrvTypeRqst(message, sendbuf, errorcode); break; case SLP_FUNCT_SAADVERT: errorcode = ProcessSAAdvert(message, sendbuf, errorcode); break; default: /* Should never happen... but we're paranoid */ errorcode = SLP_ERROR_PARSE_ERROR; break; } } else { SLPDLogParseWarning(peerinfo, recvbuf); } if (header.functionid == SLP_FUNCT_SRVREG || header.functionid == SLP_FUNCT_DAADVERT ) { /* TRICKY: If this is a reg or daadvert message we do not * free the message descriptor or duplicated recvbuf * because they are being kept in the database! * */ if (errorcode == 0) { goto FINISHED; } /* TRICKY: If there is an error we need to free the * duplicated recvbuf, */ SLPBufferFree(recvbuf); } SLPMessageFree(message); } else { /* out of memory */ errorcode = SLP_ERROR_INTERNAL_ERROR; } } else { SLPDLogParseWarning(peerinfo,recvbuf); } FINISHED: #ifdef DEBUG if (errorcode) { SLPDLog("\n*** DEBUG *** errorcode %i during processing of message from %s\n", errorcode, inet_ntoa(peerinfo->sin_addr)); } #endif /* Log message silently ignored because of an error */ if(errorcode) { if (*sendbuf == 0 || (*sendbuf)->end == (*sendbuf)->start ) { SLPDLogMessage(SLPDLOG_TRACEDROP,peerinfo,recvbuf); } } /* Log trace message */ SLPDLogMessage(SLPDLOG_TRACEMSG_OUT, peerinfo, *sendbuf); return errorcode; } openslp-1.2.1/slpd/slpd_regfile.c0000644033442200000310000005062310202252053016622 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_regfile.c */ /* */ /* Abstract: Reads service registrations from a file */ /* */ /* WARNING: NOT thread safe! */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ /*=========================================================================*/ /* slpd includes */ /*=========================================================================*/ #include "slpd_regfile.h" #include "slpd_property.h" #include "slpd_log.h" #ifdef ENABLE_SLPv2_SECURITY #include "slpd_spi.h" #endif /*=========================================================================*/ /* common code includes */ /*=========================================================================*/ #include "slp_xmalloc.h" #include "slp_compare.h" #ifdef ENABLE_SLPv2_SECURITY #include "slp_auth.h" #endif /*-------------------------------------------------------------------------*/ char* TrimWhitespace(char* str) /*-------------------------------------------------------------------------*/ { char* end; end=str+strlen(str)-1; while(*str && *str <= 0x20) { str++; } while(end >= str) { if(*end > 0x20) { break; } *end = 0; end--; } return str; } /*-------------------------------------------------------------------------*/ char* RegFileReadLine(FILE* fd, char* line, int linesize) /*-------------------------------------------------------------------------*/ { while(1) { if(fgets(line,linesize,fd) == 0) { return 0; } while(*line && *line <= 0x20 && *line != 0x0d && *line != 0x0a) line++; if(*line == 0x0d || *line == 0x0a) { break; } if(*line != 0 && *line != '#' && *line != ';') { break; } } return line; } /*=========================================================================*/ int SLPDRegFileReadSrvReg(FILE* fd, SLPMessage* msg, SLPBuffer* buf) /* A really big and nasty function that reads an service registration from */ /* from a file. Don't look at this too hard or you'll be sick. This is by */ /* the most horrible code in OpenSLP. Please volunteer to rewrite it! */ /* */ /* "THANK GOODNESS this function is only called at startup" -- Matt */ /* */ /* */ /* fd (IN) file to read from */ /* */ /* msg (OUT) message describing the SrvReg in buf */ /* */ /* buf (OUT) buffer containing the SrvReg */ /* */ /* Returns: zero on success. > 0 on error. < 0 if EOF */ /* */ /* Note: Eventually the caller needs to call SLPBufferFree() and */ /* SLPMessageFree() to free memory */ /*=========================================================================*/ { char* slider1; char* slider2; char* p; char line[4096]; struct sockaddr_in peer; int result = 0; int bufsize = 0; int langtaglen = 0; char* langtag = 0; int scopelistlen = 0; char* scopelist = 0; int urllen = 0; char* url = 0; int lifetime = 0; int srvtypelen = 0; char* srvtype = 0; int attrlistlen = 0; char* attrlist = 0; #ifdef ENABLE_SLPv2_SECURITY unsigned char* urlauth = 0; int urlauthlen = 0; unsigned char* attrauth = 0; int attrauthlen = 0; #endif /*-------------------------------------------*/ /* give the out params an initial NULL value */ /*-------------------------------------------*/ *buf = 0; *msg = 0; /*----------------------------------------------------------*/ /* read the next non-white non-comment line from the stream */ /*----------------------------------------------------------*/ do { slider1 = RegFileReadLine(fd,line,4096); if(slider1 == 0) { /* Breath a sigh of relief. We get out before really */ /* horrid code */ return -1; } }while(*slider1 == 0x0d || *slider1 == 0x0a); /*---------------------*/ /* Parse the url-props */ /*---------------------*/ slider2 = strchr(slider1,','); if(slider2) { /* srvurl */ *slider2 = 0; /* squash comma to null terminate srvurl */ url = xstrdup(TrimWhitespace(slider1)); if(url == 0) { result = SLP_ERROR_INTERNAL_ERROR; goto CLEANUP; } /* replace "$HOSTNAME" string in url */ while ((p = strchr(url, '$')) && !strncmp(p, "$HOSTNAME", 9)) { char *_url = (char*)malloc(strlen(url) - 9 + G_SlpdProperty.myHostnameLen + 1); strncpy(_url, url, p - url); strncpy(_url + (p - url), G_SlpdProperty.myHostname, G_SlpdProperty.myHostnameLen); strcpy(_url + (p - url) + G_SlpdProperty.myHostnameLen, url + (p - url) + 9); free(url); url = _url; } urllen = strlen(url); /* derive srvtype from srvurl */ srvtype = strstr(slider1,"://"); if(srvtype == 0) { result = SLP_ERROR_INVALID_REGISTRATION; goto CLEANUP; } *srvtype = 0; srvtype=xstrdup(TrimWhitespace(slider1)); if(srvtype == 0) { result = SLP_ERROR_INTERNAL_ERROR; goto CLEANUP; } srvtypelen = strlen(srvtype); slider1 = slider2 + 1; /*lang*/ slider2 = strchr(slider1,','); if(slider2) { *slider2 = 0; /* squash comma to null terminate lang */ langtag = xstrdup(TrimWhitespace(slider1)); if(langtag == 0) { result = SLP_ERROR_INVALID_REGISTRATION; goto CLEANUP; } langtaglen = strlen(langtag); slider1 = slider2 + 1; } else { result = SLP_ERROR_INVALID_REGISTRATION; goto CLEANUP; } /* ltime */ slider2 = strchr(slider1,','); if(slider2) { *slider2 = 0; /* squash comma to null terminate ltime */ lifetime = atoi(slider1); slider1 = slider2 + 1; } else { lifetime = atoi(slider1); slider1 = slider2; } if(lifetime < 1 || lifetime > SLP_LIFETIME_MAXIMUM) { result = SLP_ERROR_INVALID_REGISTRATION; goto CLEANUP; } /* get the srvtype if one was not derived by the srvurl*/ if(srvtype == 0) { srvtype = xstrdup(TrimWhitespace(slider1)); if(srvtype == 0) { result = SLP_ERROR_INTERNAL_ERROR; goto CLEANUP; } srvtypelen = strlen(srvtype); if(srvtypelen == 0) { result = SLP_ERROR_INVALID_REGISTRATION; goto CLEANUP; } } } else { result = SLP_ERROR_INVALID_REGISTRATION; goto CLEANUP; } /*-------------------------------------------------*/ /* Read all the attributes including the scopelist */ /*-------------------------------------------------*/ *line=0; while(1) { slider1 = RegFileReadLine(fd,line,4096); if(slider1 == 0) { /* Breathe a sigh of relief. We're done */ result = -1; break; } if(*slider1 == 0x0d || *slider1 == 0x0a) { break; } /* Check to see if it is the scopes line */ /* FIXME We can collapse the scope stuff into the value getting and * just make it a special case (do strcmp on the tag as opposed to the * line) of attribute getting. */ if(strncasecmp(slider1,"scopes",6) == 0) { /* found scopes line */ slider2 = strchr(slider1,'='); if(slider2) { slider2++; if(*slider2) { /* just in case some idiot puts multiple scopes lines */ if(scopelist) { result = SLP_ERROR_SCOPE_NOT_SUPPORTED; goto CLEANUP; } /* make sure there are no spaces in the scope list */ if(strchr(slider2,' ')) { result = SLP_ERROR_SCOPE_NOT_SUPPORTED; goto CLEANUP; } scopelist=xstrdup(TrimWhitespace(slider2)); if(scopelist == 0) { result = SLP_ERROR_INTERNAL_ERROR; goto CLEANUP; } scopelistlen = strlen(scopelist); } } } else { /* line contains an attribute (slow but it works)*/ /* TODO Fix this so we do not have to realloc memory each time! */ TrimWhitespace(slider1); if(attrlist == 0) { attrlistlen += strlen(slider1) + 2; attrlist = xmalloc(attrlistlen + 1); *attrlist = 0; } else { attrlistlen += strlen(slider1) + 3; attrlist = xrealloc(attrlist, attrlistlen + 1); strcat(attrlist,","); } if(attrlist == 0) { result = SLP_ERROR_INTERNAL_ERROR; goto CLEANUP; } /* we need special case for keywords (why do we need these) */ /* they seem like a waste of code. Why not just use booleans */ if(strchr(slider1,'=')) { /* normal attribute (with '=') */ strcat(attrlist,"("); strcat(attrlist,slider1); strcat(attrlist,")"); } else { /* keyword (no '=') */ attrlistlen -= 2; /* subtract 2 bytes for no '(' or ')' */ strcat(attrlist,slider1); } } } /* Set the scope set in properties if not is set */ if(scopelist == 0) { scopelist=xstrdup(G_SlpdProperty.useScopes); if(scopelist == 0) { result = SLP_ERROR_INTERNAL_ERROR; goto CLEANUP; } scopelistlen = G_SlpdProperty.useScopesLen; } #ifdef ENABLE_SLPv2_SECURITY /*--------------------------------*/ /* Generate authentication blocks */ /*--------------------------------*/ if(G_SlpdProperty.securityEnabled) { SLPAuthSignUrl(G_SlpdSpiHandle, 0, 0, urllen, url, &urlauthlen, &urlauth); SLPAuthSignString(G_SlpdSpiHandle, 0, 0, attrlistlen, attrlist, &attrauthlen, &attrauth); } #endif /*----------------------------------------*/ /* Allocate buffer for the SrvReg Message */ /*----------------------------------------*/ bufsize = 14 + langtaglen; /* 14 bytes for header */ bufsize += urllen + 6; /* 1 byte for reserved */ /* 2 bytes for lifetime */ /* 2 bytes for urllen */ /* 1 byte for authcount */ bufsize += srvtypelen + 2; /* 2 bytes for len field */ bufsize += scopelistlen + 2;/* 2 bytes for len field */ bufsize += attrlistlen + 2; /* 2 bytes for len field */ bufsize += 1; /* 1 byte for authcount */ #ifdef ENABLE_SLPv2_SECURITY bufsize += urlauthlen; bufsize += attrauthlen; #endif *buf = SLPBufferAlloc(bufsize); if(*buf == 0) { result = SLP_ERROR_INTERNAL_ERROR; goto CLEANUP; } /*------------------------------*/ /* Now build the SrvReg Message */ /*------------------------------*/ /*version*/ *((*buf)->start) = 2; /*function id*/ *((*buf)->start + 1) = SLP_FUNCT_SRVREG; /*length*/ ToUINT24((*buf)->start + 2, bufsize); /*flags*/ ToUINT16((*buf)->start + 5, 0); /*ext offset*/ ToUINT24((*buf)->start + 7,0); /*xid*/ ToUINT16((*buf)->start + 10, 0); /*lang tag len*/ ToUINT16((*buf)->start + 12,langtaglen); /*lang tag*/ memcpy((*buf)->start + 14, langtag, langtaglen); (*buf)->curpos = (*buf)->start + langtaglen + 14 ; /* url-entry reserved */ *(*buf)->curpos= 0; (*buf)->curpos = (*buf)->curpos + 1; /* url-entry lifetime */ ToUINT16((*buf)->curpos,lifetime); (*buf)->curpos = (*buf)->curpos + 2; /* url-entry urllen */ ToUINT16((*buf)->curpos,urllen); (*buf)->curpos = (*buf)->curpos + 2; /* url-entry url */ memcpy((*buf)->curpos,url,urllen); (*buf)->curpos = (*buf)->curpos + urllen; /* url-entry authblock */ #ifdef ENABLE_SLPv2_SECURITY if(urlauth) { /* authcount */ *(*buf)->curpos = 1; (*buf)->curpos = (*buf)->curpos + 1; /* authblock */ memcpy((*buf)->curpos,urlauth,urlauthlen); (*buf)->curpos = (*buf)->curpos + urlauthlen; } else #endif { /* authcount */ *(*buf)->curpos = 0; (*buf)->curpos += 1; } /* service type */ ToUINT16((*buf)->curpos,srvtypelen); (*buf)->curpos = (*buf)->curpos + 2; memcpy((*buf)->curpos,srvtype,srvtypelen); (*buf)->curpos = (*buf)->curpos + srvtypelen; /* scope list */ ToUINT16((*buf)->curpos,scopelistlen); (*buf)->curpos = (*buf)->curpos + 2; memcpy((*buf)->curpos,scopelist,scopelistlen); (*buf)->curpos = (*buf)->curpos + scopelistlen; /* attr list */ ToUINT16((*buf)->curpos,attrlistlen); (*buf)->curpos = (*buf)->curpos + 2; memcpy((*buf)->curpos,attrlist,attrlistlen); (*buf)->curpos = (*buf)->curpos + attrlistlen; /* attribute auth block */ #ifdef ENABLE_SLPv2_SECURITY if(attrauth) { /* authcount */ *(*buf)->curpos = 1; (*buf)->curpos = (*buf)->curpos + 1; /* authblock */ memcpy((*buf)->curpos,attrauth,attrauthlen); (*buf)->curpos = (*buf)->curpos + attrauthlen; } else #endif { /* authcount */ *(*buf)->curpos = 0; (*buf)->curpos = (*buf)->curpos + 1; } /*------------------------------------------------*/ /* Ok Now comes the really stupid (and lazy part) */ /*------------------------------------------------*/ *msg = SLPMessageAlloc(); if(*msg == 0) { SLPBufferFree(*buf); *buf=0; result = SLP_ERROR_INTERNAL_ERROR; goto CLEANUP; } peer.sin_addr.s_addr = htonl(LOOPBACK_ADDRESS); result = SLPMessageParseBuffer(&peer,*buf,*msg); (*msg)->body.srvreg.source = SLP_REG_SOURCE_STATIC; CLEANUP: /*----------------------------------*/ /* Check for errors and free memory */ /*----------------------------------*/ switch(result) { case SLP_ERROR_INTERNAL_ERROR: SLPDLog("\nERROR: Out of memory one reg file line:\n %s\n",line); break; case SLP_ERROR_INVALID_REGISTRATION: SLPDLog("\nERROR: Invalid reg file format near:\n %s\n",line); break; case SLP_ERROR_SCOPE_NOT_SUPPORTED: SLPDLog("\nERROR: Duplicate scopes or scope list with imbedded spaces near:\n %s\n",line); break; default: break; } if(langtag) xfree(langtag); if(scopelist) xfree(scopelist); if(url) xfree(url); if(srvtype) xfree(srvtype); if(attrlist)xfree(attrlist); #ifdef ENABLE_SLPv2_SECURITY if(urlauth) xfree(urlauth); if(attrauth) xfree(attrauth); #endif return result; } openslp-1.2.1/slpd/slpd_database.h0000644033442200000310000004210610202047550016757 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_database.h */ /* */ /* Abstract: Implements database abstraction. Currently a simple */ /* double linked list (common/slp_database.c) is used for the */ /* underlying storage. */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLPD_DATABASE_H_INCLUDED #define SLPD_DATABASE_H_INCLUDED #include "slpd.h" /*=========================================================================*/ /* Common code includes */ /*=========================================================================*/ #include "slp_database.h" #define SLPDDATABASE_INITIAL_URLCOUNT 256 #define SLPDDATABASE_INITIAL_SRVTYPELISTLEN 2048 /*=========================================================================*/ typedef struct _SLPDDatabase /*=========================================================================*/ { SLPDatabase database; int urlcount; int srvtypelistlen; }SLPDDatabase; /*=========================================================================*/ typedef struct _SLPDDatabaseSrvRqstResult /*=========================================================================*/ { void* reserved; SLPUrlEntry** urlarray; int urlcount; }SLPDDatabaseSrvRqstResult; /*=========================================================================*/ typedef struct _SLPDDatabaseSrvTypeRqstResult /*=========================================================================*/ { void* reserved; char* srvtypelist; int srvtypelistlen; }SLPDDatabaseSrvTypeRqstResult; /*=========================================================================*/ typedef struct _SLPDDatabaseAttrRqstResult /*=========================================================================*/ { void* reserved; char* attrlist; int attrlistlen; SLPAuthBlock* autharray; int authcount; int ispartial; }SLPDDatabaseAttrRqstResult; /*=========================================================================*/ void SLPDDatabaseAge(int seconds, int ageall); /* Ages the database entries and clears new and deleted entry lists */ /* */ /* seconds (IN) the number of seconds to age each entry by */ /* */ /* ageall (IN) age even entries with SLP_LIFETIME_MAXIMUM */ /* */ /* Returns - None */ /*=========================================================================*/ /*=========================================================================*/ int SLPDDatabaseReg(SLPMessage msg, SLPBuffer buf); /* Add a service registration to the database */ /* */ /* msg (IN) SLPMessage of a SrvReg message as returned by */ /* SLPMessageParse() */ /* */ /* buf (IN) Otherwise unreferenced buffer interpreted by the msg */ /* structure */ /* */ /* Returns - Zero on success. Nonzero on error */ /* */ /* NOTE: All registrations are treated as fresh */ /*=========================================================================*/ /*=========================================================================*/ int SLPDDatabaseDeReg(SLPMessage msg); /* Remove a service registration from the database */ /* */ /* msg - (IN) message interpreting an SrvDereg message */ /* */ /* Returns - Zero on success. Non-zero on failure */ /*=========================================================================*/ /*=========================================================================*/ int SLPDDatabaseSrvRqstStart(SLPMessage msg, SLPDDatabaseSrvRqstResult** result); /* Find services in the database */ /* */ /* msg (IN) the SrvRqst to find. */ /* */ /* result (OUT) pointer result structure */ /* */ /* Returns - Zero on success. Non-zero on failure */ /* */ /* Note: Caller must pass *result to SLPDDatabaseSrvRqstEnd() to free */ /*=========================================================================*/ /*=========================================================================*/ void SLPDDatabaseSrvRqstEnd(SLPDDatabaseSrvRqstResult* result); /* Release resources used to find services in the database */ /* */ /* result (IN) pointer result structure previously passed to */ /* SLPDDatabaseSrvRqstStart */ /* */ /* Returns - None */ /*=========================================================================*/ /*=========================================================================*/ int SLPDDatabaseSrvTypeRqstStart(SLPMessage msg, SLPDDatabaseSrvTypeRqstResult** result); /* Find service types in the database */ /* */ /* msg (IN) the SrvTypRqst to find. */ /* */ /* result (OUT) pointer result structure */ /* */ /* Returns - Zero on success. Non-zero on failure */ /* */ /* Note: Caller must pass *result to SLPDDatabaseSrvtypeRqstEnd() to */ /* free */ /*=========================================================================*/ /*=========================================================================*/ void SLPDDatabaseSrvTypeRqstEnd(SLPDDatabaseSrvTypeRqstResult* result); /* Release resources used to find service types in the database */ /* */ /* result (IN) pointer result structure previously passed to */ /* SLPDDatabaseSrvTypeRqstStart */ /* */ /* Returns - None */ /*=========================================================================*/ /*=========================================================================*/ int SLPDDatabaseAttrRqstStart(SLPMessage msg, SLPDDatabaseAttrRqstResult** result); /* Find attributes in the database */ /* */ /* msg (IN) the AttrRqst to find. */ /* */ /* result (OUT) pointer result structure */ /* */ /* Returns - Zero on success. Non-zero on failure */ /* */ /* Note: Caller must pass *result to SLPDDatabaseAttrRqstEnd() to */ /* free */ /*=========================================================================*/ /*=========================================================================*/ void SLPDDatabaseAttrRqstEnd(SLPDDatabaseAttrRqstResult* result); /* Release resources used to find attributes in the database */ /* */ /* result (IN) pointer result structure previously passed to */ /* SLPDDatabaseSrvTypeRqstStart */ /* */ /* Returns - None */ /*=========================================================================*/ /*=========================================================================*/ void* SLPDDatabaseEnumStart(); /* Start an enumeration of the entire database */ /* */ /* Returns: An enumeration handle that is passed to subsequent calls to */ /* SLPDDatabaseEnum(). Returns NULL on failure. Returned */ /* enumeration handle (if not NULL) must be passed to */ /* SLPDDatabaseEnumEnd() when you are done with it. */ /*=========================================================================*/ /*=========================================================================*/ SLPMessage SLPDDatabaseEnum(void* eh, SLPMessage* msg, SLPBuffer* buf); /* Enumerate through all entries of the database */ /* */ /* eh (IN) pointer to opaque data that is used to maintain */ /* enumerate entries. Pass in a pointer to NULL to start */ /* enumeration. */ /* */ /* msg (OUT) pointer to the SrvReg message that discribes buf */ /* */ /* buf (OUT) pointer to the SrvReg message buffer */ /* */ /* returns: Pointer to enumerated entry or NULL if end of enumeration */ /*=========================================================================*/ /*=========================================================================*/ void SLPDDatabaseEnumEnd(void* eh); /* End an enumeration started by SLPDDatabaseEnumStart() */ /* */ /* Parameters: eh (IN) The enumeration handle returned by */ /* SLPDDatabaseEnumStart() */ /*=========================================================================*/ /*=========================================================================*/ int SLPDDatabaseIsEmpty(); /* Returns an boolean value indicating whether the database is empty */ /*=========================================================================*/ /*=========================================================================*/ int SLPDDatabaseInit(const char* regfile); /* Initialize the database with registrations from a regfile. */ /* */ /* regfile (IN) the regfile to register. Pass in NULL for no regfile */ /* */ /* Returns - zero on success or non-zero on error. */ /*=========================================================================*/ /*=========================================================================*/ int SLPDDatabaseReInit(const char* regfile); /* Re-initialize the database with changed registrations from a regfile. */ /* */ /* regfile (IN) the regfile to register. */ /* */ /* Returns - zero on success or non-zero on error. */ /*=========================================================================*/ #ifdef DEBUG /*=========================================================================*/ void SLPDDatabaseDeinit(void); /* Cleans up all resources used by the database */ /*=========================================================================*/ /*=========================================================================*/ void SLPDDatabaseDump(void); /* Dumps currently valid service registrations present with slpd */ /*=========================================================================*/ #endif #endif /* not defined SLPD_DATABASE_H_INCLUDED */ openslp-1.2.1/slpd/slpd_property.c0000644033442200000310000002570310202251620017071 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_property.c */ /* */ /* Abstract: Defines the data structures for global SLP properties */ /* */ /* WARNING: NOT thread safe! */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ /*=========================================================================*/ /* slpd includes */ /*=========================================================================*/ #include "slpd_property.h" /*=========================================================================*/ /* Common code code includes */ /*=========================================================================*/ #include "slp_message.h" #include "slp_property.h" #include "slp_iface.h" #include "slp_net.h" #include "slp_xmalloc.h" /*=========================================================================*/ SLPDProperty G_SlpdProperty; /*=========================================================================*/ /*=========================================================================*/ int SLPDPropertyInit(const char* conffile) /*=========================================================================*/ { char* myname = 0; char* myinterfaces = 0; char* myurl = 0; const char* ifaces = 0; SLPPropertyReadFile(conffile); memset(&G_SlpdProperty,0,sizeof(G_SlpdProperty)); /*-------------------------------------------------------------*/ /* Set the properties without hard defaults */ /*-------------------------------------------------------------*/ G_SlpdProperty.isDA = SLPPropertyAsBoolean(SLPPropertyGet("net.slp.isDA")); G_SlpdProperty.activeDADetection = SLPPropertyAsBoolean(SLPPropertyGet("net.slp.activeDADetection")); if(G_SlpdProperty.activeDADetection) { G_SlpdProperty.DAActiveDiscoveryInterval = atoi(SLPPropertyGet("net.slp.DAActiveDiscoveryInterval")); if(G_SlpdProperty.DAActiveDiscoveryInterval > 1 && G_SlpdProperty.DAActiveDiscoveryInterval < SLPD_CONFIG_DA_FIND ) { G_SlpdProperty.DAActiveDiscoveryInterval = SLPD_CONFIG_DA_FIND; } } else { G_SlpdProperty.DAActiveDiscoveryInterval = 0; } G_SlpdProperty.passiveDADetection = SLPPropertyAsBoolean(SLPPropertyGet("net.slp.passiveDADetection")); G_SlpdProperty.isBroadcastOnly = SLPPropertyAsBoolean(SLPPropertyGet("net.slp.isBroadcastOnly")); G_SlpdProperty.multicastTTL = atoi(SLPPropertyGet("net.slp.multicastTTL")); G_SlpdProperty.multicastMaximumWait = atoi(SLPPropertyGet("net.slp.multicastMaximumWait")); G_SlpdProperty.unicastMaximumWait = atoi(SLPPropertyGet("net.slp.unicastMaximumWait")); G_SlpdProperty.randomWaitBound = atoi(SLPPropertyGet("net.slp.randomWaitBound")); G_SlpdProperty.maxResults = atoi(SLPPropertyGet("net.slp.maxResults")); G_SlpdProperty.traceMsg = SLPPropertyAsBoolean(SLPPropertyGet("net.slp.traceMsg")); G_SlpdProperty.traceReg = SLPPropertyAsBoolean(SLPPropertyGet("net.slp.traceReg")); G_SlpdProperty.traceDrop = SLPPropertyAsBoolean(SLPPropertyGet("net.slp.traceDrop")); G_SlpdProperty.traceDATraffic = SLPPropertyAsBoolean(SLPPropertyGet("net.slp.traceDATraffic")); G_SlpdProperty.DAAddresses = SLPPropertyGet("net.slp.DAAddresses"); G_SlpdProperty.DAAddressesLen = strlen(G_SlpdProperty.DAAddresses); /* TODO make sure that we are using scopes correctly. What about DHCP, etc*/ G_SlpdProperty.useScopes = SLPPropertyGet("net.slp.useScopes"); G_SlpdProperty.useScopesLen = strlen(G_SlpdProperty.useScopes); G_SlpdProperty.locale = SLPPropertyGet("net.slp.locale"); G_SlpdProperty.localeLen = strlen(G_SlpdProperty.locale); G_SlpdProperty.securityEnabled = SLPPropertyAsBoolean(SLPPropertyGet("net.slp.securityEnabled")); G_SlpdProperty.checkSourceAddr = SLPPropertyAsBoolean(SLPPropertyGet("net.slp.checkSourceAddr")); G_SlpdProperty.DAHeartBeat = SLPPropertyAsInteger(SLPPropertyGet("net.slp.DAHeartBeat")); /*-------------------------------------*/ /* Set the net.slp.interfaces property */ /*-------------------------------------*/ ifaces = SLPPropertyGet("net.slp.interfaces"); if (!ifaces || !*ifaces) { G_SlpdProperty.updateIfaces = 1; } if(SLPIfaceGetInfo(ifaces, &G_SlpdProperty.ifaceInfo) == 0) { if(ifaces) { if(SLPIfaceSockaddrsToString(G_SlpdProperty.ifaceInfo.iface_addr, G_SlpdProperty.ifaceInfo.iface_count, &myinterfaces) == 0) { if(myinterfaces) { SLPPropertySet("net.slp.interfaces", myinterfaces); xfree(myinterfaces); ifaces = SLPPropertyGet("net.slp.interfaces"); } } } } else { G_SlpdProperty.ifaceInfo.iface_count = SLP_MAX_IFACES; if (SLPIfaceStringToSockaddrs(ifaces, G_SlpdProperty.ifaceInfo.iface_addr, &G_SlpdProperty.ifaceInfo.iface_count) != 0) { G_SlpdProperty.ifaceInfo.iface_count = 0; } } G_SlpdProperty.interfaces = ifaces; G_SlpdProperty.interfacesLen = ifaces ? strlen(ifaces) : 0; /*----------------------------*/ /* Get out canonical hostname */ /*----------------------------*/ if(SLPNetGetThisHostname(&myname,0) == 0) { if (!myname && !G_SlpdProperty.myHostnameLen) myname = xstrdup("127.0.0.1"); if (myname) { SLPPropertySet("net.slp.myHostname",myname); xfree(myname); G_SlpdProperty.myHostname = SLPPropertyGet("net.slp.myHostname"); G_SlpdProperty.myHostnameLen = strlen(G_SlpdProperty.myHostname); } } /*---------------------------------------------------------*/ /* Set the value used internally as the url for this agent */ /*---------------------------------------------------------*/ /* 27 is the size of "service:directory-agent://(NULL)" */ if(SLPNetGetThisHostname(&myname,1) == 0) { if (!myname && !G_SlpdProperty.myUrlLen) myname = xstrdup("127.0.0.1"); if (myname) { if (!strncmp(myname, "127.", 4)) { /* cannot run as DA if hostname is loopback */ G_SlpdProperty.isDA = 0; } myurl = (char*)xmalloc(27 + strlen(myname)); if(G_SlpdProperty.isDA) { strcpy(myurl,SLP_DA_SERVICE_TYPE); } else { strcpy(myurl,SLP_SA_SERVICE_TYPE); } strcat(myurl,"://"); strcat(myurl,myname); SLPPropertySet("net.slp.agentUrl",myurl); G_SlpdProperty.myUrl = SLPPropertyGet("net.slp.agentUrl"); G_SlpdProperty.myUrlLen = strlen(G_SlpdProperty.myUrl); xfree(myurl); xfree(myname); } } /*----------------------------------*/ /* Set other values used internally */ /*----------------------------------*/ G_SlpdProperty.DATimestamp = 1; /* DATimestamp must start at 1 */ G_SlpdProperty.activeDiscoveryXmits = 3; /* ensures xmit on first 3 calls to SLPDKnownDAActiveDiscovery() */ G_SlpdProperty.nextActiveDiscovery = 0; /* ensures xmit on first call to SLPDKnownDAActiveDiscovery() */ G_SlpdProperty.nextPassiveDAAdvert = 0; /* ensures xmit on first call to SLPDKnownDAPassiveDiscovery()*/ return 0; } #ifdef DEBUG /*=========================================================================*/ void SLPDPropertyDeinit() /*=========================================================================*/ { SLPPropertyFreeAll(); } #endif openslp-1.2.1/slpd/slpd_process.h0000644033442200000310000001376610202054067016704 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_process.h */ /* */ /* Abstract: Processes incoming SLP messages */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLPD_PROCESS_H_INCLUDED #define SLPD_PROCESS_H_INCLUDED #include "slpd.h" /*=========================================================================*/ /* Common code includes */ /*=========================================================================*/ #include "slp_buffer.h" /*=========================================================================*/ int SLPDProcessMessage(struct sockaddr_in* peerinfo, SLPBuffer recvbuf, SLPBuffer* sendbuf) ; /* Processes the recvbuf and places the results in sendbuf */ /* */ /* peerinfo - the socket the message was received on */ /* */ /* recvbuf - message to process */ /* */ /* sendbuf - results of the processed message */ /* */ /* Returns - SLP_ERROR errorcode */ /*=========================================================================*/ #if defined(ENABLE_SLPv1) /*=========================================================================*/ int SLPDv1ProcessMessage(struct sockaddr_in* peeraddr, SLPBuffer recvbuf, SLPBuffer* sendbuf); /* Processes the recvbuf and places the results in sendbuf */ /* */ /* peerinfo - the socket the message was received on */ /* */ /* recvbuf - message to process */ /* */ /* sendbuf - results of the processed message */ /* */ /* Returns - SLP_ERROR errorcode */ /*=========================================================================*/ #endif #endif openslp-1.2.1/slpd/slpd_socket.h0000644033442200000310000002422610202252407016505 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_socket.c */ /* */ /* Abstract: Socket specific functions implementation */ /* */ /* WARNING: NOT thread safe! */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLPD_SOCKET_H_INCLUDED #define SLPD_SOCKET_H_INCLUDED #include "slpd.h" /*=========================================================================*/ /* common code includes */ /*=========================================================================*/ #include "slp_buffer.h" /*=========================================================================*/ /* Misc constants */ /*=========================================================================*/ #define SLPD_SMALLEST_MESSAGE 18 /* 18 bytes is smallest SLPv2 msg */ /*=========================================================================*/ /* Values representing a type or state of a socket */ /*=========================================================================*/ #define SOCKET_PENDING_IO 100 #define SOCKET_LISTEN 0 #define SOCKET_CLOSE 1 #define DATAGRAM_UNICAST 2 #define DATAGRAM_MULTICAST 3 #define DATAGRAM_BROADCAST 4 #define STREAM_CONNECT_IDLE 5 #define STREAM_CONNECT_BLOCK 6 + SOCKET_PENDING_IO #define STREAM_CONNECT_CLOSE 7 + SOCKET_PENDING_IO #define STREAM_READ 8 + SOCKET_PENDING_IO #define STREAM_READ_FIRST 9 + SOCKET_PENDING_IO #define STREAM_WRITE 10 + SOCKET_PENDING_IO #define STREAM_WRITE_FIRST 11 + SOCKET_PENDING_IO #define STREAM_WRITE_WAIT 12 + SOCKET_PENDING_IO #ifdef _WIN32 #define CloseSocket(Arg) closesocket(Arg) #else #define CloseSocket(Arg) close(Arg) #endif /*=========================================================================*/ typedef struct _SLPDSocket /* Structure representing a socket */ /*=========================================================================*/ { SLPListItem listitem; int fd; time_t age; /* in seconds */ int state; struct sockaddr_in ifaddr; /* address of interface */ struct sockaddr_in peeraddr; /* Incoming socket stuff */ SLPBuffer recvbuf; SLPBuffer sendbuf; /* Outgoing socket stuff */ int reconns; SLPList sendlist; }SLPDSocket; /*==========================================================================*/ SLPDSocket* SLPDSocketCreateConnected(struct in_addr* addr); /* */ /* addr - (IN) the address of the peer to connect to */ /* */ /* Returns: A connected socket or a socket in the process of being connected*/ /* if the socket was connected the SLPDSocket->state will be set */ /* to writable. If the connect would block, SLPDSocket->state will*/ /* be set to connect. Return NULL on error */ /*==========================================================================*/ /*==========================================================================*/ SLPDSocket* SLPDSocketCreateListen(struct in_addr* peeraddr); /* */ /* peeraddr - (IN) the address of the peer to connect to */ /* */ /* type (IN) DATAGRAM_UNICAST, DATAGRAM_MULTICAST, DATAGRAM_BROADCAST */ /* */ /* Returns: A listening socket. SLPDSocket->state will be set to */ /* SOCKET_LISTEN. Returns NULL on error */ /*==========================================================================*/ /*==========================================================================*/ SLPDSocket* SLPDSocketCreateDatagram(struct in_addr* peeraddr, int type); /* peeraddr - (IN) the address of the peer to connect to */ /* */ /* type - (IN) the type of socket to create DATAGRAM_UNICAST, */ /* DATAGRAM_MULTICAST, or DATAGRAM_BROADCAST */ /* Returns: A datagram socket SLPDSocket->state will be set to */ /* DATAGRAM_UNICAST, DATAGRAM_MULTICAST, or DATAGRAM_BROADCAST */ /*==========================================================================*/ /*==========================================================================*/ SLPDSocket* SLPDSocketCreateBoundDatagram(struct in_addr* myaddr, struct in_addr* peeraddr, int type); /* myaddr - (IN) the address of the interface to join mcast on */ /* */ /* peeraddr - (IN) the address of the peer to connect to */ /* */ /* type (IN) DATAGRAM_UNICAST, DATAGRAM_MULTICAST, DATAGRAM_BROADCAST */ /* */ /* Returns: A datagram socket SLPDSocket->state will be set to */ /* DATAGRAM_UNICAST, DATAGRAM_MULTICAST, or DATAGRAM_BROADCAST */ /*==========================================================================*/ /*=========================================================================*/ SLPDSocket* SLPDSocketAlloc(); /* Allocate memory for a new SLPDSocket. */ /* */ /* Returns: pointer to a newly allocated SLPDSocket, or NULL if out of */ /* memory. */ /*=========================================================================*/ /*=========================================================================*/ void SLPDSocketFree(SLPDSocket* sock); /* Frees memory associated with the specified SLPDSocket */ /* */ /* sock (IN) pointer to the socket to free */ /*=========================================================================*/ #endif openslp-1.2.1/slpd/slpd_unistd.h0000644033442200000310000001035410202047550016521 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_unistd.h */ /* */ /* Abstract: Unix standard specific header file */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef LINUX #include #include #endif #if(!defined MAX_PATH) #define MAX_PATH 256 #endif /* we do a kind of abstraction layer for socket descriptors, since on NT they're of type "SOCKET" */ typedef int sockfd_t; openslp-1.2.1/configure.in0000644033442200000310000001516010204453052015367 0ustar rganesanfloppydnl *********************************************************************** dnl Process this file with autoconf to produce a configure script. dnl *********************************************************************** AC_PREREQ(2.50) AC_INIT(openslp, 1.2.1, openslp-devel@lists.sourceforge.net) AC_CONFIG_SRCDIR(slpd/slpd_main.c) AM_INIT_AUTOMAKE AC_CONFIG_HEADERS(config.h) dnl *********************************************************************** dnl We don't want /usr/etc or /usr/var dnl *********************************************************************** test "$prefix" = NONE && prefix=/usr if test "$prefix" = '/usr'; then # We don't want /usr/etc and /usr/var test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc test "$sharedstatedir" = '${prefix}/com' && localstatedir=/var test "$localstatedir" = '${prefix}/var' && localstatedir=/var fi dnl *********************************************************************** dnl Take care of the debug stuff dnl *********************************************************************** AC_ARG_ENABLE(debug, [ --enable-debug Turn on debugging (default off)], debug=$enableval, debug=no) CFLAGS="${CFLAGS:=}" LDFLAGS="${LDFLAGS:=}" case "$debug" in yes) CFLAGS="-g -DDEBUG -D_REENTRANT=1 $CFLAGS" ;; no) CFLAGS="-DNDEBUG -D_REENTRANT=1 $CFLAGS" ;; *) AC_MSG_ERROR(bad value ${debug} for --enable-debug) ;; esac dnl *********************************************************************** dnl System type macros dnl *********************************************************************** AC_CANONICAL_HOST case "$host_os" in *linux*) CFLAGS="$CFLAGS -DLINUX" ;; *solaris*) CFLAGS="$CFLAGS -DSOLARIS";; *aix*) CFLAGS="$CFLAGS -DAIX";; *hpux*) CFLAGS="$CFLAGS -DHPUX";; esac dnl *********************************************************************** dnl SLPv1 support can be turned off dnl *********************************************************************** AC_ARG_ENABLE(slpv1, [ --enable-slpv1 Turn on SLPv1 support (default on)], slpv1=$enableval, slpv1=yes) dnl Conditional for optional SLPv1 support AM_CONDITIONAL(ENABLE_SLPv1, test "$slpv1" = "yes") if test "$slpv1" = "yes"; then AC_DEFINE(ENABLE_SLPv1, 1, [defined if struct sigaction has member sa_restorer]) fi dnl *********************************************************************** dnl Handle Predicates dnl *********************************************************************** AC_ARG_ENABLE(predicates, [ --disable-predicates Turn off predicates], predicates=$enableval, predicates=yes) dnl Conditional for optional predicates support AM_CONDITIONAL(ENABLE_PREDICATES, test "$predicates" = "yes") if test "$predicates" = "yes"; then AC_DEFINE(ENABLE_PREDICATES, 1, [defined if predicates are enabled]) fi dnl *********************************************************************** dnl Enable asyncronous support in libslp SLP API library dnl *********************************************************************** AC_ARG_ENABLE(async-api, [ --enable-async-api Turn on asyncronous support (default off)], asyncapi=$enableval, asyncapi=no) dnl Conditional for optional asyncronous support in libslp SLP API library AM_CONDITIONAL(ENABLE_ASYNC_API, test "$asyncapi" = "yes") if test "$asyncapi" = "yes"; then AC_DEFINE(ENABLE_ASYNC_API, 1, [defined if the async SLP API support is enabled]) fi dnl *********************************************************************** dnl Enable security support dnl *********************************************************************** AC_ARG_ENABLE(slpv2-security, [ --enable-slpv2-security Turn on security support (default off)], slpv2security=$enableval, slpv2security=no) AC_CHECK_LIB(crypto, DSA_sign) AC_CHECK_FUNCS(DSA_verify DSA_size DSA_free SHA1) dnl Conditional for optional security support in libslp SLP API library AM_CONDITIONAL(ENABLE_SLPv2_SECURITY, test "$slpv2security" = "yes") if test "$slpv2security" = "yes"; then AC_DEFINE(ENABLE_SLPv2_SECURITY, 1, [defined if the SLPv2 authentication support is enabled]) fi dnl *********************************************************************** dnl Checks for programs. dnl *********************************************************************** AC_PROG_CC AC_PROG_INSTALL AM_PROG_LIBTOOL AM_PROG_LEX AC_PROG_YACC dnl *********************************************************************** dnl Set C/C++ compiler specific warning/optimization flags dnl *********************************************************************** if test X"$GCC" = X"yes"; then CFLAGS="$CFLAGS -Wall" if test X"$debug" = X"yes"; then CFLAGS="$CFLAGS -Werror" fi if test X"$debug" = X"no"; then OPTFLAGS="-O3" fi elif $CC -V 2>&1 | grep "WorkShop Compilers"; then dnl Allow C++ style comments CFLAGS="$CFLAGS -xCC" if test X"$debug" = X"no"; then OPTFLAGS="-fast" if echo $CC | grep "xarch=v9"; then dnl "-fast" sets -xarch=v8 disabling 64-bit mode, enable it again OPTFLAGS="$OPTFLAGS -xarch=v9" fi fi elif echo $host_os | grep -i "osf" >/dev/null; then CFLAGS="$CFLAGS -std" if test X"$debug" = X"no"; then OPTFLAGS="-O" fi else if test X"$debug" = X"no"; then OPTFLAGS="-O" fi fi CFLAGS="$CFLAGS $OPTFLAGS" dnl *********************************************************************** dnl Checks for header files. dnl *********************************************************************** AC_HEADER_STDC AC_CHECK_HEADERS(string.h sys/types.h stdint.h netinet/in.h) dnl *********************************************************************** dnl Checks for data types. dnl *********************************************************************** OPENSLP_CHECK_TYPE(socklen_t, int, [defined to size_t if does not support socklen_t data type]) OPENSLP_STRUCT_SA_RESTORER dnl *********************************************************************** dnl Checks for libraries. dnl *********************************************************************** AC_CHECK_LIB(resolv, inet_aton) AC_CHECK_LIB(socket, main) AC_CHECK_LIB(nsl, gethostbyname) dnl AC_CHECK_LIB(m, main) dnl AC_CHECK_FUNCS(ceil log10 strncasecmp strcasecmp ) AC_CHECK_FUNCS(strncasecmp strcasecmp) dnl AC_OUTPUT( Makefile common/Makefile libslpattr/Makefile libslp/Makefile dnl slpd/Makefile slptool/Makefile test/Makefile slp.list ) AC_CONFIG_FILES([ Makefile ]) AC_CONFIG_FILES([ common/Makefile ]) AC_CONFIG_FILES([ libslpattr/Makefile ]) AC_CONFIG_FILES([ libslp/Makefile ]) AC_CONFIG_FILES([ slpd/Makefile ]) AC_CONFIG_FILES([ slptool/Makefile ]) AC_CONFIG_FILES([ test/Makefile ]) AC_CONFIG_FILES([ slp.list ]) AC_OUTPUT openslp-1.2.1/debian/0000755033442200000310000000000010641470757014315 5ustar rganesanfloppyopenslp-1.2.1/debian/libslp1.config0000644033442200000310000000102610641470757017051 0ustar rganesanfloppy#!/bin/sh set -e # Source debconf library. . /usr/share/debconf/confmodule # /proc/net/igmp is present only in a multicast kernel if uname | grep -q Linux && [ -d /proc/net -a ! -f /proc/net/igmp ] then db_input medium libslp1/multicast || true db_go fi # Check for multicast route, # Disabled for now because it's not clear whether multicast route is really # needed. if ! netstat -rn | grep "224\.0\.0\.0" >/dev/null && false then db_input medium libslp1/multicast-route || true db_go fi openslp-1.2.1/debian/libslp-dev.examples0000644033442200000310000000004510641470757020115 0ustar rganesanfloppyslptool/slptool.h slptool/slptool.c openslp-1.2.1/debian/slptool.docs0000644033442200000310000000003310641470757016657 0ustar rganesanfloppyNEWS README AUTHORS THANKS openslp-1.2.1/debian/copyright0000644033442200000310000000362010641470757016251 0ustar rganesanfloppyThis package was debianized by Ganesan Rajagopal from sources downloaded from http://prdownloads.sourceforge.net/openslp/openslp-*.tar.gz. Upstream Authors: Mathew Peterson (mpeterson@calderasystems.com) et al. Copyright: The following copyright and license is applicable to the entire OpenSLP project (libslp, slpd, and related documentation): Copyright (C) 2000 Caldera Systems, Inc All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of Caldera Systems nor the names of itscontributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. openslp-1.2.1/debian/init.d0000644033442200000310000000174510641470757015434 0ustar rganesanfloppy#! /bin/sh # script to start/stop the OpenSLP daemon DAEMON=/usr/sbin/slpd NAME=slpd DESC="OpenSLP server" test -f $DAEMON || exit 0 case "$1" in start) echo -n "Starting $DESC: " start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ --exec $DAEMON echo "$NAME." ;; stop) echo -n "Stopping $DESC: " start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ --exec $DAEMON echo "$NAME." ;; reload) echo "Reloading $DESC configuration files." start-stop-daemon --stop --signal 1 --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON ;; restart|force-reload) echo -n "Restarting $DESC: " start-stop-daemon --stop --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON sleep 1 start-stop-daemon --start --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON echo "$NAME." ;; *) N=/etc/init.d/$NAME # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 echo "Usage: $N {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0 openslp-1.2.1/debian/po/0000755033442200000310000000000010641470757014733 5ustar rganesanfloppyopenslp-1.2.1/debian/po/gl.po0000644033442200000310000000516010641470757015677 0ustar rganesanfloppy# Galician translation of openslp's debconf templates # This file is distributed under the same license as the openslp package. # Jacobo Tarrio , 2007. # msgid "" msgstr "" "Project-Id-Version: openslp\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2003-04-06 17:12-0300\n" "PO-Revision-Date: 2007-01-17 10:56+0100\n" "Last-Translator: Jacobo Tarrio \n" "Language-Team: Galician \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Description #: ../libslp1.templates:3 msgid "To reduce network traffic use a IP multicast enabled kernel" msgstr "Empregue un núcleo con multicast IP para reducir o tráfico na rede" #. Description #: ../libslp1.templates:3 msgid "" "The kernel version that you are currently running does not appear to support " "IP multicast. OpenSLP will continue to work even without multicast support " "in the kernel by using broadcasts. However, broadcasts are less efficient on " "the network, so please consider upgrading to a multicast enabled kernel." msgstr "" "Semella que a versión do núcleo que está a executar non soporta multicast " "IP. OpenSLP ha seguir funcionando sen soporte de multicast no núcleo " "empregando broadcasts. Nembargantes, os broadcasts son menos eficientes coa " "rede, así que pense en se actualizar a un núcleo con multicast activado." #. Description #: ../libslp1.templates:12 msgid "Please configure a multicast route in /etc/network/interfaces" msgstr "Configure unha ruta multicast en /etc/network/interfaces" #. Description #: ../libslp1.templates:12 msgid "" "You don't seem to have a multicast route configured. OpenSLP can take " "advantage of multicast packets and reduce traffic on your network. You can " "setup a multicast route automatically on system startup by adding the " "following commands to the \"interface\" line(s) in your /etc/network/" "interfaces file." msgstr "" "Semella que non ten unha ruta multicast configurada. OpenSLP pode aproveitar " "os paquetes multicast e reducir o tráfico na súa rede. Pode configurar " "automaticamente unha ruta multicast ao iniciar o sistema engandido as " "seguintes ordes á(s) liña(s) \"interface\" do seu ficheiro /etc/network/" "interfaces." #. Description #: ../libslp1.templates:12 msgid "\" up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "\" up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" #. Description #: ../libslp1.templates:12 msgid "\" down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "\" down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" openslp-1.2.1/debian/po/templates.pot0000644033442200000310000000406410641470757017461 0ustar rganesanfloppy# # Translators, if you are not familiar with the PO format, gettext # documentation is worth reading, especially sections dedicated to # this format, e.g. by running: # info -n '(gettext)PO Files' # info -n '(gettext)Header Entry' # # Some information specific to po-debconf are available at # /usr/share/doc/po-debconf/README-trans # or http://www.debian.org/intl/l10n/po-debconf/README-trans # # Developers do not need to manually edit POT or PO files. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2003-04-06 17:12-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #. Description #: ../libslp1.templates:3 msgid "To reduce network traffic use a IP multicast enabled kernel" msgstr "" #. Description #: ../libslp1.templates:3 msgid "" "The kernel version that you are currently running does not appear to support " "IP multicast. OpenSLP will continue to work even without multicast support " "in the kernel by using broadcasts. However, broadcasts are less efficient on " "the network, so please consider upgrading to a multicast enabled kernel." msgstr "" #. Description #: ../libslp1.templates:12 msgid "Please configure a multicast route in /etc/network/interfaces" msgstr "" #. Description #: ../libslp1.templates:12 msgid "" "You don't seem to have a multicast route configured. OpenSLP can take " "advantage of multicast packets and reduce traffic on your network. You can " "setup a multicast route automatically on system startup by adding the " "following commands to the \"interface\" line(s) in your /etc/network/" "interfaces file." msgstr "" #. Description #: ../libslp1.templates:12 msgid "\" up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "" #. Description #: ../libslp1.templates:12 msgid "\" down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "" openslp-1.2.1/debian/po/da.po0000644033442200000310000000613610641470757015665 0ustar rganesanfloppy# # Translators, if you are not familiar with the PO format, gettext # documentation is worth reading, especially sections dedicated to # this format, e.g. by running: # info -n '(gettext)PO Files' # info -n '(gettext)Header Entry' # Some information specific to po-debconf are available at # /usr/share/doc/po-debconf/README-trans # or http://www.debian.org/intl/l10n/po-debconf/README-trans# # Developers do not need to manually edit POT or PO files. # Claus Hindsgaul , 2004. # msgid "" msgstr "" "Project-Id-Version: openslp_1.0.11-7_templates\n" "POT-Creation-Date: 2003-04-06 17:12-0300\n" "PO-Revision-Date: 2004-04-21 13:54+0200\n" "Last-Translator: Claus Hindsgaul \n" "Language-Team: Danish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.3.1\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. Description #: ../libslp1.templates:3 msgid "To reduce network traffic use a IP multicast enabled kernel" msgstr "" "Brug en kerne, der understøtter \"IP multicast\" for at reducere " "netværkstrafikken" #. Description #: ../libslp1.templates:3 msgid "" "The kernel version that you are currently running does not appear to support " "IP multicast. OpenSLP will continue to work even without multicast support " "in the kernel by using broadcasts. However, broadcasts are less efficient on " "the network, so please consider upgrading to a multicast enabled kernel." msgstr "" "Den kerneversion, der kører nu, lader ikke til at understøtte \"IP multicast" "\". OpenSLP vil fungere pÃ¥ trods at den manglende multicast-understøttelse i " "kernen ved hjælp af rundsending (\"broadcasts\"). Rundsendinger nedsætter " "dog netværkets effektivitet, sÃ¥ det anbefales at overveje at opgradere til " "en kerne med multicast-understøttelse." #. Description #: ../libslp1.templates:12 msgid "Please configure a multicast route in /etc/network/interfaces" msgstr "Sæt multicast-ruten op i /etc/network/interfaces" #. Description #: ../libslp1.templates:12 msgid "" "You don't seem to have a multicast route configured. OpenSLP can take " "advantage of multicast packets and reduce traffic on your network. You can " "setup a multicast route automatically on system startup by adding the " "following commands to the \"interface\" line(s) in your /etc/network/" "interfaces file." msgstr "" "Du lader ikke til at have sat en multicast-rute op. OpenSLP kan benytte " "multicast-pakker og reducere trafikken pÃ¥ dit netværk. Du kan sætte en " "multicast-rute op automatisk under systemets opstart ved at tilføje følgende " "kommandoer til \"interface\"-linjerne i filen /etc/network/interfaces." #. Description #: ../libslp1.templates:12 msgid "\" up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "\" up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" #. Description #: ../libslp1.templates:12 msgid "\" down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "\" down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" openslp-1.2.1/debian/po/pt.po0000644033442200000310000000532610641470757015724 0ustar rganesanfloppy# Portuguese translation of openslp debconf messagens. # Copyright (C) 2007 Carlos Lisboa # This file is distributed under the same license as the openslp package. # Carlos Lisboa , 2007. # msgid "" msgstr "" "Project-Id-Version: openslp\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2003-04-06 17:12-0300\n" "PO-Revision-Date: 2007-01-23 23:09+0000\n" "Last-Translator: Carlos Lisboa \n" "Language-Team: Portuguese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Description #: ../libslp1.templates:3 msgid "To reduce network traffic use a IP multicast enabled kernel" msgstr "Para reduzir o tráfego da rede utilize um kernel com IP multicast" #. Description #: ../libslp1.templates:3 msgid "" "The kernel version that you are currently running does not appear to support " "IP multicast. OpenSLP will continue to work even without multicast support " "in the kernel by using broadcasts. However, broadcasts are less efficient on " "the network, so please consider upgrading to a multicast enabled kernel." msgstr "" "A versão de kernel que está a correr neste momento parece não suportar IP " "multicast. O OpenSLP irá continuar a trabalhar mesmo sem suporte para " "multicast no kernel, usando broadcasts. No entanto, os broadcasts são menos " "eficientes na rede, por isso considere actualizar para um kernel com " "multicast activo." #. Description #: ../libslp1.templates:12 msgid "Please configure a multicast route in /etc/network/interfaces" msgstr "Configure a rota multicast em /etc/network/interfaces" #. Description #: ../libslp1.templates:12 msgid "" "You don't seem to have a multicast route configured. OpenSLP can take " "advantage of multicast packets and reduce traffic on your network. You can " "setup a multicast route automatically on system startup by adding the " "following commands to the \"interface\" line(s) in your /etc/network/" "interfaces file." msgstr "" "Parece que não possui a rota multicast configurada. O OpenSLP poderá usar " "como vantagem os pacotes multicast e reduzir o tráfego da sua rede. Poderá " "configurar uma rota multicast automaticamente no arranque do sistema " "adicionando os seguintes comandos às linhas de \"interface\" no seu " "ficheiro /etc/network/interfaces." #. Description #: ../libslp1.templates:12 msgid "\" up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "\" up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" #. Description #: ../libslp1.templates:12 msgid "\" down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "\" down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" openslp-1.2.1/debian/po/es.po0000644033442200000310000000731010641470757015703 0ustar rganesanfloppy# openslp po-debconf translation to spanish # Copyright (C) 2006 Software in the Public Interest, SPI Inc. # This file is distributed under the same license as the openslp package. # Changes: # - Initial translation # Steve Lord Flaubert , 2006 # Traductores, si no conoce el formato PO, merece la pena leer la # documentación de gettext, especialmente las secciones dedicadas a este # formato, por ejemplo ejecutando: # info -n '(gettext)PO Files' # info -n '(gettext)Header Entry' # Equipo de traducción al español, por favor lean antes de traducir # los siguientes documentos: # - El proyecto de traducción de Debian al español # http://www.debian.org/intl/spanish/ # especialmente las notas y normas de traducción en # http://www.debian.org/intl/spanish/notas # - La guía de traducción de po's de debconf: # /usr/share/doc/po-debconf/README-trans # o http://www.debian.org/intl/l10n/po-debconf/README-trans # Si tiene dudas o consultas sobre esta traducción consulte con el último # traductor (campo Last-Translator) y ponga en copia a la lista de # traducción de Debian al español () # # msgid "" msgstr "" "Project-Id-Version: openslp 1.2.1-6\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2003-04-06 17:12-0300\n" "PO-Revision-Date: 2006-12-09 20:15+0100\n" "Last-Translator: Steve Lord Flaubert \n" "Language-Team: Spanish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Description #: ../libslp1.templates:3 msgid "To reduce network traffic use a IP multicast enabled kernel" msgstr "" "Para reducir el tráfico de la red use un núcleo con «IP multicast» habilitado" #. Description #: ../libslp1.templates:3 msgid "" "The kernel version that you are currently running does not appear to support " "IP multicast. OpenSLP will continue to work even without multicast support " "in the kernel by using broadcasts. However, broadcasts are less efficient on " "the network, so please consider upgrading to a multicast enabled kernel." msgstr "" "La versión del núcleo que utiliza actualmente no parece tener soporte para " "«IP multicast». OpenSLP continuará trabajando, aún sin soporte de " "«multicast» en el núcleo, usando «broadcasts». Sin embargo, los «broadcasts» " "son menos eficientes sobre la red, por favor considere habilitar el núcleo " "para soporte «multicast»." #. Description #: ../libslp1.templates:12 msgid "Please configure a multicast route in /etc/network/interfaces" msgstr "Por favor configure una ruta «multicast» en «/etc/network/interfaces»" #. Description #: ../libslp1.templates:12 msgid "" "You don't seem to have a multicast route configured. OpenSLP can take " "advantage of multicast packets and reduce traffic on your network. You can " "setup a multicast route automatically on system startup by adding the " "following commands to the \"interface\" line(s) in your /etc/network/" "interfaces file." msgstr "" "Parece no tener una ruta «multicast» configurada. OpenSLP puede aprovecharse " "de los paquetes «multicast» y reducir el tráfico en su red. Puede configurar " "una ruta «multicast» automáticamente al inicio del sistema agregando las " "siguientes órdenes a la(s) linea(s) «interface» en su archivo «/etc/network/" "interfaces»." #. Description #: ../libslp1.templates:12 msgid "\" up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "« activar route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0»" #. Description #: ../libslp1.templates:12 msgid "\" down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "« desactivar route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0»" openslp-1.2.1/debian/po/nl.po0000644033442200000310000000662310641470757015713 0ustar rganesanfloppy# translation of openslp_1.2.1-5_templates.po to dutch # This file is distributed under the same license as the openslp package. # Please see debian/copyright. # # Translators, if you are not familiar with the PO format, gettext # documentation is worth reading, especially sections dedicated to # this format, e.g. by running: # info -n '(gettext)PO Files' # info -n '(gettext)Header Entry' # Some information specific to po-debconf are available at # /usr/share/doc/po-debconf/README-trans # or http://www.debian.org/intl/l10n/po-debconf/README-trans# # Developers do not need to manually edit POT or PO files. # msgid "" msgstr "" "Project-Id-Version: openslp_1.2.1-5_nl\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-03-10 07:23-0700\n" "PO-Revision-Date: 2006-04-11 11:28\n" "Last-Translator: Kurt De Bree \n" "Language-Team: Nederlands \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.10.2\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. Type: note #. Description #: ../libslp1.templates:3 msgid "To reduce network traffic use a IP multicast enabled kernel" msgstr "" "Gebruik een kernel met ondersteuning voor IP-multicast om het netwerkverkeer " "te verminderen. " #. Type: note #. Description #: ../libslp1.templates:3 msgid "" "The kernel version that you are currently running does not appear to support " "IP multicast. OpenSLP will continue to work even without multicast support " "in the kernel by using broadcasts. However, broadcasts are less efficient on " "the network, so please consider upgrading to a multicast enabled kernel." msgstr "" "De momenteel door u gebruikte kernelversie lijkt geen ondersteuning te " "bevatten voor IP-multicast. Dit is geen probleem voor OpenSLP, daar deze dan " "uitzendingen (broadcasts) gebruikt. Deze methode levert echter meer " "netwerkverkeer op, het is dan ook aan te raden om een opwaardering naar een " "kernel met multicast te overwegen. " #. Type: note #. Description #: ../libslp1.templates:12 msgid "Please configure a multicast route in /etc/network/interfaces" msgstr "Gelieve een multicast route te configureren in /etc/network/interfaces" #. Type: note #. Description #: ../libslp1.templates:12 msgid "" "You don't seem to have a multicast route configured. OpenSLP can take " "advantage of multicast packets and reduce traffic on your network. You can " "setup a multicast route automatically on system startup by adding the " "following commands to the \"interface\" line(s) in your /etc/network/" "interfaces file." msgstr "" "U schijnt geen geconfigureerde multicast route te hebben. OpenSLP kan uit " "multicast pakketten voordeel halen en zo uw netwerkverkeer verminderen. U " "kunt tijdens het opstarten van het systeem een multicast route automatisch " "instellen door het volgende aan de \"interface\"-regel(s) in uw /etc/network/" "interfaces bestand op uw systeem toe te voegen." #. Type: note #. Description #: ../libslp1.templates:12 msgid "\" up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "\" up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" #. Type: note #. Description #: ../libslp1.templates:12 msgid "\" down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "\" down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" openslp-1.2.1/debian/po/POTFILES.in0000644033442200000310000000005410641470757016507 0ustar rganesanfloppy[type: gettext/rfc822deb] libslp1.templates openslp-1.2.1/debian/po/fr.po0000644033442200000310000000641510641470757015710 0ustar rganesanfloppy# # Translators, if you are not familiar with the PO format, gettext # documentation is worth reading, especially sections dedicated to # this format, e.g. by running: # info -n '(gettext)PO Files' # info -n '(gettext)Header Entry' # # Some information specific to po-debconf are available at # /usr/share/doc/po-debconf/README-trans # or http://www.debian.org/intl/l10n/po-debconf/README-trans # # Developers do not need to manually edit POT or PO files. # msgid "" msgstr "" "Project-Id-Version: openslp 1.0.11-1\n" "POT-Creation-Date: 2003-04-06 17:12-0300\n" "PO-Revision-Date: 2003-05-03 09:24+0100\n" "Last-Translator: Christian Perrier \n" "Language-Team: Deiban french translation team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Description #: ../libslp1.templates:3 msgid "To reduce network traffic use a IP multicast enabled kernel" msgstr "" "Afin de réduire le trafic réseau, veuillez utiliser un noyau avec l'option " "de multidiffusion IP (« IP multicast »)" #. Description #: ../libslp1.templates:3 msgid "" "The kernel version that you are currently running does not appear to support " "IP multicast. OpenSLP will continue to work even without multicast support " "in the kernel by using broadcasts. However, broadcasts are less efficient on " "the network, so please consider upgrading to a multicast enabled kernel." msgstr "" "Le noyau que vous utilisez ne semble pas comporter l'option de " "multidiffusion IP (« IP multicast »). OpenSLP va continuer à fonctionner " "sans le support de la multidiffusion dans le noyau, par utilisation de " "diffusions générales (« broadcasts »). Cependant, les diffusions générales " "sont moins efficaces sur le réseau ; il vous est donc conseillé de basculer " "vers un noyau comportant l'option de multidiffusion." #. Description #: ../libslp1.templates:12 msgid "Please configure a multicast route in /etc/network/interfaces" msgstr "" "Veuillez configurer une route de multidiffusion dans /etc/network/interfaces." #. Description #: ../libslp1.templates:12 msgid "" "You don't seem to have a multicast route configured. OpenSLP can take " "advantage of multicast packets and reduce traffic on your network. You can " "setup a multicast route automatically on system startup by adding the " "following commands to the \"interface\" line(s) in your /etc/network/" "interfaces file." msgstr "" "Aucune route de multidiffusion ne semble configurée. OpenSLP peut tirer " "avantage de paquets réseau avec multidiffusion (« multicast packets ») pour " "réduire le trafic sur votre réseau. Il est possible de configurer une route " "de multidiffusion automatiquement, au démarrage, en ajoutant les commandes " "suivantes dans le(s) ligne(s) « interfaces » du fichier /etc/network/" "interfaces" #. Description #: ../libslp1.templates:12 msgid "\" up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "\" up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" #. Description #: ../libslp1.templates:12 msgid "\" down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "\" down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" openslp-1.2.1/debian/po/de.po0000644033442200000310000000620410641470757015665 0ustar rganesanfloppy# # Translators, if you are not familiar with the PO format, gettext # documentation is worth reading, especially sections dedicated to # this format, e.g. by running: # info -n '(gettext)PO Files' # info -n '(gettext)Header Entry' # Some information specific to po-debconf are available at # /usr/share/doc/po-debconf/README-trans # or http://www.debian.org/intl/l10n/po-debconf/README-trans# # Developers do not need to manually edit POT or PO files. # Erik Schanze , 2004. # msgid "" msgstr "" "Project-Id-Version: openslp_1.0.11-7_templates\n" "POT-Creation-Date: 2003-04-06 17:12-0300\n" "PO-Revision-Date: 2004-08-09 16:57+0200\n" "Last-Translator: Erik Schanze \n" "Language-Team: German \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.3.1\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. Description #: ../libslp1.templates:3 msgid "To reduce network traffic use a IP multicast enabled kernel" msgstr "Kernel mit IP-Multicast für geringere Netzwerklast nutzen" #. Description #: ../libslp1.templates:3 msgid "" "The kernel version that you are currently running does not appear to support " "IP multicast. OpenSLP will continue to work even without multicast support " "in the kernel by using broadcasts. However, broadcasts are less efficient on " "the network, so please consider upgrading to a multicast enabled kernel." msgstr "" "Die Kernelversion, die Sie gerade benutzen, scheint IP-Multicast nicht zu " "unterstützen. OpenSLP wird auch ohne Multicast-Unterstützung im Kernel " "arbeiten, in dem es Broadcasts nutzt. Leider sind Broadcasts weniger " "wirkungsvoll im Netzwerk, ziehen Sie bitte deshalb einen Kernel mit " "Multicast-Unterstützung in Betracht." #. Description #: ../libslp1.templates:12 msgid "Please configure a multicast route in /etc/network/interfaces" msgstr "" "Bitte eine Multicast-Route in der Datei /etc/network/interfaces einrichten" #. Description #: ../libslp1.templates:12 msgid "" "You don't seem to have a multicast route configured. OpenSLP can take " "advantage of multicast packets and reduce traffic on your network. You can " "setup a multicast route automatically on system startup by adding the " "following commands to the \"interface\" line(s) in your /etc/network/" "interfaces file." msgstr "" "Sie haben scheinbar keine Multicast-Route eingerichtet. OpenSLP kann die " "Vorteile von Multicast-Paketen nutzen und den Netzwerkverkehr verringern. " "Sie können automatisch bei jedem Systemstart eine Multicast-Route setzen " "lassen, wenn Sie die folgenden Kommandos an die Zeile(n) \"interface\" in " "Ihrer Datei /etc/network/interfaces anfügen." #. Description #: ../libslp1.templates:12 msgid "\" up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "\" up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" #. Description #: ../libslp1.templates:12 msgid "\" down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "\" down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" openslp-1.2.1/debian/po/sv.po0000644033442200000310000000601610641470757015726 0ustar rganesanfloppy# # Translators, if you are not familiar with the PO format, gettext # documentation is worth reading, especially sections dedicated to # this format, e.g. by running: # info -n '(gettext)PO Files' # info -n '(gettext)Header Entry' # # Some information specific to po-debconf are available at # /usr/share/doc/po-debconf/README-trans # or http://www.debian.org/intl/l10n/po-debconf/README-trans # # Developers do not need to manually edit POT or PO files. # msgid "" msgstr "" "Project-Id-Version: openslp 1.2.1-3\n" "POT-Creation-Date: 2003-04-06 17:12-0300\n" "PO-Revision-Date: 2005-11-09 01:27+0100\n" "Last-Translator: Daniel Nylander \n" "Language-Team: Swedish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: swe\n" "X-Poedit-Country: swe\n" #. Description #: ../libslp1.templates:3 msgid "To reduce network traffic use a IP multicast enabled kernel" msgstr "För att minska nätverkstrafik, använd en IP-multicast aktiverad kärna" #. Description #: ../libslp1.templates:3 msgid "" "The kernel version that you are currently running does not appear to support " "IP multicast. OpenSLP will continue to work even without multicast support " "in the kernel by using broadcasts. However, broadcasts are less efficient on " "the network, so please consider upgrading to a multicast enabled kernel." msgstr "" "Kärnans version som du för närvarande kör verkar inte ha stöd för IP-" "multicast. OpenSLP kan fortsätta att fungera även utan stöd för multicast i " "kärnan genom att använda broadcasts. Dock är broadcasts mindre effektivt pÃ¥ " "nätverket sÃ¥ du bör fundera pÃ¥ att uppgradera till en kärna där multicast är " "aktiverat." #. Description #: ../libslp1.templates:12 msgid "Please configure a multicast route in /etc/network/interfaces" msgstr "Vänligen konfigurera en multicast-rutt i /etc/network/interfaces" #. Description #: ../libslp1.templates:12 msgid "" "You don't seem to have a multicast route configured. OpenSLP can take " "advantage of multicast packets and reduce traffic on your network. You can " "setup a multicast route automatically on system startup by adding the " "following commands to the \"interface\" line(s) in your /etc/network/" "interfaces file." msgstr "" "Du verkar inte ha en multicast-rutt konfigurerad. OpenSLP kan dra nytta av " "multicastpaket och minska trafiken pÃ¥ ditt nätverk. Du kan ställa in en " "multicast-rutt automatiskt vid systemets uppstart genom att lägga till " "följande kommandon till rad(erna) med \"interface\" i din fil /etc/network/" "interfaces." #. Description #: ../libslp1.templates:12 msgid "\" up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "\" up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" #. Description #: ../libslp1.templates:12 msgid "\" down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "\" down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" openslp-1.2.1/debian/po/ca.po0000644033442200000310000000532610641470757015664 0ustar rganesanfloppy# openslp (debconf) translation to Catalan. # Copyright (C) 2004 Free Software Foundation, Inc. # Aleix Badia i Bosch , 2004 # msgid "" msgstr "" "Project-Id-Version: openslp_1.0.11-7_templates\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2003-07-20 11:44+0200\n" "PO-Revision-Date: 2004-03-05 19:46GMT\n" "Last-Translator: Aleix Badia i Bosch \n" "Language-Team: Catalan \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit" #. Description #: ../libslp1.templates:3 msgid "To reduce network traffic use a IP multicast enabled kernel" msgstr "" "Per reduir el tràfic de la xarxa utilitzeu un nucli amb l'opció de difusió " "selectiva d'IP habilitada" #. Description #: ../libslp1.templates:3 msgid "" "The kernel version that you are currently running does not appear to support " "IP multicast. OpenSLP will continue to work even without multicast support " "in the kernel by using broadcasts. However, broadcasts are less efficient on " "the network, so please consider upgrading to a multicast enabled kernel." msgstr "" "Aparentment la versió del nucli que esteu executant no suporta la difusió " "selectiva d'IP. L'OpenSLP continuarà funcionant utilitzant difusió tot i no " "disposar del suport per la difusió selectiva. Considereu la possibilitat " "d'utilitzar un nucli amb l'opció de difusió habilitada ja que resulta més " "eficient." #. Description #: ../libslp1.templates:12 msgid "Please configure a multicast route in /etc/network/interfaces" msgstr "" "Configureu una ruta de difusió selectiva al fitxer /etc/network/interfaces" #. Description #: ../libslp1.templates:12 msgid "" "You don't seem to have a multicast route configured. OpenSLP can take " "advantage of multicast packets and reduce traffic on your network. You can " "setup a multicast route automatically on system startup by adding the " "following commands to the \"interface\" line(s) in your /etc/network/" "interfaces file." msgstr "" "Aparentment no teniu configurada una ruta de difusió selectiva. L'OpenSLP " "pot aprofitar els paquets de difusió selectiva i reduir el tràfic de la " "xarxa. Podeu configurar automàticament una ruta de difusió selectiva a " "l'arrencada afegint les ordres següents a la línia \"interface\" del fitxer /" "etc/network/interfaces." #. Description #: ../libslp1.templates:12 msgid "\" up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "\" up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" #. Description #: ../libslp1.templates:12 msgid "\" down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "\" down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" openslp-1.2.1/debian/po/ru.po0000644033442200000310000000650310641470757015725 0ustar rganesanfloppy# translation of openslp_1.2.1-6_debconf_ru.po to Russian # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Yuri Kozlov , 2007. msgid "" msgstr "" "Project-Id-Version: 1.2.1-6\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2003-04-06 17:12-0300\n" "PO-Revision-Date: 2007-01-07 12:51+0300\n" "Last-Translator: Yuri Kozlov \n" "Language-Team: Russian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" "10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #. Description #: ../libslp1.templates:3 msgid "To reduce network traffic use a IP multicast enabled kernel" msgstr "Ð”Ð»Ñ ÑƒÐ¼ÐµÐ½ÑŒÑˆÐµÐ½Ð¸Ñ Ñетевого трафика включите в Ñдре IP multicast" #. Description #: ../libslp1.templates:3 msgid "" "The kernel version that you are currently running does not appear to support " "IP multicast. OpenSLP will continue to work even without multicast support " "in the kernel by using broadcasts. However, broadcasts are less efficient on " "the network, so please consider upgrading to a multicast enabled kernel." msgstr "" "Ð’ работающем Ñдре нет поддержки IP multicast. OpenSLP будет работать даже " "без поддержки мультикаÑтинга в Ñдре, иÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÑ ÑˆÐ¸Ñ€Ð¾ÐºÐ¾Ð²ÐµÑ‰Ð°Ñ‚ÐµÐ»ÑŒÐ½Ñ‹Ðµ пакеты. " "Однако широковещательные пакеты менее Ñффективны в Ñети, поÑтому попробуйте " "обновить Ñдро, в котором еÑть поддержка мультикаÑтинга." #. Description #: ../libslp1.templates:12 msgid "Please configure a multicast route in /etc/network/interfaces" msgstr "ÐаÑтройте мультикаÑтовый маршрут в /etc/network/interfaces" #. Description #: ../libslp1.templates:12 msgid "" "You don't seem to have a multicast route configured. OpenSLP can take " "advantage of multicast packets and reduce traffic on your network. You can " "setup a multicast route automatically on system startup by adding the " "following commands to the \"interface\" line(s) in your /etc/network/" "interfaces file." msgstr "" "КажетÑÑ, у Ð²Ð°Ñ Ð½Ðµ наÑтроен мультикаÑтовый маршрут. OpenSLP может " "иÑпользовать преимущеÑтва мультикаÑтовых пакетов и уменьшить трафик в вашей " "Ñети. Ð’Ñ‹ можете наÑтраивать мультикаÑтовый маршрут в при запуÑке ÑиÑтемы " "автоматичеÑки, добавив Ñледующие команды в Ñтроку(и) \"interface\" в файл /" "etc/network/interfaces." #. Description #: ../libslp1.templates:12 msgid "\" up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "\" up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" #. Description #: ../libslp1.templates:12 msgid "\" down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "\" down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" openslp-1.2.1/debian/po/pt_BR.po0000644033442200000310000000604110641470757016302 0ustar rganesanfloppy# # Translators, if you are not familiar with the PO format, gettext # documentation is worth reading, especially sections dedicated to # this format, e.g. by running: # info -n '(gettext)PO Files' # info -n '(gettext)Header Entry' # # Some information specific to po-debconf are available at # /usr/share/doc/po-debconf/README-trans # or http://www.debian.org/intl/l10n/po-debconf/README-trans # # Developers do not need to manually edit POT or PO files. # msgid "" msgstr "" "Project-Id-Version: openslp_1.0.10-4\n" "POT-Creation-Date: 2003-04-06 17:12-0300\n" "PO-Revision-Date: 2003-04-06 17:20-0300\n" "Last-Translator: André Luís Lopes \n" "Language-Team: Debian-BR Project \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Description #: ../libslp1.templates:3 msgid "To reduce network traffic use a IP multicast enabled kernel" msgstr "" "Para reduzir o tráfego de rede use um kernel com IP multicast habilitado." #. Description #: ../libslp1.templates:3 msgid "" "The kernel version that you are currently running does not appear to support " "IP multicast. OpenSLP will continue to work even without multicast support " "in the kernel by using broadcasts. However, broadcasts are less efficient on " "the network, so please consider upgrading to a multicast enabled kernel." msgstr "" "A versão do kernel que você está executando atualmente não parece suportar " "multicast IP. O OpenSLP continuará a funcionar mesmo sem o suporte a " "multicast no kernel usando broadcasts. Porém, broadcasts são menos " "eficientes na rede, portanto por favor considere atulizar para um kernel com " "suporte a multicast habilitado." #. Description #: ../libslp1.templates:12 msgid "Please configure a multicast route in /etc/network/interfaces" msgstr "Por favor configure uma rota multicast em /etc/network/interfaces" #. Description #: ../libslp1.templates:12 msgid "" "You don't seem to have a multicast route configured. OpenSLP can take " "advantage of multicast packets and reduce traffic on your network. You can " "setup a multicast route automatically on system startup by adding the " "following commands to the \"interface\" line(s) in your /etc/network/" "interfaces file." msgstr "" "Parece que você não possui uma rota multicast configurada. O OpenSLP pode " "tirar vantagem de pacotes multicast e reduzir o tráfego em sua rede. Você " "pode configurar uma rota multicast automaaticamente na inicilização do " "sistema adicionado os seguintes comandos para a(s) linha(s) \"interface\" em " "seu arquivo /etc/network/interfaces." #. Description #: ../libslp1.templates:12 msgid "\" up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "\" up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" #. Description #: ../libslp1.templates:12 msgid "\" down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "\" down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" openslp-1.2.1/debian/po/cs.po0000644033442200000310000000572110641470757015705 0ustar rganesanfloppy# # Translators, if you are not familiar with the PO format, gettext # documentation is worth reading, especially sections dedicated to # this format, e.g. by running: # info -n '(gettext)PO Files' # info -n '(gettext)Header Entry' # # Some information specific to po-debconf are available at # /usr/share/doc/po-debconf/README-trans # or http://www.debian.org/intl/l10n/po-debconf/README-trans # # Developers do not need to manually edit POT or PO files. # msgid "" msgstr "" "Project-Id-Version: openslp 1.0.11a-2\n" "POT-Creation-Date: 2003-04-06 17:12-0300\n" "PO-Revision-Date: 2005-05-28 12:25+0200\n" "Last-Translator: Martin Sin \n" "Language-Team: Czech \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Description #: ../libslp1.templates:3 msgid "To reduce network traffic use a IP multicast enabled kernel" msgstr "Pro snížení provozu na síti použijte jádro s povoleným IP multicastem." #. Description #: ../libslp1.templates:3 msgid "" "The kernel version that you are currently running does not appear to support " "IP multicast. OpenSLP will continue to work even without multicast support " "in the kernel by using broadcasts. However, broadcasts are less efficient on " "the network, so please consider upgrading to a multicast enabled kernel." msgstr "" "Zdá se, že verze jádra, kterou právÄ› používáte, nepodporuje IP multicast. " "OpenSLP bude fungovat i bez podpory multicastu v jádÅ™e a to použitím " "broadcastu. Pamatujte, že broadcast je v síti ménÄ› uÄinný, proto zvažte " "aktualizaci na jádro s podporu multicastu." #. Description #: ../libslp1.templates:12 msgid "Please configure a multicast route in /etc/network/interfaces" msgstr "Nastavte smÄ›rování multicastu v souboru /etc/network/interfaces" #. Description #: ../libslp1.templates:12 msgid "" "You don't seem to have a multicast route configured. OpenSLP can take " "advantage of multicast packets and reduce traffic on your network. You can " "setup a multicast route automatically on system startup by adding the " "following commands to the \"interface\" line(s) in your /etc/network/" "interfaces file." msgstr "" "Nezdá se, že byste mÄ›li nastavené smÄ›rování multicastu. OpenSLP může využít " "multicastové pakety a snížit tak provoz ve vaší síti. Chcete-li nastavit " "smÄ›rování multicastu automaticky pÅ™i zavádÄ›ní systému, staÄí pÅ™idat " "následující příkazy k řádkům \"interfaces\" v souboru /etc/network/" "interfaces." #. Description #: ../libslp1.templates:12 msgid "\" up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "\" up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" #. Description #: ../libslp1.templates:12 msgid "\" down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" msgstr "\" down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0\"" openslp-1.2.1/debian/slpd.80000644033442200000310000000313710641470757015354 0ustar rganesanfloppy.TH slpd 8 "Sep 08 2001" "OpenSLP 1.0.1" .SH NAME slpd \- SLPv2 Service Agent (SA)/Directory Agent (DA) .SH SYNOPSIS .B /usr/sbin/slpd .B [\-d] .B [\-c configfile] .B [\-r registrationfile] .B [\-l logfile] .B [\-p pidfile] .B .SH DESCRIPTION .LP .B slpd is an SLPv2 compliant Service Agent and (optionally) Directory Agent. It listens for SLP requests on port 427, responding to the SLP User Agents and (when running as a DA) Service Agents. .B slpd is typically invoked at boot time, usually out of .B /etc/init.d/slpd . .SH OPTIONS .TP .BI \-d Don't detach from the controlling tty .TP .BI \-f " configfile" Use configfile as the file slpd reads to obtain configuration information, rather than the default, .B /etc/slpd.conf . .TP .BI \-r " registrationfile" Use registrationfile as the file that slpd reads to obtain static registrations, rather than the default, .BR /etc/slpd.rej . .TP .BI \-l " logfile" Use logfile as the file that slpd reads to write log messages, rather than the default, .B /var/log/slpd.log. .TP .BI \-p " pidfile" Use pidfile as the file that holds the slpd process id, rather than the default, .B /var/run/slpd.pid. .SH SEE ALSO "OpenSLP User's Guide" .SH NOTES This man page was written for the Debian project by Debian Developer Ganesan Rajagopal (rganesan@debian.org). You should refer to the online html documentation in the .BR openslp-doc package for more complete and up-to-date information. .SH BUGS http://sourceforge.net/tracker/?group_id=1730&atid=101730 .SH ACKNOWLEDGEMENTS .B OpenSLP is developed and maintained by The OpenSLP Project (http://www.openslp.org/). openslp-1.2.1/debian/docs0000644033442200000310000000003310641470757015164 0ustar rganesanfloppyNEWS README AUTHORS THANKS openslp-1.2.1/debian/libslp1.postinst0000644033442200000310000000023710641470757017472 0ustar rganesanfloppy#!/bin/sh # Source debconf library. . /usr/share/debconf/confmodule if [ "$1" = "configure" ] then ldconfig /usr/lib/libslp.so.1 fi #DEBHELPER# exit 0 openslp-1.2.1/debian/libslp1.templates0000644033442200000310000000172410641470757017607 0ustar rganesanfloppyTemplate: libslp1/multicast Type: error _Description: To reduce network traffic use a IP multicast enabled kernel The kernel version that you are currently running does not appear to support IP multicast. OpenSLP will continue to work even without multicast support in the kernel by using broadcasts. However, broadcasts are less efficient on the network, so please consider upgrading to a multicast enabled kernel. Template: libslp1/multicast-route Type: error _Description: Please configure a multicast route in /etc/network/interfaces You don't seem to have a multicast route configured. OpenSLP can take advantage of multicast packets and reduce traffic on your network. You can setup a multicast route automatically on system startup by adding the following commands to the "interface" line(s) in your /etc/network/interfaces file. . " up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0" . " down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0" openslp-1.2.1/debian/openslp-doc.doc-base.programmersguide0000644033442200000310000000053210641470757023512 0ustar rganesanfloppyDocument: openslp-programmersguide Title: OpenSLP Programmer's Guide Author: Matt Peterson Abstract: This is a programmer's guide for OpenSLP. It describes all the SLP APIs. Section: Apps/Programming Format: HTML Index: /usr/share/doc/openslp-doc/html/ProgrammersGuide/index.html Files: /usr/share/doc/openslp-doc/html/ProgrammersGuide/*.html openslp-1.2.1/debian/rules0000755033442200000310000000551210641470757015400 0ustar rganesanfloppy#!/usr/bin/make -f # Comment this to turn off verbose mode. export DH_VERBOSE=1 # This has to be exported to make some magic below work. export DH_OPTIONS # shared library versions, option 1 version=1.0.1 major=1 DEB_BUILD_GNU_CPU ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU) DEB_BUILD_GNU_SYSTEM ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) ifeq ($(DEB_BUILD_GNU_SYSTEM),kfreebsd-gnu) DEB_BUILD_GNU_TYPE := $(DEB_BUILD_GNU_CPU)-gnu endif ifeq ($(DEB_BUILD_GNU_SYSTEM),knetbsd-gnu) DEB_BUILD_GNU_TYPE := $(DEB_BUILD_GNU_CPU)-gnu endif build: build-stamp build-stamp: dh_testdir cp -f /usr/share/misc/config.guess /usr/share/misc/config.sub . touch Makefile.in # work around patch timestamp problems ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \ --prefix=/usr --mandir=\$${prefix}/share/man \ --infodir=\$${prefix}/share/info --enable-slpv1 \ --enable-async-api $(DEB_BUILD_GNU_TYPE) # Compile the package. $(MAKE) touch build-stamp clean: dh_testdir dh_testroot # Clean up after the build process. -$(MAKE) distclean rm -f build-stamp config.status dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Install the package into debian/tmp. $(MAKE) install DESTDIR=`pwd`/debian/tmp # Build architecture-independent files here. binary-indep: dh_testdir -i dh_testroot -i dh_installdocs -i -XCVS dh_installchangelogs -i ChangeLog dh_compress -i dh_installdeb -i dh_gencontrol -i dh_md5sums -i dh_builddeb -i # Build architecture-dependent files here. binary-arch: build install dh_testdir -a dh_testroot -a dh_installinit -a dh_installdocs -a -XCVS # build libslp${major} package by moving files from slpd package dh_movefiles -plibslp$(major) \ usr/lib/libslp.so.$(major) \ usr/lib/libslp.so.$(version) # build libslp-dev package by moving files from slpd package dh_movefiles -plibslp-dev usr/include usr/lib # build slptool package by moving files from slpd package dh_movefiles -pslptool usr/bin/slptool # Remove the installed html documentation (we'll pull it in by # install-docs) into openslp-doc package rm -rf debian/tmp/usr/doc # remove empty directories in slpd package rmdir debian/tmp/usr/include rmdir debian/tmp/usr/lib dh_installexamples -a # dh_installmenu # dh_installcron dh_installdebconf -a dh_installman -pslpd debian/slpd.8 dh_installman -pslptool debian/slptool.1 dh_installchangelogs -a ChangeLog dh_link -a dh_strip -a dh_compress -a dh_fixperms -a dh_makeshlibs -a dh_installdeb -a dh_shlibdeps -a dh_gencontrol -a dh_md5sums -a dh_builddeb -a binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install openslp-1.2.1/debian/slptool.10000644033442200000310000000336410641470757016101 0ustar rganesanfloppy.TH slptool 1 "Sep 08 2001" "OpenSLP 1.0.1" .SH NAME slptool \- SLP command line tool .SH SYNOPSIS .B /usr/bin/slpd .B [\-v|\-\-version] .B [\-s|\-\-scope scopes] .B [\-l|\-\-language languagetag] .B [command [arguments]] .B .SH DESCRIPTION .LP .B slptool is a command line tool to make SLPv2 User Agent (UA) requests. It can be used for SLP lookup/advertisement in shell scripts or as a diagnostic tool. .SH OPTIONS .TP .BI \-v|\-\-version displays version of slptool and OpenSLP. .TP .BI \-s|\-\-scope " scopes" .I scopes is a comma separated list of scopes applicable for the command. .TP .BI [\-l|\-\-language " languagetag" .I languagetag is the language tag to be used for the command. .TP .BI findsrvs " service\-type [filter]" .TP .BI findattrs " url [attrids]" .TP .BI findsrvtypes " [authority] " .TP .BI findscopes .TP .BI register " url [attrs]" .TP .BI deregister " url" .TP .BI getproperty " propertyname" .SH EXAMPLES slptool register service:myserv.x://myhost.com "(attr1=val1),(attr2=val2)" .LP slptool findsrvs service:myserv.x .LP slptool findsrvs service:myserv.x "(attr1=val1)" .LP slptool findattrs service:myserv.x://myhost.com .LP slptool findattrs service:myserv.x://myhost.com attr1 .LP slptool deregister service:myserv.x://myhost.com .LP slptool getproperty net.slp.useScopes .SH SEE ALSO "OpenSLP User's Guide" .SH NOTES This man page was written for the Debian project by Debian Developer Ganesan Rajagopal (rganesan@debian.org). You should refer to the online html documentation in the .BR openslp-doc package for more complete and up-to-date information. .SH BUGS http://sourceforge.net/tracker/?group_id=1730&atid=101730 .SH ACKNOWLEDGEMENTS .B OpenSLP is developed and maintained by The OpenSLP Project (http://www.openslp.org/). openslp-1.2.1/debian/control0000644033442200000310000000661510641470757015730 0ustar rganesanfloppySource: openslp Section: net Priority: extra Maintainer: Ganesan Rajagopal Build-Depends: debhelper (>= 4.1.26), debconf | debconf-2.0, autotools-dev Build-Conflicts: libssl-dev Standards-Version: 3.6.2 Package: slpd Section: net Priority: extra Architecture: any Depends: ${shlibs:Depends} Suggests: openslp-doc (= ${Source-Version}) Description: OpenSLP Server (slpd) Service Location Protocol is an IETF standard protocol that is used to discover/advertise services on the network. You can use SLP for anything from locating a suitable printer on your floor to discovering what LDAP directories are available in your organization. This package provides slpd, the OpenSLP daemon, which provides an SLPv2 (RFC 2608) compliant Service Agent and Directory Agent. Package: openslp-doc Section: doc Priority: extra Architecture: all Description: OpenSLP documentation Service Location Protocol is an IETF standard protocol that is used to discover/advertise services on the network. You can use SLP for anything from locating a suitable printer on your floor to discovering what LDAP directories are available in your organization. This package provides comprehensive documentation on SLP and the OpenSLP implementation; it contains an Introduction to SLP, a User's Guide, a Programmer's Guide and related RFCs. Package: libslp1 Section: libs Priority: optional Architecture: any Depends: ${shlibs:Depends}, debconf | debconf-2.0, net-tools Suggests: slpd (= ${Source-Version}), openslp-doc (= ${Source-Version}) Description: OpenSLP libraries Service Location Protocol is an IETF standard protocol that is used to discover/advertise services on the network. You can use SLP for anything from locating a suitable printer on your floor to discovering what LDAP directories are available in your organization. This package provides the OpenSLP run-time library package that is linked to SLP aware applications. This library implements RFC 2614 - An API for Service Location. Unless there is a SLP DA in the network, you must install the slpd package to be able to advertise the services. Package: slptool Section: utils Priority: extra Architecture: any Depends: libslp1 (= ${Source-Version}) Suggests: openslp-doc (= ${Source-Version}) Description: SLP command line tool Service Location Protocol is an IETF standard protocol that is used to discover/advertise services on the network. You can use SLP for anything from locating a suitable printer on your floor to discovering what LDAP directories are available in your organization. This package contains the a utility which you can use to exercise/test SLP. Package: libslp-dev Section: libdevel Priority: extra Architecture: any Depends: libslp1 (= ${Source-Version}), libc6-dev Suggests: openslp-doc (= ${Source-Version}) Conflicts: libxdelta3-dev Description: OpenSLP development libraries Service Location Protocol is an IETF standard protocol that is used to discover/advertise services on the network. You can use SLP for anything from locating a suitable printer on your floor to discovering what LDAP directories are available in your organization. This package allows development of SLP applications using the OpenSLP libraries. It includes headers, libraries and links to allow static and dynamic linking. It also includes slptool, a utility to test service advertisement/lookup. The library implements RFC 2614 - An API for Service Location. openslp-1.2.1/debian/openslp-doc.docs0000644033442200000310000000015410641470757017412 0ustar rganesanfloppyNEWS README AUTHORS THANKS doc/html doc/rfc/srvreg-integrity.txt doc/rfc/threat_analysis_min_security.html openslp-1.2.1/debian/libslp1.postrm0000644033442200000310000000014110641470757017125 0ustar rganesanfloppy#!/bin/sh if [ "$1" = "remove" ] then ldconfig /usr/lib/libslp.so.1 fi #DEBHELPER# exit 0 openslp-1.2.1/debian/openslp-doc.doc-base.usersguide0000644033442200000310000000042010641470757022311 0ustar rganesanfloppyDocument: openslp-usersguide Title: OpenSLP User's Guide Author: Matt Peterson Abstract: This the user guide for OpenSLP. Section: Apps/Net Format: HTML Index: /usr/share/doc/openslp-doc/html/UsersGuide/index.html Files: /usr/share/doc/openslp-doc/html/UsersGuide/*.html openslp-1.2.1/debian/libslp-dev.docs0000644033442200000310000000003410641470757017225 0ustar rganesanfloppyNEWS README AUTHORS THANKS openslp-1.2.1/debian/changelog0000644033442200000310000003104210641470757016167 0ustar rganesanfloppyopenslp (1.2.1-6.2) unstable; urgency=low * Non-maintainer upload to fix a forgotten l10n issue in last NMU. * Debconf translations: - Spanish. Closes: #402352 - Convert all translations to UTF-8 -- Christian Perrier Sun, 25 Feb 2007 09:27:26 +0100 openslp (1.2.1-6.1) unstable; urgency=low * Non-maintainer upload to fix pending l10n issues. * Turn the debconf notes into error type. Closes: #388919 * Debconf translations: - Portuguese. Closes: #408184 - Russian. Closes: #405906 - Galician. Closes: #407271 -- Christian Perrier Sun, 18 Feb 2007 18:54:11 +0100 openslp (1.2.1-6) unstable; urgency=low * Remove debconf dependency in postrm. (Closes: #387951). * Remove bashisms in debian/rules. (Closes: #375632). * Included Swedish debconf templates translation. (Closes: #338257). * Updated Dutch debconf templates translation. (Closes: #363038). -- Ganesan Rajagopal Mon, 18 Sep 2006 13:24:49 +0530 openslp (1.2.1-5) unstable; urgency=low * SLPv2 security is not widely used and configure.in unconditionally checks for libcrypto. Change libssl-dev Build-Depends to a Build-Conflicts to avoid dependency on libcrypto. (Closes: #337606) -- Ganesan Rajagopal Wed, 28 Dec 2005 09:50:29 +0530 openslp (1.2.1-4) unstable; urgency=low * Add Build-Depends for libssl-dev (Closes: #337606) -- Ganesan Rajagopal Thu, 10 Nov 2005 16:31:24 +0530 openslp (1.2.1-3) unstable; urgency=low * Add debconf-2.0 as an alternate for debconf dependency. * Removed DH_COMPAT version 1 in rules file. * Updated rules file to be cross compilation friendly. * Updated standards version. -- Ganesan Rajagopal Sat, 13 Aug 2005 09:47:40 +0530 openslp (1.2.1-2) unstable; urgency=low * Remove left over patch from 1.0.11a version. -- Ganesan Rajagopal Wed, 29 Jun 2005 09:57:29 +0530 openslp (1.2.1-1) unstable; urgency=low * New upstream release * Fixed typos in package description (Closes: #299998, #300002, #300027, #300030, #300032). * Included Czech debconf template translation (Closes: #311098). * Updated shared library version in debian/rules. -- Ganesan Rajagopal Tue, 28 Jun 2005 11:38:35 +0530 openslp (1.0.11a-2) unstable; urgency=high * Apply patches from SuSE openslp-1.1.5-73.15.src.rpm to fix several buffer overflows and out-of-bounds memory access (Closes: #299846). -- Ganesan Rajagopal Thu, 17 Mar 2005 18:44:25 +0530 openslp (1.0.11a-1) unstable; urgency=low * Sanitized sources by removing CVS cruft and updating slpd.all_init from latest CVS version (Closes: #279973). * Applied patch from Robert Millan to fix OpenSLP build for GNU/kFreeBSD (Closes: #262184). * Included Danish debconf template translation (Closes: #245088). * Included Catalan debconf template translation (Closes: #248746). * Included German debconf template translation (Closes: #264609). * Do igmp multicast check only for Linux kernel (Closes: #266675). * Check for proc/net before igmp multicast check (Closes: #251004). * Updated to standards version 3.6.1. -- Ganesan Rajagopal Wed, 2 Feb 2005 14:53:49 +0530 openslp (1.0.11-7) unstable; urgency=low * Re-introduce Conflicts for libxdelta3-dev because it may break upgrade from woody (Closes: #228356). -- Ganesan Rajagopal Fri, 5 Mar 2004 10:49:05 +0530 openslp (1.0.11-6) unstable; urgency=medium * Removed Conflicts for libxdelta3-dev. It's no longer in the archive. * Fix segfault when prlist is overflowed (Closes: #222649). -- Ganesan Rajagopal Fri, 5 Dec 2003 17:13:54 +0530 openslp (1.0.11-5) unstable; urgency=low * Remove "| hurd | freebsd" from dependency list because GNU/Hurd and GNU/KFreeBSD now have a package providing net-tools (Closes: #217283). -- Ganesan Rajagopal Tue, 4 Nov 2003 13:38:21 +0530 openslp (1.0.11-4) unstable; urgency=low * Work-around timestamp skew problems for files patched from diff.gz on m68k (Closes: #201888). -- Ganesan Rajagopal Wed, 30 Jul 2003 16:20:58 +0530 openslp (1.0.11-3) unstable; urgency=low * Relaxed net-tools dependency for libslp1 by applying patch from Robert Millan (Closes: #201455). * Use updated config.{guess,sub} from autotools-dev. This helps the GNU/FreeBSD port. Patch from Robert Millan (Closes: #195924). * Removed RFCs from the doc package (Closes: #199813). * Included French debconf templates update. Patch by Christian Perrier , proofread by debian-l10n-french mailing list contributors (Closes: #192250). * Bumped up standards version. -- Ganesan Rajagopal Fri, 18 Jul 2003 11:20:58 +0530 openslp (1.0.11-2) unstable; urgency=low * Added a dependency on net-tools for libslp1 (Closes: #193047) * Fixed build so that doc packages are built in binary-indep rule (Closes: #181453) -- Ganesan Rajagopal Wed, 13 May 2003 12:08:58 +0530 openslp (1.0.11-1) unstable; urgency=low * New upstream release. * Included patch from Andre Luis Lopes to move to po-debconf (Closes: #187895, #186328). * Removed prompting for multicast route (Closes: #173675). * Moved slptool into it's own package (Closes: #173675). * Bumped up standards version to 3.5.9.0. -- Ganesan Rajagopal Wed, 26 Apr 2003 17:13:08 +0530 openslp (1.0.10-4) unstable; urgency=low * autoreconf run on the source tree to get updated configure script (This is to fix build breakage on mipsel) (Closes: #180100). -- Ganesan Rajagopal Wed, 07 Feb 2003 14:16:08 +0530 openslp (1.0.10-3) unstable; urgency=low * Turning off --enable-slpv2-security because of licensing issues with KDE (Closes: #179825). * Use debconf for prompting (Closes: #171990). * Update config.guess and config.sub from autotools-dev version 20030110.1. -- Ganesan Rajagopal Wed, 05 Feb 2003 11:35:08 +0530 openslp (1.0.10-2) unstable; urgency=low * Argh. I can't believe I screwed up on config.{guess,sub} again. Especially, since I updated upstream CVS to the latest version. Updated config.{guess,sub} again from upstream CVS. (Closes: #172502). -- Ganesan Rajagopal Thu, 12 Dec 2002 09:11:38 +0530 openslp (1.0.10-1) unstable; urgency=low * New upstream release. * Enabled security and asyncapi (Closes: #163033). -- Ganesan Rajagopal Thu, 5 Dec 2002 14:41:00 +0530 openslp (1.0.9-3) unstable; urgency=low * Removed CVS directories from openslp-doc package (thanks to Joey Hess joyeh@debian.org for pointing out the problem). -- Ganesan Rajagopal Mon, 18 May 2002 12:09:38 +0530 openslp (1.0.9-2) unstable; urgency=high * Fixed really bad bug which rendered OpenSLP literally unusable. -- Ganesan Rajagopal Mon, 16 May 2002 09:33:58 +0530 openslp (1.0.9-1) unstable; urgency=low * New upstream version. * Changed multicast kernel detection to check the presence of /proc/net/igmp instead of /boot/config-* (Closes: #134974). * Changed message to add multicast route (Closes: #145598, #140380). -- Ganesan Rajagopal Mon, 13 May 2002 13:56:03 +0530 openslp (1.0.8a-3) unstable; urgency=high * Change libslp1 priority to optional (Closes: #145058). Increasing urgency to high to get this into Woody. RM: This is the only change in this package to fix a last minute bug because of policy violation. -- Ganesan Rajagopal Mon, 30 Apr 2002 08:15:34 +0530 openslp (1.0.8a-2) unstable; urgency=low * Change libslp1 dependency on slpd to suggests (Closes: #138466). * Partially fix multicast checks doing install. -- Ganesan Rajagopal Wed, 13 Mar 2002 14:27:16 +0530 openslp (1.0.8a-1) unstable; urgency=low * New upstream release -- Ganesan Rajagopal Tue, 5 Mar 2002 11:11:16 +0530 openslp (1.0.7-1) unstable; urgency=low * New upstream release -- Ganesan Rajagopal Fri, 08 Feb 2002 08:39:14 +0530 openslp (1.0.6-3) unstable; urgency=low * Fixed URL in manpages (was pointing to www.openldap.org!). -- Ganesan Rajagopal Sat, 05 Jan 2002 13:27:22 +0530 openslp (1.0.6-2) unstable; urgency=low * Added AUTHORS file to the package. -- Ganesan Rajagopal Wed, 26 Dec 2001 08:27:22 +0530 openslp (1.0.6-1) unstable; urgency=low * New upstream release -- Ganesan Rajagopal Sat, 15 Dec 2001 12:49:14 +0530 openslp (1.0.5-1) unstable; urgency=low * New upstream release * libslp-dev now conflicts libxdelta3-dev because /usr/include/slp.h exists in both packages. (Closes: #115460, #115461) -- Ganesan Rajagopal Sat, 24 Nov 2001 12:52:28 +0530 openslp (1.0.4-1) unstable; urgency=low * New upstream release * Added /etc/slp.spi as a conf file * Fixed lintian warning about unsafe ldconfig in libslp1 postinst. -- Ganesan Rajagopal Tue, 30 Oct 2001 16:28:16 +0530 openslp (1.0.3-1) unstable; urgency=low * New upstream release * Updated config.{guess,sub} from ftp://ftp.gnu.org/pub/gnu/config (Closes: #115013) -- Ganesan Rajagopal Fri, 12 Oct 2001 13:58:58 +0530 openslp (1.0.2-2) unstable; urgency=low * Updated package descriptions so that they're .. well, more descriptive. (Closes: #113107) -- Ganesan Rajagopal Sat, 22 Sep 2001 08:14:24 +0530 openslp (1.0.2-1) unstable; urgency=low * New upstream release -- Ganesan Rajagopal Thu, 13 Sep 2001 08:44:24 +0530 openslp (1.0.1-3) unstable; urgency=low * Fixed section and priority of packages. * libslp1 now recommends slpd. * Removed CVS stuff from debian directory. * Man pages for slptool and slpd (no open bugs). * Build-Depends-Indep changed to Build-Depends (Closes: #111870). -- Ganesan Rajagopal Tue, 11 Sep 2001 08:55:59 +0530 openslp (1.0.1-2) unstable; urgency=low * First official debian upload, I am now a debian Developer :-). Closes: #83228 * Removed config.cache after build to avoid lintian error. * Modified "Upstream Author(s)" in copyright file to shutup lintian. * Removed ldconfig call in libslp1.postinst (lintian warning). * Changed maintainer field to rganesan@debian.org. -- Ganesan Rajagopal Wed, 05 Sep 2001 18:13:08 +0530 openslp (1.0.1-1) unstable; urgency=low * New upstream version. * Updated to standards version 3.5.6.0 * Changed download location from download.sourceforge.net to prdownloads.sourceforge.net -- Ganesan Rajagopal Thu, 08 Aug 2001 10:10:55 +0530 openslp (1.0.0-1) unstable; urgency=low * New upstream version. * Updated to standards version 3.5.5.0 -- Ganesan Rajagopal Thu, 02 Aug 2001 23:38:30 +0530 openslp (0.8.3-3) unstable; urgency=low * Cleanup the debian/rules. * Added Build-Depends and updated Standards-Version to 3.5.2 -- Ganesan Rajagopal Wed, 13 Apr 2001 20:45:48 +0530 openslp (0.8.3-2) unstable; urgency=low * Fixed a bug (caused by debhelper) that prevented init scripts from starting up. -- Ganesan Rajagopal Wed, 14 Mar 2001 20:55:48 +0530 openslp (0.8.3-1) unstable; urgency=low * New upstream version. * Removed "set -e" from init.d because it causes problems in upgrading. * Added warning to enable multicast for the interfaces. * Fixed a couple of lintian warnings. -- Ganesan Rajagopal Wed, 14 Mar 2001 14:10:13 +0530 openslp (0.8.2-1) unstable; urgency=low * New upstream version. -- Ganesan Rajagopal Thu, 15 Feb 2001 09:38:30 +0530 openslp (0.8.1-2) unstable; urgency=low * Updated with review comments from Susan G. Kleinmann (sgk@debian.org). New package openslp-doc created. * Added doc-base entries for openslp-doc. * Renamed openslpd package to slpd (based on how openldap2 does this). -- Ganesan Rajagopal Wed, 14 Feb 2001 17:09:53 +0530 openslp (0.8.1-1) unstable; urgency=low * Initial Release. -- Ganesan Rajagopal Sat, 9 Dec 2000 16:18:46 +0530 openslp-1.2.1/debian/preinst0000644033442200000310000000146310641470757015730 0ustar rganesanfloppy#! /bin/sh # preinst script for openslp # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `install' # * `install' # * `upgrade' # * `abort-upgrade' case "$1" in install|upgrade) if [ "$1" = "upgrade" ] then start-stop-daemon --stop --quiet --oknodo \ --pidfile /var/run/slpd.pid \ --exec /usr/sbin/slpd 2>/dev/null || true fi ;; abort-upgrade) ;; *) echo "preinst called with unknown argument \`$1'" >&2 exit 0 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 openslp-1.2.1/debian/libslp1.docs0000644033442200000310000000003310641470757016531 0ustar rganesanfloppyNEWS README AUTHORS THANKS openslp-1.2.1/debian/dirs0000644033442200000310000000001310641470757015173 0ustar rganesanfloppyetc/init.d openslp-1.2.1/debian/conffiles0000644033442200000310000000007110641470757016206 0ustar rganesanfloppy/etc/slp.reg /etc/slp.conf /etc/slp.spi /etc/init.d/slpd openslp-1.2.1/debian/openslp-doc.doc-base.intro0000644033442200000310000000050110641470757021265 0ustar rganesanfloppyDocument: openslp Title: Introduction to SLP Author: Matt Peterson Abstract: This document provides an overview of the Service Location Protocol (SLP). Section: Apps/Net Format: HTML Index: /usr/share/doc/openslp-doc/html/IntroductionToSLP/index.html Files: /usr/share/doc/openslp-doc/html/IntroductionToSLP/*.html openslp-1.2.1/aclocal.m40000644033442200000310000073260210211377450014732 0ustar rganesanfloppy# generated automatically by aclocal 1.8.3 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 # Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # serial 47 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If this macro is not defined by Autoconf, define it here. m4_ifdef([AC_PROVIDE_IFELSE], [], [m4_define([AC_PROVIDE_IFELSE], [m4_ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # AC_PROG_LIBTOOL # --------------- AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. AC_PROVIDE_IFELSE([AC_PROG_CXX], [AC_LIBTOOL_CXX], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX ])]) dnl And a similar setup for Fortran 77 support AC_PROVIDE_IFELSE([AC_PROG_F77], [AC_LIBTOOL_F77], [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 ])]) dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [ifdef([AC_PROG_GCJ], [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([A][M_PROG_GCJ], [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([LT_AC_PROG_GCJ], [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) ])])# AC_PROG_LIBTOOL # _AC_PROG_LIBTOOL # ---------------- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ])# _AC_PROG_LIBTOOL # AC_LIBTOOL_SETUP # ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.50)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl AC_LIBTOOL_SYS_MAX_CMD_LEN AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE AC_LIBTOOL_OBJDIR AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] # Same as above, but do not quote variable references. [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" AC_CHECK_TOOL(AR, ar, false) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes AC_ARG_WITH([pic], [AC_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= AC_LIBTOOL_LANG_C_CONFIG _LT_AC_TAGCONFIG ])# AC_LIBTOOL_SETUP # _LT_AC_SYS_COMPILER # ------------------- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_AC_SYS_COMPILER # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_LINK_IFELSE(AC_LANG_PROGRAM,[ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX # _LT_AC_SHELL_INIT(ARG) # ---------------------- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_AC_SHELL_INIT # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) ])])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_LOCK # ----------- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case "`/usr/bin/file conftest.o`" in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; ]) esac need_locks="$enable_libtool_lock" ])# _LT_AC_LOCK # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED]) AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then $2=yes fi fi $rm conftest* ]) if test x"[$]$2" = xyes; then ifelse([$5], , :, [$5]) else ifelse([$6], , :, [$6]) fi ])# AC_LIBTOOL_COMPILER_OPTION # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD else $2=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then ifelse([$4], , :, [$4]) else ifelse([$5], , :, [$5]) fi ])# AC_LIBTOOL_LINKER_OPTION # AC_LIBTOOL_SYS_MAX_CMD_LEN # -------------------------- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 testring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \ = "XX$testring") >/dev/null 2>&1 && new_result=`expr "X$testring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` testring=$testring$testring done testring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi ])# AC_LIBTOOL_SYS_MAX_CMD_LEN # _LT_AC_CHECK_DLFCN # -------------------- AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl ])# _LT_AC_CHECK_DLFCN # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ------------------------------------------------------------------ AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_unknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi ])# AC_LIBTOOL_DLOPEN_SELF # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* ]) ])# AC_LIBTOOL_PROG_CC_C_O # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) # ----------------------------------------- # Check to see if we can do hard links to lock some files if needed AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl hard_links="nottested" if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS # AC_LIBTOOL_OBJDIR # ----------------- AC_DEFUN([AC_LIBTOOL_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir ])# AC_LIBTOOL_OBJDIR # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) # ---------------------------------------------- # Check hardcoding attributes. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_AC_TAGVAR(hardcode_action, $1)= if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then # We can hardcode non-existant directories. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_AC_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH # AC_LIBTOOL_SYS_LIB_STRIP # ------------------------ AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi ])# AC_LIBTOOL_SYS_LIB_STRIP # AC_LIBTOOL_SYS_DYNAMIC_LINKER # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= shrext=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then ld_extra=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf` sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=yes library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then AC_MSG_WARN([output file `$ofile' does not exist]) fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) else AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in "") ;; *) AC_MSG_ERROR([invalid tag name: $tagname]) ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then AC_MSG_ERROR([tag name \"$tagname\" already exists]) fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && test "X$CXX" != "Xno"; then AC_LIBTOOL_LANG_CXX_CONFIG else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then AC_LIBTOOL_LANG_F77_CONFIG else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then AC_LIBTOOL_LANG_GCJ_CONFIG else tagname="" fi ;; RC) AC_LIBTOOL_LANG_RC_CONFIG ;; *) AC_MSG_ERROR([Unsupported tag name: $tagname]) ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" AC_MSG_ERROR([unable to update list of available tagged configurations.]) fi fi ])# _LT_AC_TAGCONFIG # AC_LIBTOOL_DLOPEN # ----------------- # enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_DLOPEN # AC_LIBTOOL_WIN32_DLL # -------------------- # declare package support for building win32 dll's AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_WIN32_DLL # AC_ENABLE_SHARED([DEFAULT]) # --------------------------- # implement the --enable-shared flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([shared], [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]AC_ENABLE_SHARED_DEFAULT) ])# AC_ENABLE_SHARED # AC_DISABLE_SHARED # ----------------- #- set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no) ])# AC_DISABLE_SHARED # AC_ENABLE_STATIC([DEFAULT]) # --------------------------- # implement the --enable-static flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([static], [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]AC_ENABLE_STATIC_DEFAULT) ])# AC_ENABLE_STATIC # AC_DISABLE_STATIC # ----------------- # set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no) ])# AC_DISABLE_STATIC # AC_ENABLE_FAST_INSTALL([DEFAULT]) # --------------------------------- # implement the --enable-fast-install flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([fast-install], [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) ])# AC_ENABLE_FAST_INSTALL # AC_DISABLE_FAST_INSTALL # ----------------------- # set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no) ])# AC_DISABLE_FAST_INSTALL # AC_LIBTOOL_PICMODE([MODE]) # -------------------------- # implement the --with-pic flag # MODE is either `yes' or `no'. If omitted, it defaults to `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default) ])# AC_LIBTOOL_PICMODE # AC_PROG_EGREP # ------------- # This is predefined starting with Autoconf 2.54, so this conditional # definition can be removed once we require Autoconf 2.54 or later. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi]) EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) ])]) # AC_PATH_TOOL_PREFIX # ------------------- # find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="ifelse([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi ])# AC_PATH_TOOL_PREFIX # AC_PATH_MAGIC # ------------- # find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# AC_PATH_MAGIC # AC_PROG_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], [AC_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no]) AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case "$host_cpu" in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) case $host_cpu in alpha*|hppa*|i*86|ia64*|m68*|mips*|powerpc*|sparc*|s390*|sh*|x86_64) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; esac lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' else lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown ])# AC_DEPLIBS_CHECK_METHOD # AC_PROG_NM # ---------- # find the pathname to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/${ac_tool_prefix}nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac esac fi done IFS="$lt_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" ])# AC_PROG_NM # AC_CHECK_LIBM # ------------- # check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac ])# AC_CHECK_LIBM # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If # DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will # be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and # top_srcdir appropriately in the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_CONVENIENCE # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl installable library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that LIBLTDL # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If # DIRECTORY is not provided and an installed libltdl is not found, it is # assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' # and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single # quotes!). If your package is not flat and you're not using automake, # define top_builddir and top_srcdir appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, lt_dlinit, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_INSTALLABLE # AC_LIBTOOL_CXX # -------------- # enable support for C++ libraries AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX]) ])# AC_LIBTOOL_CXX # _LT_AC_LANG_CXX # --------------- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([AC_PROG_CXXCPP]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) ])# _LT_AC_LANG_CXX # AC_LIBTOOL_F77 # -------------- # enable support for Fortran 77 libraries AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77]) ])# AC_LIBTOOL_F77 # _LT_AC_LANG_F77 # --------------- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) ])# _LT_AC_LANG_F77 # AC_LIBTOOL_GCJ # -------------- # enable support for GCJ libraries AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ]) ])# AC_LIBTOOL_GCJ # _LT_AC_LANG_GCJ # --------------- AC_DEFUN([_LT_AC_LANG_GCJ], [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) ])# _LT_AC_LANG_GCJ # AC_LIBTOOL_RC # -------------- # enable support for Windows resource files AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) ])# AC_LIBTOOL_RC # AC_LIBTOOL_LANG_C_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) AC_DEFUN([_LT_AC_LANG_C_CONFIG], [lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' _LT_AC_SYS_COMPILER # # Check for any special shared library compilation flags. # _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= if test "$GCC" = no; then case $host_os in sco3.2v5*) _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' ;; esac fi if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then : else AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no fi fi # # Check to make sure the static flag actually works. # AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF($1) # Report which librarie types wil actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; darwin* | rhapsody*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case "$host_os" in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' ;; esac fi ;; esac output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_C_CONFIG # AC_LIBTOOL_LANG_CXX_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([AC_PROG_CXXCPP]) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Dependencies to place before and after the object being linked: _LT_AC_TAGVAR(predep_objects, $1)= _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= # Source file extension for C++ test sources. ac_ext=cc # Object file extension for compiled C++ test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration AC_PROG_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_AC_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) _LT_AC_TAGVAR(always_export_symbols, $1)=yes # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds it's shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case "$host_os" in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' ;; esac fi ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; dgux*) case $cc_basename in ec++) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; ghcx) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before switch to ELF _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | kfreebsd*-gnu) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_AC_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then case "$host_cpu" in hppa*64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; *) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case "$host_cpu" in hppa*64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; ia64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC) case "$host_cpu" in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case "$host_cpu" in ia64*|hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; irix5* | irix6*) case $cc_basename in CC) # SGI C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; linux*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc) # Intel C++ with_gnu_ld=yes _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; cxx) # Compaq C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; osf3*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; RCC) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ $rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; sco*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case $cc_basename in CC) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; sunos4*) case $cc_basename in CC) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; lcc) # Lucid # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx) # Green Hills C++ Compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' fi ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; tandem*) case $cc_basename in NCC) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$GXX" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_POSTDEP_PREDEP($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld ])# AC_LIBTOOL_LANG_CXX_CONFIG # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) # ------------------------ # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" ifelse([$1], [], [#! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG], [# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_[]_LT_AC_TAGVAR(LD, $1) # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS=$lt_AS # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext='$shrext' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) # Commands used to build and install a shared archive. archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) # Flag that forces no undefined symbols. no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) # The commands to list exported symbols. export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) # Symbols that must always be exported. include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ifelse([$1],[], [# ### END LIBTOOL CONFIG], [# ### END LIBTOOL TAG CONFIG: $tagname]) __EOF__ ifelse([$1],[], [ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ]) else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ])# AC_LIBTOOL_CONFIG # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris* | sysv5*) symcode='[[BDRT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[[]] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) # --------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) ifelse([$1],[CXX],[ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC) # KAI C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; icpc) # Intel C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; cxx) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC) # Rational C++ 2.4.1 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx) # Digital/Compaq C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; sco*) case $cc_basename in CC) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; *) ;; esac ;; solaris*) case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC) # Sun C++ 4.x _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc) # Lucid _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC) # NonStop-UX NCC 3.20 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; unixware*) ;; vxworks*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; newsos6) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; linux*) case $CC in icc* | ecc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; ccc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; sco3.2v5*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' ;; solaris*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sunos4*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; uts4*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" ;; esac ]) # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)= _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_AC_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac _LT_AC_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; sunos4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; linux*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_cmds, $1)="$tmp_archive_cmds" supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)="$tmp_archive_cmds" fi else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=yes _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) _LT_AC_TAGVAR(always_export_symbols, $1)=yes # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds it's shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # see comment about different semantics on the GNU ld section _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; bsdi4*) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext=".dll" # FIXME: Setting linknames here is a bad hack. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) if test "$GXX" = yes ; then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case "$host_os" in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' ;; esac fi ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; dgux*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; *) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi ;; os2*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; sco3.2v5*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_AC_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_AC_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4.2uw2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv5*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' ;; uts4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_AC_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) _LT_AC_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac ])# AC_LIBTOOL_PROG_LD_SHLIBS # _LT_AC_FILE_LTDLL_C # ------------------- # Be careful that the start marker always follows a newline. AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ ])# _LT_AC_FILE_LTDLL_C # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) # --------------------------------- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS) ]) AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no) ]) # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # # LT_AC_PROG_SED # -------------- # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. AC_DEFUN([LT_AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && break cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done SED=$lt_cv_path_SED ]) AC_MSG_RESULT([$SED]) ]) # -*- Autoconf -*- # Copyright (C) 2002, 2003 Free Software Foundation, Inc. # Generated from amversion.in; do not edit by hand. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.8"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.8.3])]) # AM_AUX_DIR_EXPAND # Copyright (C) 2001, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 6 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]) fi])]) # serial 7 -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # (even with -Werror). So we grep stderr for any message # that says an option was ignored. if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. #serial 2 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. for file in `sed -n ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # This macro actually does too much some checks are only needed if # your package does certain things. But this isn't really a big deal. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 11 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.58])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_MISSING_PROG(AMTAR, tar) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. # Copyright (C) 2001, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # -*- Autoconf -*- # Copyright (C) 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 1 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 4 # AM_PROG_LEX # ----------- # Autoconf leaves LEX=: if lex or flex can't be found. Change that to a # "missing" invocation, for better error output. AC_DEFUN([AM_PROG_LEX], [AC_PREREQ(2.50)dnl AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_REQUIRE([AC_PROG_LEX])dnl if test "$LEX" = :; then LEX=${am_missing_run}flex fi]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 2 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 3 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # AM_PROG_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. # Copyright (C) 2003, 2004 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories # created by `make install' are always world readable, even if the # installer happens to have an overly restrictive umask (e.g. 077). # This was a mistake. There are at least two reasons why we must not # use `-m 0755': # - it causes special bits like SGID to be ignored, # - it may be too restrictive (some setups expect 775 directories). # # Do not use -m 0755 and let people choose whatever they expect by # setting umask. # # We cannot accept any implementation of `mkdir' that recognizes `-p'. # Some implementations (such as Solaris 8's) are not thread-safe: if a # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' # concurrently, both version can detect that a/ is missing, but only # one can create it and the other will error out. Consequently we # restrict ourselves to GNU make (using the --version option ensures # this.) AC_DEFUN([AM_PROG_MKDIR_P], [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # Keeping the `.' argument allows $(mkdir_p) to be used without # argument. Indeed, we sometimes output rules like # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more # expensive solution, as it forces Make to start a sub-shell.) mkdir_p='mkdir -p -- .' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi AC_SUBST([mkdir_p])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 2 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # # Check to make sure that the build environment is sane. # # Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 3 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # AM_PROG_INSTALL_STRIP # Copyright (C) 2001, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) m4_include([acinclude.m4]) openslp-1.2.1/install-sh0000755033442200000310000002177010211377461015075 0ustar rganesanfloppy#!/bin/sh # install - install a program, script, or datafile scriptversion=2004-02-15.20 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename= transform_arg= instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= usage="Usage: $0 [OPTION]... SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 -d DIRECTORIES... In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default. In the second, create the directory path DIR. Options: -b=TRANSFORMBASENAME -c copy source (using $cpprog) instead of moving (using $mvprog). -d create directories instead of installing files. -g GROUP $chgrp installed files to GROUP. -m MODE $chmod installed files to MODE. -o USER $chown installed files to USER. -s strip installed files (using $stripprog). -t=TRANSFORM --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; -c) instcmd=$cpprog shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit 0;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; --version) echo "$0 $scriptversion"; exit 0;; *) # When -d is used, all remaining arguments are directories to create. test -n "$dir_arg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then instcmd=: chmodcmd= else instcmd=$mkdirprog fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" || lasterr=$? # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test ! -d "$pathcomp" && { (exit ${lasterr-1}); exit; } fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $instcmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else # If we're going to rename the final executable, determine the name now. if test -z "$transformarg"; then dstfile=`basename "$dst"` else dstfile=`basename "$dst" $transformbasename \ | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename. test -z "$dstfile" && dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 trap '(exit $?); exit' 1 2 13 15 # Move or copy the file name to the temp name $doit $instcmd "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now remove or move aside any old file at destination location. We # try this two ways since rm can't unlink itself on some systems and # the destination file might be busy for other reasons. In this case, # the final cleanup might fail but the new file should still install # successfully. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" fi || { (exit 1); exit; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: openslp-1.2.1/depcomp0000755033442200000310000003477110211377462014454 0ustar rganesanfloppy#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2003-11-08.23 # Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit 0 ;; -v | --v*) echo "depcomp $scriptversion" exit 0 ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # `libtool' can also be set to `yes' or `no'. if test -z "$depfile"; then base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` dir=`echo "$object" | sed 's,/.*$,/,'` if test "$dir" = "$object"; then dir= fi # FIXME: should be _deps on DOS. depfile="$dir.deps/$base" fi tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1="$dir.libs/$base.lo.d" tmpdepfile2="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" else tmpdepfile="$tmpdepfile2" fi if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: openslp-1.2.1/FAQ0000644033442200000310000001765407424315111013425 0ustar rganesanfloppyOpenSLP FAQ by Matt Peterson ================================================= A really compresensive FAQ is not yet available for OpenSLP so please send your questions to the OpenSLP mailing lists: openslp-devel@lists.sourceforge.net openslp-users@lists.sourceforge.net Q: Where is the configure script to build OpenSLP? A: Did you read section 3 of the README? You need to run autogen.sh to generate the configure script. Q: How do I build OpenSLP on Windows? A: The MSVC project files used by the developers who ported OpenSLP to win32 available in the source directories. If you do not use MSVC and you are a Windows developer, then you will be used to trying to get MSVC makes to work with your tools Q: Will OpenSLP work on my operating system A: Yes, the OpenSLP code has proven to be very portable. It currently works many operating systems including: Linux, BSD, Solaris, Tru64, HPUX, UnixWare, OSR5, and Win32 Q: I am having trouble discovering attributes using FindAttr() and "slptool findattrs". The functions seem to execute properly, and the services URL's can be discovered, but no attributes are returned. I am registering services in slp.reg files. I don't think it is my syntax in the slp.reg file, because the example registrations in that file do not return attributes either. Can anyone help? A: If you just want to use slptool to see if things are working, you need to do the following: Contents of the slp.reg: ------------------------ service:myservice1.x://myhost.caldera.com,en,65535 owner=Matt Peterson email=mpeterson@caldera.com service:myservice1.x://yourhost.yourdomain.com,en,65535 owner=Kim Jackson email=bjackson@yourhost.yourdomain.com IMPORTANT: Restart slpd and check the /var/log/slpd.log to ensure that there were no errors during parsing of the .reg file Use slptool to find attributes ------------------------------ $ slptool findsrvs service:myservice1.x service:myservice1.x://myhost.caldera.com.com,65535 service:myservice1.x://yourhost.yourdomain.com,65535 $ slptool findattrs service:myservice1.x://myhost.mydomain.com (owner=Matt Peterson),(email=mpeterson@caldera.com) $ slptool findattrs service:myservice1.x://yourhost.caldera.com (owner=Kim Jackson),(email=bjackson@yourhost.yourdomain.com) Note that you need to supply the service-url as returned by findsrvs Q: I have a multi-homed machine and OpenSLP is not working. A: Please read the updated installation guide http://www.openslp.org/doc/html/UsersGuide/Installation.html. There are special instructions for users of multi-homed machines. Q: In our development lab, the multicast SLP requests work just fine. However, in our SVT lab, the multicasts requests never work. We always have to edit the slp.conf file and turn on broadcast. Have any others seen this? Do you recall what the solution was? We have spent a great deal of time trying to figure this one out without success. A: Yes, others have seen this behavior -- I know I have. I should put this in the FAQ because I get a lot of questions. The following is a list of the most common problems along with trouble shooting and resolution info: No multicast route ------------------- A very common problem with some OS installations (especially Linux) is that there is no multicast or default route set up. On systems with BSD derived TCP/IP stacks (nearly all OSes), broadcast and multicast traffic are delivered using the unicast routing table. If the unicast routing table does not have either a default route or an explicit multicast route, then the kernel does not know where to send the SLP datagram and returns an error 101 - network unreachable error which translates into a SLPError -23 SLP_NETWORK_ERROR. A quick test is to try to ping SLP multicast: $ ping 239.255.255.253 If ping returns an error that the network was unreachable, you will need to set up a default route or a multicast route. Note you may not get any responses to the ping. This may not indicate a problem. The only thing to be concerned about is if there is an error actually sending the ping. Please read the installation instructions for more information on how to install a multicast route: http://www.openslp.org/doc/html/UsersGuide/Installation.html The "smart switch /stupid router" problem ------------------------------------------ The smart switch / stupid router (or no router) problem is something that happens on switched ethernet networks only. If you do not have a switched ethernet network, then you do not have this problem. If you do have a switched ethernet network, then you may have this problem if you are using newer switching hardware. The reason is that ethernet switching hardware is smart enough to monitor IGMP traffic and only forward multicast ethernet frames to those ports that are connected to a host that has maintained the appropriate IGMP conversations with the router. At a very high level, IGMP works like this. First, the host joins the multicast group by sending the router an IGMP message. The router responds periodically with request to the host to see if the host is still interested in multicast traffic. Since IGMP conversations are handled transparently by the kernel level IP stack implementations, most developers and users do not even realize anything is happening. However, "smart" ethernet switches do realize something is happening! If they do not see the IGMP messages being sent from the router to a host that is plugged into a given port of the switch, then they will will not forward multicast ethernet frames to that port. This is good and bad. It is good because it makes multicast extremely efficient in terms of physical network usage. However, it also makes it so multicast will not work at all if a router does not exist (or does not support IGMP) to maintain it's end of the IGMP conversation. Trouble Shooting: Monitor IGMP traffic! Make sure that periodic IGMP traffic is happening on your network. IGMP traffic can be monitored on Linux (and many other OSes) with the following command: # tcpdump igmp Issue this command before starting slpd. You will notice that several IGMP "report" messages are sent. The important thing to look for a IGMP "query" message from the router. If you do not see the IGMP query message from the router then you will soon find that you will no longer see any "report" messages either. Another good test is to try to ping the multicast address and see where it is visable. $ ping 239.255.255.253 Finally, the best advice is to read the normally untouched section of your ethernet switch manual that describes how the switch handles multicast. Stupid/inexpensive switches treat multicast frames exactly like broadcast frames which means that they are forwarded to every port of the switch. Smart/Expensive switches often allow this behavior to be configured. If you are on a network without a router, then it is possible that you might need to "dumb down" your switch. Broken NIC driver ------------------ Some NICs do not support multicast operation, so the driver does the work by placing the NIC into permiscuous mode (accept everything) then the driver filters out what is not needed. The problem with this is that sometimes on a very busy ethernet, the NIC buffers may not be able to keep up with all the traffic and some frames will be dropped. This is normally not a problem since SLP is designed to work on unreliable physical networks, but if enough frames are dropped, OpenSLP may not be able to find DAs or other services. This would result in erratic behavior. openslp-1.2.1/etc/0000755033442200000310000000000010211377554013640 5ustar rganesanfloppyopenslp-1.2.1/etc/slp.reg0000644033442200000310000000224110202047620015120 0ustar rganesanfloppy############################################################################# # # OpenSLP registration file # # May be used to register services for legacy applications that do not use # the SLPAPIs to register for themselves # # Format and contents conform to specification in IETF RFC 2614 so the # comments use the language of the RFC. In OpenSLP, SLPD operates as an SA # and a DA. The SLP UA functionality is encapsulated by the libslp library. # ############################################################################# #comment ;comment #service-url,language-tag,lifetime,[service-type] #["scopes="scope-list] #[attrid"="val1] #[attrid"="val1,val2,val3] # # # The following are examples entries for this file # ##Register a OpenSLP testing service #service:test.openslp://192.168.100.1,en,65535 #scopes=test1,test2 #description=OpenSLP Testing Service #authors=mpeterson,jcarey ##Register ssh service #service:ssh.openslp://192.168.100.1,en,65535 #use default scopes #description="Secure Shell" ##Register telnet service with no attributes #service:telnet.myorg://192.168.100.1,en,65535 #use default scopes openslp-1.2.1/etc/slpd.calderaUNIX_init0000644033442200000310000000216310202047620017634 0ustar rganesanfloppy#! /bin/sh # # slpd Start/Stop the OpenSLP SA daemon (slpd). # # Author: Miquel van Smoorenburg, # Modified for RHS Linux by Damien Neil # Modified for COL by Raymund Will, # Modified for OpenSLP by Matt Peterson # Modified for OSr5/UnixWare/OpenUNIX platform by Vince Seavello # vinces@caldera.com # ### BEGIN INIT INFO # Provides: # Required-Start: # Required-Stop: # Default-Start: # Default-Stop: # Description: slpd - Service Location Protocol daemon ### END INIT INFO NAME=slpd DAEMON=/usr/sbin/$NAME SVIlock=/var/run/$NAME.pid SVIscript=$0 cd / # See how we were called. case "$1" in start) [ -f $SVIlock ] && exit 1 [ -x $DAEMON ] || exit 0 echo -n "Starting slpd daemon..." # ssd -S -n $NAME -x $DAEMON -- $OPTIONS $DAEMON echo ;; stop) [ -f $SVIlock ] || exit 0 echo -n "Stopping slpd daemon..." pid=`cat $SVIlock` kill $pid rm -f /var/run/$NAME.pid echo ;; *) echo "Usage: $SVIscript {start|stop}" exit 1 esac exit 0 openslp-1.2.1/etc/slpd.redhat_init0000644033442200000310000000156210202047620017006 0ustar rganesanfloppy#!/bin/bash # # /etc/rc.d/init.d/slpd # # Starts the at daemon # # chkconfig: 345 40 60 # description: OpenSLP daemon for the Service Location Protocol # processname: slpd # Source function library. . /etc/rc.d/init.d/functions test -x /usr/sbin/slpd || exit 0 RETVAL=0 # # See how we were called. # case "$1" in start) # Check if atd is already running if [ ! -f /var/lock/subsys/slpd ]; then echo -n 'Starting slpd: ' daemon /usr/sbin/slpd RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/slpd echo fi ;; stop) echo -n 'Stopping slpd: ' killproc /usr/sbin/slpd RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/slpd echo ;; reload|restart) $0 stop $0 start RETVAL=$? ;; status) status /usr/sbin/slpd RETVAL=$? ;; *) echo "Usage: /etc/rc.d/init.d/slpd {start|stop|restart|reload|status}" exit 1 esac exit $RETVAL openslp-1.2.1/etc/slp.conf0000644033442200000310000002153510202047620015277 0ustar rganesanfloppy############################################################################# # # OpenSLP configuration file # # Format and contents conform to specification in IETF RFC 2614 so the # comments use the language of the RFC. In OpenSLP, SLPD operates as an SA # and a DA. The SLP UA functionality is encapsulated by SLPLIB. # ############################################################################# #---------------------------------------------------------------------------- # Static Scope and Static DA Configuration #---------------------------------------------------------------------------- # This option is a comma delimited list of strings indicating the only scopes # a UA or SA is allowed when making requests or registering or the scopes a # DA must support. (default value is "DEFAULT") ;net.slp.useScopes = myScope1, myScope2, myScope3 # Allows administrator to force UA and SA agents to use specific DAs. If # this setting is not used dynamic DA discovery will be used to determine # which DAs to use. (Default is to use dynamic DA discovery) ;net.slp.DAAddresses = myDa1,myDa2,myDa3 #---------------------------------------------------------------------------- # DA Specific Configuration #---------------------------------------------------------------------------- # Enables slpd to function as a DA. Only a very few DAs should exist. It # is suggested that the administrator read the OpenSLP users guide before # enabling this setting. Default is false. Uncomment the line below to # enable DA operation. ;net.slp.isDA = true # A 32 bit integer giving the number of seconds for the DA heartbeat. # Default is 3 hours (10800 seconds). This property corresponds to # the protocol specification parameter CONFIG_DA_BEAT [7]. Ignored # if isDA is false. ;net.slp.DAHeartBeat = 10800 #---------------------------------------------------------------------------- # SA Specific Configuration #---------------------------------------------------------------------------- # If net.slp.watchRegistrationPID is set to true, local registrations made # with the SA via the SLPReg() API call will be monitored. If the PID of the # process (and/or thread on Linux) disappears (the registering process died # unexpectedly with out calling SLPDereg()), then the registration is # automatically de-registered. (Default value is true. Uncomment the line # below to disable PID watching. ;net.slp.watchRegistrationPID = false #---------------------------------------------------------------------------- # UA Specific Configuration #---------------------------------------------------------------------------- # A 32 bit integer giving the maximum number of results to accumulate and # return for a synchronous request before the timeout, or the maximum number # of results to return through a callback if the request results are # reported asynchronously (default value is 256). ;net.slp.maxResults = 256 #---------------------------------------------------------------------------- # Network Configuration Properties #---------------------------------------------------------------------------- # Force broadcasts to be used instead of multicast. This setting is seldom # necessary since OpenSLP will automatically use broadcast if multicast # is unavailable. (Default is false) ;net.slp.isBroadcastOnly = true # A boolean indicating whether passive DA detection should be used. # Default is true. Uncomment the following line to disable passive DA # detection ;net.slp.passiveDADetection = false # A boolean indicating whether active DA detection should be used. This is # useful when the DAs available are explicitly restricted to those obtained # from DHCP or the net.slp.DAAddresses property. Default is true. Uncomment # the following line to disable active DA detection ;net.slp.activeDADetection = false # The net.slp.DAActiveDiscoveryInterval property controls *periodic* # transmission of active DA discovery SrvRqsts. The default setting # of 1 which disables sending periodic active DA discovery SrvRqsts. # However, even if net.slp.DAActiveDiscoveryInterval=1 OpenSLP agents will # send a send active DA request only upon initialization. To disable all # active DA detection you MUST net.slp.passiveDADetection = false. (you # may also set net.slp.DAActiveDiscoveryInterval=0) # simply set ;net.slp.DAActiveDiscoveryInterval = 1 # A positive integer that is less than or equal to 255. (The default is 255) ;net.slp.multicastTTL = 255 # An integer giving the maximum amount of time (in milliseconds) to perform # active DA discovery requests. (Default is 2000 ms or 2 secs). ;net.slp.DADiscoveryMaximumWait = 2000 # A value-list of 32 bit integers used as timeouts, in milliseconds, to # implement the multicast convergence algorithm during active DA discovery. # Each value specifies the time to wait before sending the next request, or # until nothing new has been learned from two successive requests. # Default is: 500,750,1000,1500,2000,3000. ;net.slp.DADiscoveryTimeouts = 500,750,1000,1500,2000,3000 # An integer giving the maximum amount of time (in milliseconds) to perform # multicast requests. (Default is 5000 ms or 5 secs). ;net.slp.multicastMaximumWait = 5000 # A value-list of 32 bit integers used as timeouts, in milliseconds, to # implement the multicast convergence algorithm. Each value specifies # the time to wait before sending the next request, or until nothing new # has been learned from two successive requests. # Default is: 500,750,1000,1500,2000,3000. In a slow network the less # aggressive values of 3000,3000,3000,3000,3000 allow better performance. ;net.slp.multicastTimeouts = 500,750,1000,1500,2000,3000 # An integer giving the maximum amount of time (in milliseconds) to perform # unicast requests. (Default is 5000 ms or 5 secs). ;net.slp.unicastMaximumWait = 5000 # A value-list of 32 bit integers used as timeouts, in milliseconds, to # implement unicast datagram transmission to DAs. The nth value gives # the time to block waiting for a reply on the nth try to contact the DA. # Currently OpenSLP uses TCP for all unicast communication so this setting # does not do anything ;net.slp.unicastTimeouts = 500,750,1000,1500,2000,3000 # To OpenSLP the following is the same as net.slp.unicastTimeouts. Use # net.slp.unicastTimeouts instead. ;net.slp.datagramTimeouts = IGNORED # An integer giving the maximum value for all random wait parameters. # (Default is 5000 or 5 sec) ;net.slp.randomWaitBound = 5000 # A integer giving the network packet MTU in bytes. (Default is 1400) ;net.slp.MTU = 1400 # A list of IP address of network interfaces on which the DA/SA should listen # for slp requests. By default, slpd will use all interfaces. ;net.slp.interfaces = 1.2.3.4,1.2.3.5,1.2.3.6 #---------------------------------------------------------------------------- # Security #---------------------------------------------------------------------------- # A boolean indicating whether the agent should enable security for URLs, # attribute lists, DAAdverts, and SAAdverts. (Default setting is false and # ENABLE_SECURITY code must be compiled) ;net.slp.securityEnabled=true # A boolean indicating whether the DA or SA will only allow deregistrations # and re-registration from the *exact* host that made the registration. # Default setting if true. Uncomment the line below to disable source # address checking. ;net.slp.checkSourceAddr=false #---------------------------------------------------------------------------- # Tracing and Logging #---------------------------------------------------------------------------- # A boolean controlling printing of messages about traffic with DAs. # Default is false. Uncomment the following line to enable DA traffic # tracing ;net.slp.traceDATraffic = true # A boolean controlling dumps of all registered services upon registration # and deregistration. If true, the contents of the DA or SA server are # dumped after a registration or deregistration occurs. Default is false. # Uncommment the following line to enable registration message logging ;net.slp.traceReg = true # A boolean controlling printing details when a SLP message is dropped for # any reason. Default is false. Uncomment the following line to trace all # dropped messages ;net.slp.traceDrop = true # A boolean controlling printing of details on SLP messages. The fields in # all incoming messages and outgoing replies are printed. Very verbose. # Default is false. Uncomment the following line to enable verbose message # tracing. ;net.slp.traceMsg = true #---------------------------------------------------------------------------- # Serialized Proxy Registration #---------------------------------------------------------------------------- # The net.slp.serializedRegURL is not supported by net.slp.serializeRegURL. # # slpd accepts the [-r] command line parameter that specifies the serialized # registration file. The default serialized registration file is # /etc/slp.reg openslp-1.2.1/etc/slp.spi0000644033442200000310000000522310202047620015141 0ustar rganesanfloppy############################################################################# # # OpenSLP SPI file # # Security Parameter Index (SPI) is an unformated string that us used # by SLP to identify security information used to authenticate SLPv2 # message. See RFC 2608 for more information. # # Format and contents conform of this file are specific to the OpenSLP # implementation of SLPv2 authentication. See comments below for more # explaination of the file format. # # NOTE: OpenSLP only supports DSA keys!!! # ############################################################################# # #------------- # File format: #------------- # Each line of this file maps an SPI string to a PEM encoded key file. # # # # #-------------- # PRIVATE key: #-------------- # The PRIVATE key line specifies the location of a key file that contains # a PEM encoded DSA private key for the given SPI. The PRIVATE key is used # for signing SLP messages that are sent the SA/DA on this host. # # A PRIVATE key entry is not required. If the PRIVATE key entry does not # exist, then SLP messages sent by this host will not be signed. Since UAs # do not have to sign any messages, it is often advantageous to # specifically omit the PRIVATE entry on hosts that do not act as an SA or # DA. # # ***IMPORTANT*** # Only one PRIVATE key is recognized by the implementation. If there is # more than one private key then only the key designated by the first PRIVATE # entry in this file will be used. # # The following is a commented example of a PRIVATE entry: # # PRIVATE myprivateslpkey /etc/secure/myprivateslpkey.pem # # #-------------- # PUBLIC keys: #-------------- # The PUBLIC key line specifies the location of a key file that contains a # PEM encoded DSA public key. This key is used for verifying messages sent # by other SLP agents # # At least one PUBLIC key entry on all hosts is required for proper # operation of of secure OpenSLP. It is possible that more than one entry # will be needed in order to verify signatures if for some reason (that I # can't imagine right now) you have configured SAs and DAs with a variety of # PRIVATE keys. # # The following is a commented example of a PUBLIC entry: # # PUBLIC mypublicslpkey /etc/secure/mypublicslpkey.pem # #----------------------- # PEM encoded key files #----------------------- # PEM encoded key files can be generated using OpenSSL or tools included with # OpenSLP. # # #------------ # Final Note #------------ # Unless you really know what you're doing, you should probably read the # more detailed documentation at http://www.openslp.org BEFORE setting up # SLP security openslp-1.2.1/etc/slpd.caldera_init0000644033442200000310000000215310202047620017127 0ustar rganesanfloppy#! /bin/sh # # slpd Start/Stop the OpenSLP SA daemon (slpd). # # Author: Miquel van Smoorenburg, # Modified for RHS Linux by Damien Neil # Modified for COL by Raymund Will, # Modified for OpenSLP by Matt Peterson # ### BEGIN INIT INFO # Provides: # Required-Start: # Required-Stop: # Default-Start: # Default-Stop: # Description: gpm - General Purpose Mouse ### END INIT INFO NAME=slpd DAEMON=/usr/sbin/$NAME # Source function library. . /etc/rc.d/init.d/functions # Change to root cd / # See how we were called. case "$1" in start) [ -e $SVIlock ] && exit 1 [ -x $DAEMON ] || exit 0 echo -n "Starting slpd daemon:" ssd -S -n $NAME -x $DAEMON -- $OPTIONS echo "." touch $SVIlock ;; stop) [ -e $SVIlock ] || exit 0 echo -n "Stopping slpd daemon: " ssd -K -p /var/run/$NAME.pid -n $NAME rm /var/run/$NAME.pid echo "." rm -f $SVIlock ;; *) echo "Usage: $SVIscript {start|stop}" exit 1 esac exit 0 openslp-1.2.1/etc/slpd.all_init0000644033442200000310000001003010202047620016275 0ustar rganesanfloppy#!/bin/bash # # /etc/rc.d/init.d/slpd # # slpd Start/Stop the OpenSLP SA daemon (slpd). # # chkconfig: 345 13 87 # description: OpenSLP daemon for the Service Location Protocol # processname: slpd # Author: Miquel van Smoorenburg, # Modified for RHS Linux by Damien Neil # Modified for COL by Raymund Will, # Modified for OpenSLP by Matt Peterson # Modified to be distribution agnostic by Bart Whiteley #//////////////////////////////////////////////////# # Does nothing if a route exists that supports # # multicast traffic. If no routes supporting # # multicast traffic exists, the function tries to # # add one. A 0 is returned on success and a 1 # # on failure. One parameter must be passed in. # # This variable determins verbosity. If parameter # # is non-zero debugging will appear # #//////////////////////////////////////////////////# multicast_route_set() { PING_OPTIONS_1='-c1 -w1' PING_OPTIONS_2='-c1 -i1' MULTICAST_ADDRESS='239.255.255.253' PING_ERROR_NO_ROUTE='unreachable' MSG_FAILED_TO_FIND='Failed to Detect Multicast Route' MSG_SUCCESS_ON_FIND='Multicast Route Enabled' MSG_ADDING_ROUTE='Attempting to Add Multicast Route ...' MSG_FAILED_TO_ADD=' FAILED - Route NOT Added.' MSG_SUCCES_ON_ADD=' SUCCESS - Route Added.' CMD_GET_INTERFACE="netstat -i | awk 'BEGIN{}(NR>2)&&(!/^lo*/){print \$1}'" CMD_ADD_ROUTE="route add -net 224.0.0.0 netmask 240.0.0.0" err_unreachable_found=`ping $PING_OPTIONS_1 $MULTICAST_ADDRESS 2>$1 1>/dev/null` if [ $? = 2 ]; then err_unreachable_found=`ping $PING_OPTIONS_2 $MULTICAST_ADDRESS 2>$1 1>/dev/null` fi #If errors, add route. Otherwise, do nothing if [ "$err_unreachable_found" ]; then if [ $1 != 0 ]; then echo $MSG_FAILED_TO_FIND echo $MSG_ADDING_ROUTE fi $CMD_ADD_ROUTE `eval $CMD_GET_INTERFACE` > /dev/null 2>&1 retval=$? if [ $1 != 0 ]; then if [ $retval = 0 ]; then echo $MSG_SUCCES_ON_ADD else echo $MSG_FAILED_TO_ADD fi fi else if [ $1 != 0 ]; then echo -n $MSG_SUCCESS_ON_FIND fi retval=0 fi return $retval } NAME=slpd DAEMON=/usr/sbin/$NAME SUSE=0 # Change to root OLDDIR=`pwd` cd / # Source function library. if [ -f /etc/rc.d/init.d/functions ]; then . /etc/rc.d/init.d/functions else SUSE=1 fi test -x $DAEMON || exit 0 if [ ! "$SVIlock" = "" ]; then unset LOCK else LOCK=/var/lock/subsys/slpd fi RETVAL=0 # # See how we were called. # case "$1" in start) # Check if atd is already running # RH style if [ $SUSE -eq 0 ] && [ ! "$LOCK" = "" ] && [ -f $LOCK ]; then exit 0 fi # Caldera Style if [ ! "$SVIlock" = "" ] && [ -f $SVIlock ]; then exit 0 fi echo -n 'Starting slpd: ' multicast_route_set 1 multicast_enabled=$? if [ "$multicast_enabled" != "0" ] ; then echo "Failure: No Route Available for Multicast Traffic" exit 1 fi if [ $SUSE -eq 0 ]; then if [ -x /sbin/ssd ]; then ssd -S -n $NAME -x $DAEMON -- $OPTIONS [ ! "$SVIlock" = "" ] && touch $SVIlock else daemon $DAEMON RETVAL=$? fi else startproc $DAEMON $OPTIONS fi [ $SUSE -eq 0 ] && [ ! "$LOCK" = "" ] && [ $RETVAL -eq 0 ] && touch $LOCK echo ;; stop) echo -n 'Stopping slpd: ' if [ -x /sbin/ssd ]; then ssd -K -p /var/run/$NAME.pid -n $NAME [ ! "$SVIlock" = "" ] && rm -f $SVIlock else killproc $DAEMON RETVAL=$? fi [ ! "$LOCK" = "" ] && [ $RETVAL -eq 0 ] && rm -f $LOCK echo ;; reload|restart) cd $OLDDIR $0 stop $0 start cd / RETVAL=$? ;; status) status /usr/sbin/slpd RETVAL=$? ;; *) echo "Usage: /etc/rc.d/init.d/slpd {start|stop|restart|reload|status}" exit 1 esac exit $RETVAL openslp-1.2.1/config.sub0000755033442200000310000007547010641470757015073 0ustar rganesanfloppy#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-04-22' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | msp430-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: openslp-1.2.1/slp.list.in0000644033442200000310000000252407335060754015174 0ustar rganesanfloppy# Software list file for OpenSLP. # Directories... $DESTDIR= $prefix=@prefix@ $exec_prefix=@exec_prefix@ $bindir=@bindir@ $sbindir=@sbindir@ $etcdir=@sysconfdir@ $datadir=@datadir@ $libdir=@libdir@ $mandir=@mandir@ $includedir=@includedir@ $srcdir=@top_srcdir@ $sharedir=@sharedstatedir@ $vardir=@localstatedir@ # Product information %product OpenSLP %copyright Caldera Systems, Inc (BSD) %vendor OpenSLP Project %license ${srcdir}/COPYING %readme ${srcdir}/README %description Open source implementation of Service Location Protocol V2. %version 1.0.1 # Binaries %system all d 0755 root sys ${prefix} - d 0755 root sys ${bindir} - d 0755 root sys ${sbindir} - d 0755 root sys ${includedir} - d 0755 root sys ${etcdir} - d 0755 root sys ${libdir} - d 0755 root sys ${sharedir} - d 0755 root sys ${sharedir}/doc - d 0755 root sys ${sharedir}/doc/openslp-$version - c 0644 root sys ${etcdir}/slp.conf ${DESTDIR}${etcdir}/slp.conf c 0644 root sys ${etcdir}/slp.reg ${DESTDIR}${etcdir}/slp.reg f 0755 root sys ${sbindir}/slpd ${DESTDIR}${sbindir}/slpd f 0755 root sys ${bindir}/slptool ${DESTDIR}${bindir}/slptool f 0644 root sys ${includedir}/slp.h ${DESTDIR}${includedir}/slp.h f 0644 root sys ${libdir}/libslp.so.1.0.0 ${DESTDIR}${libdir}/libslp.so.1.0.0 l 0777 root sys ${libdir}/libslp.so.1 libslp.so.1.0.0 l 0777 root sys ${libdir}/libslp.so libslp.so.1.0.0 openslp-1.2.1/missing0000755033442200000310000002466610211377461014477 0ustar rganesanfloppy#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2003-09-02.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then # We have makeinfo, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 fi # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: openslp-1.2.1/win32/0000755033442200000310000000000010211377554014027 5ustar rganesanfloppyopenslp-1.2.1/win32/slptool/0000755033442200000310000000000010211377554015523 5ustar rganesanfloppyopenslp-1.2.1/win32/slptool/slptool.bpf0000644033442200000310000000014107561766062017716 0ustar rganesanfloppyThis file is used by the project manager only and should be treated like the project file main openslp-1.2.1/win32/slptool/slptool.bpr0000644033442200000310000000427107561773367017750 0ustar rganesanfloppy openslp-1.2.1/win32/slptool/slptool.vcproj0000644033442200000310000001214410202213621020426 0ustar rganesanfloppy openslp-1.2.1/win32/slptool/.cvsignore0000644033442200000310000000004610211366537017522 0ustar rganesanfloppyDebug Release slptool.map slptool.tds openslp-1.2.1/win32/slptool/slptool.dsp0000644033442200000310000001026307620026430017723 0ustar rganesanfloppy# Microsoft Developer Studio Project File - Name="slptool" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=slptool - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "slptool.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "slptool.mak" CFG="slptool - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "slptool - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "slptool - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "slptool - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /Zi /O2 /I "../../libslp" /I "../../common" /D "_CONSOLE" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D SLP_VERSION=\"1.1.1\" /Fd"Release/slptool.pdb" /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib slp.lib /nologo /subsystem:console /map /debug /machine:I386 /libpath:"../libslp/release" !ELSEIF "$(CFG)" == "slptool - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /ZI /Od /I "../../libslp" /I "../../common" /D "_CONSOLE" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D SLP_VERSION=\"1.1.1\" /Fd"Debug/slptool.pdb" /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib slp.lib /nologo /subsystem:console /map /debug /machine:I386 /libpath:"../libslp/debug" !ENDIF # Begin Target # Name "slptool - Win32 Release" # Name "slptool - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\slptool\slptool.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\slptool\slptool.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project openslp-1.2.1/win32/slptool/bcbwrapper.c0000644033442200000310000000113507561766062020030 0ustar rganesanfloppy/***************************************************************************/ /* */ /* This file is only a wrapper for C++ Builder, where a project cannot */ /* contain a source file with the same base name as the project itself. */ /* for other Windows build environments, please use slptool.c directly. */ /* */ /***************************************************************************/ #include "../../slptool/slptool.c" #pragma link "slp.lib" openslp-1.2.1/win32/slptool/slptool.mak0000755033442200000310000000775207620026431017722 0ustar rganesanfloppy# Microsoft Developer Studio Generated NMAKE File, Based on slptool.dsp !IF "$(CFG)" == "" CFG=slptool - Win32 Debug !MESSAGE No configuration specified. Defaulting to slptool - Win32 Debug. !ENDIF !IF "$(CFG)" != "slptool - Win32 Release" && "$(CFG)" != "slptool - Win32 Debug" !MESSAGE Invalid configuration "$(CFG)" specified. !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "slptool.mak" CFG="slptool - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "slptool - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "slptool - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE !ERROR An invalid configuration is specified. !ENDIF !IF "$(OS)" == "Windows_NT" NULL= !ELSE NULL=nul !ENDIF CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "slptool - Win32 Release" OUTDIR=.\Release INTDIR=.\Release # Begin Custom Macros OutDir=.\Release # End Custom Macros ALL : "$(OUTDIR)\slptool.exe" CLEAN : -@erase "$(INTDIR)\slptool.idb" -@erase "$(INTDIR)\slptool.obj" -@erase "$(OUTDIR)\slptool.exe" -@erase "$(OUTDIR)\slptool.map" -@erase "$(OUTDIR)\slptool.pdb" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP_PROJ=/nologo /ML /W3 /Zi /O2 /I "../../libslp" /I "../../common" /D "_CONSOLE" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D SLP_VERSION=\"1.1.1\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\slptool.pdb" /FD /c BSC32=bscmake.exe BSC32_FLAGS=/nologo /o"$(OUTDIR)\slptool.bsc" BSC32_SBRS= \ LINK32=link.exe LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib slp.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\slptool.pdb" /map:"$(INTDIR)\slptool.map" /debug /machine:I386 /out:"$(OUTDIR)\slptool.exe" /libpath:"../libslp/release" LINK32_OBJS= \ "$(INTDIR)\slptool.obj" "$(OUTDIR)\slptool.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << !ELSEIF "$(CFG)" == "slptool - Win32 Debug" OUTDIR=.\Debug INTDIR=.\Debug # Begin Custom Macros OutDir=.\Debug # End Custom Macros ALL : "$(OUTDIR)\slptool.exe" CLEAN : -@erase "$(INTDIR)\slptool.idb" -@erase "$(INTDIR)\slptool.obj" -@erase "$(OUTDIR)\slptool.exe" -@erase "$(OUTDIR)\slptool.ilk" -@erase "$(OUTDIR)\slptool.map" -@erase "$(OUTDIR)\slptool.pdb" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP_PROJ=/nologo /MLd /W3 /Gm /ZI /Od /I "../../libslp" /I "../../common" /D "_CONSOLE" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D SLP_VERSION=\"1.1.1\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\slptool.pdb" /FD /GZ /c BSC32=bscmake.exe BSC32_FLAGS=/nologo /o"$(OUTDIR)\slptool.bsc" BSC32_SBRS= \ LINK32=link.exe LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib slp.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\slptool.pdb" /map:"$(INTDIR)\slptool.map" /debug /machine:I386 /out:"$(OUTDIR)\slptool.exe" /libpath:"../libslp/debug" LINK32_OBJS= \ "$(INTDIR)\slptool.obj" "$(OUTDIR)\slptool.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << !ENDIF .c{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .c{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << !IF "$(NO_EXTERNAL_DEPS)" != "1" !IF EXISTS("slptool.dep") !INCLUDE "slptool.dep" !ELSE !MESSAGE Warning: cannot find "slptool.dep" !ENDIF !ENDIF !IF "$(CFG)" == "slptool - Win32 Release" || "$(CFG)" == "slptool - Win32 Debug" SOURCE=..\..\slptool\slptool.c "$(INTDIR)\slptool.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF openslp-1.2.1/win32/slptool/m.bat0000755033442200000310000000040207620026430016440 0ustar rganesanfloppy@echo off if not exist slptool.dep set NO_EXTERNAL_DEPS=1 nmake /nologo /s /f slptool.mak CFG="slptool - Win32 Debug" %1 %2 %3 %4 %5 %6 %7 %8 %9 nmake /nologo /s /f slptool.mak CFG="slptool - Win32 Release" %1 %2 %3 %4 %5 %6 %7 %8 %9 set NO_EXTERNAL_DEPS= openslp-1.2.1/win32/openslp.bpg0000644033442200000310000000175110204465614016202 0ustar rganesanfloppy#------------------------------------------------------------------------------ VERSION = BWS.01 #------------------------------------------------------------------------------ !ifndef ROOT ROOT = $(MAKEDIR)\.. !endif #------------------------------------------------------------------------------ MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** DCC = $(ROOT)\bin\dcc32.exe $** BRCC = $(ROOT)\bin\brcc32.exe $** #------------------------------------------------------------------------------ PROJECTS = slp.dll slptool.exe slpd.exe #------------------------------------------------------------------------------ default: $(PROJECTS) #------------------------------------------------------------------------------ slp.dll: libslp\slp.bpr $(ROOT)\bin\bpr2mak $** $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak slptool.exe: slptool\slptool.bpr $(ROOT)\bin\bpr2mak $** $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak slpd.exe: slpd\slpd.bpr $(ROOT)\bin\bpr2mak $** $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak openslp-1.2.1/win32/slpd/0000755033442200000310000000000010211377554014771 5ustar rganesanfloppyopenslp-1.2.1/win32/slpd/slpd.dsp0000755033442200000310000002266107620026427016455 0ustar rganesanfloppy# Microsoft Developer Studio Project File - Name="slpd" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=slpd - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "slpd.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "slpd.mak" CFG="slpd - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "slpd - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "slpd - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "slpd - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /Zi /O2 /I "../../common" /D "ENABLE" /D "ENABLE_SLPv1" /D "_WINDOWS" /D "i386" /D "USE_PREDICATES" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D SLP_VERSION=\"1.1.1\" /Fd"Release/slpd.pdb" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /map /debug /machine:I386 # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "slpd - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /ZI /Od /I "../../common" /D "ENABLE_SLPv1" /D "_WINDOWS" /D "i386" /D "USE_PREDICATES" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D SLP_VERSION=\"1.1.1\" /Fd"Debug/slpd.pdb" /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /map /debug /machine:I386 # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "slpd - Win32 Release" # Name "slpd - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\libslpattr\libslpattr.c # End Source File # Begin Source File SOURCE=..\..\common\slp_buffer.c # End Source File # Begin Source File SOURCE=..\..\common\slp_compare.c # End Source File # Begin Source File SOURCE=..\..\common\slp_database.c # End Source File # Begin Source File SOURCE=..\..\common\slp_dhcp.c # End Source File # Begin Source File SOURCE=..\..\common\slp_iface.c # End Source File # Begin Source File SOURCE=..\..\common\slp_linkedlist.c # End Source File # Begin Source File SOURCE=..\..\common\slp_message.c # End Source File # Begin Source File SOURCE=..\..\common\slp_net.c # End Source File # Begin Source File SOURCE=..\..\common\slp_parse.c # End Source File # Begin Source File SOURCE=..\..\common\slp_pid.c # End Source File # Begin Source File SOURCE=..\..\common\slp_property.c # End Source File # Begin Source File SOURCE=..\..\common\slp_utf8.c # End Source File # Begin Source File SOURCE=..\..\common\slp_v1message.c # End Source File # Begin Source File SOURCE=..\..\common\slp_xid.c # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_cmdline.c # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_database.c # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_incoming.c # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_knownda.c # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_log.c # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_main.c # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_outgoing.c # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_predicate.c # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_process.c # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_property.c # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_regfile.c # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_socket.c # End Source File # Begin Source File SOURCE=..\..\\slpd\slpd_v1process.c # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_win32.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\libslpattr\libslpattr.h # End Source File # Begin Source File SOURCE=..\..\libslpattr\libslpattr_internal.h # End Source File # Begin Source File SOURCE=..\..\libslp\slp.h # End Source File # Begin Source File SOURCE=..\..\common\slp_buffer.h # End Source File # Begin Source File SOURCE=..\..\common\slp_compare.h # End Source File # Begin Source File SOURCE=..\..\common\slp_database.h # End Source File # Begin Source File SOURCE=\mpeterson\cvs\openslp\common\slp_database.h # End Source File # Begin Source File SOURCE=..\..\common\slp_iface.h # End Source File # Begin Source File SOURCE=..\..\common\slp_linkedlist.h # End Source File # Begin Source File SOURCE=..\..\common\slp_logfile.h # End Source File # Begin Source File SOURCE=..\..\common\slp_message.h # End Source File # Begin Source File SOURCE=..\..\common\slp_net.h # End Source File # Begin Source File SOURCE=..\..\common\slp_network.h # End Source File # Begin Source File SOURCE=..\..\common\slp_parse.h # End Source File # Begin Source File SOURCE=..\..\common\slp_pid.h # End Source File # Begin Source File SOURCE=..\..\common\slp_property.h # End Source File # Begin Source File SOURCE=..\..\common\slp_utf8.h # End Source File # Begin Source File SOURCE=..\..\common\slp_v1message.h # End Source File # Begin Source File SOURCE=..\..\common\slp_xid.h # End Source File # Begin Source File SOURCE=..\..\common\slp_xmalloc.h # End Source File # Begin Source File SOURCE=..\..\slpd\slpd.h # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_cmdline.h # End Source File # Begin Source File SOURCE=\mpeterson\cvs\openslp\slpd\slpd_cmdline.h # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_database.h # End Source File # Begin Source File SOURCE=\mpeterson\cvs\openslp\slpd\slpd_database.h # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_incoming.h # End Source File # Begin Source File SOURCE=\mpeterson\cvs\openslp\slpd\slpd_incoming.h # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_knownda.h # End Source File # Begin Source File SOURCE=\mpeterson\cvs\openslp\slpd\slpd_knownda.h # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_log.h # End Source File # Begin Source File SOURCE=\mpeterson\cvs\openslp\slpd\slpd_log.h # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_outgoing.h # End Source File # Begin Source File SOURCE=\mpeterson\cvs\openslp\slpd\slpd_outgoing.h # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_predicate.h # End Source File # Begin Source File SOURCE=\mpeterson\cvs\openslp\slpd\slpd_predicate.h # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_process.h # End Source File # Begin Source File SOURCE=\mpeterson\cvs\openslp\slpd\slpd_process.h # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_property.h # End Source File # Begin Source File SOURCE=\mpeterson\cvs\openslp\slpd\slpd_property.h # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_regfile.h # End Source File # Begin Source File SOURCE=\mpeterson\cvs\openslp\slpd\slpd_regfile.h # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_socket.h # End Source File # Begin Source File SOURCE=\mpeterson\cvs\openslp\slpd\slpd_socket.h # End Source File # Begin Source File SOURCE=\mpeterson\cvs\openslp\slpd\slpd_unistd.h # End Source File # Begin Source File SOURCE=..\..\slpd\slpd_win32.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project openslp-1.2.1/win32/slpd/slpd.mak0000755033442200000310000002566407620026430016437 0ustar rganesanfloppy# Microsoft Developer Studio Generated NMAKE File, Based on slpd.dsp !IF "$(CFG)" == "" CFG=slpd - Win32 Debug !MESSAGE No configuration specified. Defaulting to slpd - Win32 Debug. !ENDIF !IF "$(CFG)" != "slpd - Win32 Release" && "$(CFG)" != "slpd - Win32 Debug" !MESSAGE Invalid configuration "$(CFG)" specified. !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "slpd.mak" CFG="slpd - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "slpd - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "slpd - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE !ERROR An invalid configuration is specified. !ENDIF !IF "$(OS)" == "Windows_NT" NULL= !ELSE NULL=nul !ENDIF CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "slpd - Win32 Release" OUTDIR=.\Release INTDIR=.\Release # Begin Custom Macros OutDir=.\Release # End Custom Macros ALL : "$(OUTDIR)\slpd.exe" CLEAN : -@erase "$(INTDIR)\libslpattr.obj" -@erase "$(INTDIR)\slp_buffer.obj" -@erase "$(INTDIR)\slp_compare.obj" -@erase "$(INTDIR)\slp_database.obj" -@erase "$(INTDIR)\slp_dhcp.obj" -@erase "$(INTDIR)\slp_iface.obj" -@erase "$(INTDIR)\slp_linkedlist.obj" -@erase "$(INTDIR)\slp_message.obj" -@erase "$(INTDIR)\slp_net.obj" -@erase "$(INTDIR)\slp_parse.obj" -@erase "$(INTDIR)\slp_pid.obj" -@erase "$(INTDIR)\slp_property.obj" -@erase "$(INTDIR)\slp_utf8.obj" -@erase "$(INTDIR)\slp_v1message.obj" -@erase "$(INTDIR)\slp_xid.obj" -@erase "$(INTDIR)\slpd.idb" -@erase "$(INTDIR)\slpd_cmdline.obj" -@erase "$(INTDIR)\slpd_database.obj" -@erase "$(INTDIR)\slpd_incoming.obj" -@erase "$(INTDIR)\slpd_knownda.obj" -@erase "$(INTDIR)\slpd_log.obj" -@erase "$(INTDIR)\slpd_main.obj" -@erase "$(INTDIR)\slpd_outgoing.obj" -@erase "$(INTDIR)\slpd_predicate.obj" -@erase "$(INTDIR)\slpd_process.obj" -@erase "$(INTDIR)\slpd_property.obj" -@erase "$(INTDIR)\slpd_regfile.obj" -@erase "$(INTDIR)\slpd_socket.obj" -@erase "$(INTDIR)\slpd_v1process.obj" -@erase "$(INTDIR)\slpd_win32.obj" -@erase "$(OUTDIR)\slpd.exe" -@erase "$(OUTDIR)\slpd.map" -@erase "$(OUTDIR)\slpd.pdb" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP_PROJ=/nologo /ML /W3 /Zi /O2 /I "../../common" /D "ENABLE" /D "ENABLE_SLPv1" /D "_WINDOWS" /D "i386" /D "USE_PREDICATES" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D SLP_VERSION=\"1.1.1\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\slpd.pdb" /FD /c MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 BSC32=bscmake.exe BSC32_FLAGS=/nologo /o"$(OUTDIR)\slpd.bsc" BSC32_SBRS= \ LINK32=link.exe LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\slpd.pdb" /map:"$(INTDIR)\slpd.map" /debug /machine:I386 /out:"$(OUTDIR)\slpd.exe" LINK32_OBJS= \ "$(INTDIR)\libslpattr.obj" \ "$(INTDIR)\slp_buffer.obj" \ "$(INTDIR)\slp_compare.obj" \ "$(INTDIR)\slp_database.obj" \ "$(INTDIR)\slp_dhcp.obj" \ "$(INTDIR)\slp_iface.obj" \ "$(INTDIR)\slp_linkedlist.obj" \ "$(INTDIR)\slp_message.obj" \ "$(INTDIR)\slp_net.obj" \ "$(INTDIR)\slp_parse.obj" \ "$(INTDIR)\slp_pid.obj" \ "$(INTDIR)\slp_property.obj" \ "$(INTDIR)\slp_utf8.obj" \ "$(INTDIR)\slp_v1message.obj" \ "$(INTDIR)\slp_xid.obj" \ "$(INTDIR)\slpd_cmdline.obj" \ "$(INTDIR)\slpd_database.obj" \ "$(INTDIR)\slpd_incoming.obj" \ "$(INTDIR)\slpd_knownda.obj" \ "$(INTDIR)\slpd_log.obj" \ "$(INTDIR)\slpd_main.obj" \ "$(INTDIR)\slpd_outgoing.obj" \ "$(INTDIR)\slpd_predicate.obj" \ "$(INTDIR)\slpd_process.obj" \ "$(INTDIR)\slpd_property.obj" \ "$(INTDIR)\slpd_regfile.obj" \ "$(INTDIR)\slpd_socket.obj" \ "$(INTDIR)\slpd_v1process.obj" \ "$(INTDIR)\slpd_win32.obj" "$(OUTDIR)\slpd.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << !ELSEIF "$(CFG)" == "slpd - Win32 Debug" OUTDIR=.\Debug INTDIR=.\Debug # Begin Custom Macros OutDir=.\Debug # End Custom Macros ALL : "$(OUTDIR)\slpd.exe" CLEAN : -@erase "$(INTDIR)\libslpattr.obj" -@erase "$(INTDIR)\slp_buffer.obj" -@erase "$(INTDIR)\slp_compare.obj" -@erase "$(INTDIR)\slp_database.obj" -@erase "$(INTDIR)\slp_dhcp.obj" -@erase "$(INTDIR)\slp_iface.obj" -@erase "$(INTDIR)\slp_linkedlist.obj" -@erase "$(INTDIR)\slp_message.obj" -@erase "$(INTDIR)\slp_net.obj" -@erase "$(INTDIR)\slp_parse.obj" -@erase "$(INTDIR)\slp_pid.obj" -@erase "$(INTDIR)\slp_property.obj" -@erase "$(INTDIR)\slp_utf8.obj" -@erase "$(INTDIR)\slp_v1message.obj" -@erase "$(INTDIR)\slp_xid.obj" -@erase "$(INTDIR)\slpd.idb" -@erase "$(INTDIR)\slpd_cmdline.obj" -@erase "$(INTDIR)\slpd_database.obj" -@erase "$(INTDIR)\slpd_incoming.obj" -@erase "$(INTDIR)\slpd_knownda.obj" -@erase "$(INTDIR)\slpd_log.obj" -@erase "$(INTDIR)\slpd_main.obj" -@erase "$(INTDIR)\slpd_outgoing.obj" -@erase "$(INTDIR)\slpd_predicate.obj" -@erase "$(INTDIR)\slpd_process.obj" -@erase "$(INTDIR)\slpd_property.obj" -@erase "$(INTDIR)\slpd_regfile.obj" -@erase "$(INTDIR)\slpd_socket.obj" -@erase "$(INTDIR)\slpd_v1process.obj" -@erase "$(INTDIR)\slpd_win32.obj" -@erase "$(OUTDIR)\slpd.exe" -@erase "$(OUTDIR)\slpd.ilk" -@erase "$(OUTDIR)\slpd.map" -@erase "$(OUTDIR)\slpd.pdb" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP_PROJ=/nologo /MLd /W3 /Gm /ZI /Od /I "../../common" /D "ENABLE_SLPv1" /D "_WINDOWS" /D "i386" /D "USE_PREDICATES" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D SLP_VERSION=\"1.1.1\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\slpd.pdb" /FD /GZ /c MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 BSC32=bscmake.exe BSC32_FLAGS=/nologo /o"$(OUTDIR)\slpd.bsc" BSC32_SBRS= \ LINK32=link.exe LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\slpd.pdb" /map:"$(INTDIR)\slpd.map" /debug /machine:I386 /out:"$(OUTDIR)\slpd.exe" LINK32_OBJS= \ "$(INTDIR)\libslpattr.obj" \ "$(INTDIR)\slp_buffer.obj" \ "$(INTDIR)\slp_compare.obj" \ "$(INTDIR)\slp_database.obj" \ "$(INTDIR)\slp_dhcp.obj" \ "$(INTDIR)\slp_iface.obj" \ "$(INTDIR)\slp_linkedlist.obj" \ "$(INTDIR)\slp_message.obj" \ "$(INTDIR)\slp_net.obj" \ "$(INTDIR)\slp_parse.obj" \ "$(INTDIR)\slp_pid.obj" \ "$(INTDIR)\slp_property.obj" \ "$(INTDIR)\slp_utf8.obj" \ "$(INTDIR)\slp_v1message.obj" \ "$(INTDIR)\slp_xid.obj" \ "$(INTDIR)\slpd_cmdline.obj" \ "$(INTDIR)\slpd_database.obj" \ "$(INTDIR)\slpd_incoming.obj" \ "$(INTDIR)\slpd_knownda.obj" \ "$(INTDIR)\slpd_log.obj" \ "$(INTDIR)\slpd_main.obj" \ "$(INTDIR)\slpd_outgoing.obj" \ "$(INTDIR)\slpd_predicate.obj" \ "$(INTDIR)\slpd_process.obj" \ "$(INTDIR)\slpd_property.obj" \ "$(INTDIR)\slpd_regfile.obj" \ "$(INTDIR)\slpd_socket.obj" \ "$(INTDIR)\slpd_v1process.obj" \ "$(INTDIR)\slpd_win32.obj" "$(OUTDIR)\slpd.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << !ENDIF .c{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .c{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << !IF "$(NO_EXTERNAL_DEPS)" != "1" !IF EXISTS("slpd.dep") !INCLUDE "slpd.dep" !ELSE !MESSAGE Warning: cannot find "slpd.dep" !ENDIF !ENDIF !IF "$(CFG)" == "slpd - Win32 Release" || "$(CFG)" == "slpd - Win32 Debug" SOURCE=..\..\libslpattr\libslpattr.c "$(INTDIR)\libslpattr.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_buffer.c "$(INTDIR)\slp_buffer.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_compare.c "$(INTDIR)\slp_compare.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_database.c "$(INTDIR)\slp_database.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_dhcp.c "$(INTDIR)\slp_dhcp.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_iface.c "$(INTDIR)\slp_iface.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_linkedlist.c "$(INTDIR)\slp_linkedlist.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_message.c "$(INTDIR)\slp_message.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_net.c "$(INTDIR)\slp_net.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_parse.c "$(INTDIR)\slp_parse.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_pid.c "$(INTDIR)\slp_pid.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_property.c "$(INTDIR)\slp_property.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_utf8.c "$(INTDIR)\slp_utf8.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_v1message.c "$(INTDIR)\slp_v1message.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_xid.c "$(INTDIR)\slp_xid.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\slpd\slpd_cmdline.c "$(INTDIR)\slpd_cmdline.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\slpd\slpd_database.c "$(INTDIR)\slpd_database.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\slpd\slpd_incoming.c "$(INTDIR)\slpd_incoming.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\slpd\slpd_knownda.c "$(INTDIR)\slpd_knownda.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\slpd\slpd_log.c "$(INTDIR)\slpd_log.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\slpd\slpd_main.c "$(INTDIR)\slpd_main.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\slpd\slpd_outgoing.c "$(INTDIR)\slpd_outgoing.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\slpd\slpd_predicate.c "$(INTDIR)\slpd_predicate.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\slpd\slpd_process.c "$(INTDIR)\slpd_process.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\slpd\slpd_property.c "$(INTDIR)\slpd_property.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\slpd\slpd_regfile.c "$(INTDIR)\slpd_regfile.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\slpd\slpd_socket.c "$(INTDIR)\slpd_socket.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\\slpd\slpd_v1process.c "$(INTDIR)\slpd_v1process.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\slpd\slpd_win32.c "$(INTDIR)\slpd_win32.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF openslp-1.2.1/win32/slpd/slpd.bpr0000644033442200000310000001636207561773367016470 0ustar rganesanfloppy openslp-1.2.1/win32/slpd/.cvsignore0000644033442200000310000000004010211366511016752 0ustar rganesanfloppyDebug Release slpd.map slpd.tds openslp-1.2.1/win32/slpd/slpd.vcproj0000644033442200000310000005657110202213615017161 0ustar rganesanfloppy openslp-1.2.1/win32/slpd/slpd.bpf0000644033442200000310000000014107561773367016440 0ustar rganesanfloppyThis file is used by the project manager only and should be treated like the project file main openslp-1.2.1/win32/slpd/m.bat0000755033442200000310000000036307620026427015722 0ustar rganesanfloppy@echo off if not exist slpd.dep set NO_EXTERNAL_DEPS=1 nmake /nologo /s /f slpd.mak CFG="slpd - Win32 Debug" %1 %2 %3 %4 %5 %6 %7 %8 %9 nmake /nologo /s /f slpd.mak CFG="slpd - Win32 Release" %1 %2 %3 %4 %5 %6 %7 %8 %9 set NO_EXTERNAL_DEPS= openslp-1.2.1/win32/.cvsignore0000644033442200000310000000004410202254555016020 0ustar rganesanfloppyopenslp.dsk openslp.suo openslp.ncb openslp-1.2.1/win32/openslp.sln0000644033442200000310000000371410202206764016224 0ustar rganesanfloppyMicrosoft Visual Studio Solution File, Format Version 8.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libslp", "libslp\libslp.vcproj", "{BE7E922E-9D34-4482-A039-592394240744}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "slpd", "slpd\slpd.vcproj", "{DA8B9647-28D1-4CB8-8081-4F356C9CC674}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "slptool", "slptool\slptool.vcproj", "{9B5F060E-4ED8-42BF-828C-47B29A601BCB}" ProjectSection(ProjectDependencies) = postProject {BE7E922E-9D34-4482-A039-592394240744} = {BE7E922E-9D34-4482-A039-592394240744} EndProjectSection EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug Release = Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {BE7E922E-9D34-4482-A039-592394240744}.Debug.ActiveCfg = Debug|Win32 {BE7E922E-9D34-4482-A039-592394240744}.Debug.Build.0 = Debug|Win32 {BE7E922E-9D34-4482-A039-592394240744}.Release.ActiveCfg = Release|Win32 {BE7E922E-9D34-4482-A039-592394240744}.Release.Build.0 = Release|Win32 {DA8B9647-28D1-4CB8-8081-4F356C9CC674}.Debug.ActiveCfg = Debug|Win32 {DA8B9647-28D1-4CB8-8081-4F356C9CC674}.Debug.Build.0 = Debug|Win32 {DA8B9647-28D1-4CB8-8081-4F356C9CC674}.Release.ActiveCfg = Release|Win32 {DA8B9647-28D1-4CB8-8081-4F356C9CC674}.Release.Build.0 = Release|Win32 {9B5F060E-4ED8-42BF-828C-47B29A601BCB}.Debug.ActiveCfg = Debug|Win32 {9B5F060E-4ED8-42BF-828C-47B29A601BCB}.Debug.Build.0 = Debug|Win32 {9B5F060E-4ED8-42BF-828C-47B29A601BCB}.Release.ActiveCfg = Release|Win32 {9B5F060E-4ED8-42BF-828C-47B29A601BCB}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal openslp-1.2.1/win32/m.bat0000755033442200000310000000076110211366240014750 0ustar rganesanfloppy@echo off setlocal if not "%DevEnvDir%"=="" goto vc7x :vc6x cd libslp call m.bat %1 %2 %3 %4 %5 %6 %7 %8 %9 cd ..\slpd call m.bat %1 %2 %3 %4 %5 %6 %7 %8 %9 cd ..\slptool call m.bat %1 %2 %3 %4 %5 %6 %7 %8 %9 cd .. goto done :vc7x set SolutionConfig=Release set Target=build :nextparam shift if "%0"=="debug" set SolutionConfig=%0 if "%0"=="clean" set Target=clean if "%0"=="" goto dobuild goto nextparam :dobuild "%DevEnvDir%\devenv.exe" openslp.sln /%Target% %SolutionConfig% :done endlocalopenslp-1.2.1/win32/openslp.dsw0000755033442200000310000000154010204465614016226 0ustar rganesanfloppyMicrosoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "libslp"=.\libslp\libslp.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "slpd"=.\slpd\slpd.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "slptool"=.\slptool\slptool.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### openslp-1.2.1/win32/libslp/0000755033442200000310000000000010211377554015314 5ustar rganesanfloppyopenslp-1.2.1/win32/libslp/libslp.mak0000755033442200000310000002777007620026425017311 0ustar rganesanfloppy# Microsoft Developer Studio Generated NMAKE File, Based on libslp.dsp !IF "$(CFG)" == "" CFG=libslp - Win32 Debug !MESSAGE No configuration specified. Defaulting to libslp - Win32 Debug. !ENDIF !IF "$(CFG)" != "libslp - Win32 Release" && "$(CFG)" != "libslp - Win32 Debug" !MESSAGE Invalid configuration "$(CFG)" specified. !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "libslp.mak" CFG="libslp - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "libslp - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "libslp - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE !ERROR An invalid configuration is specified. !ENDIF !IF "$(OS)" == "Windows_NT" NULL= !ELSE NULL=nul !ENDIF CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "libslp - Win32 Release" OUTDIR=.\Release INTDIR=.\Release\obj # Begin Custom Macros OutDir=.\Release # End Custom Macros ALL : "$(OUTDIR)\slp.dll" CLEAN : -@erase "$(INTDIR)\libslp_delattrs.obj" -@erase "$(INTDIR)\libslp_dereg.obj" -@erase "$(INTDIR)\libslp_findattrs.obj" -@erase "$(INTDIR)\libslp_findscopes.obj" -@erase "$(INTDIR)\libslp_findsrvs.obj" -@erase "$(INTDIR)\libslp_findsrvtypes.obj" -@erase "$(INTDIR)\libslp_handle.obj" -@erase "$(INTDIR)\libslp_knownda.obj" -@erase "$(INTDIR)\libslp_network.obj" -@erase "$(INTDIR)\libslp_parse.obj" -@erase "$(INTDIR)\libslp_property.obj" -@erase "$(INTDIR)\libslp_reg.obj" -@erase "$(INTDIR)\libslp_thread.obj" -@erase "$(INTDIR)\slp_buffer.obj" -@erase "$(INTDIR)\slp_compare.obj" -@erase "$(INTDIR)\slp_database.obj" -@erase "$(INTDIR)\slp_dhcp.obj" -@erase "$(INTDIR)\slp_iface.obj" -@erase "$(INTDIR)\slp_linkedlist.obj" -@erase "$(INTDIR)\slp_message.obj" -@erase "$(INTDIR)\slp_net.obj" -@erase "$(INTDIR)\slp_network.obj" -@erase "$(INTDIR)\slp_parse.obj" -@erase "$(INTDIR)\slp_pid.obj" -@erase "$(INTDIR)\slp_property.obj" -@erase "$(INTDIR)\slp_utf8.obj" -@erase "$(INTDIR)\slp_v1message.obj" -@erase "$(INTDIR)\slp_xcast.obj" -@erase "$(INTDIR)\slp_xid.obj" -@erase "$(OUTDIR)\slp.dll" -@erase "$(OUTDIR)\slp.exp" -@erase "$(OUTDIR)\slp.lib" -@erase "$(OUTDIR)\slp.map" -@erase "$(OUTDIR)\slp.pdb" -@erase ".\Release\slp.idb" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" "$(INTDIR)" : if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" CPP_PROJ=/nologo /MT /W3 /Zi /O2 /I "../../common" /D "_USRDLL" /D "LIBSLP_EXPORTS" /D "ENABLE" /D "_WINDOWS" /D "i386" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D SLP_VERSION=\"1.1.1\" /Fo"$(INTDIR)\\" /Fd"Release\slp.pdb" /FD /c MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 BSC32=bscmake.exe BSC32_FLAGS=/nologo /o"$(OUTDIR)\libslp.bsc" BSC32_SBRS= \ LINK32=link.exe LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\slp.pdb" /map:"Release/slp.map" /debug /machine:I386 /out:"$(OUTDIR)\slp.dll" /implib:"$(OUTDIR)\slp.lib" LINK32_OBJS= \ "$(INTDIR)\libslp_delattrs.obj" \ "$(INTDIR)\libslp_dereg.obj" \ "$(INTDIR)\libslp_findattrs.obj" \ "$(INTDIR)\libslp_findscopes.obj" \ "$(INTDIR)\libslp_findsrvs.obj" \ "$(INTDIR)\libslp_findsrvtypes.obj" \ "$(INTDIR)\libslp_handle.obj" \ "$(INTDIR)\libslp_knownda.obj" \ "$(INTDIR)\libslp_network.obj" \ "$(INTDIR)\libslp_parse.obj" \ "$(INTDIR)\libslp_property.obj" \ "$(INTDIR)\libslp_reg.obj" \ "$(INTDIR)\libslp_thread.obj" \ "$(INTDIR)\slp_buffer.obj" \ "$(INTDIR)\slp_compare.obj" \ "$(INTDIR)\slp_database.obj" \ "$(INTDIR)\slp_dhcp.obj" \ "$(INTDIR)\slp_iface.obj" \ "$(INTDIR)\slp_linkedlist.obj" \ "$(INTDIR)\slp_message.obj" \ "$(INTDIR)\slp_net.obj" \ "$(INTDIR)\slp_network.obj" \ "$(INTDIR)\slp_parse.obj" \ "$(INTDIR)\slp_pid.obj" \ "$(INTDIR)\slp_property.obj" \ "$(INTDIR)\slp_utf8.obj" \ "$(INTDIR)\slp_v1message.obj" \ "$(INTDIR)\slp_xcast.obj" \ "$(INTDIR)\slp_xid.obj" "$(OUTDIR)\slp.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << SOURCE="$(InputPath)" DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep ALL : $(DS_POSTBUILD_DEP) # Begin Custom Macros OutDir=.\Release # End Custom Macros $(DS_POSTBUILD_DEP) : "$(OUTDIR)\slp.dll" copy ..\..\libslp\slp.h release echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)" !ELSEIF "$(CFG)" == "libslp - Win32 Debug" OUTDIR=.\Debug INTDIR=.\Debug\obj # Begin Custom Macros OutDir=.\Debug # End Custom Macros ALL : "$(OUTDIR)\slp.dll" CLEAN : -@erase "$(INTDIR)\libslp_delattrs.obj" -@erase "$(INTDIR)\libslp_dereg.obj" -@erase "$(INTDIR)\libslp_findattrs.obj" -@erase "$(INTDIR)\libslp_findscopes.obj" -@erase "$(INTDIR)\libslp_findsrvs.obj" -@erase "$(INTDIR)\libslp_findsrvtypes.obj" -@erase "$(INTDIR)\libslp_handle.obj" -@erase "$(INTDIR)\libslp_knownda.obj" -@erase "$(INTDIR)\libslp_network.obj" -@erase "$(INTDIR)\libslp_parse.obj" -@erase "$(INTDIR)\libslp_property.obj" -@erase "$(INTDIR)\libslp_reg.obj" -@erase "$(INTDIR)\libslp_thread.obj" -@erase "$(INTDIR)\slp_buffer.obj" -@erase "$(INTDIR)\slp_compare.obj" -@erase "$(INTDIR)\slp_database.obj" -@erase "$(INTDIR)\slp_dhcp.obj" -@erase "$(INTDIR)\slp_iface.obj" -@erase "$(INTDIR)\slp_linkedlist.obj" -@erase "$(INTDIR)\slp_message.obj" -@erase "$(INTDIR)\slp_net.obj" -@erase "$(INTDIR)\slp_network.obj" -@erase "$(INTDIR)\slp_parse.obj" -@erase "$(INTDIR)\slp_pid.obj" -@erase "$(INTDIR)\slp_property.obj" -@erase "$(INTDIR)\slp_utf8.obj" -@erase "$(INTDIR)\slp_v1message.obj" -@erase "$(INTDIR)\slp_xcast.obj" -@erase "$(INTDIR)\slp_xid.obj" -@erase "$(OUTDIR)\slp.dll" -@erase "$(OUTDIR)\slp.exp" -@erase "$(OUTDIR)\slp.ilk" -@erase "$(OUTDIR)\slp.lib" -@erase "$(OUTDIR)\slp.map" -@erase "$(OUTDIR)\slp.pdb" -@erase ".\Debug\slp.idb" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" "$(INTDIR)" : if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" CPP_PROJ=/nologo /MTd /W3 /Gm /ZI /Od /I "../../common" /D "_USRDLL" /D "LIBSLP_EXPORTS" /D "_WINDOWS" /D "i386" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D SLP_VERSION=\"1.1.1\" /Fo"$(INTDIR)\\" /Fd"Debug/slp.pdb" /FD /GZ /c MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 BSC32=bscmake.exe BSC32_FLAGS=/nologo /o"$(OUTDIR)\libslp.bsc" BSC32_SBRS= \ LINK32=link.exe LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\slp.pdb" /map:"Debug/slp.map" /debug /machine:I386 /out:"$(OUTDIR)\slp.dll" /implib:"$(OUTDIR)\slp.lib" LINK32_OBJS= \ "$(INTDIR)\libslp_delattrs.obj" \ "$(INTDIR)\libslp_dereg.obj" \ "$(INTDIR)\libslp_findattrs.obj" \ "$(INTDIR)\libslp_findscopes.obj" \ "$(INTDIR)\libslp_findsrvs.obj" \ "$(INTDIR)\libslp_findsrvtypes.obj" \ "$(INTDIR)\libslp_handle.obj" \ "$(INTDIR)\libslp_knownda.obj" \ "$(INTDIR)\libslp_network.obj" \ "$(INTDIR)\libslp_parse.obj" \ "$(INTDIR)\libslp_property.obj" \ "$(INTDIR)\libslp_reg.obj" \ "$(INTDIR)\libslp_thread.obj" \ "$(INTDIR)\slp_buffer.obj" \ "$(INTDIR)\slp_compare.obj" \ "$(INTDIR)\slp_database.obj" \ "$(INTDIR)\slp_dhcp.obj" \ "$(INTDIR)\slp_iface.obj" \ "$(INTDIR)\slp_linkedlist.obj" \ "$(INTDIR)\slp_message.obj" \ "$(INTDIR)\slp_net.obj" \ "$(INTDIR)\slp_network.obj" \ "$(INTDIR)\slp_parse.obj" \ "$(INTDIR)\slp_pid.obj" \ "$(INTDIR)\slp_property.obj" \ "$(INTDIR)\slp_utf8.obj" \ "$(INTDIR)\slp_v1message.obj" \ "$(INTDIR)\slp_xcast.obj" \ "$(INTDIR)\slp_xid.obj" "$(OUTDIR)\slp.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << SOURCE="$(InputPath)" PostBuild_Desc=Copy slp.h ... DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep ALL : $(DS_POSTBUILD_DEP) # Begin Custom Macros OutDir=.\Debug # End Custom Macros $(DS_POSTBUILD_DEP) : "$(OUTDIR)\slp.dll" copy ..\..\libslp\slp.h debug echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)" !ENDIF .c{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .c{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << !IF "$(NO_EXTERNAL_DEPS)" != "1" !IF EXISTS("libslp.dep") !INCLUDE "libslp.dep" !ELSE !MESSAGE Warning: cannot find "libslp.dep" !ENDIF !ENDIF !IF "$(CFG)" == "libslp - Win32 Release" || "$(CFG)" == "libslp - Win32 Debug" SOURCE=..\..\libslp\libslp_delattrs.c "$(INTDIR)\libslp_delattrs.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\libslp\libslp_dereg.c "$(INTDIR)\libslp_dereg.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\libslp\libslp_findattrs.c "$(INTDIR)\libslp_findattrs.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\libslp\libslp_findscopes.c "$(INTDIR)\libslp_findscopes.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\libslp\libslp_findsrvs.c "$(INTDIR)\libslp_findsrvs.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\libslp\libslp_findsrvtypes.c "$(INTDIR)\libslp_findsrvtypes.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\libslp\libslp_handle.c "$(INTDIR)\libslp_handle.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\libslp\libslp_knownda.c "$(INTDIR)\libslp_knownda.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\libslp\libslp_network.c "$(INTDIR)\libslp_network.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\libslp\libslp_parse.c "$(INTDIR)\libslp_parse.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\libslp\libslp_property.c "$(INTDIR)\libslp_property.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\libslp\libslp_reg.c "$(INTDIR)\libslp_reg.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\libslp\libslp_thread.c "$(INTDIR)\libslp_thread.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_buffer.c "$(INTDIR)\slp_buffer.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_compare.c "$(INTDIR)\slp_compare.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_database.c "$(INTDIR)\slp_database.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_dhcp.c "$(INTDIR)\slp_dhcp.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_iface.c "$(INTDIR)\slp_iface.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_linkedlist.c "$(INTDIR)\slp_linkedlist.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_message.c "$(INTDIR)\slp_message.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_net.c "$(INTDIR)\slp_net.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_network.c "$(INTDIR)\slp_network.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_parse.c "$(INTDIR)\slp_parse.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_pid.c "$(INTDIR)\slp_pid.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_property.c "$(INTDIR)\slp_property.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_utf8.c "$(INTDIR)\slp_utf8.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_v1message.c "$(INTDIR)\slp_v1message.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_xcast.c "$(INTDIR)\slp_xcast.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) SOURCE=..\..\common\slp_xid.c "$(INTDIR)\slp_xid.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF openslp-1.2.1/win32/libslp/libslp.vcproj0000644033442200000310000006674610202213575020041 0ustar rganesanfloppy openslp-1.2.1/win32/libslp/.cvsignore0000644033442200000310000000005610211366472017312 0ustar rganesanfloppyDebug Release slp.dll slp.lib slp.map slp.tds openslp-1.2.1/win32/libslp/slp.bpr0000644033442200000310000001606407561766060016636 0ustar rganesanfloppy openslp-1.2.1/win32/libslp/libslp.def0000644033442200000310000000046110204465615017260 0ustar rganesanfloppyLIBRARY slp.dll DESCRIPTION "Service Location Protocol Core Library" EXPORTS SLPClose SLPDelAttrs SLPDereg SLPEscape SLPFindAttrs SLPFindScopes SLPFindSrvTypes SLPFindSrvs SLPFree SLPGetProperty SLPGetRefreshInterval SLPOpen SLPParseAttrs SLPParseSrvURL SLPReg SLPSetProperty SLPUnescape openslp-1.2.1/win32/libslp/libslp.dsp0000755033442200000310000001742310207404662017317 0ustar rganesanfloppy# Microsoft Developer Studio Project File - Name="libslp" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=libslp - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "libslp.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "libslp.mak" CFG="libslp - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "libslp - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "libslp - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "libslp - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release\obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBSLP_EXPORTS" /YX /FD /c # ADD CPP /nologo /MT /W3 /Zi /O2 /I "../../common" /D "_USRDLL" /D "LIBSLP_EXPORTS" /D "ENABLE" /D "_WINDOWS" /D "i386" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D SLP_VERSION=\"1.1.1\" /Fd"Release\slp.pdb" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /map:"Release/slp.map" /debug /machine:I386 /out:"Release/slp.dll" # Begin Special Build Tool SOURCE="$(InputPath)" PostBuild_Cmds=copy ..\..\libslp\slp.h release # End Special Build Tool !ELSEIF "$(CFG)" == "libslp - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug\obj" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBSLP_EXPORTS" /YX /FD /GZ /c # ADD CPP /nologo /MTd /W3 /Gm /ZI /Od /I "../../common" /D "_USRDLL" /D "LIBSLP_EXPORTS" /D "_WINDOWS" /D "i386" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D SLP_VERSION=\"1.1.1\" /Fd"Debug/slp.pdb" /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /map:"Debug/slp.map" /debug /machine:I386 /out:"Debug/slp.dll" # Begin Special Build Tool SOURCE="$(InputPath)" PostBuild_Desc=Copy slp.h ... PostBuild_Cmds=copy ..\..\libslp\slp.h debug # End Special Build Tool !ENDIF # Begin Target # Name "libslp - Win32 Release" # Name "libslp - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\libslp\libslp_delattrs.c # End Source File # Begin Source File SOURCE=..\..\libslp\libslp_dereg.c # End Source File # Begin Source File SOURCE=..\..\libslp\libslp_findattrs.c # End Source File # Begin Source File SOURCE=..\..\libslp\libslp_findscopes.c # End Source File # Begin Source File SOURCE=..\..\libslp\libslp_findsrvs.c # End Source File # Begin Source File SOURCE=..\..\libslp\libslp_findsrvtypes.c # End Source File # Begin Source File SOURCE=..\..\libslp\libslp_handle.c # End Source File # Begin Source File SOURCE=..\..\libslp\libslp_knownda.c # End Source File # Begin Source File SOURCE=..\..\libslp\libslp_network.c # End Source File # Begin Source File SOURCE=..\..\libslp\libslp_parse.c # End Source File # Begin Source File SOURCE=..\..\libslp\libslp_property.c # End Source File # Begin Source File SOURCE=..\..\libslp\libslp_reg.c # End Source File # Begin Source File SOURCE=..\..\libslp\libslp_thread.c # End Source File # Begin Source File SOURCE=..\..\common\slp_buffer.c # End Source File # Begin Source File SOURCE=..\..\common\slp_compare.c # End Source File # Begin Source File SOURCE=..\..\common\slp_database.c # End Source File # Begin Source File SOURCE=..\..\common\slp_dhcp.c # End Source File # Begin Source File SOURCE=..\..\common\slp_iface.c # End Source File # Begin Source File SOURCE=..\..\common\slp_linkedlist.c # End Source File # Begin Source File SOURCE=..\..\common\slp_message.c # End Source File # Begin Source File SOURCE=..\..\common\slp_net.c # End Source File # Begin Source File SOURCE=..\..\common\slp_network.c # End Source File # Begin Source File SOURCE=..\..\common\slp_parse.c # End Source File # Begin Source File SOURCE=..\..\common\slp_pid.c # End Source File # Begin Source File SOURCE=..\..\common\slp_property.c # End Source File # Begin Source File SOURCE=..\..\common\slp_utf8.c # End Source File # Begin Source File SOURCE=..\..\common\slp_v1message.c # End Source File # Begin Source File SOURCE=..\..\common\slp_xcast.c # End Source File # Begin Source File SOURCE=..\..\common\slp_xid.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\libslp\libslp.h # End Source File # Begin Source File SOURCE=..\..\libslp\slp.h # End Source File # Begin Source File SOURCE=..\..\common\slp_buffer.h # End Source File # Begin Source File SOURCE=..\..\common\slp_compare.h # End Source File # Begin Source File SOURCE=..\..\common\slp_database.h # End Source File # Begin Source File SOURCE=..\..\common\slp_dhcp.h # End Source File # Begin Source File SOURCE=..\..\common\slp_iface.h # End Source File # Begin Source File SOURCE=..\..\common\slp_linkedlist.h # End Source File # Begin Source File SOURCE=..\..\common\slp_message.h # End Source File # Begin Source File SOURCE=..\..\common\slp_net.h # End Source File # Begin Source File SOURCE=..\..\common\slp_network.h # End Source File # Begin Source File SOURCE=..\..\common\slp_parse.h # End Source File # Begin Source File SOURCE=..\..\common\slp_pid.h # End Source File # Begin Source File SOURCE=..\..\common\slp_property.h # End Source File # Begin Source File SOURCE=..\..\common\slp_utf8.h # End Source File # Begin Source File SOURCE=..\..\common\slp_v1message.h # End Source File # Begin Source File SOURCE=..\..\common\slp_xcast.h # End Source File # Begin Source File SOURCE=..\..\common\slp_xid.h # End Source File # Begin Source File SOURCE=..\..\common\slp_xmalloc.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project openslp-1.2.1/win32/libslp/slp.bpf0000644033442200000310000000014407550561015016601 0ustar rganesanfloppyThis file is used by the project manager only and should be treated like the project file DllMain openslp-1.2.1/win32/libslp/m.bat0000755033442200000310000000037507620026426016247 0ustar rganesanfloppy@echo off if not exist libslp.dep set NO_EXTERNAL_DEPS=1 nmake /nologo /s /f libslp.mak CFG="libslp - Win32 Debug" %1 %2 %3 %4 %5 %6 %7 %8 %9 nmake /nologo /s /f libslp.mak CFG="libslp - Win32 Release" %1 %2 %3 %4 %5 %6 %7 %8 %9 set NO_EXTERNAL_DEPS= openslp-1.2.1/configure0000755033442200000310000261263010641470757015014 0ustar rganesanfloppy#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for openslp 1.2.1. # # Report bugs to . # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi tagnames=${tagnames+${tagnames},}CXX tagnames=${tagnames+${tagnames},}F77 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='openslp' PACKAGE_TARNAME='openslp' PACKAGE_VERSION='1.2.1' PACKAGE_STRING='openslp 1.2.1' PACKAGE_BUGREPORT='openslp-devel@lists.sourceforge.net' ac_unique_file="slpd/slpd_main.c" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" 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 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 mkdir_p AWK SET_MAKE am__leading_dot build build_cpu build_vendor build_os host host_cpu host_vendor host_os ENABLE_SLPv1_TRUE ENABLE_SLPv1_FALSE ENABLE_PREDICATES_TRUE ENABLE_PREDICATES_FALSE ENABLE_ASYNC_API_TRUE ENABLE_ASYNC_API_FALSE 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 ENABLE_SLPv2_SECURITY_TRUE ENABLE_SLPv2_SECURITY_FALSE EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LEX LEXLIB LEX_OUTPUT_ROOT YACC LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS ac_env_CXXCPP_set=${CXXCPP+set} ac_env_CXXCPP_value=$CXXCPP ac_cv_env_CXXCPP_set=${CXXCPP+set} ac_cv_env_CXXCPP_value=$CXXCPP ac_env_F77_set=${F77+set} ac_env_F77_value=$F77 ac_cv_env_F77_set=${F77+set} ac_cv_env_F77_value=$F77 ac_env_FFLAGS_set=${FFLAGS+set} ac_env_FFLAGS_value=$FFLAGS ac_cv_env_FFLAGS_set=${FFLAGS+set} ac_cv_env_FFLAGS_value=$FFLAGS # # Report the --help message. # 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 openslp 1.2.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of openslp 1.2.1:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-debug Turn on debugging (default off) --enable-slpv1 Turn on SLPv1 support (default on) --disable-predicates Turn off predicates --enable-async-api Turn on asyncronous support (default off) --enable-slpv2-security Turn on security support (default off) --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF openslp configure 1.2.1 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log 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 openslp $as_me 1.2.1, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version="1.8" ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. am__api_version="1.4" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # Keeping the `.' argument allows $(mkdir_p) to be used without # argument. Indeed, we sometimes output rules like # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more # expensive solution, as it forces Make to start a sub-shell.) mkdir_p='mkdir -p -- .' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='openslp' VERSION='1.2.1' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} AMTAR=${AMTAR-"${am_missing_run}tar"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. ac_config_headers="$ac_config_headers config.h" test "$prefix" = NONE && prefix=/usr if test "$prefix" = '/usr'; then # We don't want /usr/etc and /usr/var test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc test "$sharedstatedir" = '${prefix}/com' && localstatedir=/var test "$localstatedir" = '${prefix}/var' && localstatedir=/var fi # Check whether --enable-debug or --disable-debug was given. if test "${enable_debug+set}" = set; then enableval="$enable_debug" debug=$enableval else debug=no fi; CFLAGS="${CFLAGS:=}" LDFLAGS="${LDFLAGS:=}" case "$debug" in yes) CFLAGS="-g -DDEBUG -D_REENTRANT=1 $CFLAGS" ;; no) CFLAGS="-DNDEBUG -D_REENTRANT=1 $CFLAGS" ;; *) { { echo "$as_me:$LINENO: error: bad value ${debug} for --enable-debug" >&5 echo "$as_me: error: bad value ${debug} for --enable-debug" >&2;} { (exit 1); exit 1; }; } ;; esac # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` case "$host_os" in *linux*) CFLAGS="$CFLAGS -DLINUX" ;; *solaris*) CFLAGS="$CFLAGS -DSOLARIS";; *aix*) CFLAGS="$CFLAGS -DAIX";; *hpux*) CFLAGS="$CFLAGS -DHPUX";; esac # Check whether --enable-slpv1 or --disable-slpv1 was given. if test "${enable_slpv1+set}" = set; then enableval="$enable_slpv1" slpv1=$enableval else slpv1=yes fi; if test "$slpv1" = "yes"; then ENABLE_SLPv1_TRUE= ENABLE_SLPv1_FALSE='#' else ENABLE_SLPv1_TRUE='#' ENABLE_SLPv1_FALSE= fi if test "$slpv1" = "yes"; then cat >>confdefs.h <<\_ACEOF #define ENABLE_SLPv1 1 _ACEOF fi # Check whether --enable-predicates or --disable-predicates was given. if test "${enable_predicates+set}" = set; then enableval="$enable_predicates" predicates=$enableval else predicates=yes fi; if test "$predicates" = "yes"; then ENABLE_PREDICATES_TRUE= ENABLE_PREDICATES_FALSE='#' else ENABLE_PREDICATES_TRUE='#' ENABLE_PREDICATES_FALSE= fi if test "$predicates" = "yes"; then cat >>confdefs.h <<\_ACEOF #define ENABLE_PREDICATES 1 _ACEOF fi # Check whether --enable-async-api or --disable-async-api was given. if test "${enable_async_api+set}" = set; then enableval="$enable_async_api" asyncapi=$enableval else asyncapi=no fi; if test "$asyncapi" = "yes"; then ENABLE_ASYNC_API_TRUE= ENABLE_ASYNC_API_FALSE='#' else ENABLE_ASYNC_API_TRUE='#' ENABLE_ASYNC_API_FALSE= fi if test "$asyncapi" = "yes"; then cat >>confdefs.h <<\_ACEOF #define ENABLE_ASYNC_API 1 _ACEOF fi # Check whether --enable-slpv2-security or --disable-slpv2-security was given. if test "${enable_slpv2_security+set}" = set; then enableval="$enable_slpv2_security" slpv2security=$enableval else slpv2security=no fi; DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval="$enable_dependency_tracking" fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (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 cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+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. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+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. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _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 ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+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. */ int main () { ; return 0; } _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 ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _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 for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _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 : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _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 break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # (even with -Werror). So we grep stderr for any message # that says an option was ignored. if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi echo "$as_me:$LINENO: checking for DSA_sign in -lcrypto" >&5 echo $ECHO_N "checking for DSA_sign in -lcrypto... $ECHO_C" >&6 if test "${ac_cv_lib_crypto_DSA_sign+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char DSA_sign (); int main () { DSA_sign (); ; 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_crypto_DSA_sign=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_crypto_DSA_sign=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_crypto_DSA_sign" >&5 echo "${ECHO_T}$ac_cv_lib_crypto_DSA_sign" >&6 if test $ac_cv_lib_crypto_DSA_sign = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBCRYPTO 1 _ACEOF LIBS="-lcrypto $LIBS" fi for ac_func in DSA_verify DSA_size DSA_free SHA1 do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+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. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; 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 eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "$slpv2security" = "yes"; then ENABLE_SLPv2_SECURITY_TRUE= ENABLE_SLPv2_SECURITY_FALSE='#' else ENABLE_SLPv2_SECURITY_TRUE='#' ENABLE_SLPv2_SECURITY_FALSE= fi if test "$slpv2security" = "yes"; then cat >>confdefs.h <<\_ACEOF #define ENABLE_SLPv2_SECURITY 1 _ACEOF fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+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. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _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 ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+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. */ int main () { ; return 0; } _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 ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _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 for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _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 : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _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 break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # (even with -Werror). So we grep stderr for any message # that says an option was ignored. if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi; # Check whether --enable-static or --disable-static was given. if test "${enable_static+set}" = set; then enableval="$enable_static" p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi; # Check whether --enable-fast-install or --disable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval="$enable_fast_install" p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi; echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 if test "${lt_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && break cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done SED=$lt_cv_path_SED fi echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6 echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/${ac_tool_prefix}nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac esac fi done IFS="$lt_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 echo "${ECHO_T}$lt_cv_path_NM" >&6 NM="$lt_cv_path_NM" echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi4*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # win32_libid shell function, so use a weaker test based on 'objdump'. lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | kfreebsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case "$host_cpu" in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) case $host_cpu in alpha*|hppa*|i*86|ia64*|m68*|mips*|powerpc*|sparc*|s390*|sh*|x86_64) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; esac lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' else lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac fi echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 4890 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case "`/usr/bin/file conftest.o`" in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 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 lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; esac need_locks="$enable_libtool_lock" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+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. */ #include #include #include #include int main () { ; return 0; } _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 ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./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 : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.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. */ $ac_includes_default #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 dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then 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 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #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 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------- ## ## Report this to openslp-devel@lists.sourceforge.net ## ## -------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac 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 eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi 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 ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+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. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _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_cxx_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 ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+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. */ int main () { ; return 0; } _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_cxx_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 ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _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_cxx_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 : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _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_cxx_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 break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu depcc="$CXX" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # (even with -Werror). So we grep stderr for any message # that says an option was ignored. if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6 ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then echo "$as_me:$LINENO: result: $F77" >&5 echo "${ECHO_T}$F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_F77="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 echo "${ECHO_T}$ac_ct_F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_F77" && break done F77=$ac_ct_F77 fi # Provide some information about the compiler. echo "$as_me:6457:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 if test "${ac_cv_f77_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _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_f77_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 ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_f77_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main end _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_f77_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 ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi G77=`test $ac_compiler_gnu = yes && echo yes` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 if test "${lt_cv_sys_max_cmd_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else i=0 testring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while (test "X"`$CONFIG_SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \ = "XX$testring") >/dev/null 2>&1 && new_result=`expr "X$testring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` testring=$testring$testring done testring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 else echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris* | sysv5*) symcode='[BDRT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6 else echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 fi echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6 if test "${lt_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 echo "${ECHO_T}$lt_cv_objdir" >&6 objdir=$lt_cv_objdir case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi AR=$ac_ct_AR else AR="$ac_cv_prog_AR" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo "$as_me:$LINENO: checking for file" >&5 echo $ECHO_N "checking for file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi else MAGIC_CMD=: fi fi fi ;; esac enable_dlopen=no enable_win32_dll=no # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Check whether --with-pic or --without-pic was given. if test "${with_pic+set}" = set; then withval="$with_pic" pic_mode="$withval" else pic_mode=default fi; test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # # Check for any special shared library compilation flags. # lt_prog_cc_shlib= if test "$GCC" = no; then case $host_os in sco3.2v5*) lt_prog_cc_shlib='-belf' ;; esac fi if test -n "$lt_prog_cc_shlib"; then { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5 echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;} if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then : else { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} lt_cv_prog_cc_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_prog_compiler_static" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 else lt_prog_compiler_static_works=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 if test x"$lt_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7491: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7495: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; linux*) case $CC in icc* | ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic='-Kpic' lt_prog_compiler_static='-dn' ;; solaris*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 echo "${ECHO_T}$lt_prog_compiler_pic" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7724: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7728: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_prog_compiler_pic_works=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 if test x"$lt_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7784: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:7788: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag= enable_shared_with_static_runtimes=no archive_cmds= archive_expsym_cmds= old_archive_From_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported link_all_deplibs=unknown hardcode_automatic=no module_cmds= module_expsym_cmds= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; linux*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_cmds="$tmp_archive_cmds" supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else archive_expsym_cmds="$tmp_archive_cmds" fi else ld_shlibs=no fi ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_libdir_separator=':' link_all_deplibs=yes if test "$GCC" = yes; then case $host_os in aix4.012|aix4.012.*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 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 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 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 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec=' ' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi4*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) if test "$GXX" = yes ; then archive_cmds_need_lc=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='-flat_namespace -undefined suppress' ;; 10.*) allow_undefined_flag='-undefined dynamic_lookup' ;; esac fi ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='-all_load $convenience' link_all_deplibs=yes else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=no hardcode_shlibpath_var=no ;; ia64*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=no hardcode_shlibpath_var=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; *) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld='-rpath $libdir' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag=' -z text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4.2uw2*) archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv5*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6 test "$ld_shlibs" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 echo "${ECHO_T}$archive_cmds_need_lc" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.01* | freebsdelf3.01*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf` sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=yes library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var " || \ test "X$hardcode_automatic"="Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&6 if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; 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_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=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_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+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. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; 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_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; 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_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=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_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+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. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; 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_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; 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_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=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_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; 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_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=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_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; 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_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=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_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Report which librarie types wil actually be built echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; darwin* | rhapsody*) if test "$GCC" = yes; then archive_cmds_need_lc=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='-flat_namespace -undefined suppress' ;; 10.*) allow_undefined_flag='-undefined dynamic_lookup' ;; esac fi ;; esac output_verbose_link_cmd='echo' archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='-all_load $convenience' link_all_deplibs=yes else ld_shlibs=no fi ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS AS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler \ CC \ LD \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_prog_compiler_no_builtin_flag \ export_dynamic_flag_spec \ thread_safe_flag_spec \ whole_archive_flag_spec \ enable_shared_with_static_runtimes \ old_archive_cmds \ old_archive_from_new_cmds \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ archive_cmds \ archive_expsym_cmds \ postinstall_cmds \ postuninstall_cmds \ old_archive_from_expsyms_cmds \ allow_undefined_flag \ no_undefined_flag \ export_symbols_cmds \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ hardcode_automatic \ module_cmds \ module_expsym_cmds \ lt_cv_prog_compiler_c_o \ exclude_expsyms \ include_expsyms; do case $var in old_archive_cmds | \ old_archive_from_new_cmds | \ archive_cmds | \ archive_expsym_cmds | \ module_cmds | \ module_expsym_cmds | \ old_archive_from_expsyms_cmds | \ export_symbols_cmds | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" { echo "$as_me:$LINENO: creating $ofile" >&5 echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS=$lt_AS # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext='$shrext' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" # Check whether --with-tags or --without-tags was given. if test "${with_tags+set}" = set; then withval="$with_tags" tagnames="$withval" fi; if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} else { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} fi fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in "") ;; *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 echo "$as_me: error: invalid tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} { (exit 1); exit 1; }; } fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && test "X$CXX" != "Xno"; then ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_automatic_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= # Source file extension for C++ test sources. ac_ext=cc # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes if test "$GXX" = yes; then case $host_os in aix4.012|aix4.012.*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_CXX=yes else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 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_cxx_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 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 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_cxx_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 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_CXX=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX=' ' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) if test "$GXX" = yes; then archive_cmds_need_lc_CXX=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag_CXX='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_CXX='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_CXX='-flat_namespace -undefined suppress' ;; 10.*) allow_undefined_flag_CXX='-undefined dynamic_lookup' ;; esac fi ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_CXX='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_CXX='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='-all_load $convenience' link_all_deplibs_CXX=yes else ld_shlibs_CXX=no fi ;; dgux*) case $cc_basename in ec++) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd12*) # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | kfreebsd*-gnu) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC) archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_CXX='+b $libdir' hardcode_libdir_separator_CXX=: ;; ia64*) hardcode_libdir_flag_spec_CXX='-L$libdir' ;; *) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case "$host_cpu" in hppa*64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; *) hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC) case "$host_cpu" in hppa*64*|ia64*) archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case "$host_cpu" in ia64*|hppa*64*) archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; irix5* | irix6*) case $cc_basename in CC) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: ;; linux*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc) # Intel C++ with_gnu_ld=yes archive_cmds_need_lc_CXX=no archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; cxx) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; osf3*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; RCC) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ $rm $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sco*) archive_cmds_need_lc_CXX=no case $cc_basename in CC) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; sunos4*) case $cc_basename in CC) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.0-5 | solaris2.0-5.*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac link_all_deplibs_CXX=yes # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' fi ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) archive_cmds_need_lc_CXX=no ;; tandem*) case $cc_basename in NCC) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`" for p in `eval $output_verbose_link_cmd`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $rm -f confest.$objext case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; icpc) # Intel C++ lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; cxx) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; sco*) case $cc_basename in CC) lt_prog_compiler_pic_CXX='-fPIC' ;; *) ;; esac ;; solaris*) case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; unixware*) ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:12245: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:12249: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_CXX=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:12305: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:12309: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.01* | freebsdelf3.01*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf` sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=yes library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var CXX" || \ test "X$hardcode_automatic_CXX"="Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 echo "${ECHO_T}$hardcode_action_CXX" >&6 if test "$hardcode_action_CXX" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; 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_cxx_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_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=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_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+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. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; 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_cxx_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_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; 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_cxx_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_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=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_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+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. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; 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_cxx_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_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; 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_cxx_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_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=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_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; 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_cxx_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_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=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_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; 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_cxx_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_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=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_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS AS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_CXX \ CC_CXX \ LD_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ export_dynamic_flag_spec_CXX \ thread_safe_flag_spec_CXX \ whole_archive_flag_spec_CXX \ enable_shared_with_static_runtimes_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ postuninstall_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ export_symbols_cmds_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ hardcode_automatic_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do case $var in old_archive_cmds_CXX | \ old_archive_from_new_cmds_CXX | \ archive_cmds_CXX | \ archive_expsym_cmds_CXX | \ module_cmds_CXX | \ module_expsym_cmds_CXX | \ old_archive_from_expsyms_cmds_CXX | \ export_symbols_cmds_CXX | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_CXX # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS=$lt_AS # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext='$shrext' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_CXX old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_CXX # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_CXX # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_CXX # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_CXX # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_CXX" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # Code to be used in simple compile tests lt_simple_compile_test_code=" subroutine t\n return\n end\n" # Code to be used in simple link tests lt_simple_link_test_code=" program t\n end\n" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC compiler_F77=$CC cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4*) test "$enable_shared" = yes && enable_static=no ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 test "$ld_shlibs_F77" = no && can_build_shared=no GCC_F77="$G77" LD_F77="$LD" lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_F77=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; linux*) case $CC in icc* | ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic_F77='-Kpic' lt_prog_compiler_static_F77='-dn' ;; solaris*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:14591: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:14595: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 if test x"$lt_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_F77=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:14651: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:14655: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_F77= enable_shared_with_static_runtimes_F77=no archive_cmds_F77= archive_expsym_cmds_F77= old_archive_From_new_cmds_F77= old_archive_from_expsyms_cmds_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= thread_safe_flag_spec_F77= hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_direct_F77=no hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported link_all_deplibs_F77=unknown hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= always_export_symbols_F77=no export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_F77= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_F77=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_F77=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; linux*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_cmds_F77="$tmp_archive_cmds" supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else archive_expsym_cmds_F77="$tmp_archive_cmds" fi else ld_shlibs_F77=no fi ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= fi fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_F77='' hardcode_direct_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes if test "$GCC" = yes; then case $host_os in aix4.012|aix4.012.*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_F77=yes else # We have old collect2 hardcode_direct_F77=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_F77=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_F77='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _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_f77_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 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _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_f77_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 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_F77=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77=' ' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section ld_shlibs_F77=no ;; bsdi4*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) if test "$GXX" = yes ; then archive_cmds_need_lc_F77=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag_F77='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_F77='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_F77='-flat_namespace -undefined suppress' ;; 10.*) allow_undefined_flag_F77='-undefined dynamic_lookup' ;; esac fi ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_F77='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_F77='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_F77='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='-all_load $convenience' link_all_deplibs_F77=yes else ld_shlibs_F77=no fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; freebsd1*) ld_shlibs_F77=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_F77='+b $libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; ia64*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=no hardcode_shlibpath_var_F77=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; *) hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: link_all_deplibs_F77=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; openbsd*) hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi hardcode_libdir_separator_F77=: ;; sco3.2v5*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_F77=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4.2uw2*) archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag_F77='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv5*) no_undefined_flag_F77=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec_F77= hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 echo "${ECHO_T}$ld_shlibs_F77" >&6 test "$ld_shlibs_F77" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_F77=no else archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.01* | freebsdelf3.01*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf` sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=yes library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var F77" || \ test "X$hardcode_automatic_F77"="Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_F77" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 echo "${ECHO_T}$hardcode_action_F77" >&6 if test "$hardcode_action_F77" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS AS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_F77 \ CC_F77 \ LD_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ export_dynamic_flag_spec_F77 \ thread_safe_flag_spec_F77 \ whole_archive_flag_spec_F77 \ enable_shared_with_static_runtimes_F77 \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ predep_objects_F77 \ postdep_objects_F77 \ predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ postuninstall_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ export_symbols_cmds_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ hardcode_automatic_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do case $var in old_archive_cmds_F77 | \ old_archive_from_new_cmds_F77 | \ archive_cmds_F77 | \ archive_expsym_cmds_F77 | \ module_cmds_F77 | \ module_expsym_cmds_F77 | \ old_archive_from_expsyms_cmds_F77 | \ export_symbols_cmds_F77 | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_F77 # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS=$lt_AS # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext='$shrext' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_F77 old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_F77 # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_F77 # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_F77 # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_F77 # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_F77 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_F77 # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_F77" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o objext_GCJ=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC compiler_GCJ=$CC # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no lt_prog_compiler_no_builtin_flag_GCJ= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:16685: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:16689: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_static_GCJ='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_GCJ='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_GCJ=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_GCJ=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_GCJ='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' else lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_GCJ='-non_shared' ;; newsos6) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; linux*) case $CC in icc* | ecc*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-static' ;; ccc*) lt_prog_compiler_wl_GCJ='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_GCJ='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic_GCJ='-Kpic' lt_prog_compiler_static_GCJ='-dn' ;; solaris*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sunos4*) lt_prog_compiler_wl_GCJ='-Qoption ld ' lt_prog_compiler_pic_GCJ='-PIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_GCJ='-Kconform_pic' lt_prog_compiler_static_GCJ='-Bstatic' fi ;; uts4*) lt_prog_compiler_pic_GCJ='-pic' lt_prog_compiler_static_GCJ='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:16918: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:16922: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; esac else lt_prog_compiler_pic_GCJ= lt_prog_compiler_can_build_shared_GCJ=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_GCJ= ;; *) lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_GCJ=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:16978: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:16982: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then lt_cv_prog_compiler_c_o_GCJ=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_GCJ= enable_shared_with_static_runtimes_GCJ=no archive_cmds_GCJ= archive_expsym_cmds_GCJ= old_archive_From_new_cmds_GCJ= old_archive_from_expsyms_cmds_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= thread_safe_flag_spec_GCJ= hardcode_libdir_flag_spec_GCJ= hardcode_libdir_flag_spec_ld_GCJ= hardcode_libdir_separator_GCJ= hardcode_direct_GCJ=no hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=unsupported link_all_deplibs_GCJ=unknown hardcode_automatic_GCJ=no module_cmds_GCJ= module_expsym_cmds_GCJ= always_export_symbols_GCJ=no export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_GCJ= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_GCJ=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_GCJ=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_GCJ=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_GCJ=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_GCJ=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_GCJ='-L$libdir' allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_GCJ=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; sunos4*) archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; linux*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_cmds_GCJ="$tmp_archive_cmds" supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else archive_expsym_cmds_GCJ="$tmp_archive_cmds" fi else ld_shlibs_GCJ=no fi ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac if test "$ld_shlibs_GCJ" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_GCJ= fi fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_GCJ=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_GCJ=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_GCJ='' hardcode_direct_GCJ=yes hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes if test "$GCC" = yes; then case $host_os in aix4.012|aix4.012.*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_GCJ=yes else # We have old collect2 hardcode_direct_GCJ=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_GCJ=yes hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_libdir_separator_GCJ= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_GCJ=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_GCJ='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 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 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_GCJ="-z nodefs" archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 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 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_GCJ=' ${wl}-bernotok' allow_undefined_flag_GCJ=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_GCJ=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_GCJ=' ' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section ld_shlibs_GCJ=no ;; bsdi4*) export_dynamic_flag_spec_GCJ=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_GCJ=' ' allow_undefined_flag_GCJ=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; darwin* | rhapsody*) if test "$GXX" = yes ; then archive_cmds_need_lc_GCJ=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag_GCJ='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_GCJ='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_GCJ='-flat_namespace -undefined suppress' ;; 10.*) allow_undefined_flag_GCJ='-undefined dynamic_lookup' ;; esac fi ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_GCJ='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_GCJ='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_GCJ='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct_GCJ=no hardcode_automatic_GCJ=yes hardcode_shlibpath_var_GCJ=unsupported whole_archive_flag_spec_GCJ='-all_load $convenience' link_all_deplibs_GCJ=yes else ld_shlibs_GCJ=no fi ;; dgux*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; freebsd1*) ld_shlibs_GCJ=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no ;; ia64*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; *) hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: link_all_deplibs_GCJ=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; newsos6) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_shlibpath_var_GCJ=no ;; openbsd*) hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' ;; *) archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_GCJ='-rpath $libdir' fi hardcode_libdir_separator_GCJ=: ;; sco3.2v5*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_GCJ=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; sysv4) case $host_vendor in sni) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_GCJ='$CC -r -o $output$reload_objs' hardcode_direct_GCJ=no ;; motorola) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv4.3*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_GCJ=yes fi ;; sysv4.2uw2*) archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag_GCJ='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv5*) no_undefined_flag_GCJ=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec_GCJ= hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; *) ld_shlibs_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 echo "${ECHO_T}$ld_shlibs_GCJ" >&6 test "$ld_shlibs_GCJ" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_GCJ" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_GCJ=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_GCJ in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_GCJ compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ allow_undefined_flag_GCJ= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_GCJ=no else archive_cmds_need_lc_GCJ=yes fi allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.01* | freebsdelf3.01*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf` sys_lib_dlsearch_path_spec="/lib /usr/lib $ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=yes library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var GCJ" || \ test "X$hardcode_automatic_GCJ"="Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_GCJ" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && test "$hardcode_minus_L_GCJ" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_GCJ=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_GCJ=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_GCJ=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 echo "${ECHO_T}$hardcode_action_GCJ" >&6 if test "$hardcode_action_GCJ" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; 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_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=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_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+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. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; 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_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; 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_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=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_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+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. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; 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_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; 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_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=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_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; 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_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=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_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; 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_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=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_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS AS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_GCJ \ CC_GCJ \ LD_GCJ \ lt_prog_compiler_wl_GCJ \ lt_prog_compiler_pic_GCJ \ lt_prog_compiler_static_GCJ \ lt_prog_compiler_no_builtin_flag_GCJ \ export_dynamic_flag_spec_GCJ \ thread_safe_flag_spec_GCJ \ whole_archive_flag_spec_GCJ \ enable_shared_with_static_runtimes_GCJ \ old_archive_cmds_GCJ \ old_archive_from_new_cmds_GCJ \ predep_objects_GCJ \ postdep_objects_GCJ \ predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ postuninstall_cmds_GCJ \ old_archive_from_expsyms_cmds_GCJ \ allow_undefined_flag_GCJ \ no_undefined_flag_GCJ \ export_symbols_cmds_GCJ \ hardcode_libdir_flag_spec_GCJ \ hardcode_libdir_flag_spec_ld_GCJ \ hardcode_libdir_separator_GCJ \ hardcode_automatic_GCJ \ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do case $var in old_archive_cmds_GCJ | \ old_archive_from_new_cmds_GCJ | \ archive_cmds_GCJ | \ archive_expsym_cmds_GCJ | \ module_cmds_GCJ | \ module_expsym_cmds_GCJ | \ old_archive_from_expsyms_cmds_GCJ | \ export_symbols_cmds_GCJ | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_GCJ # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_GCJ # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS=$lt_AS # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_GCJ # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext='$shrext' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_GCJ pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_GCJ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_GCJ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_GCJ archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_GCJ module_expsym_cmds=$lt_module_expsym_cmds_GCJ # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_GCJ # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_GCJ # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_GCJ # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_GCJ # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_GCJ # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_GCJ # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_GCJ # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_GCJ # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_GCJ # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_GCJ" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_GCJ # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_GCJ # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_GCJ # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; RC) # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o objext_RC=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC compiler_RC=$CC lt_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS AS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_RC \ CC_RC \ LD_RC \ lt_prog_compiler_wl_RC \ lt_prog_compiler_pic_RC \ lt_prog_compiler_static_RC \ lt_prog_compiler_no_builtin_flag_RC \ export_dynamic_flag_spec_RC \ thread_safe_flag_spec_RC \ whole_archive_flag_spec_RC \ enable_shared_with_static_runtimes_RC \ old_archive_cmds_RC \ old_archive_from_new_cmds_RC \ predep_objects_RC \ postdep_objects_RC \ predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ postuninstall_cmds_RC \ old_archive_from_expsyms_cmds_RC \ allow_undefined_flag_RC \ no_undefined_flag_RC \ export_symbols_cmds_RC \ hardcode_libdir_flag_spec_RC \ hardcode_libdir_flag_spec_ld_RC \ hardcode_libdir_separator_RC \ hardcode_automatic_RC \ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ exclude_expsyms_RC \ include_expsyms_RC; do case $var in old_archive_cmds_RC | \ old_archive_from_new_cmds_RC | \ archive_cmds_RC | \ archive_expsym_cmds_RC | \ module_cmds_RC | \ module_expsym_cmds_RC | \ old_archive_from_expsyms_cmds_RC | \ export_symbols_cmds_RC | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_RC # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS=$lt_AS # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_RC # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext='$shrext' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_RC pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_RC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_RC old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_RC archive_expsym_cmds=$lt_archive_expsym_cmds_RC postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_RC module_expsym_cmds=$lt_module_expsym_cmds_RC # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_RC # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_RC # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_RC # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_RC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_RC # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_RC # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_RC # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_RC # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_RC # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_RC # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_RC # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_RC # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_RC # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_RC" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_RC # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_RC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_RC # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ;; *) { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 echo "$as_me: error: Unsupported tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 echo "$as_me: error: unable to update list of available tagged configurations." >&2;} { (exit 1); exit 1; }; } fi fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_LEX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then echo "$as_me:$LINENO: result: $LEX" >&5 echo "${ECHO_T}$LEX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test -z "$LEXLIB" then echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5 echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6 if test "${ac_cv_lib_fl_yywrap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char yywrap (); int main () { yywrap (); ; 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_fl_yywrap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_fl_yywrap=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_fl_yywrap" >&5 echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6 if test $ac_cv_lib_fl_yywrap = yes; then LEXLIB="-lfl" else echo "$as_me:$LINENO: checking for yywrap in -ll" >&5 echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6 if test "${ac_cv_lib_l_yywrap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ll $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char yywrap (); int main () { yywrap (); ; 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_l_yywrap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_l_yywrap=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_l_yywrap" >&5 echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6 if test $ac_cv_lib_l_yywrap = yes; then LEXLIB="-ll" fi fi fi if test "x$LEX" != "x:"; then echo "$as_me:$LINENO: checking lex output file root" >&5 echo $ECHO_N "checking lex output file root... $ECHO_C" >&6 if test "${ac_cv_prog_lex_root+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # The minimal lex program is just a single line: %%. But some broken lexes # (Solaris, I think it was) want two %% lines, so accommodate them. cat >conftest.l <<_ACEOF %% %% _ACEOF { (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5 (eval $LEX conftest.l) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} { (exit 1); exit 1; }; } fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 echo "${ECHO_T}$ac_cv_prog_lex_root" >&6 rm -f conftest.l LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6 if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c ac_save_LIBS=$LIBS LIBS="$LIBS $LEXLIB" cat >conftest.$ac_ext <<_ACEOF `cat $LEX_OUTPUT_ROOT.c` _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_prog_lex_yytext_pointer=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS rm -f "${LEX_OUTPUT_ROOT}.c" fi echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6 if test $ac_cv_prog_lex_yytext_pointer = yes; then cat >>confdefs.h <<\_ACEOF #define YYTEXT_POINTER 1 _ACEOF fi fi if test "$LEX" = :; then LEX=${am_missing_run}flex fi for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_YACC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then echo "$as_me:$LINENO: result: $YACC" >&5 echo "${ECHO_T}$YACC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" if test X"$GCC" = X"yes"; then CFLAGS="$CFLAGS -Wall" if test X"$debug" = X"yes"; then CFLAGS="$CFLAGS -Werror" fi if test X"$debug" = X"no"; then OPTFLAGS="-O3" fi elif $CC -V 2>&1 | grep "WorkShop Compilers"; then CFLAGS="$CFLAGS -xCC" if test X"$debug" = X"no"; then OPTFLAGS="-fast" if echo $CC | grep "xarch=v9"; then OPTFLAGS="$OPTFLAGS -xarch=v9" fi fi elif echo $host_os | grep -i "osf" >/dev/null; then CFLAGS="$CFLAGS -std" if test X"$debug" = X"no"; then OPTFLAGS="-O" fi else if test X"$debug" = X"no"; then OPTFLAGS="-O" fi fi CFLAGS="$CFLAGS $OPTFLAGS" echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+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. */ #include #include #include #include int main () { ; return 0; } _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 ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./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 : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi for ac_header in string.h sys/types.h stdint.h netinet/in.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then 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 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #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 ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------- ## ## Report this to openslp-devel@lists.sourceforge.net ## ## -------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac 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 eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi 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 echo "$as_me:$LINENO: checking for socklen_t" >&5 echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6 if test "${ac_cv_type_socklen_t+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. */ #include #if STDC_HEADERS #include #include #endif #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "(^|[^a-zA-Z_0-9])socklen_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then ac_cv_type_socklen_t=yes else ac_cv_type_socklen_t=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 echo "${ECHO_T}$ac_cv_type_socklen_t" >&6 if test $ac_cv_type_socklen_t = no; then cat >>confdefs.h <<\_ACEOF #define socklen_t int _ACEOF fi echo "$as_me:$LINENO: checking for sa_restorer in struct sigaction" >&5 echo $ECHO_N "checking for sa_restorer in struct sigaction... $ECHO_C" >&6 if test "${ac_cv_struct_sa_restorer+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. */ #include #include int main () { struct sigaction s; s.sa_restorer; ; return 0; } _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 ac_cv_struct_sa_restorer=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_sa_restorer=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_struct_sa_restorer" >&5 echo "${ECHO_T}$ac_cv_struct_sa_restorer" >&6 if test $ac_cv_struct_sa_restorer = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SA_RESTORER 1 _ACEOF fi echo "$as_me:$LINENO: checking for inet_aton in -lresolv" >&5 echo $ECHO_N "checking for inet_aton in -lresolv... $ECHO_C" >&6 if test "${ac_cv_lib_resolv_inet_aton+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char inet_aton (); int main () { inet_aton (); ; 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_resolv_inet_aton=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_resolv_inet_aton=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_resolv_inet_aton" >&5 echo "${ECHO_T}$ac_cv_lib_resolv_inet_aton" >&6 if test $ac_cv_lib_resolv_inet_aton = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBRESOLV 1 _ACEOF LIBS="-lresolv $LIBS" 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 gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_gethostbyname+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. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { gethostbyname (); ; 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_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=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_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 if test $ac_cv_lib_nsl_gethostbyname = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi for ac_func in strncasecmp strcasecmp do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+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. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; 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 eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ac_config_files="$ac_config_files Makefile" ac_config_files="$ac_config_files common/Makefile" ac_config_files="$ac_config_files libslpattr/Makefile" ac_config_files="$ac_config_files libslp/Makefile" ac_config_files="$ac_config_files slpd/Makefile" ac_config_files="$ac_config_files slptool/Makefile" ac_config_files="$ac_config_files test/Makefile" ac_config_files="$ac_config_files slp.list" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${ENABLE_SLPv1_TRUE}" && test -z "${ENABLE_SLPv1_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ENABLE_SLPv1\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ENABLE_SLPv1\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_PREDICATES_TRUE}" && test -z "${ENABLE_PREDICATES_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ENABLE_PREDICATES\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ENABLE_PREDICATES\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_ASYNC_API_TRUE}" && test -z "${ENABLE_ASYNC_API_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ENABLE_ASYNC_API\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ENABLE_ASYNC_API\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_SLPv2_SECURITY_TRUE}" && test -z "${ENABLE_SLPv2_SECURITY_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ENABLE_SLPv2_SECURITY\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ENABLE_SLPv2_SECURITY\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by openslp $as_me 1.2.1, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ openslp config.status 1.2.1 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "common/Makefile" ) CONFIG_FILES="$CONFIG_FILES common/Makefile" ;; "libslpattr/Makefile" ) CONFIG_FILES="$CONFIG_FILES libslpattr/Makefile" ;; "libslp/Makefile" ) CONFIG_FILES="$CONFIG_FILES libslp/Makefile" ;; "slpd/Makefile" ) CONFIG_FILES="$CONFIG_FILES slpd/Makefile" ;; "slptool/Makefile" ) CONFIG_FILES="$CONFIG_FILES slptool/Makefile" ;; "test/Makefile" ) CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "slp.list" ) CONFIG_FILES="$CONFIG_FILES slp.list" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@CYGPATH_W@,$CYGPATH_W,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@AMTAR@,$AMTAR,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@mkdir_p@,$mkdir_p,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@am__leading_dot@,$am__leading_dot,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@ENABLE_SLPv1_TRUE@,$ENABLE_SLPv1_TRUE,;t t s,@ENABLE_SLPv1_FALSE@,$ENABLE_SLPv1_FALSE,;t t s,@ENABLE_PREDICATES_TRUE@,$ENABLE_PREDICATES_TRUE,;t t s,@ENABLE_PREDICATES_FALSE@,$ENABLE_PREDICATES_FALSE,;t t s,@ENABLE_ASYNC_API_TRUE@,$ENABLE_ASYNC_API_TRUE,;t t s,@ENABLE_ASYNC_API_FALSE@,$ENABLE_ASYNC_API_FALSE,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@DEPDIR@,$DEPDIR,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t s,@ENABLE_SLPv2_SECURITY_TRUE@,$ENABLE_SLPv2_SECURITY_TRUE,;t t s,@ENABLE_SLPv2_SECURITY_FALSE@,$ENABLE_SLPv2_SECURITY_FALSE,;t t s,@EGREP@,$EGREP,;t t s,@LN_S@,$LN_S,;t t s,@ECHO@,$ECHO,;t t s,@AR@,$AR,;t t s,@ac_ct_AR@,$ac_ct_AR,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@CPP@,$CPP,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@CXXDEPMODE@,$CXXDEPMODE,;t t s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t s,@CXXCPP@,$CXXCPP,;t t s,@F77@,$F77,;t t s,@FFLAGS@,$FFLAGS,;t t s,@ac_ct_F77@,$ac_ct_F77,;t t s,@LIBTOOL@,$LIBTOOL,;t t s,@LEX@,$LEX,;t t s,@LEXLIB@,$LEXLIB,;t t s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t s,@YACC@,$YACC,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ X$ac_file : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X$ac_file | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'`/stamp-h$_am_stamp_count done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` else continue fi grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. for file in `sed -n ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p $dirpart/$fdir else as_dir=$dirpart/$fdir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi openslp-1.2.1/Makefile.in0000644033442200000310000004760010211377466015143 0ustar rganesanfloppy# Makefile.in generated by automake 1.8.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # # Makefile # Note the install script, it is not pretty, but it works. # srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_triplet = @host@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/slp.list.in $(top_srcdir)/configure AUTHORS COPYING \ ChangeLog INSTALL NEWS THANKS config.guess config.sub depcomp \ install-sh ltmain.sh missing ylwrap subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno configure.status.lineno mkinstalldirs = $(mkdir_p) CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = slp.list SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_ASYNC_API_FALSE = @ENABLE_ASYNC_API_FALSE@ ENABLE_ASYNC_API_TRUE = @ENABLE_ASYNC_API_TRUE@ ENABLE_PREDICATES_FALSE = @ENABLE_PREDICATES_FALSE@ ENABLE_PREDICATES_TRUE = @ENABLE_PREDICATES_TRUE@ ENABLE_SLPv1_FALSE = @ENABLE_SLPv1_FALSE@ ENABLE_SLPv1_TRUE = @ENABLE_SLPv1_TRUE@ ENABLE_SLPv2_SECURITY_FALSE = @ENABLE_SLPv2_SECURITY_FALSE@ ENABLE_SLPv2_SECURITY_TRUE = @ENABLE_SLPv2_SECURITY_TRUE@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ SUBDIRS = common libslpattr slpd libslp slptool test EXTRA_DIST = win32 doc etc README.W32 FAQ DOC_DIR = $(prefix)/doc/openslp-$(VERSION) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ cd $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 slp.list: $(top_builddir)/config.status $(srcdir)/slp.list.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if (etags --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ else \ include_option=--include; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkdir_p) $(distdir)/. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || mkdir "$(distdir)/$$subdir" \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="../$(top_distdir)" \ distdir="../$(distdir)/$$subdir" \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir $(AMTAR) chof - $(distdir) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(AMTAR) xf - ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(AMTAR) xf - ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-data-local install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ check-am clean clean-generic clean-libtool clean-recursive \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-generic distclean-hdr distclean-libtool \ distclean-recursive distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-local install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ mostlyclean mostlyclean-generic mostlyclean-libtool \ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-info-am install-data-local: mkdir -p $(DESTDIR)$(sysconfdir) file=$(DESTDIR)$(sysconfdir)/slp.reg; \ if [ -f $$file ]; then true; \ else cp -f $(srcdir)/etc/slp.reg $(DESTDIR)$(sysconfdir); \ fi file=$(DESTDIR)$(sysconfdir)/slp.conf; \ if [ -f $$file ]; then true; \ else cp -f $(srcdir)/etc/slp.conf $(DESTDIR)$(sysconfdir);\ fi file=$(DESTDIR)$(sysconfdir)/slp.spi; \ if [ -f $$file ]; then true; \ else cp -f $(srcdir)/etc/slp.spi $(DESTDIR)$(sysconfdir); \ fi rm -rf $(DESTDIR)$(DOC_DIR) mkdir -p $(DESTDIR)$(DOC_DIR) cp -r $(srcdir)/doc/* $(DESTDIR)$(DOC_DIR) rm -rf `find $(DESTDIR)$(DOC_DIR) -name CVS` dist-hook: -rm -rf `find $(distdir)/doc -name CVS` -rm -rf `find $(distdir)/etc -name CVS` -rm -rf `find $(distdir)/win32 -name CVS` chmod -R og-w $(distdir) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: openslp-1.2.1/NEWS0000644033442200000310000001753610207404657013600 0ustar rganesanfloppyNEWS - list of user-visible changes between releases of OpenSLP and other important events. New in openslp-1.2.1 -------------------- * A multitude of bug fixes submitted by the SuSE linux team in Germany. Much of this work was done by Michael Schroeder and other patches were submitted by Peter Marschall . Thanks very much to both of them. * The autotools scripts have been updated to be compatible with Autotools 1.5+. This should help out developers wanting to check out OpenSLP on other platforms. * The slp.reg file now accepts a $HOSTNAME "variable" that represents the hostname of the current machine. That way your reg files are somewhat more portable. New in openslp-1.1.3 -------------------- * The main new feature is the very good DHCP work that has been contributed jcalcote@novell.com * Preliminary integration of new filter and predicate code based on work done by Mike Day. Code should be operational by next release New in openslp-1.0.0 -------------------- * ALL PLANNED FEATURES ARE SUPPORTED IN THIS RELEASE * Duplicate results in sync calls are now removed * Fixed several SEGVs attributed to parsing bugs * Fix "echo to ourselves" bug when slpd is running as a DA * Cosmetic logging changes New in openslp-0.9.1 (2001-06-18) --------------------------------- * All known bugs are fixed. * SLPv1 backward compatibility support is back! * Easy Package Manager (EPM) list file added (EPM is a software packager that can generate different package formats from a single list file). New in openslp-0.9.0 (2001-04-10) --------------------------------- * Full SLPv2 Authentication support. * Documentation for SLPv2 features. * Completely new internal registration and knownDA database implementation. * Optional net.slp.checkSourceAddr security feature * Support for net.slp.OpenSLPVersion. * Support for special service-types "service:directory-agent" and "service:service-agent" can now be used in calls to SLPFindSrvs(). * Changes to libslp to prepare for collation in 0.9.1 * Fixes for several socket reconnect, reuse, and aging bugs. * Fixes for several slp.reg parsing errors. * Fix for "invalid predicate" SEGV. * Debug logging of registrations and known DAs on receipt of SIGINT. * Debug malloc wrappers. New in openslp-0.8.3 (2001-03-13) --------------------------------- * Completely updated Win32 port * Preliminary support for asyncronous API calls is now a compile time option. Async calls still not fully supported. * Addition of SLPParseAttr() API that complies with what will be in RFC2614bis (Note: the libslp.so library version is now 0.0.3) * Many fixes to documentation based on review feedback from debian developer Susan G. Kleinmann (sgk@debian.org). * Many bug fixes including the following: - "DAs with multiple scopes" bug - "Local service time out on DA" bug - "Bad 1400 byte message" bug New in openslp-0.8.2 (2001-02-14) --------------------------------- * Minor fixes in the html documentation. * Bug fixes (including "slpd tight loop" problem) * Logging changes (no log file truncation and log timestamps) * Corrections in the usage of DAAdvert bootstamps, scopelists, and XIDs * Several documentation corrections * Massive Win32 specific changes. Please read README.WIN32 ! New in openslp-0.8.1 (2000-12-19) --------------------------------- * slpd now correctly refreshes and ages services as required by DA and SA specifications * Location of slpd.pid and slpd.log files now depends on the configure prefix on Unix. * slpd running as a DA now sends passive DAAdverts for SLPv1 also. * slpd now works (again) on 64-bit platforms. New in openslp-0.8.0 (2000-11-30) -------------------------------- * New OpenSLP License. OpenSLP is now licensed under the BSD license. * OpenSLP contrib tarball is now available. OpenSLP Contrib is a collection of SLP related utilities and tools. * Predicate support now enabled by default. * SLPFindScopes() is now implemented to RFC spec. * Implemented SLPFindScopes() in libslp. * Send dead DAAdvert as part of graceful shutdown. * DAs now echo local registrations to other DAs (slpd as a DA also acts like an SA for local API callers). * Added code to ensure we respond correctly (with AUTHENICATION_UNKNOWN) when a request with a SPI is received. * Changed SLPD behaviour to be less destructive on SIGHUP. SIGHUP no longer dumps the entire registration database on SIGHUP. SIGHUP only causes slpd to re-read configuration and static registration as well as perform DA discovery. New in openslp-0.7.8 (2000-11-06) --------------------------------- * slpd now does a graceful shutdown on SIGTERM to deregister serviced with DAs * Considerable time spend using commercial debugging tools to remove ALL memory leaks from slpd (without predicates) and libslp. * IPC (via loopback) is now used by libslp to obtain DA information from slpd before multicasting * slpd running as a DA now sends passive DAAdverts * slpd running as an SA now performs active DA discovery * slpd running as an SA now re-registers all services with new DAs * Significant fixes were made to make slpd work properly on multi-homed machines New in openslp-0.7.7: (2000-10-11) ---------------------------------- * OpenSLP now supports SLPv1 when run as a DA. * TCP stream reusage was added to libslp and slpd * Correction of many active DA discovery problems were made in slpd * Predicate features from 0.7.6 are not build by default because of a few problems that will be corrected for 0.7.8 New in openslp-0.7.6: (2000-9-28) ---------------------------------- * OpenSLP ported to FreeBSD. Compaq Tru64 support is also complete. * Full predicate support has been added to OpenSLP. slpd will now correctly answer service requests containing LDAP filters * As part of the Windows port, the MSVC project files added. This should make it much easier for OpenSLP to be build on Win32 platform. * Most of slpd and libslp code was tested against a malloc debugger. Several bugs and memory leaks were fixed. New in openslp-0.7.5: (2000-09-08) ---------------------------------- * OpenSLP ported to Win32. * SLPFindSrvTypes() now works. * libslp minor version updated. New in openslp-0.7.4: (2000-09-01) ---------------------------------- * Finally added SA <--> DA communication resulting in an slpd that now acts as a much better SA and DA. * slpd (as a DA) responds to active DA discovery requests. * slpd (as an SA) performs active DA discovery, supports passive DA discovery, supports static DA configuration, registers and de-registers services with DAs. * libslp now has the ability to register services with to the local slpd (SA), or a discovered DA. This eliminates the need to have slpd running on all machines in certain cases. libslp can now request services from a DA or via multicast or broadcast. New in openslp-0.7.3: --------------------- * openslp-0.7.3 will not be released. New in openslp-0.7.2: (2000-08-17) ---------------------------------- * Revamped build system. Takes advantage of libtool/automake integration. libslp versioning changed to be compatible with libtool. Building with non-GCC compilers is now possible. Build directory can be different from source directory. Test suite integrated with automake, run make check to run the test suite. * Fixed several sneaky memory leaks and memory access bugs that dealt with langtags in libslp * Modified slpd command line parameter parsing to print version and help information * Ported to Solaris (2.6/7) and Linux Alpha. * Documentation cleaned up (code set changed to iso8859-1 and spell checked). New in openslp-0.7.1: --------------------- * Several bug fixes. * Now uses Autoconf/Automake. New in openslp-0.7.0: (2000-07-06) ---------------------------------- * Addition of NEWS file. * Move of CHANGELOG to ChangeLog. openslp-1.2.1/ylwrap0000755033442200000310000001405710211377462014336 0ustar rganesanfloppy#! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2003-11-18.20 # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003 # Free Software Foundation, Inc. # # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case "$1" in '') echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit 0 ;; -v|--v*) echo "ylwrap $scriptversion" exit 0 ;; esac # The input. input="$1" shift case "$input" in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input="`pwd`/$input" ;; esac pairlist= while test "$#" -ne 0; do if test "$1" = "--"; then shift break fi pairlist="$pairlist $1" shift done # The program to run. prog="$1" shift # Make any relative path in $prog absolute. case "$prog" in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog="`pwd`/$prog" ;; esac # FIXME: add hostname here for parallel makes that run commands on # other machines. But that might take us over the 14-char limit. dirname=ylwrap$$ trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) $prog "$input" ;; *) $prog "$@" "$input" ;; esac status=$? if test $status -eq 0; then set X $pairlist shift first=yes # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot="no" if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot="yes" fi # The directory holding the input. input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'` # Quote $INPUT_DIR so we can use it in a regexp. # FIXME: really we should care about more than `.' and `\'. input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'` while test "$#" -ne 0; do from="$1" # Handle y_tab.c and y_tab.h output by DOS if test $y_tab_nodot = "yes"; then if test $from = "y.tab.c"; then from="y_tab.c" else if test $from = "y.tab.h"; then from="y_tab.h" fi fi fi if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend `../'. case "$2" in [\\/]* | ?:[\\/]*) target="$2";; *) target="../$2";; esac # We do not want to overwrite a header file if it hasn't # changed. This avoid useless recompilations. However the # parser itself (the first file) should always be updated, # because it is the destination of the .y.c rule in the # Makefile. Divert the output of all other files to a temporary # file so we can compare them to existing versions. if test $first = no; then realtarget="$target" target="tmp-`echo $target | sed s/.*[\\/]//g`" fi # Edit out `#line' or `#' directives. # # We don't want the resulting debug information to point at # an absolute srcdir; it is better for it to just mention the # .y file with no path. # # We want to use the real output file name, not yy.lex.c for # instance. # # We want the include guards to be adjusted too. FROM=`echo "$from" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` TARGET=`echo "$2" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \ -e "s,$FROM,$TARGET," "$from" >"$target" || status=$? # Check whether header files must be updated. if test $first = no; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$2" is unchanged rm -f "$target" else echo updating "$2" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the first file. This # is a blatant hack to let us support using "yacc -d". If -d # is not specified, we don't want an error when the header # file is "missing". if test $first = yes; then status=1 fi fi shift shift first=no done else status=$? fi # Remove the directory. cd .. rm -rf $dirname exit $status # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: openslp-1.2.1/config.h.in0000644033442200000310000000560010211377460015105 0ustar rganesanfloppy/* config.h.in. Generated from configure.in by autoheader. */ /* defined if the async SLP API support is enabled */ #undef ENABLE_ASYNC_API /* defined if predicates are enabled */ #undef ENABLE_PREDICATES /* defined if struct sigaction has member sa_restorer */ #undef ENABLE_SLPv1 /* defined if the SLPv2 authentication support is enabled */ #undef ENABLE_SLPv2_SECURITY /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the `DSA_free' function. */ #undef HAVE_DSA_FREE /* Define to 1 if you have the `DSA_size' function. */ #undef HAVE_DSA_SIZE /* Define to 1 if you have the `DSA_verify' function. */ #undef HAVE_DSA_VERIFY /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `crypto' library (-lcrypto). */ #undef HAVE_LIBCRYPTO /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL /* Define to 1 if you have the `resolv' library (-lresolv). */ #undef HAVE_LIBRESOLV /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* defined if struct sigaction has member sa_restorer */ #undef HAVE_SA_RESTORER /* Define to 1 if you have the `SHA1' function. */ #undef HAVE_SHA1 /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strncasecmp' function. */ #undef HAVE_STRNCASECMP /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* defined to size_t if does not support socklen_t data type */ #undef socklen_t openslp-1.2.1/COPYING0000644033442200000310000000322607211505531014115 0ustar rganesanfloppyThe following copyright and license is applicable to the entire OpenSLP project (libslp, slpd, and related documentation): Copyright (C) 2000 Caldera Systems, Inc All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of Caldera Systems nor the names of itscontributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. openslp-1.2.1/test/0000755033442200000310000000000010211377554014044 5ustar rganesanfloppyopenslp-1.2.1/test/SLP_attr_test/0000755033442200000310000000000010211377553016572 5ustar rganesanfloppyopenslp-1.2.1/test/SLP_attr_test/slp_attr_test.c0000644033442200000310000006703610202047670021633 0ustar rganesanfloppy #include #include #include #include #include #include #define STR "a string of length." #define STR1 "hi \\there again" #define STR2 "yet another value" #define OP1 "aasdf" #define OP2 "ae\nl;adsf;\\y" #define SER1 "(abool=false),keyw,(anInt=51)" #define TERM_INT (int)-2345 #include /* Tests a serialized string to see if an attribute contains the named * values. * * Params: * str - The serialized attribute list. * name - Name of the attribute to test. * ... - List of strings the attribute must contain. Null terminated. * * Returns 1 iff the attributes contain all of the named values. 0 otherwise. */ int test_serialized(char *str, char *name, ...) { char *vl_start; /* The start of the serialized value list. */ char *vl_end; /* End of the value list. The ')'. */ int vl_size; /* The expected size of the value list. */ va_list ap; char *current_value; /* Current member of ap. */ /***** Find value list. *****/ { char *attr_name; /* The attribute name as it should appear in the serialized string. (ie, with preceeding '(' and trailing '=')*/ int len; /* The length of the name. */ /**** Build attribute as it should appear in str. ****/ len = strlen(name) + 2; /* +2 for '(' and '='. */ attr_name = (char *)malloc(len + 1); /* +1 for null. */ assert(attr_name); /*** Add pre/post fix. ***/ *attr_name = '('; strcpy(attr_name + 1, name); attr_name[len - 1] = '='; attr_name[len] = 0; /**** Search in attribute list. ****/ vl_start = strstr(str, attr_name); len = strlen(attr_name); /* Icky variable reuse. */ free(attr_name); if (vl_start == NULL) { return 0; } vl_start += len; /* Zip to the start of the attribute list. */ vl_end = strchr(vl_start, ')'); if (vl_end == NULL) { return 0; /* No terminating ')'. Syntax error. */ } } vl_size = 0; /***** Text contents of value list. *****/ va_start(ap, name); current_value = va_arg(ap, char *); while (current_value != NULL) { /* Foreach value... */ char *index; /* Index to current_value in value list. */ /* Check to see if the current value is in the value list. */ index = strstr(vl_start, current_value); if (index == NULL) { /* A value is missing. */ va_end(ap); return 0; } /* Check that it's _within_ the list. */ if (index > vl_end) { va_end(ap); return 0; } /* TODO Check that it is properly delimited. */ /* Increment vl_size. */ vl_size += strlen(current_value) + 1; /* +1 for comma. */ current_value = va_arg(ap, char *); /* NEXT! */ } va_end(ap); /***** Check that all values in str are accounted for (ie, there are no extra). *****/ /**** Account for commas in value list. ****/ vl_size -= 1; /* -1 for lack of trailing comma. */ if (vl_size != (int) (vl_end - vl_start)) { return 0; } return 1; } /* Finds the number of attributes in an attribute list. * * Returns the number of attributes in the passed list. */ int test_size(SLPAttributes attr) { SLPAttrIterator iter; SLPError err; char const *tag; /* The tag. */ SLPType type; int count; err = SLPAttrIteratorAlloc(attr, &iter); count = 0; while (SLPAttrIterNext(iter, &tag, &type) == SLP_TRUE) { count++; } SLPAttrIteratorFree(iter); return count; } /* Tests the named attribute to see if it has all of the named values. * * Params: * name - Name of the attribute to test. * ... - List of ints that must be associated with name. Terminated with a * TERM_INT. * * Returns 1 iff the attributes contain all of the named values. 0 otherwise. */ int test_int(SLPAttributes attr, char *name, ...) { int *int_arr; /* Values returned from SLPAttrGet_str(). */ int len; /* Number of values returned. */ int current_value; /* The passed value currently being tested. */ int values_seen; /* The count of passed values. */ int i; va_list ap; SLPError err; err = SLPAttrGet_int(attr, name, &int_arr, &len); assert(err == SLP_OK); /* Foreach value... */ values_seen = 0; va_start(ap, name); current_value = va_arg(ap, int); while (current_value != TERM_INT) { values_seen++; /* Check to see if the current value is in the value list. */ for (i = 0; i < len; i++) { if (int_arr[i] == current_value) { break; } } /* The current value was not found. */ if (i == len) { /* TODO cleanup: */ va_end(ap); return 0; } current_value = va_arg(ap, int); } va_end(ap); /* Cleanup memory. */ free(int_arr); /* Check that all values in str_attr are accounted for (ie, there are no extra). */ if (values_seen != len) { return 0; } return 1; } /* Tests the named attribute to see if it has all of the named attributes. * * Params: * name - Name of the attribute to test. * ... - List of strings that must be associated with name. Terminated with a * NULL. * * Returns 1 iff the attributes contain all of the named values. 0 otherwise. */ int test_string(SLPAttributes attr, char *name, ...) { char **str_arr; /* Values returned from SLPAttrGet_str(). */ int len; /* Number of values returned. */ char *current_value; /* The passed value currently being tested. */ int values_seen; /* The count of passed values. */ int i; va_list ap; SLPError err; err = SLPAttrGet_str(attr, name, &str_arr, &len); assert(err == SLP_OK); /* Foreach value... */ values_seen = 0; va_start(ap, name); current_value = va_arg(ap, char *); while (current_value != NULL) { values_seen++; /* Check to see if the current value is in the value list. */ for (i = 0; i < len; i++) { if (strcmp(current_value, str_arr[i]) == 0) { break; } } /* The current value was not found. */ if (i == len) { /* TODO cleanup: */ va_end(ap); return 0; } current_value = va_arg(ap, char *); } va_end(ap); /* Cleanup memory. */ for (i = 0; i < len; i++) { free(str_arr[i]); } free(str_arr); /* Check that all values in str_attr are accounted for (ie, there are no extra). */ if (values_seen != len) { return 0; } return 1; } /* Forward declare. */ int find_value_list_end(char *value, int *value_count, SLPType *type, int *unescaped_len, char **end); int main(int argc, char *argv[]) { SLPAttributes attr; SLPError err; char *str, *str2; int len; #ifdef ENABLE_PREDICATES char data[] = STR; SLPBoolean bool; int *int_arr; char **str_arr; SLPType type; char *tag; SLPAttrIterator iter; len = strlen(data); data[4] = '\0'; printf("Predicates enabled. Performing full test for libslpattr.c\n"); /***** Test string parsing. *****/ { int int_err; /* Somewhere to store integer return values. */ int value_count; SLPType type; int unescaped_len; char *cur; char *val; /*** Valid case: Single string. ***/ val = "value"; int_err = find_value_list_end(val, &value_count, &type, &unescaped_len, &cur); assert(int_err == 1); assert(value_count == 1); assert(type == SLP_STRING); assert(unescaped_len == strlen(val)); assert(cur == val + (strlen(val))); /*** Valid case: paired string. ***/ val = "value,12"; int_err = find_value_list_end(val, &value_count, &type, &unescaped_len, &cur); assert(int_err == 1); assert(value_count == 2); assert(type == SLP_STRING); assert(unescaped_len == strlen(val) - 1); assert(cur == val + (strlen(val))); /*** Valid case: tripled string. ***/ val = "2,value,12"; int_err = find_value_list_end(val, &value_count, &type, &unescaped_len, &cur); assert(int_err == 1); assert(value_count == 3); assert(type == SLP_STRING); assert(unescaped_len == strlen(val) - 2); assert(cur == val + (strlen(val))); /*** Valid case: tripled string. ***/ val = "2,v,12"; int_err = find_value_list_end(val, &value_count, &type, &unescaped_len, &cur); assert(int_err == 1); assert(value_count == 3); assert(type == SLP_STRING); assert(unescaped_len == strlen(val) - 2); assert(cur == val + (strlen(val))); /*** Valid case: boolean. ***/ val = "true"; int_err = find_value_list_end(val, &value_count, &type, &unescaped_len, &cur); assert(int_err == 1); assert(value_count == 1); assert(type == SLP_BOOLEAN); assert(cur == val + (strlen(val))); /*** Valid case: boolean. ***/ val = "false"; int_err = find_value_list_end(val, &value_count, &type, &unescaped_len, &cur); assert(int_err == 1); assert(value_count == 1); assert(type == SLP_BOOLEAN); assert(cur == val + (strlen(val))); /*** Valid case: paired string (devolve from int to str). ***/ val = "false,true"; int_err = find_value_list_end(val, &value_count, &type, &unescaped_len, &cur); assert(int_err == 1); assert(value_count == 2); assert(type == SLP_STRING); assert(unescaped_len == strlen(val) - 1); assert(cur == val + (strlen(val))); /*** Valid case: Single opaque. ***/ val = "\\00\\AB"; int_err = find_value_list_end(val, &value_count, &type, &unescaped_len, &cur); assert(int_err == 1); assert(value_count == 1); assert(type == SLP_OPAQUE); assert(unescaped_len == 1); assert(cur == val + (strlen(val))); /*** Valid case: paired opaque. ***/ val = "\\00\\AB,\\00\\12"; int_err = find_value_list_end(val, &value_count, &type, &unescaped_len, &cur); assert(int_err == 1); assert(value_count == 2); assert(type == SLP_OPAQUE); assert(unescaped_len == 2); assert(cur == val + (strlen(val))); /*** Invalid case: Opaque and non-opaque. ***/ val = "\\00\\AB,\\00\\12,2"; int_err = find_value_list_end(val, &value_count, &type, &unescaped_len, &cur); assert(int_err == 0); /*** Invalid case: Opaque and non-opaque. ***/ val = "dog,\\00\\AB"; int_err = find_value_list_end(val, &value_count, &type, &unescaped_len, &cur); assert(int_err == 0); } /***** Test Simple boolean set and get. *****/ err = SLPAttrAlloc("en", NULL, SLP_FALSE, &attr); assert(err == SLP_OK); err = SLPAttrSet_bool(attr, "shouldBeFalse", SLP_FALSE); /* Create. */ assert(err == SLP_OK); err = SLPAttrGetType(attr, "shouldBeFalse", &type); assert(err == SLP_OK); assert(type == SLP_BOOLEAN); err = SLPAttrGet_bool(attr, "shouldBeFalse", &bool); /* Test. */ assert(err == SLP_OK); assert(bool == SLP_FALSE); SLPAttrFree(attr); /***** Test simple string set and get. *****/ err = SLPAttrAlloc("en", NULL, SLP_FALSE, &attr); assert(err == SLP_OK); /**** Create. ****/ err = SLPAttrSet_str(attr, "str", STR, SLP_ADD); assert(err == SLP_OK); err = SLPAttrGetType(attr, "str", &type); assert(err == SLP_OK); assert(type == SLP_STRING); /*** Test. ***/ err = SLPAttrGet_str(attr, "str", &str_arr, &len); assert(err == SLP_OK); assert(len == 1); assert(strcmp(str_arr[0], STR) == 0); free(str_arr[0]); free(str_arr); /**** Append. ****/ err = SLPAttrSet_str(attr, "str", STR1, SLP_ADD); assert(err == SLP_OK); err = SLPAttrGetType(attr, "str", &type); assert(err == SLP_OK); assert(type == SLP_STRING); /*** Test. ***/ err = SLPAttrGet_str(attr, "str", &str_arr, &len); assert(err == SLP_OK); assert(len == 2); if (strcmp(str_arr[0], STR) == 0) { assert(strcmp(str_arr[1], STR1) == 0); } else { assert(strcmp(str_arr[0], STR1) == 0); assert(strcmp(str_arr[1], STR) == 0); } free(str_arr[0]); free(str_arr[1]); free(str_arr); /**** Replace. ****/ err = SLPAttrSet_str(attr, "str", STR2, SLP_REPLACE); assert(err == SLP_OK); err = SLPAttrGetType(attr, "str", &type); assert(err == SLP_OK); assert(type == SLP_STRING); /*** Test. ***/ err = SLPAttrGet_str(attr, "str", &str_arr, &len); assert(err == SLP_OK); assert(len == 1); assert(strcmp(str_arr[0], STR2) == 0); free(str_arr[0]); free(str_arr); SLPAttrFree(attr); /***** Test ints. *****/ err = SLPAttrAlloc("en", NULL, SLP_FALSE, &attr); assert(err == SLP_OK); /**** Check an int. ****/ err = SLPAttrSet_int(attr, "anInt", (int)234, SLP_ADD); assert(err == SLP_OK); err = SLPAttrGet_int(attr, "anInt", &int_arr, &len); assert(err == SLP_OK); assert(len == 1); assert(int_arr[0] == 234); free(int_arr); /**** Check a bunch of ints. ****/ err = SLPAttrSet_int(attr, "anInt", (int)345, SLP_ADD); assert(err == SLP_OK); err = SLPAttrGet_int(attr, "anInt", &int_arr, &len); assert(err == SLP_OK); assert(len == 2); if (int_arr[0] == 234) { assert(int_arr[1] == 345); } else { assert(int_arr[0] == 345); assert(int_arr[1] == 234); } free(int_arr); /**** Check replacement. ****/ err = SLPAttrSet_int(attr, "anInt", (int)567, SLP_REPLACE); assert(err == SLP_OK); err = SLPAttrGet_int(attr, "anInt", &int_arr, &len); assert(err == SLP_OK); assert(len == 1); assert(int_arr[0] == 567); free(int_arr); SLPAttrFree(attr); /**** Check deserialization. ****/ err = SLPAttrAllocStr("en", NULL, SLP_FALSE, &attr, "(doc=12,34,56)"); assert(err == SLP_OK); assert(test_int(attr, "doc", (int)12, (int)34, (int)56, TERM_INT)); SLPAttrFree(attr); /****** Test keyword set and get. *****/ err = SLPAttrAlloc("en", NULL, SLP_FALSE, &attr); assert(err == SLP_OK); err = SLPAttrSet_keyw(attr, "keyw1"); /* Create. */ assert(err == SLP_OK); err = SLPAttrGet_keyw(attr, "keyw1"); /* Test. */ assert(err == SLP_OK); err = SLPAttrGet_keyw(attr, "keyw2"); /* Test. */ assert(err == SLP_TAG_ERROR); SLPAttrFree(attr); /***** FIXME INSERT OPAQUE TESTING HERE. *****/ /***** Test guessing facilities. *****/ err = SLPAttrAlloc("en", NULL, SLP_FALSE, &attr); assert(err == SLP_OK); /**** Single value. ****/ err = SLPAttrSet_guess(attr, "tag", "string", SLP_REPLACE); assert(err == SLP_OK); err = SLPAttrGetType(attr, "tag", &type); assert(err == SLP_OK); assert(type == SLP_STRING); err = SLPAttrGet_str(attr, "tag", &str_arr, &len); assert(err == SLP_OK); assert(len == 1); assert(strcmp(str_arr[0], "string") == 0); free(str_arr[0]); free(str_arr); /**** Multi value. ****/ err = SLPAttrSet_guess(attr, "tag", "str1,str2", SLP_REPLACE); assert(err == SLP_OK); err = SLPAttrGetType(attr, "tag", &type); assert(err == SLP_OK); assert(type == SLP_STRING); err = SLPAttrGet_str(attr, "tag", &str_arr, &len); assert(err == SLP_OK); assert(len == 2); // assert(strcmp(str_arr[0], "string") == 0); free(str_arr[0]); free(str_arr[1]); free(str_arr); SLPAttrFree(attr); /**** Test replacement of types. ****/ err = SLPAttrAlloc("en", NULL, SLP_FALSE, &attr); assert(err == SLP_OK); err = SLPAttrSet_keyw(attr, "keyw1"); /* Create. */ assert(err == SLP_OK); err = SLPAttrGet_keyw(attr, "keyw1"); /* Test. */ assert(err == SLP_OK); err = SLPAttrSet_bool(attr, "keyw1", SLP_TRUE); /* Create. */ assert(err == SLP_OK); err = SLPAttrGet_keyw(attr, "keyw1"); /* Test. */ assert(err == SLP_TYPE_ERROR); err = SLPAttrGet_bool(attr, "keyw1", &bool); assert(err == SLP_OK); assert(bool == SLP_TRUE); err = SLPAttrSet_int(attr, "keyw1", (int)1, SLP_ADD); assert(err == SLP_TYPE_ERROR); SLPAttrFree(attr); /**** Maintain two strings simultainiously. ****/ err = SLPAttrAlloc("en", NULL, SLP_FALSE, &attr); assert(err == SLP_OK); /**** Create. ****/ err = SLPAttrSet_str(attr, "str", STR, SLP_ADD); assert(err == SLP_OK); err = SLPAttrSet_str(attr, "str1", STR1, SLP_ADD); assert(err == SLP_OK); /*** Test. ***/ err = SLPAttrGet_str(attr, "str", &str_arr, &len); assert(err == SLP_OK); assert(len == 1); assert(strcmp(str_arr[0], STR) == 0); free(str_arr[0]); free(str_arr); err = SLPAttrGet_str(attr, "str1", &str_arr, &len); assert(err == SLP_OK); assert(len == 1); assert(strcmp(str_arr[0], STR1) == 0); free(str_arr[0]); free(str_arr); err = SLPAttrGet_str(attr, "str", &str_arr, &len); assert(err == SLP_OK); assert(len == 1); assert(strcmp(str_arr[0], STR) == 0); free(str_arr[0]); free(str_arr); SLPAttrFree(attr); /**** Allocate from string. ****/ err = SLPAttrAllocStr("en", NULL, SLP_FALSE, &attr, "(abool=false),keyw,(anInt=51,3)"); assert(err == SLP_OK); err = SLPAttrGetType(attr, "abool", &type); assert(err == SLP_OK); assert(type == SLP_BOOLEAN); err = SLPAttrGet_bool(attr, "abool", &bool); assert(err == SLP_OK); assert(bool == SLP_FALSE); err = SLPAttrGetType(attr, "keyw", &type); assert(err == SLP_OK); assert(type == SLP_KEYWORD); err = SLPAttrGet_keyw(attr, "keyw"); assert(err == SLP_OK); err = SLPAttrGetType(attr, "anInt", &type); assert(err == SLP_OK); assert(type == SLP_INTEGER); err = SLPAttrGet_int(attr, "anInt", &int_arr, &len); assert(err == SLP_OK); assert(len == 2); assert((int_arr[0] == 51 && int_arr[1] == 3) || (int_arr[0] == 3 && int_arr[1] == 51)); free(int_arr); /*** Iterate across the thing. ***/ err = SLPAttrIteratorAlloc(attr, &iter); assert(err == SLP_OK); while(SLPAttrIterNext(iter, (char const **)&tag, &type)== SLP_FALSE) { } SLPAttrIteratorFree(iter); str = NULL; err = SLPAttrSerialize(attr, NULL, &str, 0, NULL, SLP_TRUE); assert(err == SLP_OK); /* FIXME Check str. */ free(str); SLPAttrFree(attr); /**** Test freshen(). ****/ err = SLPAttrAllocStr("en", NULL, SLP_FALSE, &attr, "(abool=false),keyw,(anInt=51)"); assert(err == SLP_OK); /*** Append without replacing. ***/ err = SLPAttrFreshen(attr, "(cat=meow)"); assert(err == SLP_OK); err = SLPAttrGet_str(attr, "cat", &str_arr, &len); assert(err == SLP_OK); assert(len == 1); assert(strcmp(str_arr[0], "meow") == 0); free(str_arr[0]); free(str_arr); /*** Replace. ***/ err = SLPAttrFreshen(attr, "(abool=true)"); assert(err == SLP_OK); err = SLPAttrGet_bool(attr, "abool", &bool); assert(err == SLP_OK); assert(bool == SLP_TRUE); SLPAttrFree(attr); /**** Test the buffering for serialization. ****/ err = SLPAttrAllocStr("en", NULL, SLP_FALSE, &attr, SER1); assert(err == SLP_OK); /*** Try with too small a buffer. ***/ str2 = str = (char *)malloc(5); assert(str); assert(5 < strlen(SER1) + 1); err = SLPAttrSerialize(attr, NULL, &str, 5, NULL, SLP_FALSE); assert(str == str2); /* Ensure a new buffer wasn't created. */ assert(err == SLP_BUFFER_OVERFLOW); free(str); /*** Try with a "just right" buffer. ***/ str2 = str = (char *)malloc(strlen(SER1) + 1); assert(str); err = SLPAttrSerialize(attr, NULL, &str, strlen(SER1)+1, NULL, SLP_FALSE); assert(err == SLP_OK); assert(str == str2); /* Ensure a new buffer wasn't created. */ assert(strstr(str, "(abool=false)") != NULL); assert(strstr(str, "keyw") != NULL); assert(strstr(str, "(anInt=51)") != NULL); assert(strlen(str) == 29); free(str); /*** Try with an "n-1" buffer. (too small) ***/ str2 = str = (char *)malloc(strlen(SER1)); assert(str); err = SLPAttrSerialize(attr, NULL, &str, strlen(SER1), NULL, SLP_FALSE); assert(err == SLP_BUFFER_OVERFLOW); free(str); SLPAttrFree(attr); /**** Test the freshening. ****/ err = SLPAttrAllocStr("en", NULL, SLP_FALSE, &attr, "(abool=false),keyw,(anInt=51)"); assert(err == SLP_OK); str = NULL; err = SLPAttrSerialize(attr, NULL, &str, 0, NULL, SLP_TRUE); assert(err == SLP_OK); assert(strstr(str, "(abool=false)") != NULL); assert(strstr(str, "keyw") != NULL); assert(strstr(str, "(anInt=51)") != NULL); assert(strlen(str) == 29); free(str); err = SLPAttrSet_bool(attr, "abool", SLP_FALSE); assert(err == SLP_OK); str = NULL; err = SLPAttrSerialize(attr, NULL, &str, 0, NULL, SLP_TRUE); assert(err == SLP_OK); assert(strcmp("(abool=false)", str) == 0); free(str); SLPAttrFree(attr); /**** Test serialization. ****/ err = SLPAttrAllocStr("en", NULL, SLP_FALSE, &attr, "(a=1)"); assert(err == SLP_OK); str = NULL; err = SLPAttrSerialize(attr, NULL, &str, 0, NULL, SLP_TRUE); assert(err == SLP_OK); assert(strcmp(str, "(a=1)") == 0); free(str); SLPAttrFree(attr); /**** Test serialization. ****/ err = SLPAttrAllocStr("en", NULL, SLP_FALSE, &attr, "(a=0)"); assert(err == SLP_OK); str = NULL; err = SLPAttrSerialize(attr, NULL, &str, 0, NULL, SLP_TRUE); assert(err == SLP_OK); assert(strcmp(str, "(a=0)") == 0); free(str); SLPAttrFree(attr); /**** Test serialization. ****/ err = SLPAttrAllocStr("en", NULL, SLP_FALSE, &attr, "(a=-1)"); assert(err == SLP_OK); str = NULL; err = SLPAttrSerialize(attr, NULL, &str, 0, NULL, SLP_TRUE); assert(err == SLP_OK); assert(strcmp(str, "(a=-1)") == 0); free(str); SLPAttrFree(attr); /**** Test serialization. ****/ err = SLPAttrAllocStr("en", NULL, SLP_FALSE, &attr, "(a=52)"); assert(err == SLP_OK); str = NULL; err = SLPAttrSerialize(attr, NULL, &str, 0, NULL, SLP_FALSE); assert(err == SLP_OK); assert(strcmp(str, "(a=52)") == 0); free(str); SLPAttrFree(attr); /**** Test serialization. ****/ err = SLPAttrAllocStr("en", NULL, SLP_FALSE, &attr, "(a=-2000)"); assert(err == SLP_OK); str = NULL; err = SLPAttrSerialize(attr, NULL, &str, 0, NULL, SLP_FALSE); assert(err == SLP_OK); assert(strcmp(str, "(a=-2000)") == 0); free(str); SLPAttrFree(attr); /**** Do it again. ****/ err = SLPAttrAllocStr("en", NULL, SLP_FALSE, &attr, "(public=log),(slug=pig),(doc=12,34,56),zoink"); assert(err == SLP_OK); assert(test_int(attr, "doc", (int)12, (int)34, (int)56, TERM_INT)); /*** Test singular desrialization. ***/ str = NULL; err = SLPAttrSerialize(attr, "doc", &str, 0, NULL, SLP_FALSE); assert(err == SLP_OK); /* Check that serialized values are there. */ assert(strstr(str, "12") != NULL); assert(strstr(str, "34") != NULL); assert(strstr(str, "56") != NULL); assert(strstr(str, "doc") != NULL); /* Check that other tags aren't. */ assert(strstr(str, "public") == NULL); assert(strstr(str, "slug") == NULL); assert(strstr(str, "zoink") == NULL); free(str); /*** Test binary deserialization. ***/ str = NULL; err = SLPAttrSerialize(attr, "doc,zoink", &str, 0, NULL, SLP_FALSE); assert(err == SLP_OK); /* Check that serialized values are there. */ assert(strstr(str, "12") != NULL); assert(strstr(str, "34") != NULL); assert(strstr(str, "56") != NULL); assert(strstr(str, "zoink") != NULL); assert(strstr(str, "doc") != NULL); /* Check that other tags aren't. */ assert(strstr(str, "public") == NULL); assert(strstr(str, "slug") == NULL); free(str); /*** Test binary deserialization. ***/ str = NULL; err = SLPAttrSerialize(attr, "doc,public", &str, 0, NULL, SLP_FALSE); assert(err == SLP_OK); /* Check that serialized values are there. */ assert(strstr(str, "12") != NULL); assert(strstr(str, "34") != NULL); assert(strstr(str, "56") != NULL); assert(strstr(str, "log") != NULL); assert(strstr(str, "public") != NULL); /* Check that other tags aren't. */ assert(strstr(str, "slug") == NULL); assert(strstr(str, "pig") == NULL); assert(strstr(str, "zoink") == NULL); free(str); /*** Test binary deserialization. ***/ str = NULL; err = SLPAttrSerialize(attr, "doc,zoink,public", &str, 0, NULL, SLP_FALSE); assert(err == SLP_OK); /* Check that serialized values are there. */ assert(strstr(str, "12") != NULL); assert(strstr(str, "34") != NULL); assert(strstr(str, "56") != NULL); assert(strstr(str, "zoink") != NULL); assert(strstr(str, "doc") != NULL); assert(strstr(str, "public=log") != NULL); /* Check that other tags aren't. */ assert(strstr(str, "slug") == NULL); assert(strstr(str, "pig") == NULL); free(str); /*** Test binary deserialization. ***/ str = NULL; err = SLPAttrSerialize(attr, "doc,zoink,public,slug", &str, 0, NULL, SLP_FALSE); assert(err == SLP_OK); /* Check that serialized values are there. */ assert(strstr(str, "12") != NULL); assert(strstr(str, "34") != NULL); assert(strstr(str, "56") != NULL); assert(strstr(str, "zoink") != NULL); assert(strstr(str, "doc") != NULL); assert(strstr(str, "public=log") != NULL); assert(strstr(str, "slug=pig") != NULL); assert(strlen(str) == 44); free(str); SLPAttrFree(attr); /**** Test deserialization. ****/ err = SLPAttrAllocStr("en", NULL, SLP_FALSE, &attr, "(attr1=val1),(attr2=val1,val2),(attr3=val1,val2,val3)"); assert(err == SLP_OK); /* Check that all values were deserialized. */ assert(test_string(attr, "attr1", "val1", NULL)); assert(test_string(attr, "attr2", "val1", "val2", NULL)); assert(test_string(attr, "attr3", "val1", "val2", "val3", NULL)); /* Check that there are no extra values. */ assert(test_size(attr) == 3); SLPAttrFree(attr); /**** Test deserialization. ****/ err = SLPAttrAllocStr("en", NULL, SLP_FALSE, &attr, "(attr1=val1),(attr2=val1,val2),(attr3=val1,val2,val3)"); assert(err == SLP_OK); /* Check that all values were deserialized. */ assert(test_string(attr, "attr1", "val1", NULL)); assert(test_string(attr, "attr2", "val1", "val2", NULL)); assert(test_string(attr, "attr3", "val1", "val2", "val3", NULL)); /* Check that there are no extra values. */ assert(test_size(attr) == 3); SLPAttrFree(attr); /**** Test deserialization. ****/ str2 = "keyw1,keyw2,(ValX3=val1,val2,val3),(ints=12,3244,93,-15,2,-135),(aBool1=true),(aBool2=false)"; err = SLPAttrAllocStr("en", NULL, SLP_FALSE, &attr, str2); assert(err == SLP_OK); /* Check that all values were deserialized. */ assert(SLPAttrGet_keyw(attr, "keyw1") == SLP_OK); assert(SLPAttrGet_keyw(attr, "keyw2") == SLP_OK); assert(test_string(attr, "ValX3", "val1","val2","val3", NULL)); assert(test_int(attr, "ints", 12, 3244, 93, -15, 2, -135, TERM_INT)); assert(SLPAttrGet_bool(attr, "aBool1", &bool) == SLP_OK && bool == SLP_TRUE); assert(SLPAttrGet_bool(attr, "aBool2", &bool) == SLP_OK && bool == SLP_FALSE); /*** Test standard case of deserialization. ***/ str = (char *)93; /* It's ok. it shouldn't write here, cause we pass a length of zero in. */ err = SLPAttrSerialize(attr, NULL, &str, 0, &len, SLP_FALSE); assert(err == SLP_BUFFER_OVERFLOW); assert(strlen(str2) + 1 == len); /* +1 for null. */ str = (char *)malloc(len); assert(str != NULL); /* Check for n+1 error. */ err = SLPAttrSerialize(attr, NULL, &str, len, &len, SLP_FALSE); assert(err == SLP_OK); free(str); SLPAttrFree(attr); /*** Test that integers/strings are properly recognized. ***/ str2 = "(int=1,2,3),(str=1,2-3)"; err = SLPAttrAllocStr("en", NULL, SLP_FALSE, &attr, str2); assert(err == SLP_OK); assert(test_string(attr, "str", "1","2-3", NULL)); assert(test_int(attr, "int", 1, 2, 3, TERM_INT)); SLPAttrFree(attr); #else /* ENABLE_PREDICATES */ printf("Predicates disabled. Performing partial test for libslpattr_tiny.c"); #endif /* ENABLE_PREDICATES */ /***** Common tests. *****/ /**** Basic creation. ****/ err = SLPAttrAlloc("en", NULL, SLP_FALSE, &attr); assert(err == SLP_OK); SLPAttrFree(attr); /**** Test deserialization. ****/ str2 = "keyw1,keyw2,(ValX3=val1,val2,val3),(ints=12,3244,93,-15,2,-135),(aBool1=true),(aBool2=false)"; err = SLPAttrAlloc("en", NULL, SLP_FALSE, &attr); assert(err == SLP_OK); err = SLPAttrFreshen(attr, str2); assert(err == SLP_OK); /*** Test standard case of deserialization. ***/ str = (char *)93; /* It's ok. it shouldn't write here, cause we pass a length of zero in. */ err = SLPAttrSerialize(attr, NULL, &str, 0, &len, SLP_FALSE); assert(err == SLP_BUFFER_OVERFLOW); assert(strlen(str2) + 1 == len); /* +1 for null. */ str = (char *)malloc(len); assert(str != NULL); /* Check for n+1 error. */ err = SLPAttrSerialize(attr, NULL, &str, len, &len, SLP_FALSE); assert(err == SLP_OK); /* Check length of serialized. */ assert(strlen(str) == strlen(str2)); /* Check contents of serialized. */ assert(strstr(str, "keyw1")); assert(strstr(str, "keyw2")); assert(strstr(str, "keyw2")); free(str); SLPAttrFree(attr); /**** Create and freshen. ****/ str2 = "keyword,(aBool=true),(int=1,2,3,-4,1000,-2000),(str=val 1,val 2,val 3)"; err = SLPAttrAlloc("en", NULL, SLP_FALSE, &attr); assert(err == SLP_OK); err = SLPAttrFreshen(attr, str2); assert(err == SLP_OK); /*** Check the serialized attribute string. ***/ assert(test_serialized(str2, "aBool", "true", NULL)); assert(test_serialized(str2, "int", "1", "2", "3", "-4", "1000", "-2000", NULL)); assert(test_serialized(str2, "str", "val 1", "val 2", "val 3", NULL)); SLPAttrFree(attr); return 0; } openslp-1.2.1/test/SLPFindAttrs/0000755033442200000310000000000010260165763016322 5ustar rganesanfloppyopenslp-1.2.1/test/SLPFindAttrs/SLPFindAttrs.expected.output0000644033442200000310000000204207141761465023664 0ustar rganesanfloppyQuerying = service:test Service URL = service:test://10.0.0.1 Querying Attributes = foo Service Attributes = (foo=value1,value2) Querying = service:test Service URL = service:test://10.0.0.1 Querying Attributes = goo Service Attributes = (goo=value3,value4) Querying = service:test Service URL = service:test://10.0.0.1 Querying Attributes = description Service Attributes = (description=Test Service 1) Registering = service:test://10.0.0.1 Querying = service:test Service URL = service:test://10.0.0.1 Querying Attributes = foo Service Attributes = foo=value1,value2 Registering = service:test://10.0.0.1 Querying = service:test Service URL = service:test://10.0.0.1 Querying Attributes = goo Service Attributes = openslp-1.2.1/test/SLPFindAttrs/SLPFindAttrs.c0000644033442200000310000000646310202047670020744 0ustar rganesanfloppy/****************************************************************************/ /* Test for SLPFindAttrs */ /* Creation Date: Wed May 24 14:26:50 EDT 2000 */ /****************************************************************************/ #include #include #include #include SLPBoolean MySLPSrvURLCallback (SLPHandle hslp, const char *srvurl, unsigned short lifetime, SLPError errcode, void *cookie) { switch(errcode) { case SLP_OK: printf ("Service URL = %s\n", srvurl); *(SLPError *) cookie = SLP_OK; break; case SLP_LAST_CALL: break; default: *(SLPError *) cookie = errcode; break; } /* End switch. */ return SLP_TRUE; } void MySLPRegReport(SLPHandle hslp, SLPError errcode, void* cookie) { /* return the error code in the cookie */ *(SLPError*)cookie = errcode; } SLPBoolean MySLPAttrCallback (SLPHandle hslp, const char* attrlist, SLPError errcode, void* cookie ) { switch(errcode) { case SLP_OK: printf ("Service Attributes = %s\n", attrlist); *(SLPError *) cookie = SLP_OK; break; case SLP_LAST_CALL: break; default: check_error_state(errcode, "Error on Attribute Callback."); *(SLPError *) cookie = errcode; break; } /* End switch. */ return(1); } int main (int argc, char *argv[]) { SLPError err; SLPError callbackerr; SLPHandle hslp; char server_url[4096]; char *attrids; char reg_string[MAX_STRING_LENGTH]; if ((argc != 4) && (argc != 5)) { printf("SLPFindAttrs\n This test the SLP Find Attributes.\n Usage:\n SLPFindAttrs \n SLPFindAttrs \n"); return(0); } err = SLPOpen ("en", SLP_FALSE, &hslp); check_error_state(err, "Error opening slp handle"); if (argc == 5) { sprintf(reg_string, "%s://%s", argv[1], argv[2]); printf("Registering = %s\n",reg_string); /* Register a service with SLP */ err = SLPReg( hslp, reg_string, SLP_LIFETIME_MAXIMUM, NULL, argv[3], SLP_TRUE, MySLPRegReport, &callbackerr ); check_error_state(err, "Error registering service with slp."); check_error_state(callbackerr, "Error registering service with slp."); } /* End If. */ // Check to ensure the service we want to ask about is actually there. printf("Querying = %s\n",argv[1]); err = SLPFindSrvs ( hslp, argv[1], NULL, /* use configured scopes */ NULL, /* no attr filter */ MySLPSrvURLCallback, &callbackerr); check_error_state(err, "Error verifying service with slp."); check_error_state(callbackerr, "Error verifying service with slp."); // Check to see if the attrivbutes are set correctly if (argc == 4) attrids = (char *) strdup(argv[3]); else attrids = (char *) strdup(argv[4]); sprintf(server_url, "%s://%s", argv[1], argv[2]); printf("Querying Attributes = %s\n", attrids); err = SLPFindAttrs( hslp, server_url, NULL, attrids, MySLPAttrCallback, &callbackerr); check_error_state(err, "Error find service attributes."); /* Now that we're done using slp, close the slp handle */ SLPClose (hslp); return(0); } openslp-1.2.1/test/SLPFindAttrs/test.script0000755033442200000310000000220410207722040020514 0ustar rganesanfloppy#!/bin/sh echo "SLPFindAttrs" rm -f SLPFindAttrs.actual.output scriptdir=${srcdir}/SLPFindAttrs test -f ${srcdir}/slpd.pid && kill `cat ${srcdir}/slpd.pid` && rm ${srcdir}/slpd.pid ../slpd/slpd -r ${scriptdir}/slp.test.reg -p ${srcdir}/slpd.pid -l ${srcdir}/slpd.log RESULT=$? if test $RESULT != 1; then echo "Unable to start slpd (error = $RESULT), test failed." exit $RESULT fi ./testslpfindattrs service:test 10.0.0.1 foo >> SLPFindAttrs.actual.output echo >> SLPFindAttrs.actual.output ./testslpfindattrs service:test 10.0.0.1 goo >> SLPFindAttrs.actual.output echo >> SLPFindAttrs.actual.output ./testslpfindattrs service:test 10.0.0.1 description >> SLPFindAttrs.actual.output echo >> SLPFindAttrs.actual.output ./testslpfindattrs service:test 10.0.0.1 "(foo=value1,value2)" foo >> SLPFindAttrs.actual.output echo >> SLPFindAttrs.actual.output ./testslpfindattrs service:test 10.0.0.1 "(foo=value1,value2)" goo >> SLPFindAttrs.actual.output echo >> SLPFindAttrs.actual.output test -f ${srcdir}/slpd.pid && kill `cat ${srcdir}/slpd.pid` && rm ${srcdir}/slpd.pid diff -c ${scriptdir}/SLPFindAttrs.expected.output SLPFindAttrs.actual.output openslp-1.2.1/test/SLPFindAttrs/slp.test.reg0000644033442200000310000000151107113265250020566 0ustar rganesanfloppy############################################################################# # # OpenSLP registration file # # May be used to register services for legacy applications that do not use # the SLPAPIs to register for themselves # # Format and contents conform to specification in IETF RFC 2614 so the # comments use the language of the RFC. In OpenSLP, SLPD operates as an SA # and a DA. The SLP UA functionality is encapsulated by SLPLIB. # ############################################################################# #comment ;comment #service-url,language-tag,lifetime,[service-type] #["scopes="scope-list] #[attrid"="val1] #[attrid"="val1,val2,val3] # ##This is the other testing service service:test://10.0.0.1,en,65535 foo=value1,value2 description=Test Service 1 goo=value3,value4 openslp-1.2.1/test/Makefile.am0000644033442200000310000000330110207463534016074 0ustar rganesanfloppyEXTRA_DIST = slp_debug.h TESTS = SLPOpen/test.script SLPFindSrvTypes/test.script \ SLPFindSrvs/test.script SLPReg/test.script \ SLPDereg/test.script SLPFindAttrs/test.script \ SLPParseSrvURL/test.script SLPEscape/test.script \ SLPUnescape/test.script XFAIL_TESTS = SLPFindAttrs/test.script INCLUDES = -I$(top_srcdir)/libslp -I$(top_srcdir)/libslpattr \ -I$(top_srcdir)/common -I$(top_srcdir)/slpd noinst_PROGRAMS = testslpdereg testslpescape testslpfindattrs testslpfindsrvtypes \ testslpfindsrvs testslpopen testslpparsesrvurl testslpreg testslpunescape \ testslp_attr_test testslpd_predicate_test LDADD = ../libslp/libslp.la ../libslpattr/libslpattr.la ../common/libcommonlibslp.la ../common/libcommonslpd.la if ENABLE_PREDICATES testslpd_predicate_test_LDADD = $(LDADD) ../slpd/slpd_predicate.o ../common/libcommonslpd.la endif testslpdereg_SOURCES = SLPDereg/SLPDereg.c testslpescape_SOURCES = SLPEscape/SLPEscape.c testslpfindattrs_SOURCES = SLPFindAttrs/SLPFindAttrs.c testslpfindsrvs_SOURCES = SLPFindSrvs/SLPFindSrvs.c testslpfindsrvtypes_SOURCES = SLPFindSrvTypes/SLPFindSrvTypes.c testslpopen_SOURCES = SLPOpen/SLPOpen.c testslpparsesrvurl_SOURCES = SLPParseSrvURL/SLPParseSrvURL.c testslpreg_SOURCES = SLPReg/SLPReg.c testslpunescape_SOURCES = SLPUnescape/SLPUnescape.c testslp_attr_test_SOURCES = SLP_attr_test/slp_attr_test.c testslpd_predicate_test_SOURCES = SLPD_predicate_test/slpd_predicate_test.c clean-local: -rm -f *.output # We have to manually copy files in the TEST directories. dist-hook: @for d in $(TESTS); do \ cp -pr $(srcdir)/`dirname $$d`/* $(distdir)/`dirname $$d`; \ done openslp-1.2.1/test/SLPFindSrvs/0000755033442200000310000000000010260165763016162 5ustar rganesanfloppyopenslp-1.2.1/test/SLPFindSrvs/SLPFindSrvs.expected.output0000644033442200000310000000020407113265250023350 0ustar rganesanfloppyService URL = service:test://10.0.0.1 Service Timeout = 65535 Service URL = service:test://10.0.0.2 Service Timeout = 65535 openslp-1.2.1/test/SLPFindSrvs/SLPFindSrvs.dsp0000644033442200000310000001063007162216101020775 0ustar rganesanfloppy# Microsoft Developer Studio Project File - Name="SLPFindSrvs" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=SLPFindSrvs - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "SLPFindSrvs.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "SLPFindSrvs.mak" CFG="SLPFindSrvs - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "SLPFindSrvs - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "SLPFindSrvs - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "SLPFindSrvs - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "..\\" /I "..\..\common" /I "..\..\libslp" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 ..\..\common\Release\common.lib ..\..\libslp\Release\libslp.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib wsock32.lib winmm.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "SLPFindSrvs - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\\" /I "..\..\common" /I "..\..\libslp" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 ..\..\common\Debug\common.lib ..\..\libslp\Debug\libslp.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib wsock32.lib winmm.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "SLPFindSrvs - Win32 Release" # Name "SLPFindSrvs - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=.\SLPFindSrvs.c !IF "$(CFG)" == "SLPFindSrvs - Win32 Release" # ADD CPP /MT !ELSEIF "$(CFG)" == "SLPFindSrvs - Win32 Debug" # ADD CPP /MTd !ENDIF # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project openslp-1.2.1/test/SLPFindSrvs/test.script0000755033442200000310000000114010207722171020357 0ustar rganesanfloppy#!/bin/sh echo "SLPFindSrvs" rm -f SLPFindSrvs.actual.output scriptdir=${srcdir}/SLPFindSrvs test -f ${srcdir}/slpd.pid && kill `cat ${srcdir}/slpd.pid` && rm ${srcdir}/slpd.pid ../slpd/slpd -r ${scriptdir}/slp.test.reg -p ${srcdir}/slpd.pid -l ${srcdir}/slpd.log RESULT=$? if test $RESULT != 0; then echo "Unable to start slpd (error = $RESULT), test failed." exit $RESULT fi ./testslpfindsrvs service:test >> SLPFindSrvs.actual.output test -f ${srcdir}/slpd.pid && kill `cat ${srcdir}/slpd.pid` && rm ${srcdir}/slpd.pid diff -c ${scriptdir}/SLPFindSrvs.expected.output SLPFindSrvs.actual.output openslp-1.2.1/test/SLPFindSrvs/slp.test.reg0000644033442200000310000000160407113265250020431 0ustar rganesanfloppy############################################################################# # # OpenSLP registration file # # May be used to register services for legacy applications that do not use # the SLPAPIs to register for themselves # # Format and contents conform to specification in IETF RFC 2614 so the # comments use the language of the RFC. In OpenSLP, SLPD operates as an SA # and a DA. The SLP UA functionality is encapsulated by SLPLIB. # ############################################################################# #comment ;comment #service-url,language-tag,lifetime,[service-type] #["scopes="scope-list] #[attrid"="val1] #[attrid"="val1,val2,val3] # ##This is a testing service service:test://10.0.0.2,en,65535 description=Testing Serivce 2 ##This is the other testing service service:test://10.0.0.1,en,65535 description=Test Service 1 openslp-1.2.1/test/SLPFindSrvs/SLPFindSrvs.mak0000644033442200000310000001133707162216101020764 0ustar rganesanfloppy# Microsoft Developer Studio Generated NMAKE File, Based on SLPFindSrvs.dsp !IF "$(CFG)" == "" CFG=SLPFindSrvs - Win32 Debug !MESSAGE No configuration specified. Defaulting to SLPFindSrvs - Win32 Debug. !ENDIF !IF "$(CFG)" != "SLPFindSrvs - Win32 Release" && "$(CFG)" != "SLPFindSrvs - Win32 Debug" !MESSAGE Invalid configuration "$(CFG)" specified. !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "SLPFindSrvs.mak" CFG="SLPFindSrvs - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "SLPFindSrvs - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "SLPFindSrvs - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE !ERROR An invalid configuration is specified. !ENDIF !IF "$(OS)" == "Windows_NT" NULL= !ELSE NULL=nul !ENDIF CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "SLPFindSrvs - Win32 Release" OUTDIR=.\Release INTDIR=.\Release # Begin Custom Macros OutDir=.\Release # End Custom Macros ALL : "$(OUTDIR)\SLPFindSrvs.exe" CLEAN : -@erase "$(INTDIR)\SLPFindSrvs.obj" -@erase "$(INTDIR)\vc60.idb" -@erase "$(OUTDIR)\SLPFindSrvs.exe" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP_PROJ=/nologo /ML /W3 /GX /O2 /I "..\\" /I "..\..\common" /I "..\..\libslp" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c BSC32=bscmake.exe BSC32_FLAGS=/nologo /o"$(OUTDIR)\SLPFindSrvs.bsc" BSC32_SBRS= \ LINK32=link.exe LINK32_FLAGS=..\..\common\Release\common.lib ..\..\libslp\Release\libslp.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib wsock32.lib winmm.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\SLPFindSrvs.pdb" /machine:I386 /out:"$(OUTDIR)\SLPFindSrvs.exe" LINK32_OBJS= \ "$(INTDIR)\SLPFindSrvs.obj" "$(OUTDIR)\SLPFindSrvs.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << !ELSEIF "$(CFG)" == "SLPFindSrvs - Win32 Debug" OUTDIR=.\Debug INTDIR=.\Debug # Begin Custom Macros OutDir=.\Debug # End Custom Macros ALL : "$(OUTDIR)\SLPFindSrvs.exe" CLEAN : -@erase "$(INTDIR)\SLPFindSrvs.obj" -@erase "$(INTDIR)\vc60.idb" -@erase "$(INTDIR)\vc60.pdb" -@erase "$(OUTDIR)\SLPFindSrvs.exe" -@erase "$(OUTDIR)\SLPFindSrvs.ilk" -@erase "$(OUTDIR)\SLPFindSrvs.pdb" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP_PROJ=/nologo /MLd /W3 /Gm /GX /ZI /Od /I "..\\" /I "..\..\common" /I "..\..\libslp" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c BSC32=bscmake.exe BSC32_FLAGS=/nologo /o"$(OUTDIR)\SLPFindSrvs.bsc" BSC32_SBRS= \ LINK32=link.exe LINK32_FLAGS=..\..\common\Debug\common.lib ..\..\libslp\Debug\libslp.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib wsock32.lib winmm.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\SLPFindSrvs.pdb" /debug /machine:I386 /out:"$(OUTDIR)\SLPFindSrvs.exe" /pdbtype:sept LINK32_OBJS= \ "$(INTDIR)\SLPFindSrvs.obj" "$(OUTDIR)\SLPFindSrvs.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << !ENDIF .c{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .c{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << !IF "$(NO_EXTERNAL_DEPS)" != "1" !IF EXISTS("SLPFindSrvs.dep") !INCLUDE "SLPFindSrvs.dep" !ELSE !MESSAGE Warning: cannot find "SLPFindSrvs.dep" !ENDIF !ENDIF !IF "$(CFG)" == "SLPFindSrvs - Win32 Release" || "$(CFG)" == "SLPFindSrvs - Win32 Debug" SOURCE=.\SLPFindSrvs.c !IF "$(CFG)" == "SLPFindSrvs - Win32 Release" CPP_SWITCHES=/nologo /MT /W3 /GX /O2 /I "..\\" /I "..\..\common" /I "..\..\libslp" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c "$(INTDIR)\SLPFindSrvs.obj" : $(SOURCE) "$(INTDIR)" $(CPP) @<< $(CPP_SWITCHES) $(SOURCE) << !ELSEIF "$(CFG)" == "SLPFindSrvs - Win32 Debug" CPP_SWITCHES=/nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\\" /I "..\..\common" /I "..\..\libslp" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c "$(INTDIR)\SLPFindSrvs.obj" : $(SOURCE) "$(INTDIR)" $(CPP) @<< $(CPP_SWITCHES) $(SOURCE) << !ENDIF !ENDIF openslp-1.2.1/test/SLPFindSrvs/SLPFindSrvs.c0000644033442200000310000000267310202047670020443 0ustar rganesanfloppy/****************************************************************************/ /* Test for SLPFindSrvs */ /* Creation Date: Wed May 24 14:26:50 EDT 2000 */ /****************************************************************************/ #include #include #include SLPBoolean MySLPSrvURLCallback (SLPHandle hslp, const char *srvurl, unsigned short lifetime, SLPError errcode, void *cookie) { switch(errcode) { case SLP_OK: printf ("Service URL = %s\n", srvurl); printf ("Service Timeout = %i\n", lifetime); *(SLPError *) cookie = SLP_OK; break; case SLP_LAST_CALL: break; default: *(SLPError *) cookie = errcode; break; } /* End switch. */ return SLP_TRUE; } int main (int argc, char *argv[]) { SLPError err; SLPError callbackerr; SLPHandle hslp; if (argc != 2) { printf("SLPFindSrvs\n Finds a SLP service.\n Usage:\n SLPFindSrvs\n \n"); return (0); } /* End If. */ err = SLPOpen ("en", SLP_FALSE, &hslp); check_error_state(err,"Error opening slp handle."); err = SLPFindSrvs ( hslp, argv[1], 0, /* use configured scopes */ 0, /* no attr filter */ MySLPSrvURLCallback, &callbackerr); check_error_state(err, "Error registering service with slp."); /* Now that we're done using slp, close the slp handle */ SLPClose (hslp); return(0); } openslp-1.2.1/test/SLPFindSrvs/SLPFindSrvs.dsw0000644033442200000310000000104307162216101021002 0ustar rganesanfloppyMicrosoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "SLPFindSrvs"=".\SLPFindSrvs.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### openslp-1.2.1/test/SLPReg/0000755033442200000310000000000010260165763015141 5ustar rganesanfloppyopenslp-1.2.1/test/SLPReg/SLPReg.c0000644033442200000310000000452210202047670016374 0ustar rganesanfloppy/****************************************************************************/ /* Test for SLPReg */ /* Creation Date: Wed May 24 14:26:50 EDT 2000 */ /****************************************************************************/ #include #include #include void MySLPRegReport(SLPHandle hslp, SLPError errcode, void* cookie) { /* return the error code in the cookie */ *(SLPError*)cookie = errcode; } SLPBoolean MySLPSrvURLCallback (SLPHandle hslp, const char *srvurl, unsigned short lifetime, SLPError errcode, void *cookie) { switch(errcode) { case SLP_OK: printf ("Service Found = %s\n", srvurl); *(SLPError *) cookie = SLP_OK; break; case SLP_LAST_CALL: break; default: *(SLPError *) cookie = errcode; break; } /* End switch. */ return SLP_TRUE; } int main(int argc, char* argv[]) { SLPError err; SLPError callbackerr; SLPHandle hslp; char reg_string[4096]; if ((argc < 2) || (argc > 4)) { printf("SLPReg\n This test the SLP registration.\n Usage:\n SLPReg \n"); return(0); } err = SLPOpen("en",SLP_FALSE,&hslp); check_error_state(err, "Error opening slp handle"); sprintf(reg_string,"%s://%s",argv[1], argv[2]); /* Register a service with SLP */ printf("Registering = %s\n",reg_string); err = SLPReg( hslp, reg_string, SLP_LIFETIME_MAXIMUM, 0, "(public-key=......my_pgp_key.......)", SLP_TRUE, MySLPRegReport, &callbackerr ); check_error_state(err, "Error registering service with slp."); check_error_state(callbackerr, "Error registering service with slp."); printf("Querying = %s\n",argv[3]); /* Now make sure that the service is there. */ err = SLPFindSrvs ( hslp, argv[3], 0, /* use configured scopes */ 0, /* no attr filter */ MySLPSrvURLCallback, &callbackerr); /* err may contain an error code that occured as the slp library */ /* _prepared_ to make the call. */ check_error_state(err, "Error registering service with slp."); check_error_state(callbackerr, "Error registering service with slp."); /* Now that we're done using slp, close the slp handle */ SLPClose(hslp); return(0); } openslp-1.2.1/test/SLPReg/SLPReg.expected.output0000644033442200000310000000061107130443444021312 0ustar rganesanfloppyRegistering = service:valid://10.0.0.1 Querying = service:valid Service Found = service:valid://10.0.0.1 Registering = service:valid://10.0.0.1 Querying = service:invalid Error registering service with slp. -19: SLP_NETWORK_TIMED_OUT When no reply can be obtained in the time specified by the configured timeout interval for a unicast request, this error is returned. openslp-1.2.1/test/SLPReg/test.script0000755033442200000310000000124210207720774017350 0ustar rganesanfloppy#!/bin/sh echo "SLPReg" rm -f SLPReg.actual.output scriptdir=${srcdir}/SLPReg test -f ${srcdir}/slpd.pid && kill `cat ${srcdir}/slpd.pid` && rm ${srcdir}/slpd.pid ../slpd/slpd -p ${srcdir}/slpd.pid -l ${srcdir}/slpd.log RESULT=$? if test $RESULT != 0; then echo "Unable to start slpd (error = $RESULT), test failed." exit $RESULT fi ./testslpreg service:valid 10.0.0.1 service:valid >> SLPReg.actual.output echo >> SLPReg.actual.output ./testslpreg service:valid 10.0.0.1 service:invalid >> SLPReg.actual.output test -f ${srcdir}/slpd.pid && kill `cat ${srcdir}/slpd.pid` && rm ${srcdir}/slpd.pid diff -c ${scriptdir}/SLPReg.expected.output SLPReg.actual.output openslp-1.2.1/test/SLPReg/slp.test.reg0000644033442200000310000000130307113265250017404 0ustar rganesanfloppy############################################################################# # # OpenSLP registration file # # May be used to register services for legacy applications that do not use # the SLPAPIs to register for themselves # # Format and contents conform to specification in IETF RFC 2614 so the # comments use the language of the RFC. In OpenSLP, SLPD operates as an SA # and a DA. The SLP UA functionality is encapsulated by SLPLIB. # ############################################################################# #comment ;comment #service-url,language-tag,lifetime,[service-type] #["scopes="scope-list] #[attrid"="val1] #[attrid"="val1,val2,val3] # openslp-1.2.1/test/SLPUnescape/0000755033442200000310000000000010260165763016167 5ustar rganesanfloppyopenslp-1.2.1/test/SLPUnescape/SLPUnescape.c0000644033442200000310000000147310202047670020452 0ustar rganesanfloppy/****************************************************************************/ /* Test for SLPUnescape */ /* Creation Date: Mon Jun 5 13:51:26 EDT 2000 */ /****************************************************************************/ #include #include #include int main (int argc, char *argv[]) { SLPError err; char *output_string; if (argc != 2) { printf("SLPUnescape\n This program tests the un-parsing of a service url.\n Usage:\n SLPEscape \n"); return(1); } /* End If. */ err = SLPUnescape(argv[1], &output_string, SLP_TRUE); check_error_state(err, "Error parsing Service Tag"); printf("Input Tag = %s\n", argv[1]); printf("Output Tag = "); puts(output_string); return(0); } openslp-1.2.1/test/SLPUnescape/test.script0000755033442200000310000000105307534263614020402 0ustar rganesanfloppy#!/bin/sh echo "SLPUnescape" rm -f SLPUnescape.actual.output scriptdir=${srcdir}/SLPUnescape ./testslpunescape asdfasdf > SLPUnescape.actual.output echo >> SLPUnescape.actual.output ./testslpunescape \\28abc >> SLPUnescape.actual.output echo >> SLPUnescape.actual.output ./testslpunescape abc\\7E >> SLPUnescape.actual.output echo >> SLPUnescape.actual.output ./testslpunescape \\28\\29\\2C\\5C\\21\\3C\\3D\\3E\\7E >> SLPUnescape.actual.output echo >> SLPUnescape.actual.output diff -c ${scriptdir}/SLPUnescape.expected.output SLPUnescape.actual.output openslp-1.2.1/test/SLPUnescape/SLPUnescape.expected.output0000644033442200000310000000027007116777354023405 0ustar rganesanfloppyInput Tag = asdfasdf Output Tag = asdfasdf Input Tag = \28abc Output Tag = (abc Input Tag = abc\7E Output Tag = abc~ Input Tag = \28\29\2C\5C\21\3C\3D\3E\7E Output Tag = (),\!<=>~ openslp-1.2.1/test/SLPParseSrvURL/0000755033442200000310000000000010260165763016554 5ustar rganesanfloppyopenslp-1.2.1/test/SLPParseSrvURL/SLPParseSrvURL.expected.output0000644033442200000310000000067407113265250024347 0ustar rganesanfloppyService Type = service:test Host Identification = 10.0.0.1 Port Number = 0 Family = IP URL Remainder = Service Type = service:test1:test2 Host Identification = 10.0.0.1 Port Number = 80 Family = IP URL Remainder = Service Type = service:test Host Identification = 10.0.0.1 Port Number = 80 Family = IP URL Remainder = /foo/goo Service Type = service:test Host Identification = 10.0.0.1 Port Number = 0 Family = IP URL Remainder = /foo/goo openslp-1.2.1/test/SLPParseSrvURL/test.script0000755033442200000310000000071307534263613020770 0ustar rganesanfloppy#!/bin/sh echo "SLPParseSrvURL" rm -f SLPParseSrvURL.actual.output scriptdir=${srcdir}/SLPParseSrvURL ( ./testslpparsesrvurl service:test://10.0.0.1 echo ./testslpparsesrvurl service:test1:test2://10.0.0.1:80 echo ./testslpparsesrvurl service:test://10.0.0.1:80/foo/goo echo ./testslpparsesrvurl service:test://10.0.0.1/foo/goo ) > SLPParseSrvURL.actual.output diff -c ${scriptdir}/SLPParseSrvURL.expected.output SLPParseSrvURL.actual.output openslp-1.2.1/test/SLPParseSrvURL/slp.test.reg0000644033442200000310000000151107113265250021020 0ustar rganesanfloppy############################################################################# # # OpenSLP registration file # # May be used to register services for legacy applications that do not use # the SLPAPIs to register for themselves # # Format and contents conform to specification in IETF RFC 2614 so the # comments use the language of the RFC. In OpenSLP, SLPD operates as an SA # and a DA. The SLP UA functionality is encapsulated by SLPLIB. # ############################################################################# #comment ;comment #service-url,language-tag,lifetime,[service-type] #["scopes="scope-list] #[attrid"="val1] #[attrid"="val1,val2,val3] # ##This is the other testing service service:test://10.0.0.1,en,65535 foo=value1,value2 description=Test Service 1 goo=value3,value4 openslp-1.2.1/test/SLPParseSrvURL/SLPParseSrvURL.c0000644033442200000310000000204310202047670021416 0ustar rganesanfloppy/****************************************************************************/ /* Test for SLPOpen */ /* Creation Date: Wed May 24 14:26:50 EDT 2000 */ /****************************************************************************/ #include #include #include #include int main (int argc, char *argv[]) { SLPError err; SLPSrvURL *parsedurl; if (argc != 2) { printf("SLPParseSrvURL\n This program tests the parsing of a service url.\n Usage:\n SLPParseSrvURL \n"); return(1); } /* End If. */ err = SLPParseSrvURL(argv[1], &parsedurl); check_error_state(err, "Error parsing SrvURL"); printf("Service Type = %s\n", parsedurl->s_pcSrvType); printf("Host Identification = %s\n", parsedurl->s_pcHost); printf("Port Number = %d\n", parsedurl->s_iPort); printf("Family = %s\n", ((strlen(parsedurl->s_pcNetFamily)==0)?"IP":"Other")); printf("URL Remainder = %s\n", parsedurl->s_pcSrvPart); return(0); } openslp-1.2.1/test/SLPD_predicate_test/0000755033442200000310000000000010211377553017664 5ustar rganesanfloppyopenslp-1.2.1/test/SLPD_predicate_test/slpd_predicate_test.c0000644033442200000310000003214510202047670024050 0ustar rganesanfloppy#include #include #include #ifdef ENABLE_PREDICATES typedef void* SLPDPredicate; int SLPDPredicateTest(SLPDPredicate predicate, SLPAttributes attr); typedef enum { FR_UNSET /* Placeholder. Used to detect errors. */, FR_INTERNAL_SYSTEM_ERROR /* Internal error. */, FR_PARSE_ERROR /* Parse error detected. */, FR_MEMORY_ALLOC_FAILED /* Ran out of memory. */, FR_EVAL_TRUE /* Expression successfully evaluated to true. */, FR_EVAL_FALSE /* Expression successfully evaluated to false. */ } FilterResult; FilterResult wildcard(const char *pattern, int pattern_len, const char *str, int str_len); #define ez_WILDCARD(x,y) wildcard(x, (int) strlen(x), y, (int) strlen(y)) void test_wildcard() { #ifdef ENABLE_PREDICATES int err; err = ez_WILDCARD("slug", "slug"); assert(err == FR_EVAL_TRUE); err = ez_WILDCARD("slug*", "slug"); assert(err == FR_EVAL_TRUE); err = ez_WILDCARD("slug*", "slugx"); assert(err == FR_EVAL_TRUE); err = ez_WILDCARD("slug*", "slugxy"); assert(err == FR_EVAL_TRUE); err = ez_WILDCARD("slug*y", "slugxy"); assert(err == FR_EVAL_TRUE); err = ez_WILDCARD("slug*x", "slugxy"); assert(err == FR_EVAL_FALSE); err = ez_WILDCARD("s*y", "slugxy"); assert(err == FR_EVAL_TRUE); err = ez_WILDCARD("sl*xy", "slugxy"); assert(err == FR_EVAL_TRUE); err = ez_WILDCARD("ab*ab", "ababcdab"); assert(err == FR_EVAL_TRUE); err = ez_WILDCARD("ab*ab*", "ababcdab"); assert(err == FR_EVAL_TRUE); err = ez_WILDCARD("*", "ababcdab"); assert(err == FR_EVAL_TRUE); err = ez_WILDCARD("*cd", "ababcdab"); assert(err == FR_EVAL_FALSE); err = ez_WILDCARD("*cdab", "ababcdab"); assert(err == FR_EVAL_TRUE); err = ez_WILDCARD("*cd*", "ababcdab"); assert(err == FR_EVAL_TRUE); err = ez_WILDCARD("*c*d*", "ababcdab"); assert(err == FR_EVAL_TRUE); err = ez_WILDCARD("*****c****d****", "ababcdab"); assert(err == FR_EVAL_TRUE); /* Test escaping. */ err = ez_WILDCARD("ab\\2Acd", "ab*cd"); assert(err == FR_EVAL_TRUE); /* Test escaping. */ err = ez_WILDCARD("ab\\2A\\2A", "ab**"); assert(err == FR_EVAL_TRUE); /* Test escaping. */ err = ez_WILDCARD("ab\\2A\\2Aln*", "ab**lnas"); assert(err == FR_EVAL_TRUE); /* Test escaping. */ err = ez_WILDCARD("ab\\2A\\2Aln", "ab**lnas"); assert(err == FR_EVAL_FALSE); /* Test escaping. */ err = ez_WILDCARD("ab\\2A*\\2Aln", "ab*x*l*ln"); assert(err == FR_EVAL_TRUE); #else /* ENABLE_PREDICATES */ puts("Predicates disabled. Skipping."); #endif /* ENABLE_PREDICATES */ } void test_predicate() { char *str; int ierr; SLPAttributes slp_attr; SLPError err; /******************** Test int stuff. *********************/ err = SLPAttrAlloc("en", NULL, SLP_FALSE, &slp_attr); assert(err == SLP_OK); SLPAttrSet_int(slp_attr, "int", (int)23, SLP_ADD); SLPAttrSet_int(slp_attr, "int", (int)25, SLP_ADD); SLPAttrSet_int(slp_attr, "int", (int)27, SLP_ADD); /* Test equals. */ str = "(&(&(int=23)(int=25))(int=26))"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > 0); /* False. */ str = "(&(&(int=24)(int=25))(int=26))"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > 0); /* False. */ str = "(&(&(int=24)(int=28))(int=26))"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > 0); /* False. */ str = "(&(&(int=23)(int=25))(int=27))"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* True. */ /* Test greater. */ str = "(int>=29)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > 0); /* f. */ str = "(int>=26)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* T. */ str = "(int>=24)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t. */ str = "(int>=22)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t. */ /* Test lesser. */ str = "(int<=22)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > 0); /* f */ str = "(int<=23)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ SLPAttrFree(slp_attr); /* Simple equality. */ err = SLPAttrAllocStr("en", NULL, SLP_FALSE, &slp_attr, "(a=1)"); assert(err == SLP_OK); str = "(a=1)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ SLPAttrFree(slp_attr); /******************** Test opaque stuff. *********************/ err = SLPAttrAlloc("en", NULL, SLP_FALSE, &slp_attr); assert(err == SLP_OK); err = SLPAttrSet_str(slp_attr, "op", "\\00\\12\\24\\36", SLP_REPLACE); assert(err == SLP_OK); /* Test less (single-valued). */ str = "(op<=\\00\\12\\10\\43)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > 0); /* f */ str = "(op<=\\00\\12\\24\\36)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ str = "(op<=\\00\\12\\24\\36\\12)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ str = "(op>=\\00\\12\\24\\36)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ SLPAttrFree(slp_attr); /******************** Test string stuff. *********************/ err = SLPAttrAlloc("en", NULL, SLP_FALSE, &slp_attr); assert(err == SLP_OK); err = SLPAttrSet_str(slp_attr, "str", "string", SLP_REPLACE); assert(err == SLP_OK); /* Test less (single-valued). */ str = "(str<=a)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > 0); /* f */ str = "(str<=string)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ str = "(str<=strinx)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ /* Test greater (single-valued). */ str = "(str>=a)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ str = "(str>=string)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ str = "(str>=strinx)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > 0); /* f */ /* Test equal (single valued). */ str = "(str=a)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > 0); /* f */ str = "(str=*ing)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ str = "(str=stri*)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ str = "(str=*tri*)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ str = "(str=\\73*)"; /* s* */ ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ str = "(str=\\73\\74\\72\\69*)"; /* stri* */ ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ str = "(str=*\\73\\74\\72\\69*)"; /* *stri* */ ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ str = "(str=s*t*r*i*n*g)"; /* s*t*r*i* */ ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ str = "(str=s*t*r*i*ng)"; /* s*t*r*i* */ ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ str = "(str=\\73\\74\\72\\69ng)"; /* s*t*r*i* */ ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ str = "(str=s*tring)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ str = "(str=\\73*\\74ring)"; /* s*t*r*i* */ ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ /* TODO Test escaped '*'s. */ /* TODO Test multivalued. */ SLPAttrFree(slp_attr); /******************** Test boolean stuff. *********************/ err = SLPAttrAlloc("en", NULL, SLP_FALSE, &slp_attr); assert(err == SLP_OK); err = SLPAttrSet_bool(slp_attr, "bool", SLP_TRUE); assert(err == SLP_OK); /* Test equal. */ str = "(bool=true)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ str = "(bool=false)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > 0); /* f */ /* Test bad strings. */ str = "(bool=falsew)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > 0); /* f */ str = "(bool=*false)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > 0); /* f */ str = "(bool=truee)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > 0); /* f */ str = "(bool= true)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > 0); /* f */ SLPAttrFree(slp_attr); /******************** Test keyword stuff. *********************/ err = SLPAttrAlloc("en", NULL, SLP_FALSE, &slp_attr); assert(err == SLP_OK); err = SLPAttrSet_keyw(slp_attr, "keyw"); assert(err == SLP_OK); /* Test present. */ str = "(keyw=*)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ str = "(keyw=sd)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > 0); /* f */ str = "(keyw<=adf)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > 0); /* f */ SLPAttrFree(slp_attr); /********************* Test boolean operators. *********************/ err = SLPAttrAlloc("en", NULL, SLP_FALSE, &slp_attr); assert(err == SLP_OK); err = SLPAttrSet_keyw(slp_attr, "keyw"); assert(err == SLP_OK); str = "(keyw=*)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ /* Test not. */ str = "(!(keyw=*))"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > 0); /* f */ str = "(!(!(keyw=*)))"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ str = "(!(!(!(keyw=*))))"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > 0); /* f */ str = "(!(!(!(!(keyw=*)))))"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ /* Build up to testing binary ops. */ err = SLPAttrSet_bool(slp_attr, "bool", SLP_TRUE); assert(err == SLP_OK); /* Test and. */ str = "(&(keyw=*)(bool=true))"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ str = "(&(keyw=*)(bool=false))"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > 0); /* f */ str = "(&(keyw=*)(!(bool=false)))"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ str = "(&(keywx=*)(bool=true))"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > 0); /* f */ str = "(&(!(keywx=*))(bool=true))"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ str = "(&(lkeyw=*)(bool=false))"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > 0); /* f */ str = "(&(!(lkeyw=*))(!(bool=false)))"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ str = "(&(&(keyw=*)(bool=true))(&(keyw=*)(bool=true)))"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ str = "(&(&(!(keyw=*))(bool=true))(&(keyw=*)(bool=true)))"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > 0); /* f */ str = "(!(&(&(!(keyw=*))(bool=true))(&(keyw=*)(bool=true))))"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr == 0); /* t */ /* Test sytax errors. */ /* No preceeding bracket. */ str = "asdf=log"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr < 0); /* No trailing bracket. */ str = "(asdf=log"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr < 0); /* Unbalanced brackets. */ str = "(asdf=log))"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr < 0); str = "((asdf=log)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr < 0); /* Missing operators. */ str = "(asdflog)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr < 0); /* Check that the leaf operator isn't causing the problem. */ str = "(asdflog=q)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > 0); /* Missing logical unary. */ str = "((asdflog=q))"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr < 0); /* Missing logical binary. */ str = "((asdflog=q)(asdflog=q))"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr < 0); /* Missing operands and operator. */ str = "()"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr < 0); /* Missing unary operands. */ str = "(!)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr < 0); /* Missing binary operands. */ str = "(&)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr < 0); /* Missing binary operands. */ str = "(=)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr < 0); /* Missing binary operands. I _guess_ this is legal... */ str = "(thingy=)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > -1); /* Trailing trash. */ str = "(&(a=b)(c=d))"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > -1); /* Check that the following test will not be short circuited. */ str = "(a=b)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr > 0); /* f */ str = "(|(a=b)(c=d)w)"; ierr = SLPDPredicateTest( str, slp_attr); assert(ierr < 0); SLPAttrFree(slp_attr); /* Check multiple (more than two) subexpressions. */ err = SLPAttrAlloc("en", NULL, SLP_FALSE, &slp_attr); assert(err == SLP_OK); err = SLPAttrSet_int(slp_attr, "x", 1, SLP_ADD); assert(err == SLP_OK); str = "(&(x=1)(!(x=1)))"; ierr = SLPDPredicateTest((SLPDPredicate)str, slp_attr); assert(ierr > 0); /* f */ str = "(&(x=1))"; ierr = SLPDPredicateTest((SLPDPredicate)str, slp_attr); assert(ierr == 0); /* t */ str = "(&(x=1)(x=1)(x=1))"; ierr = SLPDPredicateTest((SLPDPredicate)str, slp_attr); assert(ierr == 0); /* t */ SLPAttrFree(slp_attr); } int main(int argc, char *argv[]) { test_predicate(); test_wildcard(); return 0; } #else /* ENABLE_PREDICATES */ int main(int argc, char *argv[]) { puts("Predicates disabled. Not testing."); return 0; } #endif /* ENABLE_PREDICATES */ openslp-1.2.1/test/SLPDereg/0000755033442200000310000000000010260165763015452 5ustar rganesanfloppyopenslp-1.2.1/test/SLPDereg/SLPDereg.expected.output0000644033442200000310000000140007113265122022125 0ustar rganesanfloppyRegistering = service:registered://10.0.0.1 Srv. Registered = service:registered://10.0.0.1 Querying = service:registered Service Found = service:registered://10.0.0.1 Deregistering = service:registered://10.0.0.1 Deregistered = service:registered://10.0.0.1 Registering = service:registered://10.0.0.1 Srv. Registered = service:registered://10.0.0.1 Querying = service:unregistered Error registering service with slp. -19: SLP_NETWORK_TIMED_OUT When no reply can be obtained in the time specified by the configured timeout interval for a unicast request, this error is returned. Querying = service:test Service Found = service:test://10.0.0.1 Deregistering = service:test://10.0.0.1 Deregistered = service:test://10.0.0.1 openslp-1.2.1/test/SLPDereg/slp.test.conf0000644033442200000310000001264207113265122020073 0ustar rganesanfloppy############################################################################# # # OpenSLP configuration file # # Format and contents conform to specification in IETF RFC 2614 so the # comments use the language of the RFC. In OpenSLP, SLPD operates as an SA # and a DA. The SLP UA functionality is encapsulated by SLPLIB. # ############################################################################# #---------------------------------------------------------------------------- # Static Scope Configuration #---------------------------------------------------------------------------- # This option is a comma delimited list of strings indicating the only scopes # a UA or SA is allowed when making requests or registering or the scopes a # DA must support. (default value is "DEFAULT") ;net.slp.useScopes = # Allows administrator to force UA and SA agents to use specific DAs. If # this setting is not used dynamic DA discovery will be used to determine # which DAs to use. (Default is to use dynamic DA discovery) ;net.slp.DAAddresses = myDa1,myDa2,myDa3 #---------------------------------------------------------------------------- # Network Configuration Properties #---------------------------------------------------------------------------- # Force broadcasts to be used instead of multicast. This setting is seldom # necessary since OpenSLP will automatically use broadcast if multicast # is unavailable. (Default is false) ;net.slp.isBroadcastOnly = true # A boolean indicating whether passive DA detection should be use. # (Default is true) ;net.slp.passiveDADetection = true # A boolean indicating whether active DA dection should be used. Note that if # both passive and active DA detection are disabled, DAs will not be used # unless they are statically configured using the net.slp.DAAddresses property # (Default is true) ;net.slp.activeDADetection = true # A positive integer that is less than or equal to 255. (The default is 255) ;net.slp.multicastTTL = 255 # OpenSLP does not honor this parameter unless it is set to zero. When set # to zero active discovery is turned off. See (net.slp.activeDADetection) ;net.slp.DAActiveDiscoveryInterval = 0 # An integer giving the maximum amount of time (in milliseconds) to perform # multicast requests. (Default is 15000 ms or 15 secs). ;net.slp.multicastMaximumWait = 15000 # OpenSLP does not honor this parameter. Multicast timeouts are generated # internally based on the .net.slp.multicastMaximumWait parameter. ;net.slp.multicastTimeouts = IGNORED # OpenSLP does not honor this parameter. Multicast timeouts are generated # internally based on the .net.slp.multicastMaximumWait parameter. ;net.slp.DADiscoveryTimeouts = IGNORED # An integer giving the maximum amount of time (in milliseconds) to perform # unicast requests. (Default is 15000 ms or 15 secs). ;net.slp.unicastMaximumWait = 15000 # OpenSLP does not honor this parameter. Unicast timeouts are generated # internal based on the net.slp.unicastMaximumWait parameter ;net.slp.datagramTimeouts = IGNORED # An integer giving the maximum value for all random wait parameters. # (Default is 1000 or 1 sec) ;net.slp.randomWaitBound = 1000 # A integer giving the network packet MTU in bytes. (Default is 1400) ;net.slp.MTU = 1400 # A list of IP address of network interfaces on which the DA/SA should listen # for slp requests. By default, slpd will use all interfaces. ;net.slp.interfaces = 1.2.3.4,1.2.3.5,1.2.3.6 #---------------------------------------------------------------------------- # Security #---------------------------------------------------------------------------- # Indicates whether all agents should use authentication blocks ;net.slp.securityEnabled = true #---------------------------------------------------------------------------- # DA Specific Configuration #---------------------------------------------------------------------------- # Not yet supported by OpenSLP #---------------------------------------------------------------------------- # SA Specific Configuration #---------------------------------------------------------------------------- # Not yet supported by OpenSLP #---------------------------------------------------------------------------- # SA Specific Configuration #---------------------------------------------------------------------------- # Not yet supported by OpenSLP #---------------------------------------------------------------------------- # Tracing and Logging #---------------------------------------------------------------------------- # A boolean controlling printing of messages about traffic with DAs. # Default is false. net.slp.traceDATraffic = true # A boolean controlling printing of details on SLP messages. The fields in # all incoming messages and outgoing replies are printed. Default is false. net.slp.traceMsg = true # A boolean controlling printing details when a SLP message is dropped for # any reason. Default is false. net.slp.traceDrop = true # A boolean controlling dumps of all registered services upon registration # and deregistration. If true, the contents of the DA or SA server are # dumped after a registration or deregistration occurs. Default is false. net.slp.traceReg = true #---------------------------------------------------------------------------- # Serialized Proxy Registration #---------------------------------------------------------------------------- # slpd accepts the [-r] command line parameter that specifies the # serialized registration file. openslp-1.2.1/test/SLPDereg/SLPDereg.c0000644033442200000310000000576110202047670017224 0ustar rganesanfloppy/****************************************************************************/ /* Test for SLPDereg */ /* Creation Date: Wed May 24 14:26:50 EDT 2000 */ /****************************************************************************/ #include #include #include void MySLPRegReport(SLPHandle hslp, SLPError errcode, void* cookie) { /* return the error code in the cookie */ *(SLPError*)cookie = errcode; } SLPBoolean MySLPSrvURLCallback (SLPHandle hslp, const char *srvurl, unsigned short lifetime, SLPError errcode, void *cookie) { switch(errcode) { case SLP_OK: printf ("Service Found = %s\n", srvurl); *(SLPError *) cookie = SLP_OK; break; case SLP_LAST_CALL: break; default: *(SLPError *) cookie = errcode; break; } /* End switch. */ /* return SLP_TRUE because we want to be called again */ /* if more services were found */ return SLP_TRUE; } int main(int argc, char* argv[]) { /* * This test works by: * 1. Register a service. * 2. Query the service to make sure it is there. * 3. Remove the service. * 4. Query the service to ensure it is not there. */ SLPError err; SLPError callbackerr; SLPHandle hslp; char reg_string[4096]; char dereg_string[4096]; if ((argc != 3) && (argc != 5)) { printf("SLPDereg\n This test the SLP de-registration.\n Usage:\n SLPDereg\n \n \n \n \n SLPDereg\n \n"); return (0); } /* End If. */ err = SLPOpen("en",SLP_FALSE,&hslp); check_error_state(err, "Error opening slp handle."); /* Register a service with SLP */ if (argc == 5) { sprintf(reg_string,"%s://%s",argv[1], argv[2]); printf("Registering = %s\n",reg_string); err = SLPReg( hslp, reg_string, SLP_LIFETIME_MAXIMUM, "", "", SLP_TRUE, MySLPRegReport, &callbackerr ); check_error_state(err, "Error registering service with slp"); printf("Srv. Registered = %s\n",reg_string); } /* End If. */ /* Now make sure that the service is there. */ printf("Querying = %s\n",(argc == 5)?argv[3]:argv[1]); err = SLPFindSrvs ( hslp, (argc==5)?argv[3]:argv[1], "", /* use configured scopes */ "", /* no attr filter */ MySLPSrvURLCallback, &callbackerr); check_error_state(err, "Error registering service with slp."); /* Deregister the service. */ if (argc == 5) sprintf(dereg_string,"%s://%s",argv[3], argv[4]); else sprintf(dereg_string,"%s://%s",argv[1], argv[2]); printf("Deregistering = %s\n",dereg_string); err = SLPDereg( hslp, dereg_string, MySLPRegReport, &callbackerr); check_error_state(err, "Error deregistering service with slp."); printf("Deregistered = %s\n",dereg_string); /* Now that we're done using slp, close the slp handle */ SLPClose(hslp); return(0); } openslp-1.2.1/test/SLPDereg/test.script0000755033442200000310000000152710207721761017664 0ustar rganesanfloppy#!/bin/sh echo "SLPDereg" rm -f SLPDereg.actual.output scriptdir=${srcdir}/SLPDereg test -f ${srcdir}/slpd.pid && kill `cat ${srcdir}/slpd.pid` && rm ${srcdir}/slpd.pid ../slpd/slpd -r ${scriptdir}/slp.test.reg -p ${srcdir}/slpd.pid -l ${srcdir}/slpd.log RESULT=$? if test $RESULT != 0; then echo "Unable to start slpd (error = $RESULT), test failed." exit $RESULT fi ./testslpdereg service:registered 10.0.0.1 service:registered 10.0.0.1 >> SLPDereg.actual.output echo >> SLPDereg.actual.output ./testslpdereg service:registered 10.0.0.1 service:unregistered 10.0.0.1 >> SLPDereg.actual.output echo >> SLPDereg.actual.output ./testslpdereg service:test 10.0.0.1 >> SLPDereg.actual.output test -f ${srcdir}/slpd.pid && kill `cat ${srcdir}/slpd.pid` && rm ${srcdir}/slpd.pid diff -c ${scriptdir}/SLPDereg.expected.output SLPDereg.actual.output openslp-1.2.1/test/SLPDereg/slp.test.reg0000644033442200000310000000144007113265122017715 0ustar rganesanfloppy############################################################################# # # OpenSLP registration file # # May be used to register services for legacy applications that do not use # the SLPAPIs to register for themselves # # Format and contents conform to specification in IETF RFC 2614 so the # comments use the language of the RFC. In OpenSLP, SLPD operates as an SA # and a DA. The SLP UA functionality is encapsulated by SLPLIB. # ############################################################################# #comment ;comment #service-url,language-tag,lifetime,[service-type] #["scopes="scope-list] #[attrid"="val1] #[attrid"="val1,val2,val3] # ##This is a testing service service:test://10.0.0.1,en,65535 description=Testing Serivce 1 openslp-1.2.1/test/slp_debug.h0000644033442200000310000001646610202047707016170 0ustar rganesanfloppy/****************************************************************************/ /* slp_debug */ /* Creation Date: Wed May 24 14:26:50 EDT 2000 */ /****************************************************************************/ #include #include #define MAX_STRING_LENGTH 4096 typedef struct { SLPError error_number; char *label; char *description; } SLPErrorEntry; SLPErrorEntry error_entries[] = { {SLP_LAST_CALL, "SLP_LAST_CALL", "Passed to callback functions when the API library has no more data for them and therefore no further calls will be made to the callback on the currently outstanding operation. The callback can use this to signal the main body of the client code that no more data will be forthcoming on the operation, so that the main body of the client code can break out of data collection loops. On the last call of a callback during both a synchronous and synchronous call, the error code parameter has value SLP_LAST_CALL, and the other parameters are all NULL. If no results are returned by an API operation, then only one call is made , with the error parameter set to SLP_LAST_CALL."}, {SLP_OK, "SLP_OK", "No DA or SA has service advertisement or attribute information in the language requested, but at least one DA or SA indicated, via the LANGUAGE_NOT_SUPPORTED error code, that it might have information for that service in another language"}, //SLP_LANGUAGE_NOT_SUPPORTED, {-1, "SLP_LANGUAGE_NOT_SUPPORTED", "The SLP message was rejected by a remote SLP agent. The API returns this error only when no information was retrieved, and at least one SA or DA indicated a protocol error. The data supplied through the API may be malformed or a may have been damaged in transit."}, {SLP_INVALID_REGISTRATION, "SLP_INVALID_REGISTRATION", "The API may return this error if an attempt to register a service was rejected by all DAs because of a malformed URL or attributes. SLP does not return the error if at least one DA accepted the registration."}, {SLP_AUTHENTICATION_ABSENT, "SLP_AUTHENTICATION_ABSENT", "The API returns this error if the SA has been configured with net.slp.useScopes value-list of scopes and the SA request did not specify one or more of these allowable scopes, and no others. It may be returned by a DA or SA if the scope included in a request is not supported by the DA or SA."}, {SLP_INVALID_UPDATE, "SLP_INVALID_UPDATE", "if the SLP framework supports authentication, this error arises when the UA or SA failed to send an authenticator for requests or registrations in a protected scope."}, {SLP_AUTHENTICATION_FAILED, "SLP_AUTHENTICATION_FAILED", "If the SLP framework supports authentication, this error arises when a authentication on an SLP message failed"}, {SLP_INVALID_UPDATE, "SLP_INVALID_UPDATE", "An update for a non-existing registration was issued, or the update includes a service type or scope different than that in the initial registration, etc."}, {SLP_REFRESH_REJECTED, "SLP_REFRESH_REJECTED", "The SA attempted to refresh a registration more frequently than the minimum refresh interval. The SA should call the appropriate API function to obtain the minimum refresh interval to use."}, {SLP_NOT_IMPLEMENTED, "SLP_NOT_IMPLEMENTED", "If an unimplemented feature is used, this error is returned."}, {SLP_BUFFER_OVERFLOW, "SLP_BUFFER_OVERFLOW", "An outgoing request overflowed the maximum network MTU size. The request should be reduced in size or broken into pieces and tried again."}, {SLP_NETWORK_TIMED_OUT, "SLP_NETWORK_TIMED_OUT", "When no reply can be obtained in the time specified by the configured timeout interval for a unicast request, this error is returned."}, {SLP_NETWORK_INIT_FAILED, "SLP_NETWORK_INIT_FAILED", "If the network cannot initialize properly, this error is returned. Will also be returned if an SA or DA agent (slpd) can not be contacted. See SLPReg() and SLPDeReg() for more information."}, {SLP_MEMORY_ALLOC_FAILED, "SLP_MEMORY_ALLOC_FAILED", "Out of memory error"}, {SLP_PARAMETER_BAD, "SLP_PARAMETER_BAD", "If a parameter passed into a function is bad, this error is returned."}, {SLP_NETWORK_ERROR, "SLP_NETWORK_ERROR ", "The failure of networking during normal operations causes this error to be returned."}, {SLP_INTERNAL_SYSTEM_ERROR, "SLP_INTERNAL_SYSTEM_ERROR", "A basic failure of the API causes this error to be returned. This occurs when a system call or library fails. The operation could not recover."}, {SLP_HANDLE_IN_USE, "SLP_HANDLE_IN_USE", "In the C API, callback functions are not permitted to recursively call into the API on the same SLPHandle, either directly or indirectly. If an attempt is made to do so, this error is returned from the called API function."}, {SLP_TYPE_ERROR, "SLP_TYPE_ERROR", "If the API supports type checking of registrations against service type templates, this error can arise if the attributes in a registration do not match the service type template for the service."}, }; /* These strings are returned if the error code is not found. */ #define UNKNOWN_ERROR_LABEL "Unknown" #define UNKNOWN_ERROR_DESCRIPTION "Undefined error code." /*=========================================================================*/ void get_full_error_data(int error_number, char **error_name, char **error_description) /* Returns data in the parameter variables about the error code */ /* */ /* errorNumber - Error code received. */ /* */ /* errorName - Name of the error code. */ /* */ /* errorDescription - A long winded description about the error. */ /* */ /* Returns - Nothing. */ /* */ /* Comment - This returns (char *) (const) pointers to the strings */ /* which means that deletion of the strings is un-neces- */ /* ary. */ /*=========================================================================*/ { int i; int num_entires; /* Determine the number of entries in the error code array. */ num_entires = sizeof(error_entries) / sizeof(SLPErrorEntry); for (i = 0; i < num_entires; i++) { if (error_entries[i].error_number == error_number) { *error_name = (error_entries[i].label); *error_description = (error_entries[i].description); return; } /* End If. */ } /* End For. */ *error_name = UNKNOWN_ERROR_LABEL; *error_description = UNKNOWN_ERROR_DESCRIPTION; } /* End getFullErrorData(int, char *, char *). */ void check_error_state(int err, char *location_text) { char *error_name; char *error_description; if (err != SLP_OK) { get_full_error_data(err, &error_name, &error_description); printf ("%s\n%d: %s\n%s\n", location_text, err, error_name, error_description); exit(err); } /* End If. */ } openslp-1.2.1/test/SLPFindSrvTypes/0000755033442200000310000000000010260165763017024 5ustar rganesanfloppyopenslp-1.2.1/test/SLPFindSrvTypes/test.script0000755033442200000310000000163710207722247021240 0ustar rganesanfloppy#!/bin/sh echo "SLPFindSrvTypes" rm -f SLPFindSrvTypes.actual.output scriptdir=${srcdir}/SLPFindSrvTypes test -f ${srcdir}/slpd.pid && kill `cat ${srcdir}/slpd.pid` && rm ${srcdir}/slpd.pid ../slpd/slpd -r ${scriptdir}/slp.test.reg -p ${srcdir}/slpd.pid -l ${srcdir}/slpd.log RESULT=$? if test $RESULT != 0; then echo "Unable to start slpd (error = $RESULT), test failed." exit $RESULT fi ./testslpfindsrvtypes "*" >> SLPFindSrvTypes.actual.output echo >> SLPFindSrvTypes.actual.output ./testslpfindsrvtypes "" >> SLPFindSrvTypes.actual.output echo >> SLPFindSrvTypes.actual.output ./testslpfindsrvtypes "JUNK" >> SLPFindSrvTypes.actual.output echo >> SLPFindSrvTypes.actual.output ./testslpfindsrvtypes "OPENSLP" >> SLPFindSrvTypes.actual.output test -f ${srcdir}/slpd.pid && kill `cat ${srcdir}/slpd.pid` && rm ${srcdir}/slpd.pid diff -c ${scriptdir}/SLPFindSrvTypes.expected.output SLPFindSrvTypes.actual.output openslp-1.2.1/test/SLPFindSrvTypes/slp.test.reg0000644033442200000310000000205207155111341021266 0ustar rganesanfloppy############################################################################# # # OpenSLP registration file # # May be used to register services for legacy applications that do not use # the SLPAPIs to register for themselves # # Format and contents conform to specification in IETF RFC 2614 so the # comments use the language of the RFC. In OpenSLP, SLPD operates as an SA # and a DA. The SLP UA functionality is encapsulated by SLPLIB. # ############################################################################# #comment ;comment #service-url,language-tag,lifetime,[service-type] #["scopes="scope-list] #[attrid"="val1] #[attrid"="val1,val2,val3] # ##This is a testing service service:test1://10.0.0.2,en,65535 description=Testing Service 1 ##This is the other testing service service:test2://10.0.0.1,en,65535 description=Testing Service 2 ##This is the testing service using another naming authority service:test.OPENSLP://10.0.0.1,en,65535 description=Testing Service with OPENSLP naming authority openslp-1.2.1/test/SLPFindSrvTypes/SLPFindSrvTypes.c0000644033442200000310000000311310202047670022135 0ustar rganesanfloppy/****************************************************************************/ /* Test for SLPFindSrvTypes */ /* Creation Date: Sun Aug 20 21:06:18 IST 2000 */ /****************************************************************************/ #include #include #include SLPBoolean MySLPSrvTypeCallback (SLPHandle hslp, const char *pcSrvTypes, SLPError errcode, void *cookie) { switch(errcode) { case SLP_OK: printf ("Service Types = %s\n", pcSrvTypes); *(SLPError *) cookie = SLP_OK; break; case SLP_LAST_CALL: break; default: *(SLPError *) cookie = errcode; break; } /* End switch. */ return SLP_TRUE; } int main (int argc, char *argv[]) { SLPError err; SLPError callbackerr; SLPHandle hslp; if (argc != 2) { printf("SLPFindSrvTypes\n Finds a SLP service.\n Usage:\n SLPFindSrvTypes\n \n"); return (0); } /* End If. */ err = SLPOpen ("en", SLP_FALSE, &hslp); check_error_state(err,"Error opening slp handle."); err = SLPFindSrvTypes ( hslp, argv[1], /* naming authority */ 0, /* use configured scopes */ MySLPSrvTypeCallback, &callbackerr); check_error_state(err, "Error getting service type with slp."); /* Now that we're done using slp, close the slp handle */ SLPClose (hslp); return(0); } openslp-1.2.1/test/SLPFindSrvTypes/SLPFindSrvTypes.expected.output0000644033442200000310000000054707155111341025063 0ustar rganesanfloppyService Types = service:test.OPENSLP,service:test2,service:test1 Service Types = service:test2,service:test1 Error getting service type with slp. -19: SLP_NETWORK_TIMED_OUT When no reply can be obtained in the time specified by the configured timeout interval for a unicast request, this error is returned. Service Types = service:test.OPENSLP openslp-1.2.1/test/Makefile.in0000644033442200000310000016632210211377472016122 0ustar rganesanfloppy# Makefile.in generated by automake 1.8.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(testslp_attr_test_SOURCES) $(testslpd_predicate_test_SOURCES) $(testslpdereg_SOURCES) $(testslpescape_SOURCES) $(testslpfindattrs_SOURCES) $(testslpfindsrvs_SOURCES) $(testslpfindsrvtypes_SOURCES) $(testslpopen_SOURCES) $(testslpparsesrvurl_SOURCES) $(testslpreg_SOURCES) $(testslpunescape_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_triplet = @host@ noinst_PROGRAMS = testslpdereg$(EXEEXT) testslpescape$(EXEEXT) \ testslpfindattrs$(EXEEXT) testslpfindsrvtypes$(EXEEXT) \ testslpfindsrvs$(EXEEXT) testslpopen$(EXEEXT) \ testslpparsesrvurl$(EXEEXT) testslpreg$(EXEEXT) \ testslpunescape$(EXEEXT) testslp_attr_test$(EXEEXT) \ testslpd_predicate_test$(EXEEXT) subdir = test DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(mkdir_p) CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = PROGRAMS = $(noinst_PROGRAMS) am_testslp_attr_test_OBJECTS = slp_attr_test.$(OBJEXT) testslp_attr_test_OBJECTS = $(am_testslp_attr_test_OBJECTS) testslp_attr_test_LDADD = $(LDADD) testslp_attr_test_DEPENDENCIES = ../libslp/libslp.la \ ../libslpattr/libslpattr.la ../common/libcommonlibslp.la \ ../common/libcommonslpd.la am_testslpd_predicate_test_OBJECTS = slpd_predicate_test.$(OBJEXT) testslpd_predicate_test_OBJECTS = \ $(am_testslpd_predicate_test_OBJECTS) am__DEPENDENCIES_1 = ../libslp/libslp.la ../libslpattr/libslpattr.la \ ../common/libcommonlibslp.la ../common/libcommonslpd.la @ENABLE_PREDICATES_TRUE@testslpd_predicate_test_DEPENDENCIES = \ @ENABLE_PREDICATES_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_PREDICATES_TRUE@ ../slpd/slpd_predicate.o \ @ENABLE_PREDICATES_TRUE@ ../common/libcommonslpd.la am_testslpdereg_OBJECTS = SLPDereg.$(OBJEXT) testslpdereg_OBJECTS = $(am_testslpdereg_OBJECTS) testslpdereg_LDADD = $(LDADD) testslpdereg_DEPENDENCIES = ../libslp/libslp.la \ ../libslpattr/libslpattr.la ../common/libcommonlibslp.la \ ../common/libcommonslpd.la am_testslpescape_OBJECTS = SLPEscape.$(OBJEXT) testslpescape_OBJECTS = $(am_testslpescape_OBJECTS) testslpescape_LDADD = $(LDADD) testslpescape_DEPENDENCIES = ../libslp/libslp.la \ ../libslpattr/libslpattr.la ../common/libcommonlibslp.la \ ../common/libcommonslpd.la am_testslpfindattrs_OBJECTS = SLPFindAttrs.$(OBJEXT) testslpfindattrs_OBJECTS = $(am_testslpfindattrs_OBJECTS) testslpfindattrs_LDADD = $(LDADD) testslpfindattrs_DEPENDENCIES = ../libslp/libslp.la \ ../libslpattr/libslpattr.la ../common/libcommonlibslp.la \ ../common/libcommonslpd.la am_testslpfindsrvs_OBJECTS = SLPFindSrvs.$(OBJEXT) testslpfindsrvs_OBJECTS = $(am_testslpfindsrvs_OBJECTS) testslpfindsrvs_LDADD = $(LDADD) testslpfindsrvs_DEPENDENCIES = ../libslp/libslp.la \ ../libslpattr/libslpattr.la ../common/libcommonlibslp.la \ ../common/libcommonslpd.la am_testslpfindsrvtypes_OBJECTS = SLPFindSrvTypes.$(OBJEXT) testslpfindsrvtypes_OBJECTS = $(am_testslpfindsrvtypes_OBJECTS) testslpfindsrvtypes_LDADD = $(LDADD) testslpfindsrvtypes_DEPENDENCIES = ../libslp/libslp.la \ ../libslpattr/libslpattr.la ../common/libcommonlibslp.la \ ../common/libcommonslpd.la am_testslpopen_OBJECTS = SLPOpen.$(OBJEXT) testslpopen_OBJECTS = $(am_testslpopen_OBJECTS) testslpopen_LDADD = $(LDADD) testslpopen_DEPENDENCIES = ../libslp/libslp.la \ ../libslpattr/libslpattr.la ../common/libcommonlibslp.la \ ../common/libcommonslpd.la am_testslpparsesrvurl_OBJECTS = SLPParseSrvURL.$(OBJEXT) testslpparsesrvurl_OBJECTS = $(am_testslpparsesrvurl_OBJECTS) testslpparsesrvurl_LDADD = $(LDADD) testslpparsesrvurl_DEPENDENCIES = ../libslp/libslp.la \ ../libslpattr/libslpattr.la ../common/libcommonlibslp.la \ ../common/libcommonslpd.la am_testslpreg_OBJECTS = SLPReg.$(OBJEXT) testslpreg_OBJECTS = $(am_testslpreg_OBJECTS) testslpreg_LDADD = $(LDADD) testslpreg_DEPENDENCIES = ../libslp/libslp.la \ ../libslpattr/libslpattr.la ../common/libcommonlibslp.la \ ../common/libcommonslpd.la am_testslpunescape_OBJECTS = SLPUnescape.$(OBJEXT) testslpunescape_OBJECTS = $(am_testslpunescape_OBJECTS) testslpunescape_LDADD = $(LDADD) testslpunescape_DEPENDENCIES = ../libslp/libslp.la \ ../libslpattr/libslpattr.la ../common/libcommonlibslp.la \ ../common/libcommonslpd.la DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/SLPDereg.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/SLPEscape.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/SLPFindAttrs.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/SLPFindSrvTypes.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/SLPFindSrvs.Po ./$(DEPDIR)/SLPOpen.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/SLPParseSrvURL.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/SLPReg.Po ./$(DEPDIR)/SLPUnescape.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/slp_attr_test.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/slpd_predicate_test.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(testslp_attr_test_SOURCES) \ $(testslpd_predicate_test_SOURCES) $(testslpdereg_SOURCES) \ $(testslpescape_SOURCES) $(testslpfindattrs_SOURCES) \ $(testslpfindsrvs_SOURCES) $(testslpfindsrvtypes_SOURCES) \ $(testslpopen_SOURCES) $(testslpparsesrvurl_SOURCES) \ $(testslpreg_SOURCES) $(testslpunescape_SOURCES) DIST_SOURCES = $(testslp_attr_test_SOURCES) \ $(testslpd_predicate_test_SOURCES) $(testslpdereg_SOURCES) \ $(testslpescape_SOURCES) $(testslpfindattrs_SOURCES) \ $(testslpfindsrvs_SOURCES) $(testslpfindsrvtypes_SOURCES) \ $(testslpopen_SOURCES) $(testslpparsesrvurl_SOURCES) \ $(testslpreg_SOURCES) $(testslpunescape_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_ASYNC_API_FALSE = @ENABLE_ASYNC_API_FALSE@ ENABLE_ASYNC_API_TRUE = @ENABLE_ASYNC_API_TRUE@ ENABLE_PREDICATES_FALSE = @ENABLE_PREDICATES_FALSE@ ENABLE_PREDICATES_TRUE = @ENABLE_PREDICATES_TRUE@ ENABLE_SLPv1_FALSE = @ENABLE_SLPv1_FALSE@ ENABLE_SLPv1_TRUE = @ENABLE_SLPv1_TRUE@ ENABLE_SLPv2_SECURITY_FALSE = @ENABLE_SLPv2_SECURITY_FALSE@ ENABLE_SLPv2_SECURITY_TRUE = @ENABLE_SLPv2_SECURITY_TRUE@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ EXTRA_DIST = slp_debug.h TESTS = SLPOpen/test.script SLPFindSrvTypes/test.script \ SLPFindSrvs/test.script SLPReg/test.script \ SLPDereg/test.script SLPFindAttrs/test.script \ SLPParseSrvURL/test.script SLPEscape/test.script \ SLPUnescape/test.script XFAIL_TESTS = SLPFindAttrs/test.script INCLUDES = -I$(top_srcdir)/libslp -I$(top_srcdir)/libslpattr \ -I$(top_srcdir)/common -I$(top_srcdir)/slpd LDADD = ../libslp/libslp.la ../libslpattr/libslpattr.la ../common/libcommonlibslp.la ../common/libcommonslpd.la @ENABLE_PREDICATES_TRUE@testslpd_predicate_test_LDADD = $(LDADD) ../slpd/slpd_predicate.o ../common/libcommonslpd.la testslpdereg_SOURCES = SLPDereg/SLPDereg.c testslpescape_SOURCES = SLPEscape/SLPEscape.c testslpfindattrs_SOURCES = SLPFindAttrs/SLPFindAttrs.c testslpfindsrvs_SOURCES = SLPFindSrvs/SLPFindSrvs.c testslpfindsrvtypes_SOURCES = SLPFindSrvTypes/SLPFindSrvTypes.c testslpopen_SOURCES = SLPOpen/SLPOpen.c testslpparsesrvurl_SOURCES = SLPParseSrvURL/SLPParseSrvURL.c testslpreg_SOURCES = SLPReg/SLPReg.c testslpunescape_SOURCES = SLPUnescape/SLPUnescape.c testslp_attr_test_SOURCES = SLP_attr_test/slp_attr_test.c testslpd_predicate_test_SOURCES = SLPD_predicate_test/slpd_predicate_test.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu test/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done testslp_attr_test$(EXEEXT): $(testslp_attr_test_OBJECTS) $(testslp_attr_test_DEPENDENCIES) @rm -f testslp_attr_test$(EXEEXT) $(LINK) $(testslp_attr_test_LDFLAGS) $(testslp_attr_test_OBJECTS) $(testslp_attr_test_LDADD) $(LIBS) testslpd_predicate_test$(EXEEXT): $(testslpd_predicate_test_OBJECTS) $(testslpd_predicate_test_DEPENDENCIES) @rm -f testslpd_predicate_test$(EXEEXT) $(LINK) $(testslpd_predicate_test_LDFLAGS) $(testslpd_predicate_test_OBJECTS) $(testslpd_predicate_test_LDADD) $(LIBS) testslpdereg$(EXEEXT): $(testslpdereg_OBJECTS) $(testslpdereg_DEPENDENCIES) @rm -f testslpdereg$(EXEEXT) $(LINK) $(testslpdereg_LDFLAGS) $(testslpdereg_OBJECTS) $(testslpdereg_LDADD) $(LIBS) testslpescape$(EXEEXT): $(testslpescape_OBJECTS) $(testslpescape_DEPENDENCIES) @rm -f testslpescape$(EXEEXT) $(LINK) $(testslpescape_LDFLAGS) $(testslpescape_OBJECTS) $(testslpescape_LDADD) $(LIBS) testslpfindattrs$(EXEEXT): $(testslpfindattrs_OBJECTS) $(testslpfindattrs_DEPENDENCIES) @rm -f testslpfindattrs$(EXEEXT) $(LINK) $(testslpfindattrs_LDFLAGS) $(testslpfindattrs_OBJECTS) $(testslpfindattrs_LDADD) $(LIBS) testslpfindsrvs$(EXEEXT): $(testslpfindsrvs_OBJECTS) $(testslpfindsrvs_DEPENDENCIES) @rm -f testslpfindsrvs$(EXEEXT) $(LINK) $(testslpfindsrvs_LDFLAGS) $(testslpfindsrvs_OBJECTS) $(testslpfindsrvs_LDADD) $(LIBS) testslpfindsrvtypes$(EXEEXT): $(testslpfindsrvtypes_OBJECTS) $(testslpfindsrvtypes_DEPENDENCIES) @rm -f testslpfindsrvtypes$(EXEEXT) $(LINK) $(testslpfindsrvtypes_LDFLAGS) $(testslpfindsrvtypes_OBJECTS) $(testslpfindsrvtypes_LDADD) $(LIBS) testslpopen$(EXEEXT): $(testslpopen_OBJECTS) $(testslpopen_DEPENDENCIES) @rm -f testslpopen$(EXEEXT) $(LINK) $(testslpopen_LDFLAGS) $(testslpopen_OBJECTS) $(testslpopen_LDADD) $(LIBS) testslpparsesrvurl$(EXEEXT): $(testslpparsesrvurl_OBJECTS) $(testslpparsesrvurl_DEPENDENCIES) @rm -f testslpparsesrvurl$(EXEEXT) $(LINK) $(testslpparsesrvurl_LDFLAGS) $(testslpparsesrvurl_OBJECTS) $(testslpparsesrvurl_LDADD) $(LIBS) testslpreg$(EXEEXT): $(testslpreg_OBJECTS) $(testslpreg_DEPENDENCIES) @rm -f testslpreg$(EXEEXT) $(LINK) $(testslpreg_LDFLAGS) $(testslpreg_OBJECTS) $(testslpreg_LDADD) $(LIBS) testslpunescape$(EXEEXT): $(testslpunescape_OBJECTS) $(testslpunescape_DEPENDENCIES) @rm -f testslpunescape$(EXEEXT) $(LINK) $(testslpunescape_LDFLAGS) $(testslpunescape_OBJECTS) $(testslpunescape_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SLPDereg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SLPEscape.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SLPFindAttrs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SLPFindSrvTypes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SLPFindSrvs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SLPOpen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SLPParseSrvURL.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SLPReg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SLPUnescape.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_attr_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slpd_predicate_test.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< slp_attr_test.o: SLP_attr_test/slp_attr_test.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT slp_attr_test.o -MD -MP -MF "$(DEPDIR)/slp_attr_test.Tpo" -c -o slp_attr_test.o `test -f 'SLP_attr_test/slp_attr_test.c' || echo '$(srcdir)/'`SLP_attr_test/slp_attr_test.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/slp_attr_test.Tpo" "$(DEPDIR)/slp_attr_test.Po"; else rm -f "$(DEPDIR)/slp_attr_test.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLP_attr_test/slp_attr_test.c' object='slp_attr_test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/slp_attr_test.Po' tmpdepfile='$(DEPDIR)/slp_attr_test.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o slp_attr_test.o `test -f 'SLP_attr_test/slp_attr_test.c' || echo '$(srcdir)/'`SLP_attr_test/slp_attr_test.c slp_attr_test.obj: SLP_attr_test/slp_attr_test.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT slp_attr_test.obj -MD -MP -MF "$(DEPDIR)/slp_attr_test.Tpo" -c -o slp_attr_test.obj `if test -f 'SLP_attr_test/slp_attr_test.c'; then $(CYGPATH_W) 'SLP_attr_test/slp_attr_test.c'; else $(CYGPATH_W) '$(srcdir)/SLP_attr_test/slp_attr_test.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/slp_attr_test.Tpo" "$(DEPDIR)/slp_attr_test.Po"; else rm -f "$(DEPDIR)/slp_attr_test.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLP_attr_test/slp_attr_test.c' object='slp_attr_test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/slp_attr_test.Po' tmpdepfile='$(DEPDIR)/slp_attr_test.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o slp_attr_test.obj `if test -f 'SLP_attr_test/slp_attr_test.c'; then $(CYGPATH_W) 'SLP_attr_test/slp_attr_test.c'; else $(CYGPATH_W) '$(srcdir)/SLP_attr_test/slp_attr_test.c'; fi` slp_attr_test.lo: SLP_attr_test/slp_attr_test.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT slp_attr_test.lo -MD -MP -MF "$(DEPDIR)/slp_attr_test.Tpo" -c -o slp_attr_test.lo `test -f 'SLP_attr_test/slp_attr_test.c' || echo '$(srcdir)/'`SLP_attr_test/slp_attr_test.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/slp_attr_test.Tpo" "$(DEPDIR)/slp_attr_test.Plo"; else rm -f "$(DEPDIR)/slp_attr_test.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLP_attr_test/slp_attr_test.c' object='slp_attr_test.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/slp_attr_test.Plo' tmpdepfile='$(DEPDIR)/slp_attr_test.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o slp_attr_test.lo `test -f 'SLP_attr_test/slp_attr_test.c' || echo '$(srcdir)/'`SLP_attr_test/slp_attr_test.c slpd_predicate_test.o: SLPD_predicate_test/slpd_predicate_test.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT slpd_predicate_test.o -MD -MP -MF "$(DEPDIR)/slpd_predicate_test.Tpo" -c -o slpd_predicate_test.o `test -f 'SLPD_predicate_test/slpd_predicate_test.c' || echo '$(srcdir)/'`SLPD_predicate_test/slpd_predicate_test.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/slpd_predicate_test.Tpo" "$(DEPDIR)/slpd_predicate_test.Po"; else rm -f "$(DEPDIR)/slpd_predicate_test.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPD_predicate_test/slpd_predicate_test.c' object='slpd_predicate_test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/slpd_predicate_test.Po' tmpdepfile='$(DEPDIR)/slpd_predicate_test.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o slpd_predicate_test.o `test -f 'SLPD_predicate_test/slpd_predicate_test.c' || echo '$(srcdir)/'`SLPD_predicate_test/slpd_predicate_test.c slpd_predicate_test.obj: SLPD_predicate_test/slpd_predicate_test.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT slpd_predicate_test.obj -MD -MP -MF "$(DEPDIR)/slpd_predicate_test.Tpo" -c -o slpd_predicate_test.obj `if test -f 'SLPD_predicate_test/slpd_predicate_test.c'; then $(CYGPATH_W) 'SLPD_predicate_test/slpd_predicate_test.c'; else $(CYGPATH_W) '$(srcdir)/SLPD_predicate_test/slpd_predicate_test.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/slpd_predicate_test.Tpo" "$(DEPDIR)/slpd_predicate_test.Po"; else rm -f "$(DEPDIR)/slpd_predicate_test.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPD_predicate_test/slpd_predicate_test.c' object='slpd_predicate_test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/slpd_predicate_test.Po' tmpdepfile='$(DEPDIR)/slpd_predicate_test.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o slpd_predicate_test.obj `if test -f 'SLPD_predicate_test/slpd_predicate_test.c'; then $(CYGPATH_W) 'SLPD_predicate_test/slpd_predicate_test.c'; else $(CYGPATH_W) '$(srcdir)/SLPD_predicate_test/slpd_predicate_test.c'; fi` slpd_predicate_test.lo: SLPD_predicate_test/slpd_predicate_test.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT slpd_predicate_test.lo -MD -MP -MF "$(DEPDIR)/slpd_predicate_test.Tpo" -c -o slpd_predicate_test.lo `test -f 'SLPD_predicate_test/slpd_predicate_test.c' || echo '$(srcdir)/'`SLPD_predicate_test/slpd_predicate_test.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/slpd_predicate_test.Tpo" "$(DEPDIR)/slpd_predicate_test.Plo"; else rm -f "$(DEPDIR)/slpd_predicate_test.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPD_predicate_test/slpd_predicate_test.c' object='slpd_predicate_test.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/slpd_predicate_test.Plo' tmpdepfile='$(DEPDIR)/slpd_predicate_test.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o slpd_predicate_test.lo `test -f 'SLPD_predicate_test/slpd_predicate_test.c' || echo '$(srcdir)/'`SLPD_predicate_test/slpd_predicate_test.c SLPDereg.o: SLPDereg/SLPDereg.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPDereg.o -MD -MP -MF "$(DEPDIR)/SLPDereg.Tpo" -c -o SLPDereg.o `test -f 'SLPDereg/SLPDereg.c' || echo '$(srcdir)/'`SLPDereg/SLPDereg.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPDereg.Tpo" "$(DEPDIR)/SLPDereg.Po"; else rm -f "$(DEPDIR)/SLPDereg.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPDereg/SLPDereg.c' object='SLPDereg.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPDereg.Po' tmpdepfile='$(DEPDIR)/SLPDereg.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPDereg.o `test -f 'SLPDereg/SLPDereg.c' || echo '$(srcdir)/'`SLPDereg/SLPDereg.c SLPDereg.obj: SLPDereg/SLPDereg.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPDereg.obj -MD -MP -MF "$(DEPDIR)/SLPDereg.Tpo" -c -o SLPDereg.obj `if test -f 'SLPDereg/SLPDereg.c'; then $(CYGPATH_W) 'SLPDereg/SLPDereg.c'; else $(CYGPATH_W) '$(srcdir)/SLPDereg/SLPDereg.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPDereg.Tpo" "$(DEPDIR)/SLPDereg.Po"; else rm -f "$(DEPDIR)/SLPDereg.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPDereg/SLPDereg.c' object='SLPDereg.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPDereg.Po' tmpdepfile='$(DEPDIR)/SLPDereg.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPDereg.obj `if test -f 'SLPDereg/SLPDereg.c'; then $(CYGPATH_W) 'SLPDereg/SLPDereg.c'; else $(CYGPATH_W) '$(srcdir)/SLPDereg/SLPDereg.c'; fi` SLPDereg.lo: SLPDereg/SLPDereg.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPDereg.lo -MD -MP -MF "$(DEPDIR)/SLPDereg.Tpo" -c -o SLPDereg.lo `test -f 'SLPDereg/SLPDereg.c' || echo '$(srcdir)/'`SLPDereg/SLPDereg.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPDereg.Tpo" "$(DEPDIR)/SLPDereg.Plo"; else rm -f "$(DEPDIR)/SLPDereg.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPDereg/SLPDereg.c' object='SLPDereg.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPDereg.Plo' tmpdepfile='$(DEPDIR)/SLPDereg.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPDereg.lo `test -f 'SLPDereg/SLPDereg.c' || echo '$(srcdir)/'`SLPDereg/SLPDereg.c SLPEscape.o: SLPEscape/SLPEscape.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPEscape.o -MD -MP -MF "$(DEPDIR)/SLPEscape.Tpo" -c -o SLPEscape.o `test -f 'SLPEscape/SLPEscape.c' || echo '$(srcdir)/'`SLPEscape/SLPEscape.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPEscape.Tpo" "$(DEPDIR)/SLPEscape.Po"; else rm -f "$(DEPDIR)/SLPEscape.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPEscape/SLPEscape.c' object='SLPEscape.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPEscape.Po' tmpdepfile='$(DEPDIR)/SLPEscape.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPEscape.o `test -f 'SLPEscape/SLPEscape.c' || echo '$(srcdir)/'`SLPEscape/SLPEscape.c SLPEscape.obj: SLPEscape/SLPEscape.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPEscape.obj -MD -MP -MF "$(DEPDIR)/SLPEscape.Tpo" -c -o SLPEscape.obj `if test -f 'SLPEscape/SLPEscape.c'; then $(CYGPATH_W) 'SLPEscape/SLPEscape.c'; else $(CYGPATH_W) '$(srcdir)/SLPEscape/SLPEscape.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPEscape.Tpo" "$(DEPDIR)/SLPEscape.Po"; else rm -f "$(DEPDIR)/SLPEscape.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPEscape/SLPEscape.c' object='SLPEscape.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPEscape.Po' tmpdepfile='$(DEPDIR)/SLPEscape.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPEscape.obj `if test -f 'SLPEscape/SLPEscape.c'; then $(CYGPATH_W) 'SLPEscape/SLPEscape.c'; else $(CYGPATH_W) '$(srcdir)/SLPEscape/SLPEscape.c'; fi` SLPEscape.lo: SLPEscape/SLPEscape.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPEscape.lo -MD -MP -MF "$(DEPDIR)/SLPEscape.Tpo" -c -o SLPEscape.lo `test -f 'SLPEscape/SLPEscape.c' || echo '$(srcdir)/'`SLPEscape/SLPEscape.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPEscape.Tpo" "$(DEPDIR)/SLPEscape.Plo"; else rm -f "$(DEPDIR)/SLPEscape.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPEscape/SLPEscape.c' object='SLPEscape.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPEscape.Plo' tmpdepfile='$(DEPDIR)/SLPEscape.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPEscape.lo `test -f 'SLPEscape/SLPEscape.c' || echo '$(srcdir)/'`SLPEscape/SLPEscape.c SLPFindAttrs.o: SLPFindAttrs/SLPFindAttrs.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPFindAttrs.o -MD -MP -MF "$(DEPDIR)/SLPFindAttrs.Tpo" -c -o SLPFindAttrs.o `test -f 'SLPFindAttrs/SLPFindAttrs.c' || echo '$(srcdir)/'`SLPFindAttrs/SLPFindAttrs.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPFindAttrs.Tpo" "$(DEPDIR)/SLPFindAttrs.Po"; else rm -f "$(DEPDIR)/SLPFindAttrs.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPFindAttrs/SLPFindAttrs.c' object='SLPFindAttrs.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPFindAttrs.Po' tmpdepfile='$(DEPDIR)/SLPFindAttrs.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPFindAttrs.o `test -f 'SLPFindAttrs/SLPFindAttrs.c' || echo '$(srcdir)/'`SLPFindAttrs/SLPFindAttrs.c SLPFindAttrs.obj: SLPFindAttrs/SLPFindAttrs.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPFindAttrs.obj -MD -MP -MF "$(DEPDIR)/SLPFindAttrs.Tpo" -c -o SLPFindAttrs.obj `if test -f 'SLPFindAttrs/SLPFindAttrs.c'; then $(CYGPATH_W) 'SLPFindAttrs/SLPFindAttrs.c'; else $(CYGPATH_W) '$(srcdir)/SLPFindAttrs/SLPFindAttrs.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPFindAttrs.Tpo" "$(DEPDIR)/SLPFindAttrs.Po"; else rm -f "$(DEPDIR)/SLPFindAttrs.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPFindAttrs/SLPFindAttrs.c' object='SLPFindAttrs.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPFindAttrs.Po' tmpdepfile='$(DEPDIR)/SLPFindAttrs.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPFindAttrs.obj `if test -f 'SLPFindAttrs/SLPFindAttrs.c'; then $(CYGPATH_W) 'SLPFindAttrs/SLPFindAttrs.c'; else $(CYGPATH_W) '$(srcdir)/SLPFindAttrs/SLPFindAttrs.c'; fi` SLPFindAttrs.lo: SLPFindAttrs/SLPFindAttrs.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPFindAttrs.lo -MD -MP -MF "$(DEPDIR)/SLPFindAttrs.Tpo" -c -o SLPFindAttrs.lo `test -f 'SLPFindAttrs/SLPFindAttrs.c' || echo '$(srcdir)/'`SLPFindAttrs/SLPFindAttrs.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPFindAttrs.Tpo" "$(DEPDIR)/SLPFindAttrs.Plo"; else rm -f "$(DEPDIR)/SLPFindAttrs.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPFindAttrs/SLPFindAttrs.c' object='SLPFindAttrs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPFindAttrs.Plo' tmpdepfile='$(DEPDIR)/SLPFindAttrs.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPFindAttrs.lo `test -f 'SLPFindAttrs/SLPFindAttrs.c' || echo '$(srcdir)/'`SLPFindAttrs/SLPFindAttrs.c SLPFindSrvs.o: SLPFindSrvs/SLPFindSrvs.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPFindSrvs.o -MD -MP -MF "$(DEPDIR)/SLPFindSrvs.Tpo" -c -o SLPFindSrvs.o `test -f 'SLPFindSrvs/SLPFindSrvs.c' || echo '$(srcdir)/'`SLPFindSrvs/SLPFindSrvs.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPFindSrvs.Tpo" "$(DEPDIR)/SLPFindSrvs.Po"; else rm -f "$(DEPDIR)/SLPFindSrvs.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPFindSrvs/SLPFindSrvs.c' object='SLPFindSrvs.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPFindSrvs.Po' tmpdepfile='$(DEPDIR)/SLPFindSrvs.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPFindSrvs.o `test -f 'SLPFindSrvs/SLPFindSrvs.c' || echo '$(srcdir)/'`SLPFindSrvs/SLPFindSrvs.c SLPFindSrvs.obj: SLPFindSrvs/SLPFindSrvs.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPFindSrvs.obj -MD -MP -MF "$(DEPDIR)/SLPFindSrvs.Tpo" -c -o SLPFindSrvs.obj `if test -f 'SLPFindSrvs/SLPFindSrvs.c'; then $(CYGPATH_W) 'SLPFindSrvs/SLPFindSrvs.c'; else $(CYGPATH_W) '$(srcdir)/SLPFindSrvs/SLPFindSrvs.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPFindSrvs.Tpo" "$(DEPDIR)/SLPFindSrvs.Po"; else rm -f "$(DEPDIR)/SLPFindSrvs.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPFindSrvs/SLPFindSrvs.c' object='SLPFindSrvs.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPFindSrvs.Po' tmpdepfile='$(DEPDIR)/SLPFindSrvs.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPFindSrvs.obj `if test -f 'SLPFindSrvs/SLPFindSrvs.c'; then $(CYGPATH_W) 'SLPFindSrvs/SLPFindSrvs.c'; else $(CYGPATH_W) '$(srcdir)/SLPFindSrvs/SLPFindSrvs.c'; fi` SLPFindSrvs.lo: SLPFindSrvs/SLPFindSrvs.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPFindSrvs.lo -MD -MP -MF "$(DEPDIR)/SLPFindSrvs.Tpo" -c -o SLPFindSrvs.lo `test -f 'SLPFindSrvs/SLPFindSrvs.c' || echo '$(srcdir)/'`SLPFindSrvs/SLPFindSrvs.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPFindSrvs.Tpo" "$(DEPDIR)/SLPFindSrvs.Plo"; else rm -f "$(DEPDIR)/SLPFindSrvs.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPFindSrvs/SLPFindSrvs.c' object='SLPFindSrvs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPFindSrvs.Plo' tmpdepfile='$(DEPDIR)/SLPFindSrvs.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPFindSrvs.lo `test -f 'SLPFindSrvs/SLPFindSrvs.c' || echo '$(srcdir)/'`SLPFindSrvs/SLPFindSrvs.c SLPFindSrvTypes.o: SLPFindSrvTypes/SLPFindSrvTypes.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPFindSrvTypes.o -MD -MP -MF "$(DEPDIR)/SLPFindSrvTypes.Tpo" -c -o SLPFindSrvTypes.o `test -f 'SLPFindSrvTypes/SLPFindSrvTypes.c' || echo '$(srcdir)/'`SLPFindSrvTypes/SLPFindSrvTypes.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPFindSrvTypes.Tpo" "$(DEPDIR)/SLPFindSrvTypes.Po"; else rm -f "$(DEPDIR)/SLPFindSrvTypes.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPFindSrvTypes/SLPFindSrvTypes.c' object='SLPFindSrvTypes.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPFindSrvTypes.Po' tmpdepfile='$(DEPDIR)/SLPFindSrvTypes.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPFindSrvTypes.o `test -f 'SLPFindSrvTypes/SLPFindSrvTypes.c' || echo '$(srcdir)/'`SLPFindSrvTypes/SLPFindSrvTypes.c SLPFindSrvTypes.obj: SLPFindSrvTypes/SLPFindSrvTypes.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPFindSrvTypes.obj -MD -MP -MF "$(DEPDIR)/SLPFindSrvTypes.Tpo" -c -o SLPFindSrvTypes.obj `if test -f 'SLPFindSrvTypes/SLPFindSrvTypes.c'; then $(CYGPATH_W) 'SLPFindSrvTypes/SLPFindSrvTypes.c'; else $(CYGPATH_W) '$(srcdir)/SLPFindSrvTypes/SLPFindSrvTypes.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPFindSrvTypes.Tpo" "$(DEPDIR)/SLPFindSrvTypes.Po"; else rm -f "$(DEPDIR)/SLPFindSrvTypes.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPFindSrvTypes/SLPFindSrvTypes.c' object='SLPFindSrvTypes.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPFindSrvTypes.Po' tmpdepfile='$(DEPDIR)/SLPFindSrvTypes.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPFindSrvTypes.obj `if test -f 'SLPFindSrvTypes/SLPFindSrvTypes.c'; then $(CYGPATH_W) 'SLPFindSrvTypes/SLPFindSrvTypes.c'; else $(CYGPATH_W) '$(srcdir)/SLPFindSrvTypes/SLPFindSrvTypes.c'; fi` SLPFindSrvTypes.lo: SLPFindSrvTypes/SLPFindSrvTypes.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPFindSrvTypes.lo -MD -MP -MF "$(DEPDIR)/SLPFindSrvTypes.Tpo" -c -o SLPFindSrvTypes.lo `test -f 'SLPFindSrvTypes/SLPFindSrvTypes.c' || echo '$(srcdir)/'`SLPFindSrvTypes/SLPFindSrvTypes.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPFindSrvTypes.Tpo" "$(DEPDIR)/SLPFindSrvTypes.Plo"; else rm -f "$(DEPDIR)/SLPFindSrvTypes.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPFindSrvTypes/SLPFindSrvTypes.c' object='SLPFindSrvTypes.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPFindSrvTypes.Plo' tmpdepfile='$(DEPDIR)/SLPFindSrvTypes.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPFindSrvTypes.lo `test -f 'SLPFindSrvTypes/SLPFindSrvTypes.c' || echo '$(srcdir)/'`SLPFindSrvTypes/SLPFindSrvTypes.c SLPOpen.o: SLPOpen/SLPOpen.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPOpen.o -MD -MP -MF "$(DEPDIR)/SLPOpen.Tpo" -c -o SLPOpen.o `test -f 'SLPOpen/SLPOpen.c' || echo '$(srcdir)/'`SLPOpen/SLPOpen.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPOpen.Tpo" "$(DEPDIR)/SLPOpen.Po"; else rm -f "$(DEPDIR)/SLPOpen.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPOpen/SLPOpen.c' object='SLPOpen.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPOpen.Po' tmpdepfile='$(DEPDIR)/SLPOpen.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPOpen.o `test -f 'SLPOpen/SLPOpen.c' || echo '$(srcdir)/'`SLPOpen/SLPOpen.c SLPOpen.obj: SLPOpen/SLPOpen.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPOpen.obj -MD -MP -MF "$(DEPDIR)/SLPOpen.Tpo" -c -o SLPOpen.obj `if test -f 'SLPOpen/SLPOpen.c'; then $(CYGPATH_W) 'SLPOpen/SLPOpen.c'; else $(CYGPATH_W) '$(srcdir)/SLPOpen/SLPOpen.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPOpen.Tpo" "$(DEPDIR)/SLPOpen.Po"; else rm -f "$(DEPDIR)/SLPOpen.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPOpen/SLPOpen.c' object='SLPOpen.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPOpen.Po' tmpdepfile='$(DEPDIR)/SLPOpen.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPOpen.obj `if test -f 'SLPOpen/SLPOpen.c'; then $(CYGPATH_W) 'SLPOpen/SLPOpen.c'; else $(CYGPATH_W) '$(srcdir)/SLPOpen/SLPOpen.c'; fi` SLPOpen.lo: SLPOpen/SLPOpen.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPOpen.lo -MD -MP -MF "$(DEPDIR)/SLPOpen.Tpo" -c -o SLPOpen.lo `test -f 'SLPOpen/SLPOpen.c' || echo '$(srcdir)/'`SLPOpen/SLPOpen.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPOpen.Tpo" "$(DEPDIR)/SLPOpen.Plo"; else rm -f "$(DEPDIR)/SLPOpen.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPOpen/SLPOpen.c' object='SLPOpen.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPOpen.Plo' tmpdepfile='$(DEPDIR)/SLPOpen.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPOpen.lo `test -f 'SLPOpen/SLPOpen.c' || echo '$(srcdir)/'`SLPOpen/SLPOpen.c SLPParseSrvURL.o: SLPParseSrvURL/SLPParseSrvURL.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPParseSrvURL.o -MD -MP -MF "$(DEPDIR)/SLPParseSrvURL.Tpo" -c -o SLPParseSrvURL.o `test -f 'SLPParseSrvURL/SLPParseSrvURL.c' || echo '$(srcdir)/'`SLPParseSrvURL/SLPParseSrvURL.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPParseSrvURL.Tpo" "$(DEPDIR)/SLPParseSrvURL.Po"; else rm -f "$(DEPDIR)/SLPParseSrvURL.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPParseSrvURL/SLPParseSrvURL.c' object='SLPParseSrvURL.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPParseSrvURL.Po' tmpdepfile='$(DEPDIR)/SLPParseSrvURL.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPParseSrvURL.o `test -f 'SLPParseSrvURL/SLPParseSrvURL.c' || echo '$(srcdir)/'`SLPParseSrvURL/SLPParseSrvURL.c SLPParseSrvURL.obj: SLPParseSrvURL/SLPParseSrvURL.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPParseSrvURL.obj -MD -MP -MF "$(DEPDIR)/SLPParseSrvURL.Tpo" -c -o SLPParseSrvURL.obj `if test -f 'SLPParseSrvURL/SLPParseSrvURL.c'; then $(CYGPATH_W) 'SLPParseSrvURL/SLPParseSrvURL.c'; else $(CYGPATH_W) '$(srcdir)/SLPParseSrvURL/SLPParseSrvURL.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPParseSrvURL.Tpo" "$(DEPDIR)/SLPParseSrvURL.Po"; else rm -f "$(DEPDIR)/SLPParseSrvURL.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPParseSrvURL/SLPParseSrvURL.c' object='SLPParseSrvURL.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPParseSrvURL.Po' tmpdepfile='$(DEPDIR)/SLPParseSrvURL.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPParseSrvURL.obj `if test -f 'SLPParseSrvURL/SLPParseSrvURL.c'; then $(CYGPATH_W) 'SLPParseSrvURL/SLPParseSrvURL.c'; else $(CYGPATH_W) '$(srcdir)/SLPParseSrvURL/SLPParseSrvURL.c'; fi` SLPParseSrvURL.lo: SLPParseSrvURL/SLPParseSrvURL.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPParseSrvURL.lo -MD -MP -MF "$(DEPDIR)/SLPParseSrvURL.Tpo" -c -o SLPParseSrvURL.lo `test -f 'SLPParseSrvURL/SLPParseSrvURL.c' || echo '$(srcdir)/'`SLPParseSrvURL/SLPParseSrvURL.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPParseSrvURL.Tpo" "$(DEPDIR)/SLPParseSrvURL.Plo"; else rm -f "$(DEPDIR)/SLPParseSrvURL.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPParseSrvURL/SLPParseSrvURL.c' object='SLPParseSrvURL.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPParseSrvURL.Plo' tmpdepfile='$(DEPDIR)/SLPParseSrvURL.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPParseSrvURL.lo `test -f 'SLPParseSrvURL/SLPParseSrvURL.c' || echo '$(srcdir)/'`SLPParseSrvURL/SLPParseSrvURL.c SLPReg.o: SLPReg/SLPReg.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPReg.o -MD -MP -MF "$(DEPDIR)/SLPReg.Tpo" -c -o SLPReg.o `test -f 'SLPReg/SLPReg.c' || echo '$(srcdir)/'`SLPReg/SLPReg.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPReg.Tpo" "$(DEPDIR)/SLPReg.Po"; else rm -f "$(DEPDIR)/SLPReg.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPReg/SLPReg.c' object='SLPReg.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPReg.Po' tmpdepfile='$(DEPDIR)/SLPReg.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPReg.o `test -f 'SLPReg/SLPReg.c' || echo '$(srcdir)/'`SLPReg/SLPReg.c SLPReg.obj: SLPReg/SLPReg.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPReg.obj -MD -MP -MF "$(DEPDIR)/SLPReg.Tpo" -c -o SLPReg.obj `if test -f 'SLPReg/SLPReg.c'; then $(CYGPATH_W) 'SLPReg/SLPReg.c'; else $(CYGPATH_W) '$(srcdir)/SLPReg/SLPReg.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPReg.Tpo" "$(DEPDIR)/SLPReg.Po"; else rm -f "$(DEPDIR)/SLPReg.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPReg/SLPReg.c' object='SLPReg.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPReg.Po' tmpdepfile='$(DEPDIR)/SLPReg.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPReg.obj `if test -f 'SLPReg/SLPReg.c'; then $(CYGPATH_W) 'SLPReg/SLPReg.c'; else $(CYGPATH_W) '$(srcdir)/SLPReg/SLPReg.c'; fi` SLPReg.lo: SLPReg/SLPReg.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPReg.lo -MD -MP -MF "$(DEPDIR)/SLPReg.Tpo" -c -o SLPReg.lo `test -f 'SLPReg/SLPReg.c' || echo '$(srcdir)/'`SLPReg/SLPReg.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPReg.Tpo" "$(DEPDIR)/SLPReg.Plo"; else rm -f "$(DEPDIR)/SLPReg.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPReg/SLPReg.c' object='SLPReg.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPReg.Plo' tmpdepfile='$(DEPDIR)/SLPReg.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPReg.lo `test -f 'SLPReg/SLPReg.c' || echo '$(srcdir)/'`SLPReg/SLPReg.c SLPUnescape.o: SLPUnescape/SLPUnescape.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPUnescape.o -MD -MP -MF "$(DEPDIR)/SLPUnescape.Tpo" -c -o SLPUnescape.o `test -f 'SLPUnescape/SLPUnescape.c' || echo '$(srcdir)/'`SLPUnescape/SLPUnescape.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPUnescape.Tpo" "$(DEPDIR)/SLPUnescape.Po"; else rm -f "$(DEPDIR)/SLPUnescape.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPUnescape/SLPUnescape.c' object='SLPUnescape.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPUnescape.Po' tmpdepfile='$(DEPDIR)/SLPUnescape.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPUnescape.o `test -f 'SLPUnescape/SLPUnescape.c' || echo '$(srcdir)/'`SLPUnescape/SLPUnescape.c SLPUnescape.obj: SLPUnescape/SLPUnescape.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPUnescape.obj -MD -MP -MF "$(DEPDIR)/SLPUnescape.Tpo" -c -o SLPUnescape.obj `if test -f 'SLPUnescape/SLPUnescape.c'; then $(CYGPATH_W) 'SLPUnescape/SLPUnescape.c'; else $(CYGPATH_W) '$(srcdir)/SLPUnescape/SLPUnescape.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPUnescape.Tpo" "$(DEPDIR)/SLPUnescape.Po"; else rm -f "$(DEPDIR)/SLPUnescape.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPUnescape/SLPUnescape.c' object='SLPUnescape.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPUnescape.Po' tmpdepfile='$(DEPDIR)/SLPUnescape.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPUnescape.obj `if test -f 'SLPUnescape/SLPUnescape.c'; then $(CYGPATH_W) 'SLPUnescape/SLPUnescape.c'; else $(CYGPATH_W) '$(srcdir)/SLPUnescape/SLPUnescape.c'; fi` SLPUnescape.lo: SLPUnescape/SLPUnescape.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT SLPUnescape.lo -MD -MP -MF "$(DEPDIR)/SLPUnescape.Tpo" -c -o SLPUnescape.lo `test -f 'SLPUnescape/SLPUnescape.c' || echo '$(srcdir)/'`SLPUnescape/SLPUnescape.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SLPUnescape.Tpo" "$(DEPDIR)/SLPUnescape.Plo"; else rm -f "$(DEPDIR)/SLPUnescape.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SLPUnescape/SLPUnescape.c' object='SLPUnescape.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/SLPUnescape.Plo' tmpdepfile='$(DEPDIR)/SLPUnescape.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o SLPUnescape.lo `test -f 'SLPUnescape/SLPUnescape.c' || echo '$(srcdir)/'`SLPUnescape/SLPUnescape.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list='$(TESTS)'; \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ echo "XPASS: $$tst"; \ ;; \ *) \ echo "PASS: $$tst"; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xfail=`expr $$xfail + 1`; \ echo "XFAIL: $$tst"; \ ;; \ *) \ failed=`expr $$failed + 1`; \ echo "FAIL: $$tst"; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ echo "SKIP: $$tst"; \ fi; \ done; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="All $$all tests passed"; \ else \ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all tests failed"; \ else \ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ skipped="($$skip tests were not run)"; \ test `echo "$$skipped" | wc -c` -gt `echo "$$banner" | wc -c` && \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -gt `echo "$$banner" | wc -c` && \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ test -n "$$skipped" && echo "$$skipped"; \ test -n "$$report" && echo "$$report"; \ echo "$$dashes"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-local clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ clean-generic clean-libtool clean-local clean-noinstPROGRAMS \ ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-info-am clean-local: -rm -f *.output # We have to manually copy files in the TEST directories. dist-hook: @for d in $(TESTS); do \ cp -pr $(srcdir)/`dirname $$d`/* $(distdir)/`dirname $$d`; \ done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: openslp-1.2.1/test/README0000644033442200000310000000323007131105354014714 0ustar rganesanfloppy=============================================================================== David McCormack & Evan Hughes Thu Jul 6 09:33:28 EDT 2000 slp_project@nexus.carleton.ca =============================================================================== Setup Perform these steps to setup the program for testing. 0. Ensure OpenSLP source tree is installed 1. `tar xvfz test-suite.tar.gz' into the openslp directory. 2. Perform a root make of Openslp to ensure all libraries are created 3. Ensure that libslp.so.0.*.* is sym linked to libslp.so in the libslp directory. Executing Tests Go into the root directory and type the following commands: make clean make make test All tests are passed if the Makefile exits normally. Functionality Tested The following functionality has been tested (as of the date in the square brackets): [20000525] - SLPDereg() [20000525] - SLPFindSrvs() [20000525] - SLPParseSrvURL() [20000525] - SLPFindAttrs() [20000525] - SLPOpen() [20000525] - SLPReg() [20000605] - SLPEscape() [20000605] - SLPUnescape() The following SLP function as defined in RFC 2614 were not tested: - SLPDelAttrs() - SLPFindSrvTypes() - SLPFree() - SLPGetRefreshInterval() - SLPFindScopes() - SLPGetProperty() - SLPSetProperty() Assorted Information Please contact us (slp_project@nexus.carleton.ca) if there are any issues with this test suite. The running of this test suite does not ensure that all of the functionality is working correctly, it mearly ensures that the tested modules return the valid results given their input. openslp-1.2.1/test/SLPEscape/0000755033442200000310000000000010260165763015624 5ustar rganesanfloppyopenslp-1.2.1/test/SLPEscape/test.script0000755033442200000310000000076407534263613020046 0ustar rganesanfloppy#!/bin/sh echo "SLPEscape" rm -f SLPEscape.actual.output scriptdir=${srcdir}/SLPEscape ./testslpescape asdf\(asdf > SLPEscape.actual.output echo >> SLPEscape.actual.output ./testslpescape \(asdf >> SLPEscape.actual.output echo >> SLPEscape.actual.output ./testslpescape asdf\\ >> SLPEscape.actual.output echo >> SLPEscape.actual.output ./testslpescape \(\),\\!\<=\>\~ >> SLPEscape.actual.output echo >> SLPEscape.actual.output diff -c ${scriptdir}/SLPEscape.expected.output SLPEscape.actual.output openslp-1.2.1/test/SLPEscape/slp.test.reg0000644033442200000310000000151107116747626020107 0ustar rganesanfloppy############################################################################# # # OpenSLP registration file # # May be used to register services for legacy applications that do not use # the SLPAPIs to register for themselves # # Format and contents conform to specification in IETF RFC 2614 so the # comments use the language of the RFC. In OpenSLP, SLPD operates as an SA # and a DA. The SLP UA functionality is encapsulated by SLPLIB. # ############################################################################# #comment ;comment #service-url,language-tag,lifetime,[service-type] #["scopes="scope-list] #[attrid"="val1] #[attrid"="val1,val2,val3] # ##This is the other testing service service:test://10.0.0.1,en,65535 foo=value1,value2 description=Test Service 1 goo=value3,value4 openslp-1.2.1/test/SLPEscape/SLPEscape.expected.output0000644033442200000310000000030407116747626022474 0ustar rganesanfloppyInput Tag = asdf(asdf Escaped Tag = asdf\28asdf Input Tag = (asdf Escaped Tag = \28asdf Input Tag = asdf\ Escaped Tag = asdf\5C Input Tag = (),\!<=>~ Escaped Tag = \28\29\2C\5C\21\3C\3D\3E\7E openslp-1.2.1/test/SLPEscape/SLPEscape.c0000644033442200000310000000146210202047670017542 0ustar rganesanfloppy/****************************************************************************/ /* Test for SLPEscape */ /* Creation Date: Fri Jun 2 09:23:41 EDT 2000 */ /****************************************************************************/ #include #include #include int main (int argc, char *argv[]) { SLPError err; char *output_string; if (argc != 2) { printf("SLPEscape\n This program tests the parsing of a service url.\n Usage:\n SLPEscape \n"); return(1); } /* End If. */ err = SLPEscape(argv[1], &output_string, SLP_TRUE); check_error_state(err, "Error parsing Service Tag"); printf("Input Tag = %s\n", argv[1]); printf("Escaped Tag = %s\n", output_string); return(0); } openslp-1.2.1/test/SLPOpen/0000755033442200000310000000000010260165763015325 5ustar rganesanfloppyopenslp-1.2.1/test/SLPOpen/SLPOpen.c0000644033442200000310000000117110202047670016741 0ustar rganesanfloppy/****************************************************************************/ /* Test for SLPOpen */ /* Creation Date: Wed May 24 14:26:50 EDT 2000 */ /****************************************************************************/ #include #include #include int main (int argc, char *argv[]) { SLPError err; SLPHandle hslp; err = SLPOpen ("en", SLP_FALSE, &hslp); check_error_state(err,"Error opening slp handle"); /* Now that we're done using slp, close the slp handle */ SLPClose (hslp); return(0); } openslp-1.2.1/test/SLPOpen/slp.test.conf0000644033442200000310000001264207113265250017750 0ustar rganesanfloppy############################################################################# # # OpenSLP configuration file # # Format and contents conform to specification in IETF RFC 2614 so the # comments use the language of the RFC. In OpenSLP, SLPD operates as an SA # and a DA. The SLP UA functionality is encapsulated by SLPLIB. # ############################################################################# #---------------------------------------------------------------------------- # Static Scope Configuration #---------------------------------------------------------------------------- # This option is a comma delimited list of strings indicating the only scopes # a UA or SA is allowed when making requests or registering or the scopes a # DA must support. (default value is "DEFAULT") ;net.slp.useScopes = # Allows administrator to force UA and SA agents to use specific DAs. If # this setting is not used dynamic DA discovery will be used to determine # which DAs to use. (Default is to use dynamic DA discovery) ;net.slp.DAAddresses = myDa1,myDa2,myDa3 #---------------------------------------------------------------------------- # Network Configuration Properties #---------------------------------------------------------------------------- # Force broadcasts to be used instead of multicast. This setting is seldom # necessary since OpenSLP will automatically use broadcast if multicast # is unavailable. (Default is false) ;net.slp.isBroadcastOnly = true # A boolean indicating whether passive DA detection should be use. # (Default is true) ;net.slp.passiveDADetection = true # A boolean indicating whether active DA dection should be used. Note that if # both passive and active DA detection are disabled, DAs will not be used # unless they are statically configured using the net.slp.DAAddresses property # (Default is true) ;net.slp.activeDADetection = true # A positive integer that is less than or equal to 255. (The default is 255) ;net.slp.multicastTTL = 255 # OpenSLP does not honor this parameter unless it is set to zero. When set # to zero active discovery is turned off. See (net.slp.activeDADetection) ;net.slp.DAActiveDiscoveryInterval = 0 # An integer giving the maximum amount of time (in milliseconds) to perform # multicast requests. (Default is 15000 ms or 15 secs). ;net.slp.multicastMaximumWait = 15000 # OpenSLP does not honor this parameter. Multicast timeouts are generated # internally based on the .net.slp.multicastMaximumWait parameter. ;net.slp.multicastTimeouts = IGNORED # OpenSLP does not honor this parameter. Multicast timeouts are generated # internally based on the .net.slp.multicastMaximumWait parameter. ;net.slp.DADiscoveryTimeouts = IGNORED # An integer giving the maximum amount of time (in milliseconds) to perform # unicast requests. (Default is 15000 ms or 15 secs). ;net.slp.unicastMaximumWait = 15000 # OpenSLP does not honor this parameter. Unicast timeouts are generated # internal based on the net.slp.unicastMaximumWait parameter ;net.slp.datagramTimeouts = IGNORED # An integer giving the maximum value for all random wait parameters. # (Default is 1000 or 1 sec) ;net.slp.randomWaitBound = 1000 # A integer giving the network packet MTU in bytes. (Default is 1400) ;net.slp.MTU = 1400 # A list of IP address of network interfaces on which the DA/SA should listen # for slp requests. By default, slpd will use all interfaces. ;net.slp.interfaces = 1.2.3.4,1.2.3.5,1.2.3.6 #---------------------------------------------------------------------------- # Security #---------------------------------------------------------------------------- # Indicates whether all agents should use authentication blocks ;net.slp.securityEnabled = true #---------------------------------------------------------------------------- # DA Specific Configuration #---------------------------------------------------------------------------- # Not yet supported by OpenSLP #---------------------------------------------------------------------------- # SA Specific Configuration #---------------------------------------------------------------------------- # Not yet supported by OpenSLP #---------------------------------------------------------------------------- # SA Specific Configuration #---------------------------------------------------------------------------- # Not yet supported by OpenSLP #---------------------------------------------------------------------------- # Tracing and Logging #---------------------------------------------------------------------------- # A boolean controlling printing of messages about traffic with DAs. # Default is false. net.slp.traceDATraffic = true # A boolean controlling printing of details on SLP messages. The fields in # all incoming messages and outgoing replies are printed. Default is false. net.slp.traceMsg = true # A boolean controlling printing details when a SLP message is dropped for # any reason. Default is false. net.slp.traceDrop = true # A boolean controlling dumps of all registered services upon registration # and deregistration. If true, the contents of the DA or SA server are # dumped after a registration or deregistration occurs. Default is false. net.slp.traceReg = true #---------------------------------------------------------------------------- # Serialized Proxy Registration #---------------------------------------------------------------------------- # slpd accepts the [-r] command line parameter that specifies the # serialized registration file. openslp-1.2.1/test/SLPOpen/test.script0000755033442200000310000000106710207721353017533 0ustar rganesanfloppy#!/bin/sh echo "SLPOpen" rm -f SLPOpen.actual.output scriptdir=${srcdir}/SLPOpen test -f ${srcdir}/slpd.pid && kill `cat ${srcdir}/slpd.pid` && rm ${srcdir}/slpd.pid ../slpd/slpd -r ${scriptdir}/slp.test.reg -p ${srcdir}/slpd.pid -l ${srcdir}/slpd.log RESULT=$? if test $RESULT != 0; then echo "Unable to start slpd (error = $RESULT), test failed." exit $RESULT fi ./testslpopen > SLPOpen.actual.output test -f ${srcdir}/slpd.pid && kill `cat ${srcdir}/slpd.pid` && rm ${srcdir}/slpd.pid diff -c ${scriptdir}/SLPOpen.expected.output SLPOpen.actual.output openslp-1.2.1/test/SLPOpen/slp.test.reg0000644033442200000310000000160407113265250017574 0ustar rganesanfloppy############################################################################# # # OpenSLP registration file # # May be used to register services for legacy applications that do not use # the SLPAPIs to register for themselves # # Format and contents conform to specification in IETF RFC 2614 so the # comments use the language of the RFC. In OpenSLP, SLPD operates as an SA # and a DA. The SLP UA functionality is encapsulated by SLPLIB. # ############################################################################# #comment ;comment #service-url,language-tag,lifetime,[service-type] #["scopes="scope-list] #[attrid"="val1] #[attrid"="val1,val2,val3] # ##This is a testing service service:test://10.0.0.2,en,65535 description=Testing Serivce 2 ##This is the other testing service service:test://10.0.0.1,en,65535 description=Test Service 1 openslp-1.2.1/test/SLPOpen/SLPOpen.expected.output0000644033442200000310000000000007113265250021650 0ustar rganesanfloppyopenslp-1.2.1/doc/0000755033442200000310000000000010211377554013632 5ustar rganesanfloppyopenslp-1.2.1/doc/rfc/0000755033442200000310000000000010641471176014406 5ustar rganesanfloppyopenslp-1.2.1/doc/rfc/srvreg-integrity.txt0000644033442200000310000002515007311522703020467 0ustar rganesanfloppySimple Service Registration Transaction Integrity for SLPv2 ============================================================ As described by RFC 2608, SLPv2 is designed to support integrity and authentication of service location information. In fact, the full implementation of SLPv2 security often exceed the requirements for many SLP applications. In such cases, the requirements for distribution of key material and security configuration challenges SLP's claim that: "Using this protocol, computers using the [network] need little or no static configuration of network services for network based applications." -- RFC 2608 (abstract) In order to provide SLPv2 security, it is necessary to distribute SPI and key information to ALL agents (UAs SAs and DAs). The SLP security Problem ------------------------- SPI configuration ----------------- An SPI is an arbitrary string that identifies a key material that is needed to generate and verify digital signatures. Basically, a SPI is an alias for a public/private key pair. In order for SLPv2 security to work, there needs to be some way for the implementation to map SPIs to keys and mapping must be saved in secure storage. The formatting will vary, but the information represented by the following table must be represented: SPINAME = PUBLICKEY [PRIVATEKEY] In the case of a UAs it is not necessary to configure a private key since a UA does not generate signatures. The SA and DA do generate signatures and must be configured with a private key for SPIs they support. All agents need to be configured with a public key for SPIs they support. It is evident from RFC 2614 that it is not intended for SPIs to be exposed to developers. Since there are no standardized APIs to change SPI configuration, it is always an implementation specific (and most likely manual) procedure. It is also evident that SPI configuration is intended to be managed on a per-SLP installation basis -- not on a per-application basis. Key distribution ---------------- - keys (especially private) are difficult to distribute automatically. SPIs and scopes related? ------------------------ Using SLP scopes allows administrators to create functional SLP "domains" for administrative and scalability purposes. Scope configuration can be statically configured, delivered via DHCP, or selected by the user. Regardless, scope configuration is really the only peice of information that is needed for a working SLP deployment -- unless the SLP deployment needs to be secure. SPIs allow administrators to create functional SLP "domains" of trust. Conceptually, there would could be a one-to-one mapping of scopes to SPIs. To reduce confusion, might be wise to use *exactly the same string* for the scope and the SPI. SPI Hell --------- Perhaps the reason SPI configuration standards were not treated in the RFCs is because it would be very difficult (if not impossible) to come up with a standard that would address the needs of SLP deployments. Imagine the differences between the way that SPI configuration would be performed for the following: a desktop computer, a fileserver, a printer, a cell phone (or other embedded device). The best way to avoid confusion is to simply not use SLPv2 security. This is true for implementors of the SLPv2 protocol as well as for developers that write to the SLP API. Current SLP security requirements ---------------------------------- SLPv2 security as described by RFC 2608 supplies -- at the protocol level -- everything that is needed to ensure that service location information was sent by a trusted entity (authentication) and that it is not changed in transit (integrity). At the application level, this means that an application developer (probably using the SLP API) can trust *all* SLP delivered information. Blind trust of SLP deliverd information (URLs, etc) is especially significant in common situations where confidential information (username and password) are exchanged with an entity authenticated only by the fact that it was located via secure SLP. For example, LDAP enabled software uses SLP to locate an LDAP directory. If SLP information is secure, the username and password to establish a connection with the LDAP directory can be sent with out having to use any other method to establish the identity of LDAP directory. However, with LDAP (and many other protocols, however, possible to establish the identity even if the SLP information is not trusted. In fact, for any SSL or equivilant transport establishing the identity of the "other side" seperatly from the URL used. Most secure applications already have authentication built into their protocols. In these cases, additional configuration for SLP to provide another layer of authentication does not make sense. Security by fear ---------------- Most Internet security problems are approached with the assumption that no one is trustworthy and that no one is trackable or accountable. This is probably not an appropriate approach to SLP security because SLP is not intended for the Internet. SLP is intended to function within networks under cooperative administrative control. Such networks permit a policy to be implemented regarding security, multicast routing and organization of services and clients into groups which are not be feasible on the scale of the Internet as a whole. -- RFC 2608 (section 1.1 Applicability Statement) In approaching the SLP security problem, one should continue to assume that no one is trustworthy, however, it SHOULD NOT be assumed that no one is accountable or trackable. In fact, in "networks under cooperative administrative control" it is very easy track and confront individuals that corrupt otherwise insecure systems as long as it can be identified that a corruption has been attempted or has occured. Because they can be held accountable, fear of consequences keep otherwise untrustworthy individuals in line. The real SLP security problem ----------------------------- The use of secure service specific protocols/frameworks in an environment "under cooperative administrative control" greatly reduces the scope of the Security problem. Instead of having to ensure that every bit of SLP information is delivered with authenticity and integrity, SLP only has to worry about a small portion of the SLP delivered information is delivered with authenticity and integrity -- and this is only so that developers (and ultimately system administrators) can be *alerted* to SLP related attacks. Continuing the LDAP example from above, it is possible to write a secure LDAP enabled "client" application that uses "insecure" SLP to discover the LDAP server. The client would locate URLs for *all* LDAP services using SLP. The client would try to establish an SSL connection with each of the discovered LDAP servers until an LDAP server that comes to an LDAP server that is trusted. If SLP finds an LDAP servers that is not trusted it should display a warning message (thus helping to track down the rogue or misconfigured LDAP server). In the example above there is one no chance for security compromise in the LDAP application due to it's use of SLP. There is, however a chance that an attack could burdon the application. The following is a list of attacks that can not be prevented without addtions to the required SLP implementation: Unauthorized Registration - An obvious attack of registering many non-existant LDAP services which would result in the application taking a long time to connect to LDAP (it would probably have to iterate through a lot of bogus services before it found a valid one). Unauthorized Deregistration - A more effective attack would be to simply de-register the valid registration so that no LDAP services would be found at all. Unauthorized Reregistration - Reregister the LDAP service with different attributes. (This attack would only affects applications that rely on SLP attributes) Unauthorized DA - Bring up an unauthorized DA that has been modified to achieve the same results as the above mentioned attacks. Unauthorized SA - Bring up an unauthorized SA that has been modified to achieve the same results as an unauthorized registration or re-reregistration (only a problem if the application relies on SLP attributes) Scrambler in the middle - Malicious party that "sniffs" the network and intentionally scrambles valid messages so that they become invalid. Full SLPv2 security implementation prevents all of the above attacks except the "scrambler in the middle attack" which is not preventable. However, in order to do it, the full SLPv2 security imposes the SPI configuration and key distribution overhead that was discussed earlier. The solution to the SPI and the key distribution problem is to simply not use SLPv2 security as defined in the RFC or expect that the world will standardize on a single SPI and key distribution solution and that tools can be written to automate them. Perhaps the best advise for those trying to write SLP software today is to simply not use SLPv2 security as defined by the RFC and spend the time implementing or using secure service-specific transport or presentation layer protocols. As long as service-specific protocols are secure, there is no chance that sensitive data or resources will be compromised. Careful use of normal (insecure) SLPv2 can supply enough information to warn administrators about "unauthorized registration" attacks and "unauthorized SA/DA" attacks, but currently, without a simple security enhancements (in addition to normal SLPv2) it is impossible to prevent any of these attacks or to even detect "unauthorized de-registration" or "unathorized re-registration" attacks. Solution -------- "Simple Service Registration Transaction Integrity for SLPv2" (SSRTI-SLPv2) is a really long name for a very simple security extension to SLPv2 protocol that facilitates prevention or dection of all the SLP attacks that would otherwise "burdon" (not compromise) SLP enable software. Prevented by SLPv2 security unauthorized registration unauthorized deregistration unauthorized reregistration unauthorized SA unauthorized DA first registration wins (not applicable) man-in-the-middle Prevented by SSRTI-SLPv2: unauthorized deregistration unauthorized reregistration Detectable by application developer: unauthorized registration unauthorized SA Deterrable by implementation: unauthorized registration first registration wins Detectable by implementation: unauthorized DA Not preventable or detectable scrambler-in-the-middle (Remember the Registration replay attack!) openslp-1.2.1/doc/rfc/threat_analysis_min_security.html0000644033442200000310000004212207311772275023265 0ustar rganesanfloppy

SLP Security

Introduction

 

The SLP Security Problem

The SLP security problem can be divided into three categories:  SLP security attacks, security configuration and management problems, and ignorance of secure SLPv2 usage.  The following is an introduction to problems that will be examined in more detail later in this document.

The obvious SLP security problems are those that are similar to the one that is described by the following example from SLPv2 Authentication - Is it worth the trouble ):

Imagine that in an enterprise environment there is a malicious or overly curious individual that would like to obtain confidential information.    SLP could be exploited to obtain information from software that was otherwise secured only by virtue of manual configuration.    For example, an OpenSource help desk application consisting of "server" and "client" software is SLP enabled because the network administrators got tired of helping employees set up the "client" software with location and configuration information used to connect with the "server" software.

Since the source code is readily available, a sneaky employee makes a few modifications to the server code that allows him to obtain user names and passwords.  He recompiles the source and brings up the "rogue" help desk server.  Since the "rogue" help desk server and the real help desk server both have similar SLP registerations, it is possible that clients may connect to the "rogue" server instead of the real one.  When the users log in, the "rogue" server saves off a copies of user names and passwords.  The malicious employee can use these user names and passwords later to impersonate other people.

The obvious solution to this and other related SLP security problems is to build security features into the SLP protocol itself.   This is the approach that is taken by SLPv2 and it is indeed successful in preventing nearly all of the SLP security attacks in a way that requires very little effort on the part of user and application developer.  However, it places a huge security configuration and management burdon on the system administrator and makes (application level) interoperability between SLP implementations difficult if not impossible.  In other words, the SLPv2 security specification does a great job at solving most SLP security problems from a protocol perspective, but in most applications, it creates a configuration and management nighmare that challenges the fundamental SLP usability claim"
"Using this protocol, computers using the [network] need little or no static configuration of network services for network based applications."  -- RFC 2608 (abstract)
SLPv2 uses public key cryptography to generate signatures that ensure integrity of SLP messages.    Authenticity of SLP message signatures is established by the relationship of SPI and keys -- unfortunately this is a relationship that has to be established manually or by some other trusted PKI framework.   Another unfortunate reality is that there are no standards for PKI frameworks to which SLP protocol implementors can write nor are there any standard for manual configuration.   The result is that none of the secure SLPv2 security implementations are interoperable from a security configuration or management standpoint.  With out security configuration and management standards, software developers have a difficult time writing management software and System administrators are stuck with the prospect of having to manually configure key distibution and SPI configuration.

Finally, very little information is given in RFC 2608 or in RFC 2614 (especially) to educates developers of SLP software about the subelties of SLP security and how SLP must be used in order to be secure.  It turns out that there many things that developers can do to write software that is resistant to SLP related attacks that do not require use of SLPv2 protocol security features.   As discussed later in this document, it may be possible for educated developers to write acceptibly secure SLP enabled software that does not require any security configuration or management overhead.

Limiting SLP Security Requirements

Most Internet security problems are approached with the assumption that no one is trustworthy and that no one is trackable or accountable.  This is probably not an appropriate approach to SLP security because SLP is not intended for the Internet.
SLP is intended to function within networks under cooperative  administrative control.  Such networks permit a policy to be  implemented regarding security, multicast routing and organization of services and clients into goups which are not be feasible on the scale of the Internet as a whole. -- RFC 2608 (section 1.1 Applicability Statement)
In approaching the SLP security problem, one should continue to assume that no one is trustworthy, however, it SHOULD NOT be assumed that no one is accountable or trackable.  In fact, in "networks under cooperative administrative control" it is very easy track and confront individuals that corrupt otherwise insecure systems as long as it can be identified that a corruption has been attempted or has occured.  Because they can be held accountable, fear of consequences keep otherwise untrustworthy individuals in line.

SLPv2 security as described by RFC 2608 supplies, at the protocol level , everything that is needed to ensure that service location information was sent by a trusted entity (authentication) and that the information was not changed in
transit (integrity).  At the application level, this means that an application developer (probably using the SLP API) can trust *all* SLP delivered information.   This allows the developer to be more relaxed about how service specific communication is performed.

Blind trust of SLP deliverd information (URLs, etc) is especially significant in common situations where confidential information (username and password) are exchanged with an entity authenticated only by the fact that it was
located via secure SLP.  For example, LDAP enabled software uses SLP to locate an LDAP directory.  If SLP information is secure, the username and password to establish a connection with the LDAP directory can be sent with out having to use any other method to establish the identity of LDAP directory.  However, with LDAP (and many other protocols)  is is now possible to establish the identity of both the "server" and "client" nodes without trusting the service location method.    In fact, for any SSL or equivilant transport it is crucial to cyptographically establish the identity of the "other side" in a way that is seperate from the URL that was used to initiate the connection.  

As expressed in SLPv2 Security - Is it worth the pain ,  SLPv2 security does not really do much protect confidential data and resources unless the service-specific protocols are secure.   Why would it be useful to have a secure location mechanism if protocol being use to actually control confidential data and resources can be easilly compromised?   If  SLP security is not interest to anyone unless they use SLP in conjunction with some other secure protocol.  then SLP security is only valuable if it can be used without disrupting the operation already secure software.
 

Security by Fear

 

 

Under heavy attack, secure software ultimately has one alternative, it can stop working rather than give access to confidental data and resources.   Ignoring requests for services turns out to be only alternata

Continuing the LDAP example from above, it is possible to write a secure LDAP enabled "client" application that uses "insecure" SLP to discover the LDAP server.  The client would locate URLs for *all* LDAP services using SLP.
The client would try to establish an SSL connection with each of the discovered LDAP servers until an LDAP server that comes to an LDAP server that is trusted.  If SLP finds an LDAP servers that is not trusted it should
display a warning message (thus helping to track down the rogue or misconfigured LDAP server).  In this example above there is one no chance for security compromise in the LDAP application due to it's use of SLP.  There is, however a chance that  "suppresion attacks" could burdon the application.
 

SLP Security Attacks

As mentioned in the previous section, the use of secure service specific protocols/frameworks in an environment "under cooperative administrative control" greatly reduces the scope of the SLP security problem.   Instead of having to ensure that every bit of SLP information is delivered with authenticity and integrity, it could be argued that SLP only has to worry about a those portions SLP delivered information that can be subverted with out alerting the system administrator.  However, since the system administrators can't be expected to be constantly vigilant or timely in their response to alerts, it is also important that SLP enabled software be still be written in a way that does not compromize confidental data or resources when under attack.

Since SLP controlled information is publically available, most SLP security attacks are calculated to compromize information and resources controlled by service-specific protocols than information that is controlled by SLP itself.  There are two categories of SLP attack: impersonation attacks, and disruption attacks.   Impersonation attacks involve manipulation of SLP in order trick SLP enabled software into using rogue service.   The ultimate goal of impersonation attacks is to obtain confidential information.   Disruption attacks involve manipulations of SLP in order to disrupt or halt normal operation of SLP enabled software with the ultimate goal of making life hard for the system adminstrator.

If SLP enabled software uses secure service-specific protocols, impersonation attacks have almost no chance of being successful.  SLP related disruption attacks, on the other hand, have a very good chance of being successful.  The following table is a list of disruption attacks that could be directed at SLP enabled software:
 
Attack Description
Unauthorized Directory Agent An unauthorized directory agent could be installed on the network with the intention of sending incorrect information to UAs.   A malicious DA could disrupt the operation of SLP enabled applications by returning unauthorized service URLs, by returning unauthorized attributes, or by simply not returning any results at all.  Since UAs are required to use a DA if it exists, it is possible that it might attach to the unauthorized DA and receive service URLs that point to rogue services,  receive attributes that disrupt normal operation, or  not receive any service location information at all
Unauthorized Service Agent An unauthorized service agent could be installed on the network with the intention of duplicating a registrations made by authorized SAs.  In environments involving DAs, unauthorized SA would cause the unauthorized registration, deregistration, and registration problems described below.   In a multicast environments an unauthorized SA could  cause duplicate replies to be sent to service, attribute and service type requests.   Duplicate replies may cause problems when several differing attributes lists are returned for the same service URL.   UAs would be unable to tell which attributes are really valid.
Unauthorized Registrations with DA Contacting the DA to register many bogus services of the same service-type as a valid service.  Even SLP enabled applications that rely on service specific security protocols (SSL, etc) would take a long time to connect to a valid service as  it would probably have to iterate through a  lot of bogus services before it found a valid one.
Unauthorized Deregistration with DA Contacting the DA to de-registering valid registrations so that they can not be found by UAs.
Unauthorized Reregistration with DA Contacting the DA to replacing an existing registration with a new registration with modified attributes. 
Man-in-the-middle Modification  Contacting the DA to register many bogus services of the same service-type as a valid service.  Even SLP enabled applications that rely on service specific security protocols (SSL, etc) would take a long time to connect to a valid service as  it would probably have to iterate through a  lot of bogus services before it found a valid one.
Man-in-the-middle Replay "transport-time" retransmission of SLP registration, or reply messages that were previously "sniffed" from the network.
Man-in-the-middle Scrambling Blind "transport-time" modification of messages that makes them invalid so that they will be rejected by the valid SLP implementations.

Preventing Disruption Attacks

 

 
 

There are several approaches to solving security problems.  The first approach is to use SLPv2 security as specified by RFC 2608 and deal with the associated manual configuration and management overhead.  The second approach is to use custom security extensions to the SLPv2 protocol  which may or may not be interoperable with other SLP software.  The third approach would be to not use any SLP security enhancements at all.
 
 

Though provisions for security have been designed into the SLPv2 protocol, security is not a mandatory feature.   The following table presents the vulnerability of SLPv2 to attack:
 
Attack SLPv2 with RFC2608 security SLPv2 with SSRTI-SLPv2 SLPv2 with out security
Unauthorized Directory Agent PREVENTABLE DETECTABLE DETECTABLE
Unauthorized Service Agent PREVENTABLE DETECTABLE DETECTABLE
Unauthorized Registrations with DA PREVENTABLE PREVENTABLE DETECTABLE
Unauthorized Deregistration with DA PREVENTABLE PREVENTABLE VULNERABLE
Unauthorized Reregistration with DA PREVENTABLE PREVENTABLE VULNERABLE
Man-in-the-middle Modification PREVENTABLE VULNERABLE VULNERABLE
Man-in-the-middle Replay DETERRABLE PREVENTABLE VULNERABLE
Man-in-the-middle Scrambling VULNERABLE VULNERABLE VULNERABLE

PREVENTABLE - Attack can be prevented entirely.
DETECTABLE - Attack can not be prevented, but can be detected by appropriately written SLP software
DETERRABLE - Attack can not be detected or entirely prevented, but it can be deterred
VULNERABLE - Attack can not be prevented, deterred or detected
 
 
  openslp-1.2.1/doc/html/0000755033442200000310000000000010211377554014576 5ustar rganesanfloppyopenslp-1.2.1/doc/html/UsersGuide/0000755033442200000310000000000010211377554016655 5ustar rganesanfloppyopenslp-1.2.1/doc/html/UsersGuide/WhoShouldRead.html0000644033442200000310000000263507142533111022251 0ustar rganesanfloppy OpenSLP Users Guide - Who should read this guide

Who should read this guide


Often there are significant differences between the behavior of implementations of standardized protocols.  OpenSLP is no different.  Every attempt has been made to follow the specification from the IETF RFCs, but there still may be subtle differences between OpenSLP and other SLP implementations.  To be informed, even experienced users of SLP should read this guide.

Note: This guide deals with concepts that are specific to using OpenSLP.  If you are looking for an overview of the SLP protocol itself, you should read "An Introduction to SLP" or review the SLP RFCs (2608, 2609, 2614).  If you are a developer, you should probably read the OpenSLP Programmers Guide.
  openslp-1.2.1/doc/html/UsersGuide/SlpReg.html0000644033442200000310000001463407253065671020755 0ustar rganesanfloppy OpenSLP - Static Registration File

The Static Registration File


Often it will be very useful for OpenSLP users to be able to statically register legacy services (applications that were not compiled to use the SLP library).  To accommodate this need RFC 2614 specifies a syntax for a registration file that is read by the OpenSLP daemon (slpd).  All of the registrations from the registration file are maintained by slpd and will remain registered as long as slpd is alive.  The default location for the registration can be changed from /etc/slp.reg to another location using the -r command line option.  slpd reads the slp.reg file on startup and re-reads it when ever the SIGHUP signal is received.

Syntax

The registration file format is pretty easy to understand.  It can get complicated so if you have any questions after reading this please consult RFC 2614. Each registration consists of several lines with the following format:
 
#comment
;comment
service-url,language-tag,lifetime,[service-type]<newline>
"scopes="[scope-list]<newline>
[attrid]"="val1<newline>
[attrid]"="val1,val2,val3<newline>
<newline>


service-url

(Required) The service-url which must follow the Service URL syntax explained below.
language-tag
(Required) The language-tag uses the (two character) language tags as specified by RFC 1766 ("en" "fr", "de", etc...)
lifetime
(Required) The lifetime of the registration in seconds.  Value must be between 0 and 65535.  Use 65535 if you want the registration to be maintained for the life of slpd.
service-type
(Optional) The type of service being registered.  Ignored by OpenSLP because service-url must conform to the SLP Service URL format.
scope-list
(Optional) List of comma delimited scopes to register the service in.  If omitted then service is registered in all scopes specified by the slp.conf file.
attrs
(Optional) The attributes to register along with the service.  Any string but "scopes" or "SCOPES" can be used as an attrid.  Note that the '"' character has no real significance.  Strings should not be quoted!

Examples

Several examples of registration entries are provided below:
 
#Register a OpenSLP testing service
service:test.openslp://192.168.100.1,en,65535
scopes=test1,test2
description=OpenSLP Testing Service
authors=mpeterson,jcarey

#Register ssh service
service:ssh.openslp://192.168.100.1,en,65535
#use default scopes
description=Secure Shell

#Register telnet service with no attributes
service:telnet.myorg://192.168.100.1,en,65535
#use default scopes

Service URL Syntax

If you decide to use Service URLs extensively, you should probably read RFC 2609, but if you just want to know what they look like, the following explanation should be good enough:
service-url = "service:"<service-type>"://"<addrspec>
The service-type is a service type as explained below. addrspec can be just about anything you want that fits URL syntax (see RFC 2396) and can be translated as a network location.  The "service:" and "://" strings are required.

Service URL Examples

service:weather.nasa:wtp://weather.nasa.com:12000
service:weather.nasa:swtp://weather.nasa.com:12001
service:chat.superchat://chat.superchat.com;auth=ldap
 

SLP Service Type Syntax

The official definition of Service Type strings can be found in RFC 2609, "Service Templates and Service Schemes".  If you will be working with "well known" (IANA) service types, you should read it.  If you are developing applications for "proprietary" services then you will probably be satisfied with the following explanation:

      service-type = <abstract-type.naming-authority>":"<concrete-type>

The abstract-type is simple (hopefully short) descriptive string that describes the type of service.  The naming-authority is the name (hopefully unique) name of the organization that named the service.  The naming-authority is optional, but if it is omitted then IANA is assumed to be the naming authority and IANA requires service-types to be registered (see RFC 2609).  The concrete-type is also optional.  Think of a concrete-type as a kind of sub-type of the abstract-type.  For example, "printer" is an abstract type (owned by IANA) and "printer:lpr" is a concrete type (owned by IANA).

Service Type Examples

weather.nasa:wtp  - A (fictitious) weather service type owned by NASA that uses Weather Transfer protocol
weather.nasa:swtp - A (fictitious) weather service type owned by NASA that uses Simple Weather Transfer protocol.
chat.superchat - A chat service type owned by SuperChat
printer.samba - A samba printer service type
ftp - An IANA ftp service type
telnet - An IANA telnet service type
  openslp-1.2.1/doc/html/UsersGuide/UserFAQ.html0000644033442200000310000000105407142533111021001 0ustar rganesanfloppy OpenSLP Users Guide - User FAQ

OpenSLP User FAQ


<Put faq here as it is generated on mailing lists and email> openslp-1.2.1/doc/html/UsersGuide/Optimization.html0000644033442200000310000000136507142533111022226 0ustar rganesanfloppy OpenSLP Users Guide - Tuning and Optimizing

Tuning and Optimizing OpenSLP



 

Reducing Processor and Memory Usage

<Put tips here>
 

Reducing Multicast Traffic

<Put tips here>
 

Speed Up Service Requests

<Put tips here>
 
 
  openslp-1.2.1/doc/html/UsersGuide/CommandLine.html0000644033442200000310000000341407253065671021741 0ustar rganesanfloppy OpenSLP Users Guide - Command Line Options

Command Line Options


Currently the OpenSLP daemon (slpd) accepts several useful command line options.
 

Command Line

slpd [-d] [-c configfile] [-r registrationfile] [-l logfile] [-p pidfile]

Options

[-d]
Don't detach from the controlling tty.
[-c configfile]
Use configfile as the file slpd reads to obtain configuration information, rather than the default, /etc/slp.conf.  See Modifying the slp.conf configuration file for details.
[-r registrationfile]
Use registrationfile as the file that slpd reads to obtain static registrations, rather than the default, /etc/slp.reg.  See Creating a registration file for details.
[-l logfile]
Use logfile as the file that slpd reads to write log messages, rather than the default, /var/log/slpd.log.
[-p pidfile]
Use pidfile as the file that holds the slpd process id, rather than the default, /var/run/slpd.pid.
 
openslp-1.2.1/doc/html/UsersGuide/index.html0000644033442200000310000000311507242421242020644 0ustar rganesanfloppy OpenSLP Users Guide  


Users Guide


Introduction

Who should read this guide?

Installation

Installing OpenSLP on Linux
What did you do to my machine?

Configuration

Command line options
Modifying the slp.conf configuration file
Creating a static registration file

Advanced Topics

When to run slpd
Tuning and optimizing OpenSLP
Security

Frequently Asked Questions

FAQ sorted by topic



Prepared by: Caldera Systems Inc
 
  openslp-1.2.1/doc/html/UsersGuide/smalllogo.jpg0000644033442200000310000001243307075720153021354 0ustar rganesanfloppyÿØÿàJFIFHHÿþCreated with The GIMPÿÛC    $.' ",#(7),01444'9=82<.342ÿÛC  2!!22222222222222222222222222222222222222222222222222ÿÀj="ÿÄÿÄD !1AQaq"2‘¡±Áá#BbrÑ%3Rs’Âð$4CDSt²ÒñÿÄÿÄ!!1A"QÿÚ ?¿ÑXÊ@2™^KƒFIÂùÁU LM’Y#2Ã}è¶P•òž¡”ÐÉ4® Ž6—8ž€sZöªç\­ÐÖ:#˜j '$ œgÇ@z¸MQOC4”Ñ fkIdyƣܢvî-¬m£ÜեóÐèÉï§úÝL§xŽ'ÈFÍn¯‚§«®×ÖKV2×Ô;^üšÎ@‡ÕQ%&Ò‰êñÔ—>‹‘®Ï]׬•UÚnu”÷H$¦uLÒ–·¾¦S¥ÙäßoŒã²’Pq=Êç3¢·Ò2­¬v3Zcˆxk'sü!Ø\YuG› ¬­6VÇ/lÀàŽÍÜüñ¿šÜ…¡Àˆˆ" ˆ€""ˆ°€Ê,eeDDD@DDD@‚´j.QÇ'eL³e½Æó\úh™ 'õó7Àw¨çÍ÷7 Èêz—ÇV\Ý.c°dv}œï¶2¢R¢”N½Ö®º–Ù=I1kc l:Ãð.<•Ymâ˜-µ:èkae<™8íÚZÜ~É#ð8ÎØZfxê_-MôI9ë Œ†?9õ¸hØn3œî±OV&žFÄ韡„Fé°å¶p:ŽXé•~<ã;9•p&|M{†ç‘¶žªGz\ÍñûZpCŽã¦ß5.¶×ºŽÝGLE¬°5íÜcT…²È&‹Tëp•ñ4d´ƒŒŒoû*Fî$¹WGª68NÁ¨>&îý äcÙÇ_†Ë^¢Lr'Ù8¾qeª7Æž«@sb†¸Œ—à€6<Ô;uâò×Ü¢¥Àöåk£kKZHÃ@Ç,uÆ|VíŽÏ5Æ'Üýg’ÉXÐH <ýoíõðè¥ÜO,Œá¹ýŽ:´5ÚN\5rðʵ‘A\{)Aɨ¿¥sO¹YÛlˆöÕÖ6)Ú¾v;í·53¶Ü*øxÍn¼†6–µ”µ €GÇ\–ú¬éÏ ‰a¡5µrURFâi'‚LTœ7ëŒþ«i„Ís=f°8µÎÚAÛ¨?ŠÃÿO¶m(IÁ|>pœ¸gtO#=”¾¸ÇÎã—#…ÓntŒóðZCê¶9a °´má·B·%©€DDD@‚p2W6Kƒç™ÑQ³YnÅç^o•†žˆ1‡™Ú‡zâß+%µÙ#§¢peDîlM~3¤Ë½À{¢â¾›µ·J kÃ.—Èiäw&:@ß’õE_AsÏÝ·¨êç¢@üy€vPê8©¨Ë™Me~òJã—¼÷¸ó+jªÞ'kgžì•»=‡ÀÂå:³¶º%Ò×ÔP¹­¨,;Ùp8+Q—Ø/dû½3ø/xå±\ …k¥žÚé$ÖöÓ<Ÿ–Œü—ÖX)ªí®šXšücÕxoæ¥7ÙÖ‘+Ín3é1cËò\º®!‚–AïfrðÆÂ×4¼¸œcÖL¥œ4KN¥8=Þª†ÐÍ °QÓSÆÀbi%­Á+·}¤‹B’£Ò)Ù!ظnÜŠãÚ{Nɹ]Ž‹DfG~‰µ)n””ÒêÅ+€$gßšè´Ö¹¡Â®àãòZ7›5£žbÌàhpi>Ex´Eg†6Ö4ÖŽ@g`³¶iônMU4õ·hÿˆ€½G%\­޶ƒÈ€7ù*Æ(mñ \Ûiešxõ>GÆâvêBëGlŽ º[E0Ü> âb<×wØ¥Ñ85óÒ8 ¸Áaý¶.œr²V±ÙiÜÁ†£ïK^í#7ðrѰ]òÖÆóí ž]énŽJ:´KÑycƒÚ^–„D@CßSé\MRârÚq¡£åõQî0”TÖÁœ4à ¤Ý¡Øq8Àõ£®ùti;‰O_Þ+Ä•®dçi kG¹ÎþkÍ{6øjC喝ISJÉ,n×Ù³8uÛߟrᲂ•ÒDí¥Ž¯ÔrÒ;²­Î…­£i¢Œ}¡Çl‚­¬·@ãu•ä=¬iò6$r'~ËeùÑçÈœ·gÉ—H@æWg‡á’ äOã%ŽÐ0NGÖ'ÈeçžÕú³üYÊê¶qÒ'Žžénok_¤ÄÝË7ÂîYïP]`.hÑ+}¸Éåù*öÉzªŽ¥ÖúÙ÷·%޵·CÞ¼TÝßd½™éÈFÓ}¾»®ÆUÙÇÉåÖþÊ9ý–3QVvÐ97Íp®oEsMæøÊG¿vÁîÇü×2ßYè–¹kžK§‘®‘Î<ð£Ö©iùj«æ¢S©äÜ|û‡ ““ 4Mi+=635¢øéË9µÝýÄ^ð¶£âÉ£a‚zPê°àѾPÈk ¥¾Á%,Í{껡è}û­ž$¡ÐËœkËþ¾+œšz;I­“Uß*N$lëÜ>«œÚÛŒWYhi*ä™Á£Sä õQ« ÛEw–(å{šbÉÔ÷yDžõóâ´Ï­}2:Ðgtg”ôæ—zrb’DØSÈì‡]ê/]'o‚ù>ãr³¸Héý*›8!Üǽ@YiŠ_L¥f‰ë³!ÃÇ=T’šän6Û8–¸øŽ¿Š6ÐTÎçÜ"ž‚‚®#˜Üâ|¶ä±v§7XŒNñ¿´gŽÄ} YgûâÍ- œõÆOCŽ_U¯îãÃïô:êWÉ}À{GpÎÎõÙ_g´tèœËuY5‘HÑŸì©8»Xë)]Nú ÍC³HÇ¿ )ÛÜI<÷¶XœÓ j+®äÒb4³Ž¥˜ÏÉsØÖŽñFô|+HÉUK;&í9¹ûò¾÷ OC°LqŒýBŽÕI%¥Þ›n•Ì #[ ÈÇârñzŠåÀ¯¬ s‹›ÜíC!R’i¤KM4Ï£¦Ï ;þÔÿ⢶¬Kw„Ÿúm]?MÏã?ò¿å\^—µ¹Fîæ€¹Û;>‹n°7Ëe|)?¨o’û­ÌŽ}ñÚl•gº2¸©³j‹~…v¸‘ýŸW»º"¡–šï蘷ý“õXätÍ ´pè–¦ÞHÀú)µÖªššÐ)ÚZê‰@kX9]Ð\èa…¢´TiÒ4ºê#Ì·ãâ‹]×CAWQ7GÊ4þ,} ç±¥EqÝ’éëYe°ºIHÔÆlÞ®qäß<•´T=•ô°gÖdc_žË-MÆñPʺÏe‡1Dßa‡¿÷ŠpÍ¢GUvò’s•P_I“ÑbÑ8º¹î[+å;8€ð_U©˜DXÊ•»ÎûOÜ)ŸÙ­ž!À8.oTÇCs˜Î“äqü‚›ý¦ðô•”ÐÞi{zQ‰tŒ’·Ü~¾ C<JGG LbHóó Å’ã+7ƒ´O¸>ïF-1TKQQ‘ÍîÀÊäßïOâMÚß™¶Ò0jÔA峚Ñϯr…GNû5H>jL’Ç5Äh'bFvÇ=QϵUÁ§¸{'jcd~’Ó¿'úžñà­æo¢8QaÏÇÖXØÏF—·‘Äiaý¬¸q WÞ/}m0x‚(šÖ‡ tîïÉ?¨Û°† ’j׳³8ÝÁØ·Z1ØéöµÓzÚs¾|Or™årTTcôó~ºšø)˜sÙ‚O™ü—ÖÓTiî³G¿ªÏäµìÖ™ª'ô‰sä9õñ[Í¥ìx¦¶2=– ]’¨XNåF\棈ÝϬôV· Û#4.ÙUw ié.ͯÄ1ËË*kCö‰n ¶ÍUŒ6-8ñ+LY#ÇdÎ-³›ÅòCIÇÇOÌBÓ ø?‚ŒqÓ´¸ÆÌÿW¼þKï=[ÙWQxº¿5µD–D9ŸwAŒϦµÔ\ ©¬{I{²[ާÃÈl²¾RmÒ$Bå¢Ìf$`·%Ãoì,ÔÎ?ºòв½•4‹·tcK‡xèµ)£}†ã™£séœvs{»ÔŦêG_Va·Ê€C£°ÆAË¿õX©®¼] l𯯻P§ž1Ìù©ƒøªÃ toši±´MŒƒŸv\˜øšVÜ 7 ¢¥™Ûnu5¹çãðZÔì‹“øhQU:žÿ4n'Sbüµëj=#ˆDdûA¿E½1¥«ã*騤Ó9ƒCÀ ›øås«4ÁÄm‘çKZsîPŸì¦¿%“KE8R¾M9-¤‘ÃÜÒ¡‹sæå?¢ž*ž ¸¾öz$£-?¸Uuf‡6~]\¯;èœhóÃ7¨m±ÉUP\#a™=ÁOí\OdâÙ¾ìt6bÒZÉØ0ì ð{ÕFÀ>ïtYõÌ€î*A ÓX¸††ñغX¢ku|#àžÊ¤w“k‡S¹Î0°³øIQ;ß ÕZ)Ýq…Çõ;—rsGx*Æ£ãΫƒ[«Ù ±’ÉZZGËrŠq‡Á|¦6{# ­”ŽÖrÒÑ€y ýV“p¢+8bîjlo’S¹…Áß©ItwèUl$œv­?6­K«ÙKG®®\!æ³$,¤°IO#ÀšBÒÔî ú,1½6i/ˆë2¼ýÆÑ“þïþUŽ—µªñÇÑym9m”"Ÿü«K…n”¶™Cª\àÜçÕnS —-œšÖ‹ê”â¨×ñÝ»†ë™G4SO;™¬² =Q¿<Ÿ ß´ÛQVò;¢Æ~%@ëëïˆnW­2 Â#×± Åo<©-_eWÄô\GÀWzÊ0ö¢sdŽLjiÀ* j¸º¡ò?Uóáû­Þh§œ6ª¯!‘à’}Qø“ðKTÑPäsê°Ë;£H*4¸e±ÖÕè‘à0ନxf“C_$-v9†ªË…ê©íõåÕ2Ú\7!^Ö©!¨¡ŽhžÙ#pÙÍ9z1ÓFr´Î <:ð^>JAGC3 ­Àè²´ „D@åíaiƒÌYq7ÙÛ›Pk¬ìœö9ÆîŸÀ«=ys† ™EIlêm3îkkŒ5ÔBN„¸h'ê ×}Òþ³¬€»ûÀÉ]õ–ˆjAËBâÉÂÑå¬ܰ~:ÿM=…]EÖ¬vvêéZvÌmÔÄpé[xKKûzצvå¹ÎO‰ê¬H¬æºTöxã9!\p¥Ù.m‘û=‡½¾[(­|!œwth “U¸È›À ®¸3_F©òäî>ÈõÂïUCs–âŠHš³‰iû­g^k§õih!ŠGmÚ\!…÷ºÀ$¿ÊÃÈèú)½“‡Y%3]Ž‹ÉãÒ@Püuþö2—’éFó©Ö@]ýàä½Ç=Ö¸môŒ¤ŒìLC'üD¤þˆ<¹­ܾÑpþ9®/}cØWÖžÎL{YÉÏx¼ž¥y¼Øî”wFÔÓÛSÁ§-.û•«MgŽ,WHBÖ·ajñ§$©;²‹š§ˆ!–Œ½‡âµÛt¹“@¦yþ?tWZ#«'PÎW=¼/ C@÷,ÿž%{V ߥ²sOò^**ïUTòBúF±§ v@*ÚýgrÇèäg¢ïóÄ{PSÓWÓV¶L㾩]‚Û}UþT1± mú§>jÞ§²ÇØ/56FOÌ'ó¡ìe+,õµ ‘Ž·Ó¼]±à{Õ¯Àlš‹‡¡¦œ¼9ÎÒy€NËf>…Ôºô–ñOÉT1(»9)Ú7ÁÈYXej@DDD@ˆZ}¬ñ%ÂÁAor¾ê${e‘œÆÀϼü]MÆÍ§¨’¢J¹&™ãÎaÊýq´[îôÆžãG T'}°8(ÅgÙß –‘†…§Â ³ž>EFTR5|Y MI¨ô‡1ä þ¬ôV—ÙþªñAZ*Is ‘­äsÈ9OŠó/Ù•œË–Û)Ú;ƒ®Á`‚Í`¥‚8#:X܆>,9Z$Ã’ÊòÁ†¯KBB" 1”DD@ŒäÀîYDD@DDD@DDD@X k(€ó¡½Ád4‹(€""ˆˆ" ˆ€""ˆˆ" ˆ€""ˆˆ" ˆ€""ˆˆÿÙopenslp-1.2.1/doc/html/UsersGuide/FileLocations.html0000644033442200000310000000314107253065671022303 0ustar rganesanfloppy OpenSLP Users Guide - What did you do to my machine?

What did you do to my machine?


Most system administrators, at least the good ones, want to know exactly what is being done by installation scripts especially if the script was executed with root privileges.  The following is a list of file copies and modifications that are made by the installation script:
 

Daemon, Libraries and Config files

<dist dir>/slpd/slpd         ==>  /usr/sbin/slpd
<dist dir>/libslp/libslp.so  ==>  /usr/lib/libslp.so
<dist dir>/libslp/libslp.a   ==>  /usr/lib/libslp.a
<dist dir>/etc/slp.conf      ==>  /etc/slp.conf
<dist dir>/etc/slp.reg       ==>  /etc/slp.reg
 

Documentation

<dist dir>/doc/*             ==>  /usr/doc/openslp-x.x.x (/usr/share/doc/openslp-doc for Debian GNU/Linux)
 

Tools, Utilities and Samples

None Yet
  openslp-1.2.1/doc/html/UsersGuide/Installation.html0000644033442200000310000002266307331336524022216 0ustar rganesanfloppy OpenSLP Users Guide - Installing OpenSLP on Linux

Installing OpenSLP on Linux


Installation

Installing the latest distribution of OpenSLP is easy.  Pay attention to the following steps and you should not have any problems.
 
  • RPM Installation
    • Download the latest RPM file from www.openslp.org. Select the appropriate distribution.
    • Become root (root is usually the only user that can install packages).
    • Install the package. This is typically done with:
      • rpm -Uvh openslp-x.x.x.rpm
    • Make any configuration changes to the /etc/slp.conf file that you think you need. (see Configuration for details)
    • Set up static registrations in the /etc/slp.reg file if you need them. (see Static Registrations for details)
    • Start the OpenSLP daemon.
      • /usr/sbin/slpd
  • Tarball Installation
    • Download the latest tarball(.tar.gz) file from www.openslp.org
    • Unzip and untar the file into an appropriate directory.
      • tar -zxf openslp-x.x.x.tar.gz
    • Become root (root is usually the only user that can install daemons and libraries).
      • su root
    • Enter the extracted openslp directory build and install the OpenSLP binaries:
      • ./configure
        make
        make install
    • Make any configuration changes to the /etc/slp.conf file that you think you need. (see Configuration for details).
    • Set up static registrations in the /etc/slp.reg file if you need them. (see Static Registrations for details).
    • Start the OpenSLP daemon.
      • /usr/sbin/slpd
  • Make slpd start on boot:
    • You may want to make a few changes to your Linux initialization scripts so that slpd will start when your machine is booted.  Since it is not always necessary to have slpd running, you should probably read about when (and why) the OpenSLP daemon has to run in the Advanced Topics section before deciding to changing your init scripts.
  • Remove the distribution directory from your system.
    • Unless you will be doing OpenSLP development work, you will probably want to remove the distribution directory from your system after OpenSLP is installed.  The distribution directory is the one that was created by the tar -zxf openslp-x.x.x.tar.gz command.  During installation, all of the important files were copied out of this directory to the appropriate places on you machines file system so it can be deleted with out breaking your installation of OpenSLP.
  • Add multicast or broadcast routes if necessary.
    • Some operating systems (like Linux) require a route to be set so that the host knows which interface should be used to send multicast and general broadcast traffic.  Most of the time, the default route will be sufficient.

      # route -n
      Kernel IP routing table
      Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
      192.168.100.2   0.0.0.0         255.255.255.0   U     0      0        0 eth0
      127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
      0.0.0.0         216.250.131.254 0.0.0.0         UG    0      0        0 eth0

      With the routing table above all multicast and general broadcast will be sent on eth0  (the 0.0.0.0 route is the default route.)

      If you do not have a default route or you have a multi-homed host, you will have specify which interface should be used.   The following is an example of a routing table from a multihomed host:

      # route -n
      Kernel IP routing table
      Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
      192.168.131.0   0.0.0.0         255.255.255.0   U     0      0        0 eth1
      216.250.131.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
      127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
      0.0.0.0         216.250.131.254 0.0.0.0         UG    1      0        0 eth0

      Notice the default route?  This means that multicast traffic will be sent to eth0.   If I don't want multicast traffic to be sent to eth0 I will need to add a special route.

      # route add -net 224.0.0.0 netmask 240.0.0.0 dev eth1
      # route -n
      Kernel IP routing table
      Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
      192.168.131.0   0.0.0.0         255.255.255.0   U     0      0        0 eth1
      216.250.131.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
      127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
      224.0.0.0       0.0.0.0         240.0.0.0       U     0      0        0 eth1
      0.0.0.0         216.250.131.254 0.0.0.0         UG    1      0        0 eth0

      Now multicast will be sent on eth1 not eth0.

      To my knowledge, there is no way to send  multicast traffic both eth1 and eth0 (at least with Linux) without specialized routing software.    Some multihomed machines have NICs that are attached to the same network.  In this case, there is usually no need to send multicast on both NICs.   If you need specialized routing software take a look at mrouted.
       

  • Testing to see if your installation of OpenSLP works.
    • The OpenSLP distribution contains a handy command line tool that allows you to perform most SLP functions from the command line.  The tool is called slptool and is built and installed by the OpenSLP make files.  Look for SLP tool in /usr/bin, /usr/local/bin, or <openslp_source_dir>/slptool/.   After you have started slpd, you should be able to issue a query for SLP service agents using the following command line.

      $ slptool findsrvs service:service-agent

      The results of this command should be a list of the hosts that are running slpd.  This indicates that OpenSLP is successfully installed and working.  If you do not get any output, then OpenSLP is not installed correctly or is not working.   If this happens, please double check that you followed build and installation instructions, and read the FAQ.  If this does not help, post to the openslp-users mailing list with as much detail as you can provide.

openslp-1.2.1/doc/html/UsersGuide/WhenToRunSlpd.html0000644033442200000310000000510407253065671022265 0ustar rganesanfloppy OpenSLP Users Guide - When To Run slpd

When To Run slpd


slpd provides SA (and possibly DA) functionality along with the ability to maintain a consistent state with respect to the locations of other SLP agents on the network.  The SLP library (libslp.so) provides UA functionality internally on a per process basis with out the need to communicate with slpd. This means that in certain cases, the slp daemon does not always have to be loaded on every machine.  We're not sure if this will be a valuable feature to a majority of users, but at least it offers the additional flexibility to minimize the overhead for SLP for those machines that will only need UA capabilities.  (If you're wondering about the meaning of DA, SA, and UA, you should probably read An Introduction to SLP).
 

When is slpd needed?

  • slpd must be running on all machines that will be registering services.  In other words, slpd is required on all machines that run applications that make calls to one of the following SLP APIs SLPReg(), SLPDeReg(), or SLPDelAttrs().  See the OpenSLP Programmers Guide for details.
  • slpd is the process that maintains static registrations from the /etc/slp.reg file.  If you expect the registrations for this file to be available to other machines, you must run slpd.
  • slpd is required for automatic DA and scope discovery to work correctly.  If you do not run slpd, then DAs and scopes can only be discovered via DHCP or the /etc/slp.conf file. (Note: Due to a lack of a standard DHCP API DA discovery via DHCP is not yet supported).

When is slpd not needed?

  • slpd is not needed if a machine will only be requesting services.  In other words, slpd is not required on machines if a call will never be made to SLPReg(), SLPDeReg(), or SLPDelAttrs().
  • slpd is not needed on a machine if manual or DHCP DA or scope discovery is sufficient.
openslp-1.2.1/doc/html/UsersGuide/Security.html0000644033442200000310000000646407347736373021402 0ustar rganesanfloppy OpenSLP Users Guide - Security

Security


Protecting the daemon against attacks

The following measures have been taken to protect the OpenSLP daemon from attacks:
  • The OpenSLP daemon (slpd) must run as root initially in order to bind to the well known SLP port.  However, slpd will relinquish root privileges and suid() to the daemon user (if it exists).
  • If slpd includes paranoid SLP message checking code .  This slows down the operation of slpd slightly but ensures that malformed or intentionally malicious SLP messages will not cause segmentation faults in the daemon.

Protecting the integrity of service registrations

As of version 0.9.0, OpenSLP fully supports the SLPv2 message authentication blocks to ensure that registrations can not be modified in transit and that they are sent to and received from valid agents.   When properly installed and configured, OpenSLP will automatically provide this level of security to all SLP enabled applications with out any need to recompile or relink.   Installation of secure OpenSLP is a little involved...

Currently, OpenSLP uses DSS signatures to ensure the authenticity and integrity of certain SLP messages.  In order to do this, administrators need to: build a security enabled OpenSLP, provide  (or generate) a DSA  public and private keys, and setup the /etc/slp.spi file.   The administrator also has to ensure that OpenSSL crypto libraries are properly installed before secure OpenSLP will work.

Step 1:   Since we not sure how many installations will require OpenSLP security so the security features  are not currently built in by default.  To build a security into open slp OpenSLP you will have to use --enable-security on the ./configure command line

Step 2:  Generate DSA public and private key files in PEM format using the OpenSSL command line.   I'll provide details on exactly how this is done when I get more time in the mean time, you can figure it out by reading the openssl man pages.

Step 3: Copy the private DSA key PEM key file to very safe locations on hosts that will be registering services.  The public DSA key PEM file goes on all hosts that will be registering services and on all hosts that will be finding services.

Step 4: Edit the /etc/slp.spi file to assign an SPI to the DSA keys.  Details on how to do this are documented in the comments of the slp.spi file
 

User Level Access Control

Plans have been made to provide a mechanism that will enforce user level access control that will allow the administrator to specify the users or groups that can register services with SLP.
 

Help

If you find a security hole in OpenSLP,  please bring it to the attention of the OpenSLP maintainer.  Thanks. openslp-1.2.1/doc/html/UsersGuide/SlpConf.html0000644033442200000310000001522507500224344021107 0ustar rganesanfloppy OpenSLP Users Guide - The slp.conf File

The slp.conf File


The slp.conf file contains configuration information that affects the operation of the OpenSLP daemon (slpd) and any application that uses the OpenSLP library.    The master slp.conf file is located at /etc/slp.conf.  There is command line option that forces slpd to read a different configuration file, but the SLP library is hard coded to read from /etc/slp.conf and can only be changed by re-compiling the library.

The OpenSLP slp.conf file diverges slightly from the RFC 2614 specification for the slp configuration file, so you should probably read Divergence from RFC 2614 even if you are familiar with the RFC spec.
 

File Syntax

The slp.conf file syntax is very simple.  OpenSLP follows the syntax specified in RFC 2614 which is simply a list of key/value pairs separated by newlines; comment lines begin with a '#' or a ';'.  A good example file is copied to /etc/slp.conf with the OpenSLP distribution. Take a look at it or read the RFC if you need more details.
 

Settings

The following is a list of settings that are supported by OpenSLP:

net.slp.useScopes

This option is a comma delimited list of strings indicating the only scopes a UA or SA is allowed when making requests or registering or the scopes a DA must support. The default value is "DEFAULT".

net.slp.DAAddresses

Allows administrator to force UA and SA agents to use specific DAs.  If this setting is not used dynamic DA discovery will be used to determine which DAs to use.  Default is to use dynamic DA discovery.
net.slp.isBroadcastOnly
Force broadcasts to be used instead of multicast. This setting is seldom necessary since OpenSLP will automatically use broadcast if multicast is unavailable. Default is false.
net.slp.passiveDADetection
A boolean indicating whether passive DA detection should be used. Default is true.
net.slp.DAActiveDiscoveryInterval
A 16 bit positive integer giving the number of seconds between DA active discovery queries.  Default is 900 seconds (15 minutes).  If the property is set to zero, active discovery is turned off.  This is useful when the DAs available are explicitly restricted to those obtained from DHCP or the net.slp.DAAddresses property.
net.slp.multicastTTL
A positive integer that is less than or equal to 255.  The default is  255.
net.slp.multicastMaximumWait
An integer giving the maximum amount of time (in milliseconds) to perform multicast requests.  Default is 15000 ms or 15 secs.
net.slp.unicastMaximumWait
An integer giving the maximum amount of time (in milliseconds) to perform unicast requests. Default is 15000 ms or 15 secs.
net.slp.randomWaitBound
An integer giving the maximum value for all random wait parameters. Default is 1000 or 1 sec.
net.slp.MTU
A integer giving the network packet MTU in bytes.  Default is 1400 bytes.
net.slp.interfaces
A list of IP address of network interfaces on which the DA/SA should listen for slp requests.  By default, OpenSLP will use all interfaces.
net.slp.securityEnabled
Indicates whether all agents should use authentication blocks.
net.slp.locale
A RFC 1766 Language Tag [6] for the language locale.  Setting this property causes the property value to become the default locale for SLP messages.  Default is "en".  This property is also used for SA and DA configuration.
net.slp.maxResults
A 32 bit integer giving the maximum number of results to accumulate and return for a synchronous request before the timeout, or the maximum number of results to return through a callback if the request results are reported asynchronously.
net.slp.isDA 
A boolean indicating if the SLP server is to act as a DA. If false, not run as a DA. Default is false.
net.slp.DAHeartBeat
A 32 bit integer giving the number of seconds for the DA heartbeat.  Default is 3 hours (10800 seconds).  Ignored if net.slp.isDA is false.
net.slp.DAAttributes (currently ignored)
A comma-separated list of parenthesized attribute/value list pairs that the DA must advertise in DAAdverts.  The property must be in the SLP attribute list wire format, including escapes for reserved characters. [7]

Divergence from RFC 2614

OpenSLP does not support all of the settings that are specified by RFC 2614.  The reasons for not supporting some of the settings range from the implementors' opinions that they are either not useful or very difficult to implement with regard to their usefulness.  The following is a list of options that OpenSLP has no plans to support.

net.slp.serializedRegURL

slpd accepts the [-r] command line parameter that specifies the serialized registration file to use.
net.slp.multicastTimeouts
OpenSLP does not honor this parameter.  Currently multicast timeouts are generated internally based on the net.slp.multicastMaximumWait parameter.
net.slp.DADiscoveryTimeouts
OpenSLP does not honor this parameter.  Currently multicast timeouts are generated internally based on the net.slp.multicastMaximumWait parameter.
net.slp.datagramTimeouts
OpenSLP does not honor this parameter.  Currently unicast timeouts are generated internally based on the net.slp.unicastMaximumWait parameter.

  openslp-1.2.1/doc/html/faq.html0000644033442200000310000002712707361102474016243 0ustar rganesanfloppy OpenSLP FAQ

OpenSLP - Frequently Asked Questions


A really compresensive FAQ is not yet available for OpenSLP so please send
your questions to the OpenSLP mailing lists:

    openslp-devel@lists.sourceforge.net
    openslp-users@lists.sourceforge.net

Q: Where is the configure script to build OpenSLP?
A: Did you read section 3 of the README?  You need to run autogen.sh to
   generate the configure script.

Q: How do I build OpenSLP on Windows?
A: The MSVC project files used by the developers who ported OpenSLP to win32
   available in the source directories.  If you do not use MSVC and you are a
   Windows developer, then you will be used to trying to get MSVC makes to
   work with your tools

Q: Will OpenSLP work on my operating system
A: Yes, the OpenSLP code has proven to be very portable.  It currently works
   many operating systems including: Linux, BSD, Solaris, Tru64, HPUX, UnixWare,
   OSR5, and Win32

Q: I am having trouble discovering attributes using FindAttr() and  "slptool
   findattrs".  The functions seem to execute properly, and the services URL's
   can be discovered, but no attributes are returned.  I am registering
   services in slp.reg files. I don't think it is my syntax in the slp.reg
   file, because the example registrations in that file do not return
   attributes either.  Can anyone help?
A: If you just want to use slptool to see if things are working, you need to
   do the following:

   Contents of the slp.reg:
   ------------------------
   service:myservice1.x://myhost.caldera.com,en,65535
   owner=Matt Peterson
   email=mpeterson@caldera.com

   service:myservice1.x://yourhost.yourdomain.com,en,65535
   owner=Kim Jackson
   email=bjackson@yourhost.yourdomain.com
 

   IMPORTANT: Restart slpd and check the /var/log/slpd.log to ensure that
   there were no errors during parsing of the .reg file

   Use slptool to find attributes
   ------------------------------
   $ slptool findsrvs service:myservice1.x
   service:myservice1.x://myhost.caldera.com.com,65535
   service:myservice1.x://yourhost.yourdomain.com,65535

   $ slptool findattrs service:myservice1.x://myhost.mydomain.com
   (owner=Matt Peterson),(email=mpeterson@caldera.com)

   $ slptool findattrs service:myservice1.x://yourhost.caldera.com
   (owner=Kim Jackson),(email=bjackson@yourhost.yourdomain.com)

   Note that you need to supply the service-url as returned by findsrvs

Q: I have a multi-homed machine and OpenSLP is not working.
A: Please read the updated installation guide
   http://www.openslp.org/doc/html/UsersGuide/Installation.html.
   There are special instructions for users of multi-homed machines.

Q: In our development lab, the multicast SLP requests work just fine.
   However, in our SVT lab, the multicasts requests never work.  We always
   have to edit the slp.conf file and turn on broadcast.  Have any others seen
   this?  Do you recall what the solution was?  We have spent a great deal of
   time trying to figure this one out without success.
A: Yes, others have seen this behavior -- I know I have.  I should put this in
   the FAQ because I get a lot of questions.  The following is a list of the
   most common problems along with trouble shooting and resolution info:

   No multicast route
   -------------------
   A very common problem with some OS installations (especially Linux) is
   that there is no multicast or default route set up.  On systems with BSD
   derived TCP/IP stacks (nearly all OSes), broadcast and multicast traffic
   are delivered using the unicast routing table.  If the unicast routing
   table does not have either a default route or an explicit multicast route,
   then the kernel does not know where to send the SLP datagram and returns
   an error 101 - network unreachable error which translates into a SLPError
   -23 SLP_NETWORK_ERROR. A quick test is to try to ping SLP multicast:

      $ ping 239.255.255.253

   If ping returns an error that the network was unreachable, you will need
   to set up a default route or a multicast route.
 
   Note you may not get any responses to the ping.  This may not indicate
   a problem.  The only thing to be concerned about is if there is an error
   actually sending the ping.
 
   Please read the installation instructions for more information on how
   to install a multicast route:

       http://www.openslp.org/doc/html/UsersGuide/Installation.html

 
   The "smart switch /stupid router" problem
   ------------------------------------------
   The smart switch / stupid router (or no router) problem is something that
   happens on switched ethernet networks only.  If you do not have a
   switched ethernet network, then you do not have this problem.  If you do
   have a switched ethernet network, then you may have this problem if you
   are using newer switching hardware.  The reason is that ethernet
   switching hardware is smart enough to monitor IGMP traffic and only
   forward multicast ethernet frames to those ports that are connected to a
   host that has maintained the appropriate IGMP conversations with the
   router.

   At a very high level, IGMP works like this.  First, the host joins the
   multicast group by sending the router an IGMP message.  The router
   responds periodically with request to the host to see if the host is
   still interested in multicast traffic.  Since IGMP conversations are
   handled transparently by the kernel level IP stack implementations, most
   developers and users do not even realize anything is happening.

   However, "smart" ethernet switches do realize something is happening!
   If they do not see the IGMP messages being sent from the router to a host
   that is plugged into a given port of the switch, then they will will not
   forward multicast ethernet frames to that port.  This is good and bad.
   It is good because it makes multicast extremely efficient in terms of
   physical network usage.  However, it also makes it so multicast will not
   work at all if a router does not exist (or does not support IGMP) to
   maintain it's end of the IGMP conversation.

   Trouble Shooting:

   Monitor IGMP traffic!  Make sure that periodic IGMP traffic is happening
   on your network.  IGMP traffic can be monitored on Linux (and many other
   OSes) with the following command:
 
     # tcpdump igmp

   Issue this command before starting slpd.  You will notice that several
   IGMP "report" messages are sent.  The important thing to look for a IGMP
   "query" message from the router.  If you do not see the IGMP query
   message from the router then you will soon find that you will no longer
   see any "report" messages either.

   Another good test is to try to ping the multicast address and see where
   it is visable.
 
     $ ping 239.255.255.253

   Finally, the best advice is to read the normally untouched section of
   your ethernet switch manual that describes how the switch handles
   multicast.  Stupid/inexpensive switches treat multicast frames exactly
   like broadcast frames which means that they are forwarded to every port
   of the switch.  Smart/Expensive switches often allow this behavior to be
   configured.  If you are on a network without a router, then it is
   possible that you might need to "dumb down" your switch.

   Broken NIC driver
   ------------------
   Some NICs do not support multicast operation, so the driver does the
   work by  placing the NIC into permiscuous mode (accept everything) then
   the driver filters out what is not needed.  The problem with this is
   that sometimes on a very busy ethernet, the NIC buffers may not be able
   to keep up with all the traffic and some frames will be dropped.  This
   is normally not a problem since SLP is designed to work on unreliable
   physical networks, but if enough frames are dropped, OpenSLP may not
   be able to find DAs or other services.  This would result in erratic
   behavior.
 
 
  openslp-1.2.1/doc/html/IntroductionToSLP/0000755033442200000310000000000010211377554020141 5ustar rganesanfloppyopenslp-1.2.1/doc/html/IntroductionToSLP/ServiceReg.jpg0000644033442200000310000000640607251710723022706 0ustar rganesanfloppyÿØÿàJFIFHHÿþCreated with The GIMPÿÛC    $.' ",#(7),01444'9=82<.342ÿÛC  2!!22222222222222222222222222222222222222222222222222ÿÀ;^"ÿÄÿÄ;!1AQa"2q‘R¡r±#b¢Á%35Bc’²ÿÄÿÄ+!1AQq‘2#a±ÁÑðÿÚ ?¿Ñ#QjkN–·ÛµSaŒìÆõ|‡É­êJ´!)ÉF ÛtYúûÇ»µTΊÅn‚–’ x’\>Û¨Ó¸¯Ä¸¸]dž£‹Óè^Ìz«¶æãwýYŸ‹#S"Ì´œ`×tø2>* :øÔ€gÿNU% ãÝ|XM?Ì:¹ðH[ü®ú¬çÑ5Kì©{5üÐñ"^¨«+´Pêº#߯€¸£™HaâfŽ™œÍ¿Ñ´ŧðWô¬n¥ü2ÊQ~d±J£‰Ú2š?÷úW(ó!ü4½:[Zõ+ê~•-Ž5¼óÄc'?H;öîUœ´¹£9A¥êÑ=Ë‚H‹øpÈ_Õ!D@DDD@DDD@DDD@DDPüX´ÄýoüBòú¿á®¦ciÜÐLAàžf>Ÿ?\õÙ_ Ÿs¶Gpˆµã+«Iª–šnqóU¶Ïô{ÑYFÑžmv»N9¯ºH¿I¨c¾N*K “DÂ$¿Ûå{³†Å;dqÇ£rTûû! aÌð9‡b ¯ÞšÃ-?Ë p#`nÞÊ'“ Ÿt”›÷_½ drƒAÙ«áñiÙ(fp °º2~ÁÀzázÃJfï!L¨¨_ î%tÆÁsº½‹Ç÷|ZGÍÍŽœÃ+Õ|#èŒýØõqõ]q¶i½s]Êø(å{ùƒN?|+ãR””"ù!™â «nÚú²¶!ƒJÓ.6Àæ§sî®}7j¨šê%œî³†–ŸÁ»µ½Ÿû…«ôÙÑ ¤/S­ãXµ>â)$S¸ÙÖ¼Œ ò_H‹Ç4ˆ€•BiÎ+^)õÍÂÓv©øš'ÔÌÈ\ö€èK\pF0{ã×7Ó¾“öXҽŚڹÍê+¦?ërõzv(dÅ›½qŽJM´Ñ°-Õ̯¦l¬9e{?‡ó:[EÇ?(S刀""ˆˆn¡»6ç.7W7Ÿá)ß0gê-i {œGp÷Šë® ®š÷q3Dæ `kK»ä7ÉVÿ#l¼=Ô-wAoÞá„Ü,±¢‰¶ã¹jîÃý6IVå_Ü…CSñTÍ—ÌezW2ÅÿK‡ùBé®ÁD@DDD@DDD@P®-UŠN]Ý͇HÆD0qžg´Ø•5T·oß>–¶²Jš¨åmE[baw†9O#N<ù¹½‡šï阞MT’vý‘Yº‹){"ñ?PZÛKŸø4ý!fM)§jç½Â×Fr×nøZ†ÛM%5˜D $g-zÆ¢\¥ÚÙYÓQܤuWõ-UΪ—OÀÊ:X%tbašGàã$ZòǹQÄíw …æ÷R;>ø-Âü«¨t°6›¥t1Èâ ‡w!ã¨=wÝy†¦†VòGdÏÆØŸÛ ÜX{`Á CÖÖÿ&W|²ÌÐa¹\®Ý}Hçhê#o'³‡O±J쥩eT-‘‡ …“ì¶Úú‹¼UóÆØ0~Hš0wôê=÷ZgJ‰¦!&sËÝ|ÿRX–ÂImº[¤Íau¹ÝwÒ~Ë^et²å#@%µ“`ç+h»é+!j=3tf¢¼ÊêiY®™±½ì-ñ>s»sÔz®ž‘“O¤šó#"{QТךꊕ¢ÛUðôà`28"wÿ@•×ÓülÕW8â¼¾:êw<6@è[Œê9@Ä~:Šíq±Iè#?ó0þÄøËU5úï@£Ž°|0q±ÏSÝwxQì“ËŽµÊÿY[ôeß~ãC›XÛF™·²¾âí,®ÄQžãgÎ@ª#|ÖZæžœÔWk *C»›OM sö.OäªÚåEYj¸>G2hÙ'ÌÙKyí•ûÑ\-±äºÎúÊ“ÞIK¿l²ÎXB–(Ú¯DßËt¾só.Žq.éx¦u%éÂYcplu8È=@Û#mûçórE ’0áÝg-ñ“Þ¾"²Š:JPßðÙ¿9vGnÀ ö Cи:•˜é…âj’ñ$¿%¹¬x=+;k6ê*‹ÝU»M2:Jx%tm™±‰¤—”ã›pZÇL{­ý˜~ËÔ²ï§+k-õîŽVÊD†HŽ\AÆAêAê;nºz~(Ϲ´›\&VLìÜ5þ¼ª¶ÕQÖÝj$¤¨Œ²fº(÷i#!¹¶/F¼6û=È_tô·KÞ;Å=7vµ¸.öê}ö\ø~+OÞÛ˜K¤Ù #ã¶l«&)bUÝèŠðìÕ× E•ÐU7¹!3¶–&‘w/1. =·!P÷n0ëû£Ý-4¦‚™Ûµ”Ô Ž^ß3>à…+»\ïÓ…uQQ2ž§Åí§s:HÚAÜàs¾=<ÕqUª®qTyµóÌÝ81çÛÑqéñÔ]EJWêY³×OŽ{Dîg^$‘¹Ý³Ó°ƒïËŸÝ\C‰uÚÃLÌØOCyˆHæÆó†ç8ÁèO_0© 5·ü* m‘ÛsåÏÇôÝKxug¬¡¸‡Jîie3ÚÞQ©QP¹E&Ó“ˆš¯CëÏáWÛ¿ñkt…®2¾Æy]ÿ{Cz`ç#$`6Ô¼K®øamÒT±×Þ–^gJhÿQɸçfç×ï]ñÚÉTÛŲå$Ž…ô¾ åkIÁÄàù}^þËÍÃzŸñ)ƒPàé\zŸ ~ßîU2(vG+[ú®èüô×õ=®öæj§VÒ=ü³5ñ5¯„÷-å¿Qé¶‹²_io4qÔSÈ×µí§ ‚³÷8aYM3¯6ÈÌ¢A™á|þ¦ùú…ÑDºhÉþÔ益Ïü‡8µÌ>›‰ãŽX÷ãä'\šcZëk^†³|}ĹòHy §ë™ÝñäsÛî@54ÜD⡃ã©*-šzÞñÍ;²9½‰æoç†íÙy¸¡WW®´5¦ðËsત–C%0w;Ù¶ÏAúXHíŸEPÓ×Ó‚Ö\᪪ Û‘Ó¦;*ãÄ»oÌ6X¶^*j«f­§¦šøÛå#Ü(ä£'r×`ºç¡Z.ÉweÖ‘²³¸YFж¦­íŠÉ§b§a x’“Ëש;gòV•Ñ^vèãiÉ #¹Yfç‚Q.DU_µÕÿI×[¡µ¾š’–hß#ªª t|€íßNFùûn%e¹:D–¢*JÿÅ{ôz:Õ[Kúª§Y<ºFÓm‘òî@'ÌįáâÖ —‡.¹¶–]¢7JÈœæ6>lƒ:»tïÓenÆ,»‘U<8âMÇPSMãáå’)y"«§c˜Ê†ã¯)Æû¶ÊÔáìÕZ§@úDE""ˆˆäÞm"ç ÇbºÈ€ŒÙ´…±þ#cþxRPÐËÙQ¾i:K¾\öŽo5“…ñ2מˆU§@Ñм=Í#ÍL`FÁ€èˆâ\´å-Ê`ù˜5ÛD6ã mõq᱆Ÿ@¸pº™•!îܬÔ@DktEU§, tQ¶ð²äË´‘ ´èzzµçr¾(„Q†7 _h€‘…ÔZ2–öîi2¥¨€€[8mCG sš<×¶ï è+á ´cÑL‘²èº{d| d/5Û@Q×<½­Ã’›¢°†6L—œ)]›IQÚðæ°sêHˆmÖÓÊÀöå¤aqìz:’Ñ9–6 “ä¥H€óUQEW ŽF‚Æê tá ]I•Œ 9ÎÊÄDBÕ£!¡§1;pF7\[ )*jŒÌU’ˆ 拆ðÀð\IMm–¨­±F:.Š w¶2çJè^t+¢ˆu&‹†’7³—ÍІšg8le3D:—FCMpø†Œoœ.ža¾KíÿÙopenslp-1.2.1/doc/html/IntroductionToSLP/index.html0000644033442200000310000003324710207404660022141 0ustar rganesanfloppy An Introduction to SLP

An Introduction to the Service Location Protocol (SLP)

Whitepaper

Original Draft: Caldera Systems, Inc
Final Revision: Novell, Inc

What Is Service Location Protocol?

The Service Location Protocol (SLP) was originally an Internet Engineering Task Force (IETF) standards track protocol that provides a framework to allow networking applications to discover the existence, location, and configuration of networked services in enterprise networks. Traditionally, in order to locate services on the network, users of network applications have been required to supply the host name or network address of the machine that provides a desired service. Ensuring that users and applications are supplied with the correct information has, in many cases, become an administrative nightmare.

Protocols that support service location are often taken for granted, mostly because they are already included (without fanfare) in many network operating systems. For example, without Microsoft's SMB service location facilities, "Network Neighborhood" could not discover services available for use on the network and Novell NetWare would be unable to locate eDirectory trees. Nevertheless, an IETF sponsored protocol for service location was not standardized until the advent of SLP. Because it is not tied to a proprietary technology, SLP provides a service location solution that could become extremely important (especially on Unix) platforms.

About this Document

Like all IETF standards, SLP is described in great detail by documents called Request For Comments (RFC's). IETF RFCs are usually lengthy, very detailed, and written using precise language and notations. This whitepaper, on the other hand, was written to give a general overview of SLP. This document will, by nature, omit important details that would be interesting to the more technical reader. For these details, the reader is referred the following RFCs:
RFC 2165 - Service Location Protocol, Version 1
RFC 2608 - Service Location Protocol, Version 2
RFC 2609 - Service Templates and Service Schemes
RFC 2614 - An API for Service Location Protocol

SLP for Users and Administrators

SLP can eliminate the need for users to know the names of network hosts. With SLP, the user only needs to know the description of the service he is interested in. Based on this description, SLP is then able to return the URL of the desired service.

Consider the following example of a new employee setting up his workstation to use one of the department printers. Here's a dialog between this new employee (Newbie), and his coworker (Stan), who's been around for a while:

Traditional
Newbie: "Hey Stan, the setup program is asking me for the name of our printer. What should I type in?"
Stan: "Which printer do you want?"
Newbie: "The big one by the copier."
Stan: "I've heard it doesn't work well with postscript applications. You'll have to use the one down the hall."
Newbie: "Ok. What should I type in."
Stan: "Actually, I don't know; I use the one by the copier. You'll probably have to call the IS help desk."
Newbie: <groan> ...

With SLP
A setup program uses SLP to display to the user the description (including location) of the printers that work with postscript. The user selects one that is close to his office. The SLP service returns all necessary addressing information directly to his device setup application.

SLP for Software Developers

In many cases, SLP can eliminate the need for software applications to prompt users for host names, or to read host names from configuration files.

Consider the following example of a software engineer who is writing an LDAP-enabled application.  

Traditional
Currently, the only way to know the hostname of the LDAP server to use in the call to ldap_init() is to read it from a configuration file. The configuration file must be created at install time and updated as the location of the LDAP server changes. Keeping this configuration file up to date becomes a real problem, especially when the LDAP application is installed on a laptop that connects to various networks.

With SLP
The developer uses SLP to obtain the host names and attributes of LDAP servers that are displayed to the user at install time, and again if the user desires to connect to a different LDAP server.

As illustrated in the example above, SLP does not always eliminate the need to prompt users for information.  However, it does allow the software developer to present a descriptive list of services that can be understood by the user.

Agents

In order to understand the rest of this document (as well as all other SLP documentation), you will need to know about SLP agents. In SLP an agent is a software entity that processes SLP protocol messages. There are three types of SLP agents:  
User Agent (UA)
The SLP User Agent is a software entity that is looking for the location of one or more services. Usually implemented (at least partially), as a library to which client applications link, it provides client applications with a simple interface for accessing SLP registered service information.

Service Agent (SA)
The SLP Service Agent is a software entity that advertises the location of one or more services. SLP advertisement is designed to be both scalable and effective, minimizing the use of network bandwidth through the use of targeted multi-cast messages, and uni-cast responses to queries.

Directory Agent(DA)
The SLP Directory Agent is a software entity that acts as a centralized repository for service location information. Both Service Agents and User Agents make it a priority to discover available Directory Agents, as using a Directory Agent minimizes the amount of multi-cast messages sent by the protocol on the network.

Messages

In order to be able to provide a "framework" for service location, SLP agents communicate with each other using eleven (11) different types of messages. The dialog between agents is usually limited to very simple exchanges of request and reply messages.
Service Request (SrvRqst)
Message sent by UA's to SA's and DA's to request the location of a service.

Service Reply (SrvRply)
Message sent by SA's and DA's in response to a SrvRqst message. The SrvRply contains the URL of the requested service.

Service Registration (SrvReg)
Message sent by SA's to DA's containing information about a service that is available.

Service Deregister (SrvDeReg)
Message sent by SA's to inform DA's that a service is no longer available.

Service Acknowledge (SrvAck)
A generic acknowledgment that is sent by DA's to SA's in response to SrvReg and SrvDeReg messages.

Attribute Request (AttrRqst)
Message sent by UA's to request the attributes of a service.

Attribute Reply (AttrRply)
Message sent by SA's and DA's in response to a AttrRqst. The AttrRply contains the list of attributes that were requested.

Service Type Request (SrvTypeRqst)
Message sent by UA's to SA's and DA's requesting the types of services that are available.

Service Type Reply (SrvTypeRply)
Message by SA's and DA's in response to a SrvTypeRqst. The SrvTypeRply contains a list of requested service types.

DA Advertisement (DAAdvert)
Message sent by DA's to let SA's and UA's know where they are.

SA Advertisement (SAAdvert)
Message sent by SA's to let UA's know where they are.  

Unicast, Multicast and Broadcast

SLP is a unicast and multicast protocol. This means that the messages described in the previous section can be sent to one agent at a time (unicast) or to all agents (that are listening) at the same time (multicast). A multicast is not a broadcast. In theory, broadcast messages are "heard" by every node on the network. Multicast differs from broadcast because multicast messages are only "heard" by the nodes on the network that have "joined the multicast group" - by definition, those that are interested in the information.

For obvious reasons, network routers filter almost all broadcast traffic. This means that broadcasts that are generated on one subnet will not be forwarded, or "routed" to any of the other subnets connected to the router (from the router's perspective, a subnet is all machines connected to one of its ports). Multicast messages, on the other hand, are forwarded by routers. Multicast traffic from a given group is forwarded by routers to all subnets that have at least one machine that is interested in receiving the multicast for that group.

Agent Dialog Examples

Agent Initialization

Service Registration

Service Request/Reply

SLP Application Programmer's Interface

One of the most important parts of the SLP specification is the standard Application Programmer's Interface (API). The SLP API is a library interface that allows programmers to use SLP in their applications to locate services. Without the API, SLP would be little more than a specification. With the API, developers can add easily add SLP based features to their programs. The SLP API provides applications with the same sort of interface to service information that the LDAP client API provides to LDAP enabled applications.

The following is a list of the major SLP API function calls (more information can be found in the OpenSLP Programmer's Guide or RFC 2614): 

SLPReg()
Registers a service URL and service attributes with SLP.

SLPDeReg()
Deregisters a previously registered service.

SLPFindSrvs()
Finds services based on service type or attributes.

SLPFindAttrs()
Obtains a list of attributes for services registered with SLP.

SLPFindSrvTypes()
Obtains a list of the types of services that have been registered with SLP.  

Additional Information

Technical readers probably have additional questions that are beyond the scope of this document.

Security
SLPv2 has been designed to be a secure protocol. When properly implemented, SLPv2 can ensure integrity and authenticity of data being transmitted between SLP agents. See RFC 2608, section 9.2 for more information.

Scalability
SLPv2 was designed to be a scalable solution for enterprise service location. It is not intended to be a solution for the global Internet.  However, as an enterprise solution, SLP can be configured to use "scopes" (see RFC 2608 section 11) and SLP Directory Agents in ways that should allow it to scale well in very larger networks. More concrete evidence of SLPv2 scalability will become available when SLP is more widely used.

Implementations
The following is a list of known SLP implementations:

OpenSLP
An OpenSource project that aims to provide a full SLPv2 implementation

Sun Microsystems
Offers a "reference implementation" of SLPv2 that is available under the Sun Community License

Novell NetWare
SLPv2 is implemented by Novell NetWare servers in NetWare versions 5 through 7.

Axis Communications
Uses SLP in its thin server products 

openslp-1.2.1/doc/html/IntroductionToSLP/ServiceRqst.jpg0000644033442200000310000000640607253217214023121 0ustar rganesanfloppyÿØÿàJFIFHHÿþCreated with The GIMPÿÛC    $.' ",#(7),01444'9=82<.342ÿÛC  2!!22222222222222222222222222222222222222222222222222ÿÀ;^"ÿÄÿÄ;!1AQa"2q‘R¡r±#b¢Á%35Bc’²ÿÄÿÄ+!1AQq‘2#a±ÁÑðÿÚ ?¿Ñ#QjkN–·ÛµSaŒìÆõ|‡É­êJ´!)ÉF ÛtYúûÇ»µTΊÅn‚–’ x’\>Û¨Ó¸¯Ä¸¸]dž£‹Óè^Ìz«¶æãwýYŸ‹#S"Ì´œ`×tø2>* :øÔ€gÿNU% ãÝ|XM?Ì:¹ðH[ü®ú¬çÑ5Kì©{5üÐñ"^¨«+´Pêº#߯€¸£™HaâfŽ™œÍ¿Ñ´ŧðWô¬n¥ü2ÊQ~d±J£‰Ú2š?÷úW(ó!ü4½:[Zõ+ê~•-Ž5¼óÄc'?H;öîUœ´¹£9A¥êÑ=Ë‚H‹øpÈ_Õ!D@DDD@DDD@DDD@DDPüX´ÄýoüBòú¿á®¦ciÜÐLAàžf>Ÿ?\õÙ_ Ÿs¶Gpˆµã+«Iª–šnqóU¶Ïô{ÑYFÑžmv»N9¯ºH¿I¨c¾N*K “DÂ$¿Ûå{³†Å;dqÇ£rTûû! aÌð9‡b ¯ÞšÃ-?Ë p#`nÞÊ'“ Ÿt”›÷_½ drƒAÙ«áñiÙ(fp °º2~ÁÀzázÃJfï!L¨¨_ î%tÆÁsº½‹Ç÷|ZGÍÍŽœÃ+Õ|#èŒýØõqõ]q¶i½s]Êø(å{ùƒN?|+ãR””"ù!™â «nÚú²¶!ƒJÓ.6Àæ§sî®}7j¨šê%œî³†–ŸÁ»µ½Ÿû…«ôÙÑ ¤/S­ãXµ>â)$S¸ÙÖ¼Œ ò_H‹Ç4ˆ€•BiÎ+^)õÍÂÓv©øš'ÔÌÈ\ö€èK\pF0{ã×7Ó¾“öXҽŚڹÍê+¦?ërõzv(dÅ›½qŽJM´Ñ°-Õ̯¦l¬9e{?‡ó:[EÇ?(S刀""ˆˆn¡»6ç.7W7Ÿá)ß0gê-i {œGp÷Šë® ®š÷q3Dæ `kK»ä7ÉVÿ#l¼=Ô-wAoÞá„Ü,±¢‰¶ã¹jîÃý6IVå_Ü…CSñTÍ—ÌezW2ÅÿK‡ùBé®ÁD@DDD@DDD@P®-UŠN]Ý͇HÆD0qžg´Ø•5T·oß>–¶²Jš¨åmE[baw†9O#N<ù¹½‡šï阞MT’vý‘Yº‹){"ñ?PZÛKŸø4ý!fM)§jç½Â×Fr×nøZ†ÛM%5˜D $g-zÆ¢\¥ÚÙYÓQܤuWõ-UΪ—OÀÊ:X%tbašGàã$ZòǹQÄíw …æ÷R;>ø-Âü«¨t°6›¥t1Èâ ‡w!ã¨=wÝy†¦†VòGdÏÆØŸÛ ÜX{`Á CÖÖÿ&W|²ÌÐa¹\®Ý}Hçhê#o'³‡O±J쥩eT-‘‡ …“ì¶Úú‹¼UóÆØ0~Hš0wôê=÷ZgJ‰¦!&sËÝ|ÿRX–ÂImº[¤Íau¹ÝwÒ~Ë^et²å#@%µ“`ç+h»é+!j=3tf¢¼ÊêiY®™±½ì-ñ>s»sÔz®ž‘“O¤šó#"{QТךꊕ¢ÛUðôà`28"wÿ@•×ÓülÕW8â¼¾:êw<6@è[Œê9@Ä~:Šíq±Iè#?ó0þÄøËU5úï@£Ž°|0q±ÏSÝwxQì“ËŽµÊÿY[ôeß~ãC›XÛF™·²¾âí,®ÄQžãgÎ@ª#|ÖZæžœÔWk *C»›OM sö.OäªÚåEYj¸>G2hÙ'ÌÙKyí•ûÑ\-±äºÎúÊ“ÞIK¿l²ÎXB–(Ú¯DßËt¾só.Žq.éx¦u%éÂYcplu8È=@Û#mûçórE ’0áÝg-ñ“Þ¾"²Š:JPßðÙ¿9vGnÀ ö Cи:•˜é…âj’ñ$¿%¹¬x=+;k6ê*‹ÝU»M2:Jx%tm™±‰¤—”ã›pZÇL{­ý˜~ËÔ²ï§+k-õîŽVÊD†HŽ\AÆAêAê;nºz~(Ϲ´›\&VLìÜ5þ¼ª¶ÕQÖÝj$¤¨Œ²fº(÷i#!¹¶/F¼6û=È_tô·KÞ;Å=7vµ¸.öê}ö\ø~+OÞÛ˜K¤Ù #ã¶l«&)bUÝèŠðìÕ× E•ÐU7¹!3¶–&‘w/1. =·!P÷n0ëû£Ý-4¦‚™Ûµ”Ô Ž^ß3>à…+»\ïÓ…uQQ2ž§Åí§s:HÚAÜàs¾=<ÕqUª®qTyµóÌÝ81çÛÑqéñÔ]EJWêY³×OŽ{Dîg^$‘¹Ý³Ó°ƒïËŸÝ\C‰uÚÃLÌØOCyˆHæÆó†ç8ÁèO_0© 5·ü* m‘ÛsåÏÇôÝKxug¬¡¸‡Jîie3ÚÞQ©QP¹E&Ó“ˆš¯CëÏáWÛ¿ñkt…®2¾Æy]ÿ{Cz`ç#$`6Ô¼K®øamÒT±×Þ–^gJhÿQɸçfç×ï]ñÚÉTÛŲå$Ž…ô¾ åkIÁÄàù}^þËÍÃzŸñ)ƒPàé\zŸ ~ßîU2(vG+[ú®èüô×õ=®öæj§VÒ=ü³5ñ5¯„÷-å¿Qé¶‹²_io4qÔSÈ×µí§ ‚³÷8aYM3¯6ÈÌ¢A™á|þ¦ùú…ÑDºhÉþÔ益Ïü‡8µÌ>›‰ãŽX÷ãä'\šcZëk^†³|}ĹòHy §ë™ÝñäsÛî@54ÜD⡃ã©*-šzÞñÍ;²9½‰æoç†íÙy¸¡WW®´5¦ðËsત–C%0w;Ù¶ÏAúXHíŸEPÓ×Ó‚Ö\᪪ Û‘Ó¦;*ãÄ»oÌ6X¶^*j«f­§¦šøÛå#Ü(ä£'r×`ºç¡Z.ÉweÖ‘²³¸YFж¦­íŠÉ§b§a x’“Ëש;gòV•Ñ^vèãiÉ #¹Yfç‚Q.DU_µÕÿI×[¡µ¾š’–hß#ªª t|€íßNFùûn%e¹:D–¢*JÿÅ{ôz:Õ[Kúª§Y<ºFÓm‘òî@'ÌįáâÖ —‡.¹¶–]¢7JÈœæ6>lƒ:»tïÓenÆ,»‘U<8âMÇPSMãáå’)y"«§c˜Ê†ã¯)Æû¶ÊÔáìÕZ§@úDE""ˆˆäÞm"ç ÇbºÈ€ŒÙ´…±þ#cþxRPÐËÙQ¾i:K¾\öŽo5“…ñ2מˆU§@Ñм=Í#ÍL`FÁ€èˆâ\´å-Ê`ù˜5ÛD6ã mõq᱆Ÿ@¸pº™•!îܬÔ@DktEU§, tQ¶ð²äË´‘ ´èzzµçr¾(„Q†7 _h€‘…ÔZ2–öîi2¥¨€€[8mCG sš<×¶ï è+á ´cÑL‘²èº{d| d/5Û@Q×<½­Ã’›¢°†6L—œ)]›IQÚðæ°sêHˆmÖÓÊÀöå¤aqìz:’Ñ9–6 “ä¥H€óUQEW ŽF‚Æê tá ]I•Œ 9ÎÊÄDBÕ£!¡§1;pF7\[ )*jŒÌU’ˆ 拆ðÀð\IMm–¨­±F:.Š w¶2çJè^t+¢ˆu&‹†’7³—ÍІšg8le3D:—FCMpø†Œoœ.ža¾KíÿÙopenslp-1.2.1/doc/html/IntroductionToSLP/AgentInit.jpg0000644033442200000310000000640607251710723022532 0ustar rganesanfloppyÿØÿàJFIFHHÿþCreated with The GIMPÿÛC    $.' ",#(7),01444'9=82<.342ÿÛC  2!!22222222222222222222222222222222222222222222222222ÿÀ;^"ÿÄÿÄ;!1AQa"2q‘R¡r±#b¢Á%35Bc’²ÿÄÿÄ+!1AQq‘2#a±ÁÑðÿÚ ?¿Ñ#QjkN–·ÛµSaŒìÆõ|‡É­êJ´!)ÉF ÛtYúûÇ»µTΊÅn‚–’ x’\>Û¨Ó¸¯Ä¸¸]dž£‹Óè^Ìz«¶æãwýYŸ‹#S"Ì´œ`×tø2>* :øÔ€gÿNU% ãÝ|XM?Ì:¹ðH[ü®ú¬çÑ5Kì©{5üÐñ"^¨«+´Pêº#߯€¸£™HaâfŽ™œÍ¿Ñ´ŧðWô¬n¥ü2ÊQ~d±J£‰Ú2š?÷úW(ó!ü4½:[Zõ+ê~•-Ž5¼óÄc'?H;öîUœ´¹£9A¥êÑ=Ë‚H‹øpÈ_Õ!D@DDD@DDD@DDD@DDPüX´ÄýoüBòú¿á®¦ciÜÐLAàžf>Ÿ?\õÙ_ Ÿs¶Gpˆµã+«Iª–šnqóU¶Ïô{ÑYFÑžmv»N9¯ºH¿I¨c¾N*K “DÂ$¿Ûå{³†Å;dqÇ£rTûû! aÌð9‡b ¯ÞšÃ-?Ë p#`nÞÊ'“ Ÿt”›÷_½ drƒAÙ«áñiÙ(fp °º2~ÁÀzázÃJfï!L¨¨_ î%tÆÁsº½‹Ç÷|ZGÍÍŽœÃ+Õ|#èŒýØõqõ]q¶i½s]Êø(å{ùƒN?|+ãR””"ù!™â «nÚú²¶!ƒJÓ.6Àæ§sî®}7j¨šê%œî³†–ŸÁ»µ½Ÿû…«ôÙÑ ¤/S­ãXµ>â)$S¸ÙÖ¼Œ ò_H‹Ç4ˆ€•BiÎ+^)õÍÂÓv©øš'ÔÌÈ\ö€èK\pF0{ã×7Ó¾“öXҽŚڹÍê+¦?ërõzv(dÅ›½qŽJM´Ñ°-Õ̯¦l¬9e{?‡ó:[EÇ?(S刀""ˆˆn¡»6ç.7W7Ÿá)ß0gê-i {œGp÷Šë® ®š÷q3Dæ `kK»ä7ÉVÿ#l¼=Ô-wAoÞá„Ü,±¢‰¶ã¹jîÃý6IVå_Ü…CSñTÍ—ÌezW2ÅÿK‡ùBé®ÁD@DDD@DDD@P®-UŠN]Ý͇HÆD0qžg´Ø•5T·oß>–¶²Jš¨åmE[baw†9O#N<ù¹½‡šï阞MT’vý‘Yº‹){"ñ?PZÛKŸø4ý!fM)§jç½Â×Fr×nøZ†ÛM%5˜D $g-zÆ¢\¥ÚÙYÓQܤuWõ-UΪ—OÀÊ:X%tbašGàã$ZòǹQÄíw …æ÷R;>ø-Âü«¨t°6›¥t1Èâ ‡w!ã¨=wÝy†¦†VòGdÏÆØŸÛ ÜX{`Á CÖÖÿ&W|²ÌÐa¹\®Ý}Hçhê#o'³‡O±J쥩eT-‘‡ …“ì¶Úú‹¼UóÆØ0~Hš0wôê=÷ZgJ‰¦!&sËÝ|ÿRX–ÂImº[¤Íau¹ÝwÒ~Ë^et²å#@%µ“`ç+h»é+!j=3tf¢¼ÊêiY®™±½ì-ñ>s»sÔz®ž‘“O¤šó#"{QТךꊕ¢ÛUðôà`28"wÿ@•×ÓülÕW8â¼¾:êw<6@è[Œê9@Ä~:Šíq±Iè#?ó0þÄøËU5úï@£Ž°|0q±ÏSÝwxQì“ËŽµÊÿY[ôeß~ãC›XÛF™·²¾âí,®ÄQžãgÎ@ª#|ÖZæžœÔWk *C»›OM sö.OäªÚåEYj¸>G2hÙ'ÌÙKyí•ûÑ\-±äºÎúÊ“ÞIK¿l²ÎXB–(Ú¯DßËt¾só.Žq.éx¦u%éÂYcplu8È=@Û#mûçórE ’0áÝg-ñ“Þ¾"²Š:JPßðÙ¿9vGnÀ ö Cи:•˜é…âj’ñ$¿%¹¬x=+;k6ê*‹ÝU»M2:Jx%tm™±‰¤—”ã›pZÇL{­ý˜~ËÔ²ï§+k-õîŽVÊD†HŽ\AÆAêAê;nºz~(Ϲ´›\&VLìÜ5þ¼ª¶ÕQÖÝj$¤¨Œ²fº(÷i#!¹¶/F¼6û=È_tô·KÞ;Å=7vµ¸.öê}ö\ø~+OÞÛ˜K¤Ù #ã¶l«&)bUÝèŠðìÕ× E•ÐU7¹!3¶–&‘w/1. =·!P÷n0ëû£Ý-4¦‚™Ûµ”Ô Ž^ß3>à…+»\ïÓ…uQQ2ž§Åí§s:HÚAÜàs¾=<ÕqUª®qTyµóÌÝ81çÛÑqéñÔ]EJWêY³×OŽ{Dîg^$‘¹Ý³Ó°ƒïËŸÝ\C‰uÚÃLÌØOCyˆHæÆó†ç8ÁèO_0© 5·ü* m‘ÛsåÏÇôÝKxug¬¡¸‡Jîie3ÚÞQ©QP¹E&Ó“ˆš¯CëÏáWÛ¿ñkt…®2¾Æy]ÿ{Cz`ç#$`6Ô¼K®øamÒT±×Þ–^gJhÿQɸçfç×ï]ñÚÉTÛŲå$Ž…ô¾ åkIÁÄàù}^þËÍÃzŸñ)ƒPàé\zŸ ~ßîU2(vG+[ú®èüô×õ=®öæj§VÒ=ü³5ñ5¯„÷-å¿Qé¶‹²_io4qÔSÈ×µí§ ‚³÷8aYM3¯6ÈÌ¢A™á|þ¦ùú…ÑDºhÉþÔ益Ïü‡8µÌ>›‰ãŽX÷ãä'\šcZëk^†³|}ĹòHy §ë™ÝñäsÛî@54ÜD⡃ã©*-šzÞñÍ;²9½‰æoç†íÙy¸¡WW®´5¦ðËsત–C%0w;Ù¶ÏAúXHíŸEPÓ×Ó‚Ö\᪪ Û‘Ó¦;*ãÄ»oÌ6X¶^*j«f­§¦šøÛå#Ü(ä£'r×`ºç¡Z.ÉweÖ‘²³¸YFж¦­íŠÉ§b§a x’“Ëש;gòV•Ñ^vèãiÉ #¹Yfç‚Q.DU_µÕÿI×[¡µ¾š’–hß#ªª t|€íßNFùûn%e¹:D–¢*JÿÅ{ôz:Õ[Kúª§Y<ºFÓm‘òî@'ÌįáâÖ —‡.¹¶–]¢7JÈœæ6>lƒ:»tïÓenÆ,»‘U<8âMÇPSMãáå’)y"«§c˜Ê†ã¯)Æû¶ÊÔáìÕZ§@úDE""ˆˆäÞm"ç ÇbºÈ€ŒÙ´…±þ#cþxRPÐËÙQ¾i:K¾\öŽo5“…ñ2מˆU§@Ñм=Í#ÍL`FÁ€èˆâ\´å-Ê`ù˜5ÛD6ã mõq᱆Ÿ@¸pº™•!îܬÔ@DktEU§, tQ¶ð²äË´‘ ´èzzµçr¾(„Q†7 _h€‘…ÔZ2–öîi2¥¨€€[8mCG sš<×¶ï è+á ´cÑL‘²èº{d| d/5Û@Q×<½­Ã’›¢°†6L—œ)]›IQÚðæ°sêHˆmÖÓÊÀöå¤aqìz:’Ñ9–6 “ä¥H€óUQEW ŽF‚Æê tá ]I•Œ 9ÎÊÄDBÕ£!¡§1;pF7\[ )*jŒÌU’ˆ 拆ðÀð\IMm–¨­±F:.Š w¶2çJè^t+¢ˆu&‹†’7³—ÍІšg8le3D:—FCMpø†Œoœ.ža¾KíÿÙopenslp-1.2.1/doc/html/ProgrammersGuide/0000755033442200000310000000000010211377554020052 5ustar rganesanfloppyopenslp-1.2.1/doc/html/ProgrammersGuide/Callbacks.html0000644033442200000310000001323107326063215022616 0ustar rganesanfloppy OpenSLP Programmers Guide - Callbacks

Callbacks


What's a callback function?

If you are new to asynchronous programming, or have never used callback functions before, just think of the SLP callback functions as a pieces of code the you must write but never call directly.  Yep, that's right, you will probably never call your callback function directly, instead, it will be called by the library when it is ready to report the status or results of an operation.  This allows your program to do other things while data is being collected by the callback function.  Callback functions are required for all of the major SLP APIs for more information see SLPReg(), SLPDeReg(), SLPDelAttrs(), SLPFindSrvs(), SLPFindAttrs(), and SLPFindSrvTypes(),

Callback functions must accept the parameters that the caller (the SLP library) expects to pass to them.  This is why callback function types are defined.  See SLPRegReport(), SLPSrvURLCallback(), SLPAttrCallback().

What's different about SLP callback functions?

Callbacks are an integral part of the SLP API.  Developers usually associate callbacks with asynchronous APIs, but the SLP API uses callbacks for both synchronous and asynchronous operations.  Whether the callback is called synchronously or asynchronously, depends on the isasync parameter in the call to SLPOpen().  Remember the following rules and you should not have any problems with your callback functions.
  • Callback functions are called in both synchronous and asynchronous cases.  The only difference is that in a synchronous case, the initiating function (SLPReg(), SLPFindSrvs(), etc) will block until all results are reported to the callback function.
  • The memory passed in to callback functions is owned by the library.  i.e. the callback must strdup() strings before using them permanently because the memory passed in will be free()d by the library when the callback returns.
  • Make your callback functions as efficient as possible.  This is especially important when a call is made with an async SLPHandle because results are not collected or collated by the library before the callback function is called.  In other words,  in async mode, the library will call the callback each time a reply message is received until the request times out.
  • If the errcode upon entry to the callback is set to anything but SLP_OK, the rest of the parameters may be invalid.  Check the error code first.
  • Use the cookie parameter.  It is the best way to get information to and from your callback.

How does OpenSLP library handle asynchronous operation?

When an SLP library call is made with an SLPHandle that was opened in async mode, the library does everything it can with out blocking.  It then creates a thread (hopefully a user level thread) and returns SLP_OK.  The newly created thread processes the request (possibly blocking to wait for data to arrive from the network) and calls the callback function as data is received.

An important thing to remember is that no collection or collation of results is performed by the library when a call is initiated in async mode. This means that the callback may be called multiple times with the same result.  This would happen for example if two SAs or DAs maintained the same registration.

Currently all the code is in libslp to allow for asynchronous operation except for the calls to pthread_create().  The reason for this is mainly that no one has really needed asynchronous operation.  If you feel like you have a good reason to use asynchronous operation then please send email to openslp-devel@lists.sourceforge.net.

How does OpenSLP library handle synchronous operation?

When an SLP library call is made with an SLPHandle that was opened in sync mode, the library will not create a thread.  Instead, the calling thread will perform all processing (which may block) and report results to the callback function.  When in sync mode, all of the results are collated to ensure no duplicates are returned.  The API function call will not return until all results are finished being reported through the callback.

Why not just have separate synchronous and asynchronous APIs?

That would have been good choice, but for some reason, the SLP designers thought their way would be better.  OpenSLP API is just an implementation of a standardized specification described in RFC 2614

Can I see some example code?

Yes, example code can be found in the documentation for the SLPReg(), SLPFindSrv(), SLPFindAttrs() and SLPFindSrvTypes() functions. openslp-1.2.1/doc/html/ProgrammersGuide/SLPGetRefreshInterval.html0000644033442200000310000000354007205035467025067 0ustar rganesanfloppy OpenSLP Programmers Guide - SLPGetRefreshInterval()

SLPGetRefreshInterval


Declaration

#include <slp.h>

unsigned short SLPGetRefreshInterval()

Description

Returns the minimum refresh interval that will be accepted by all SLP agents on the network.

Parameters

None

Returns

A positive integer value that is the smallest value that should be passed as a lifetime to SLPReg().  If no agents advertise a minimum refresh interval, then zero is returned. ( Zero is not a valid value for the lifetime parameter to SLPReg() .)
 

Status

OpenSLP 0.7.8 Not Implemented.  Always returns SLP_NOT_IMPLEMENTED

Notes

RFC 2614 is really not clear as to how this function works.  In fact the RFC declares the return to be of type unsigned short and specifies that (negative) SLPError codes are returned on error.  Since a negative return could also be interpreted as (a very large) unsigned value, OpenSLP does not return SLPError codes cast to unsigned shorts it just returns zero.

See Also

SLPReg() openslp-1.2.1/doc/html/ProgrammersGuide/SLPUnescape.html0000644033442200000310000000531107326063215023061 0ustar rganesanfloppy OpenSLP Programmers Guide - SLPUnEscape()

SLPUnescape


Declaration

#include <slp.h>

SLPError SLPUnescape( const char* escaped,
                      char** unescaped,
                      SLPBoolean istag )

Description

Process the input string to unescapes any SLP reserved characters.  If the istag parameter is SLP_TRUE then SLPUnEscape() will look for bad tag characters.

Parameters

escaped Pointer to the string to be un-escaped
unescaped Pointer to a pointer for the dynamically allocated output string. The memory should be freed by a call to SLPFree() when no longer needed.
istag When SLP_TRUE_ the input buffer is checked for bad characters

Returns

SLP_OK Indicates that the no error occurred during the operation.
SLP_PARSE_ERROR The API returns this error only when no information was retrieved, and at least one SA or DA indicated a protocol error. The data supplied through the API may be malformed or a may have been damaged in transit.
SLP_MEMORY_ALLOC_FAILED  Out of memory error
SLP_PARAMETER_BAD If a parameter passed into a function is bad, this error is returned.

Status

OpenSLP 0.6.8 Fully implemented as specified by RFC 2614.

See Also

SLPEscape(), SLPFree() openslp-1.2.1/doc/html/ProgrammersGuide/SLPOpen.html0000644033442200000310000001146607326063215022227 0ustar rganesanfloppy OpenSLP Programmers Guide - SLPOpen

SLPOpen


Include

 

Declaration

#include <slp.h>

SLPError SLPOpen(const char* lang, SLPBoolean isasync, SLPHandle* phslp)
 

Description

Returns a SLPHandle handle in the phslp parameter for the language locale passed in as the lang parameter. The client indicates if operations on the handle are to be synchronous or asynchronous through the isasync parameter. The handle encapsulates the language locale for SLP requests issued through the handle, and any other resources required by the implementation. The return value of the function is an SLPError code indicating the status of the operation. Upon failure, the phslp parameter is NULL.

An SLPHandle can only be used for one SLP API operation at a time. If the original operation was started asynchronously, any attempt to start an additional operation on the handle while the original operation is pending results in the return of an SLP_HANDLE_IN_USE error from the API function. The SLPClose() API function terminates any outstanding calls on the handle. If an implementation is unable to support a asynchronous( resp. synchronous) operation, due to memory constraints or lack of threading support, the SLP_NOT_IMPLEMENTED flag may be returned when the isasync flag is SLP_TRUE (resp. SLP_FALSE).

In the OpenSLP implementation, SLPHandles are used to cache information that is costly to obtain (in terms of network usage and time).   Since the RFC 2614 API does not specify functions  to initialize the implementation library, OpenSLP keeps track of the number of SLPHandles that are open.   Several global library data structures are initialized when the first SLPHandle is opened and maintained until the last SLPHandle is closed.  Therefore, it is most efficient to leave SLPHandles open for as long as you will need them (often for the entire life of a process).    If you can help it, DO NOT make a habit of opening and closing SLPHandles frequently.

Parameters

lang A pointer to null terminated array of characters containing the RFC 1766 Language Tag for the natural language locale of requests and registrations issued on the handle.  Pass in NULL or the empty string, "" to use the local the machine is configured to use.
isasync A SLPBoolean value indicating whether the SLPHandle should be opened for asynchronous operation or not.
phslp A pointer to an SLPHandle, in which the open SLPHandle is returned.  If an error occurs, the value upon return is NULL.

Returns

SLP_AUTHENTICATION_FAILED If the SLP framework supports authentication, this error arises when a authentication on an SLP message failed.
SLP_MEMORY_ALLOC_FAILED  Out of memory error
SLP_PARAMETER_BAD If a parameter passed into a function is bad, this error is returned.
SLP_INTERNAL_SYSTEM_ERROR A basic failure of the API causes this error to be returned. This occurs when a system call or library fails. The operation could not recover.
SLP_HANDLE_IN_USE Callback functions are not permitted to recursively call into the API on the same SLPHandle, either directly or indirectly. If an attempt is made to do so, this error is returned from the called API function.

Be aware, especially if the call is async, of error codes that may be passed to the SLPRegReport() callback function.
 

Status

OpenSLP 0.6.0 Fully implemented as specified by RFC 2614

See Also

SLPClose()
  openslp-1.2.1/doc/html/ProgrammersGuide/SLPAttrCallback.html0000644033442200000310000001046707326063215023655 0ustar rganesanfloppy OpenSLP Programmers Guide - SLPAttrCallback

SLPAttrCallback


Declaration

typedef SLPBoolean SLPAttrCallback( SLPHandle hslp,
                                    const char* attrlist,
                                    SLPError errcode,
                                    void* cookie )

Description

The SLPAttrCallback type is the type of the callback function passed as a parameter to the SLPFindAttrs() function.  The behavior of the library is differs depending on whether the attribute request was by Service URL or by service type.

If the SLPFindAttrs() function was called with a Service URL, then the callback is called once regardless of whether the handle was opened asynchronously or synchronously.  The attrlist parameter will contain a comma separated list of attributes.

If the SLPFindAttrs() function was called with a service type, then the callback called is until no more results are available.  The attrlist parameter will contain a comma separated list of attributes. Returns will be collated to remove duplicates if SLPFindAttrs() was called synchronously.  If it was called asynchronously the attrlist may return duplicates.

Parameters

hslp The language specific SLPHandle that was passed into the SLPFindAttrs() function.
attrlist Pointer to a buffer containing a comma separated null terminated list of attribute id/value assignments in SLP wire format "(attr-id=attr-value-list)". 
errcode An error code indicating if an error occurred during the operation.  The callback should check this error code before processing the parameters. 
cookie The same cookie that was passed as a parameter to the SLPFindAttrs() call
 

Returns

The callback should return SLP_TRUE if more data is desired.  The callback may continue to return SLP_TRUE until it is called with an errcode of SLP_LAST_CALL.  If no more data is requested the callback should return SLP_FALSE..  Since discovery of attributes by service-type is not supported, there is really no reason to return anything but SLP_FALSE from the SLPAttrCallback().
 

Status

OpenSLP 1.0.0 SLPAttrCallback function is implemented as specified by RFC 2614

See Also

Syntax, Callbacks openslp-1.2.1/doc/html/ProgrammersGuide/SLPFindSrvs.html0000644033442200000310000002640407326063215023062 0ustar rganesanfloppy OpenSLP Programmers Guide - SLPFindSrvs()

SLPFindSrvs


Declaration

#include <slp.h>

SLPError SLPFindSrvs( SLPHandle hslp,
                      const char* srvtype,
                      const char* scopelist,
                      const char* filter,
                      SLPSrvURLCallback callback,
                      void* cookie)

Description

Issue a query for services.
 

Parameters

hslp The language specific SLPHandle on which to register the service.
srvtype The service type string, including the authority string (if any) for the request.  May not be the empty string, "". May not be NULL.  See Syntax more information on Service Type syntax. 
scopelist A pointer to a comma separated list of scope names.  May be the empty string if you wish to use scopes this machine is configured for.. 
filter A query formulated of attribute pattern matching expressions in the form of an LDAPv3 search filter.  Pass in  the empty string, "" for all services of the requested type.  See Syntax for more information on LDAP3 search filter syntax.
callback The address of an SLPSrvURLCallback function that will be called to report the results of the query.  May not be NULL. See Callbacks for more information on how callbacks are used by the SLPAPI.
cookie Pointer to memory that gets passed to the callback code.  May be NULL.

Returns

SLP_OK Indicates that the no error occurred during the operation.
SLP_PARSE_ERROR The SLP message was rejected by a remote SLP agent. The API returns this error only when no information was retrieved, and at least one SA or DA indicated a protocol error. The data supplied through the API may be malformed or a may have been damaged in transit.
SLP_AUTHENTICATION_ABSENT If the SLP framework supports authentication, this error arises when the UA or SA failed to send an authenticator for requests or registrations.
SLP_AUTHENTICATION_FAILED If the SLP framework supports authentication, this error arises when a authentication on an SLP message failed.
SLP_NETWORK_TIMED_OUT When no reply can be obtained in the time specified by the configured timeout interval for a unicast request, this error is returned.  In other words, slpd is running, but something is wrong with it
SLP_NETWORK_INIT_FAILED If the network cannot initialize properly, this error is returned. Will also be returned if an SA or DA agent (slpd) can not be contacted.  slpd must be running in order to call SLPReg() or SLPDereg().
SLP_MEMORY_ALLOC_FAILED  Out of memory error
SLP_PARAMETER_BAD If a parameter passed into a function is bad, this error is returned.
SLP_NETWORK_ERROR The failure of networking during normal operations causes this error to be returned.  In OpenSLP, this is the error you'll get if an underlying socket() call failed.
SLP_INTERNAL_SYSTEM_ERROR A basic failure of the API causes this error to be returned. This occurs when a system call or library fails. The operation could not recover.
SLP_HANDLE_IN_USE Callback functions are not permitted to recursively call into the API on the same SLPHandle, either directly or indirectly. If an attempt is made to do so, this error is returned from the called API function.

If no services can be found, no error is returned.  However, no calls (other than the SLP_LAST_CALL) will be made to the SLPSrvURLCallback.  Be aware, especially if the call is async, of error codes that may be passed to the SLPSrvURLCallback callback function.
 

Status

OpenSLP 0.9.1 Implemented as specified by RFC 2614.

See Also

Syntax, Callbacks
 

Example Code

#include <slp.h>

SLPBoolean MySLPSrvURLCallback( SLPHandle hslp,
                                const char* srvurl,
                                unsigned short lifetime,
                                SLPError errcode,
                                void* cookie )
{
    if(errcode == SLP_OK || errcode == SLP_LAST_CALL)
    {
        printf("Service URL     = %s\n",srvurl);
        printf("Service Timeout = %i\n",lifetime);
        *(SLPError*)cookie = SLP_OK;
    }
    else
    {
        *(SLPError*)cookie = errcode;
    }

    /* return SLP_TRUE because we want to be called again */
    /* if more services were found                        */

    return SLP_TRUE;
}

int main( int argc, char* argv[])
{
    SLPError err;
    SLPError callbackerr;
    SLPHandle hslp;

    err = SLPOpen("en",SLP_FALSE,&hslp);
    if(err != SLP_OK)
    {
        printf("Error opening slp handle %i\n",err);
        return err;
    }
 

    err = SLPFindSrvs( hslp,
                       "myservice.myorg",
                       0,                    /* use configured scopes */
                       0,                    /* no attr filter        */
                       MySLPSrvURLCallback,
                       &callbackerr );

    /* err may contain an error code that occurred as the slp library    */
    /* _prepared_ to make the call.                                     */
    if((err != SLP_OK) || (callbackerr != SLP_OK))
    {
        printf("Error registering service with slp %i\n",err);
        return err;
    }

    /* callbackerr may contain an error code (that was assigned through */
    /* the callback cookie) that occurred as slp packets were sent on    */
    /* the wire */
    if( callbackerr != SLP_OK)
    {
        printf("Error registering service with slp %i\n",callbackerr);
        return callbackerr;
    }

    /* Now that we're done using slp, close the slp handle */
    SLPClose(hslp);
 

    /* rest of program */
}

openslp-1.2.1/doc/html/ProgrammersGuide/SLPClose.html0000644033442200000310000000416407326063215022370 0ustar rganesanfloppy OpenSLP Programmers Guide - SLPClose

SLPClose


Declaration

#include <slp.h>

void SLPClose(SLPHandle hslp)
 

Description

Frees all resources associated with the handle.  If the handle was invalid, the functions returns silently.  Any outstanding synchronous or asynchronous operations are canceled so their callback functions will not be called any longer.

In the OpenSLP implementation, SLPHandles are used to cache information that is costly to obtain (in terms of network usage and time).   Since the RFC 2614 API does not provide function calls to for library initialization,  OpenSLP keeps track of the number of SLPHandles that are open.   Several global library data structures are initialized when the first SLPHandle is opened and maintained until the last SLPHandle is closed.  Therefore, it is most efficient to leave SLPHandles open for as long as you will need them (often for the entire life of a process).    If you can help it, DO NOT make a habit of opening and closing SLPHandles frequently.

Parameters

hslp An open SLPHandle that was returned by SLPOpen()

Returns

None
 

Status

OpenSLP 0.6.0 Fully implemented as specified by RFC 2614

See Also

SLPOpen()
 
  openslp-1.2.1/doc/html/ProgrammersGuide/openslp_security_whitepaper.html0000644033442200000310000004771607347736373026634 0ustar rganesanfloppy OpenSLP Programmers Guide - Security Whitepaper


OpenSLP and SLPv2 Authentication

February 6, 2001

Matthew Peterson  <matt@caldera.com>


Abstract

This document is summary of SLPv2 security discussions along with some conclusions that suggest direction for future Caldera sponsored development of the OpenSLP implementation of Service Location Protocol.
 

Introduction

Early in December 2000, it was suggested that OpenSLP be submitted for security review by noted security expert Olaf Kirch.   Olaf offered some very useful feedback including a suggestion to implement optional SLPv2 authentication as specified by RFC 2608 section 9.2.    Olaf was worried that in the absence of SLPv2 authentication,  users of OpenSLP might unknowingly trust malicious services that have been setup to "masquerade" as legitimate services.   In Olaf's estimation leaving out SLP authentication opens a security hole that is not  acceptable.  With respect to Volution's use of SLP to locate services Olaf wrote the following:
"Not authenticating registration and deregistration requests is clearly inacceptable in an environment where there's a non-zero security awareness. If everyone is able to change the LDAP server Volution uses to obtain its information from, then we might as well replace /bin/login with a symlink to /bin/bash"  -- Olaf Kirch
The initial response to Olaf's security review was one of complete compliance.   Code changes were quickly made for the next release of OpenSLP (ver 0.8.1) to resolve all security issues except implementation of SLPv2 authentication which was expected to be an involved change that would take several days to complete.    After a couple days of research, it became obvious that the addition of SLPv2 security would be much more complex than simply writing several hundred lines of security enabling code.   The final conflict eventually boiled down to a fundamental security / usability tradeoff that would be unresolvable even with a perfect implementation.
 

Objective of SLP

SLP can be thought of as a very simple global service registry (or directory).   Software entities that provide services register with SLP so that software entities that want to use a services can locate them.    SLP offers a very simple mapping of service types (or characteristics) to service URLs.   This means that only the type or characteristics of a service need to be known in order for a user or application to locate a service for  use.    The major feature SLP provides is usability.   Basically, SLP allows application developers to write more usable and manageable software.   With SLP users no longer need to memorize network addresses, host names or other information to configure their client applications and administrators do not have to set up elaborate means to supply this information.

In discussing security problems associated with SLP it is important to note two things  from section 1 of RFC 2608:

  • SLP is designed for enterprise networks not as a solution for the global Internet
  • The goal of SLP is to provide a framework that allows developers to write software that is user friendly and easily managed.

SLP Security

Imagine now that in an enterprise environment there is a malicious or overly curious individual that would like to obtain confidential information.    SLP could be exploited to obtain information from software that was otherwise secured by virtue of manual configuration.    For example, an OpenSource help desk application consisting of "server" and "client" software is SLP enabled because the network administrators got tired of helping employees set up the "client" software with location and configuration information used to connect with the "server" software.

Since the source code is readily available, a sneaky employee makes a few modifications to the server code that allows him to obtain user names and passwords.  He recompiles the source and brings up the "rogue" help desk server.  Since the "rogue" help desk server and the real help desk server both have similar SLP registerations, it is possible that clients may connect to the "rogue" server instead of the real one.  When the users log in, the "rogue" server saves off a copies of user names and passwords.  The malicious employee can use these user names and passwords later to impersonate other people.

In order to prevent this type of attack, SLP is designed so that services registrations and requests can be made with authentication information.   When properly implemented, SLP requests can be issued that will only return registrations made by trusted services.    With SLP Security enabled developers could trust that the service information returned by the SLP API  (URLs and configuration information).  They do not have to question (as much) whether the service at the other end of the provided URL is a rogue because SLP can guarantee that services have been "blessed" by administrators by virtue of key information.
 

SLP Security vs SLP Usability

It is a well known fact that any increase in security inevitable reduces usability for the legitimate user.  This is especially true with  SLP security -- establishment of trust is unacceptable barrier to SLP usability.    The whole reason for using SLP in the first place is to allow "plug and play" features to be built into applications!

Due to the lack of PKI standards, establishing the trust needed to ensure that service registrations can be authenticated would require manual distribution of key material.   One solution would be to have the administrator verify the authenticity of a single SLP host key or certificate which would authenticate all services provided from a given host, but this would not prevent an attacker from masquerading services if they have access to the authenticated machine.   A more secure approach is to provide per service or per user keys at the expense of increased manual intervention to establish authenticity of numerous keys or certificates.   Wait... even with SLP secured, there is still the possiblity of DNS, DHCP or ARP spoofing, so you are still not secure.

After a few minutes of meditation it becomes evident that in order to be totally safe, applications need to establish the security of their own end to end communications.  Two very good examples are PGP and SSH.  Neither application makes any assumptions about the reliability of intermediate protocols.  Everything is suspect from DNS to ARP.   Suppose that a specialized application was written that used PGP encrypted messages to communicate.   SLP is chosen to locate remote users of the same application.    Now, assume that none of the SLP security features are implemented, is the application at risk?  The answer is no because care was taken by the application developer to secure his own end to end communication.
 

IETF Workgroup (srvloc) Discussion

The idea that authentication belongs in the application itself and not in the location protocol (or other intermediate protocols) was brought up for discussion on the IETF Service Location workgroup mailing list with the following post entitled "Theoretical SLP security discussion (long)":
SLPv2 is designed to be able to authenticate agents. In other words, SLPV2 can guarantee that SAs and DAs are trustworthy. With a proper SLPv2 implementation and installation, UAs can be sure that replies to SLP requests come from trustworthy agents. There is no need to wonder if a responding agent is representing malicious services. For example, with SLPv2 authentication, I can request a service of type "service:ldap" and implicitly trust that the service urls I receive in return are ldap servers that are considered trustworthy by whoever set up the SLP installations.

Sounds pretty nice doesn't it -- at least until you start thinking about what is required to deliver key information (certificates) that makes trust relationships possible. I think I'm safe in saying that without exception, no automated delivery of key information is secure unless it requires actual validation by a human that results in some form of real-life action (phone call, hand delivery, etc).

Administration of trust relationships are completely un-addressed by the SLPv2 and SLP API specs -- which is probably why authentication is considered an optional feature. One might even take the position that SLPv2 Authentication invalidates the SLP's claim to reduce administrative workload as there is no way to deploy secure SLP without significant (manual) administrative overhead to establish certificate or key information trust.

In contemplating implementation and use of SLPv2 authentication in OpenSLP we found that there is nearly nothing in the way of standardized certificate delivery mechanisms that might actually make SLPv2 authentication possible. We did find bits and pieces from OpenSSL and various signing utilities, which lead us to start questioning why we were trying to authenticate services via SLP anyway? Why not just let services authenticate themselves?

An analogy from real life... I need to call an associate and relay some confidential information. I write down his number as it was left on my voice mail and place the phone call. BEFORE I exchange sensitive information the individual on the other line, I authenticate their identity (recognize their voice, etc). Trusting the information available on my voice mail is not required (as the number may have be to an airport pay phone). Implicitly trusting a phone number from the white pages or any other source is not required (or expected) as long as the callers can authenticate themselves.

Likewise, SLP delivered information need not be trusted to be useful. As long as the entity providing a service and the entity using the service can authenticate each other -- separate from the mechanism used to discover or locate one another. One problem is that many services do not have authentication capabilities -- which is not too much of a problem because most services don't have SLP capabilities either. In the end, the only problem is that developers are just beginning to write secure software. If secure service and client software were indeed available, there would not be any need for SLP authentication.

Having not heard additional comment from other experts, it is my opinion the SLP need not bear the burden of authenticating services. The burden of authentication should be placed on the services and their clients rather than on a protocol valued for simplicity and ease of use, administration, and deployment.

Please comment. Do you agree or disagree? Why?
 

Response from ebi@cup.hp.com:
My take on this would be that it needs to be implemented and the people deploying it should have the option of enabling/disabling it.

Because if this is not implemented, I can see a potential denial of service attack, where a rogue SA/DA, keeps on responding to all the discovers sent by the UA. Even though the authentication might fail when the application tries to authenticate using other means. It can stop the UA from finding the correct SA/DA, there by creating a denial of service attack.

On the other hand managing keys does make the protocol heavy weight. The problem of effective key management issue, needs to be solved for most other protocols (like DHCP) as well. Until then, we need
to be doing the key management manually or use what openSSL uses, and when there is an optimum key management solution, we can integrate into that.


Rebuttal from mpeterson@caldera.com:

I do not believe that the "denial of service" attack scenario described above is much of an issue.

I think that it is worth clarifying that receiving incorrect information (service URLs of rogue services from rogue DA/SAs) is not a problem that involves the "SLP UA portion" of a client application. The problem you describe above involves the portions of the client application that *use* information delivered by SLP -- the "UA portion" is only in charge of *getting* the information not using it. In other words, the problem you describe above is an SLP usage problem not an SLP problem.

Regardless of whether or not SLPv2 authentication is implemented and configured, client applications must not expect that SLP guarantees availability. SLP could not possibly be expected to guarantee the state of the network or the persistent state of the registered service. Suppose that a service registers with SLP just before a WAN outage. At least for a certain amount of time clients would experience the same "denial of service" symptoms you describe above. The real solution is to encourage developers to use the entire list of service URLs. If usage (connection to or authentication to) one service fails, the client application should try the next.

Denial of service scenarios like the one you describe are impossible to prevent. The only protection against denial of service attacks is fear. Yes, security by fear. Remember, "SLP is intended to function within networks under cooperative administrative control."  The above mentioned attack would be easy to detect, track and resolve; which means that it would not probably not be much of a problem in the environments SLP is written to run in (how many rogue DHCP servers do you see on your network).

In private network environments, the security problems that you need to worry about are those that allow confidential data to be compromised (especially if it can be done in ways can not be detected.) Denial of service attacks to not compromise data.

The argument from my original post is that even if SLP authentication was implemented and configured correctly with (magically) delivered certificates, there would still be significant service specific security risks that would be dangerous even in private networks. Upon close inspection SLP authentication appears to solve only those security problems that are not overly relevant to private networks in the first place. (Please, if I'm wrong here, give me some examples...)

I agree fully that SLP without authentication is in the same realm (security wise) as DHCP. My question remains -- Is this really a problem in private networks? If so, why? DHCP continues to be a widely deployed and extremely useful technology. One of the most useful aspects of DHCP (and SLP) is that there is no need for extensive configuration. Add requirements for establishing trust (certificates, keys, etc.) and the "plug and play" features of DHCP and SLP are gone.  As this is a "theoretical discussion" I might mention that security is not free. There is always a usability vs. security trade off. I might also mention that sometimes *lack of* security is a feature if the goal is usability.


Response from ebi@cup.hp.com:

Let me give you another example. If I have a workstation on the shared lan where my manager's PC is also there. Some companies restrict root access to people on the main network. So I cannot sniff around to find password. If there is no security in SLP, then  I can register one of the test machines, which would be in a different network (for which I have the root access to) as the pop server. Then I get the user name and password of my manager's pop account (The same thing can be done for a print spooler or a file server).
Rebuttal from mpeterson@caldera.com:
Again, Don't you think this is more an illustration of the weakness of POP3 protocol and mail server/client software than it is of SLP? I would argue that its is that POP3 needs the security boost -- after all it is in the business of securing an end to end communication. SLP is not designed to solve the end-to-end authentication problem ... or is it?

On the other hand, you do allude to a very valid point -- that most traditional and widely deployed "end-to-end" service specific protocols and software are not capable of secure service authentication. (It is usually possible authenticate the user, but client software can rarely authenticate the server which means that there is no establishment of trust before sending client side user credentials.)

Should SLP be tasked with solving this problem? The answer is definitely YES if it can be done without completely squashing major SLP usability features ("plug and play" features). I guess I just don't see how this can be done.


The discussion eventually involves several engineers from a number of organizations and becomes quite lengthy.   At least, the exchange included above should give a taste of the arguments involved.  For those that are interested in reading the entire thread, it can be found at http://www.srvloc.org/hypermail/0826.html
 

Conclusions

For those that are not willing to endure the tedium of reading the entire mailing list discussion,  the conclusion was eventually made (at least by the author) that though SLP authentication may be  appropriate in some specialized SLP deployments, it is probably not beneficial in normal network computer environments.    This conclusion is based on the following premises:
  • Implementation of SLP authentication in the absence of public key infrastructure standards would require enough manual configuration to invalidate all claims SLP has to increased usability.
  • Common helper protocols DNS, DHCP, IP, even ARP are currently insecure for usability reasons.   SLP fits into this category of protocols where lack of security may be considered a feature when it allows for maximal usability.
  • Given the lack of security in the above mentioned (and other) protocols self-established authentication of end to end communication is required anyway for secure communication of network software entities.
  • In the presence of appropriate end to end security mechanisms,  SLP related security attacks are limited to the realm of "denial of service" or "disruptions" -- even when no authentication is implemented in SLP.   In other words there is not a risk of compromise of confidential information that can be attributed to SLP as long as appropriate end to end security is established.
So, for the OpenSLP project, there are not any plans to implement SLPv2 security.   (This may change in the future depending on the success of ongoing PKI standardization efforts.)   There are, however, many things that could be done to reduce opportunities for "denial of service attacks" or other malicious SLP related disruptions.   These will be addressed in future versions of OpenSLP.     Also, in order to inform developers about the importance of writing secure applications, plans have been made to include an SLP Security HOWTO as part of the OpenSLP Documentation. openslp-1.2.1/doc/html/ProgrammersGuide/SLPParseSrvURL.html0000644033442200000310000000550107326063215023447 0ustar rganesanfloppy OpenSLP Programmers Guide - SLPParseSrvURL()

SLPParseSrvURL


Declaration

#include <slp.h>

SLPError SLPParseSrvURL( const char* srvurl,
                         SLPSrvURL** parsedurl )

Description

Parses a Service URL passed in as a character string and returns the results in a pointer to a dynamically allocated SLPSrvURL structure.  The pointer returned in parsedurl should be freed by SLPFree().
 

Parameters

srvurl Pointer to a character buffer containing the null terminated URL string to parse.  See Syntax for more information on Service URL syntax.
parsedurl Pointer to a pointer for the SLPSrvURL structure that receives the parsed URL.  The memory should be freed by a call to SLPFree() when no longer needed.

Returns

SLP_OK Indicates that the no error occurred during the operation.
SLP_PARSE_ERROR The service url being parsed is not of valid syntax
SLP_MEMORY_ALLOC_FAILED  Out of memory error
SLP_PARAMETER_BAD If a parameter passed into a function is bad, this error is returned.
SLP_INTERNAL_SYSTEM_ERROR A basic failure of the API causes this error to be returned. This occurs when a system call or library fails. The operation could not recover.

Status

OpenSLP 0.6.0 Fully implemented as specified by RFC 2614.

See Also

SLPFree(), SLPTypes, Syntax openslp-1.2.1/doc/html/ProgrammersGuide/SLPError.html0000644033442200000310000001503407326063215022412 0ustar rganesanfloppy OpenSLP Programmers Guide - SLPError Codes

SLPError Codes


The following is an explanation of the SLP error codes are returned by SLP functions:
 
SLP_LAST_CALL 1 Passed to callback functions when the API library has no more data for them and therefore no further calls will
be made to the callback on the currently outstanding operation. The callback can use this to signal the main body of the client code that no more data will be forthcoming on the operation, so that the main body of the client code can break out of data collection loops. On the last call of a callback during both a synchronous and synchronous call, the error code parameter has value SLP_LAST_CALL, and the other parameters are all NULL. If no results are returned by an API operation, then only one call is made, with the error parameter set to SLP_LAST_CALL.
SLP_OK 0 indicates that the no error occurred during the operation.
SLP_LANGUAGE_NOT_SUPPORTED -1 No DA or SA has service advertisement or attribute information in the language requested, but at least one DA or SA indicated, via the LANGUAGE_NOT_SUPPORTED error code, that it might have information for that service in another language
SLP_PARSE_ERROR -2 The SLP message was rejected by a remote SLP agent. The API returns this error only when no information was retrieved, and at least one SA or DA indicated a protocol error. The data supplied through the API may be malformed or a may have been damaged in transit.
SLP_INVALID_REGISTRATION -3 The API may return this error if an attempt to register a service was rejected by all DAs because of a malformed URL or attributes. SLP does not return the error if at least one DA accepted the registration.  The deregistered service url does not conform to valid service url syntax.  The service url being deregistered is not registered this means that either it was never registered via a call to SLPReg() or that the registration lifetime has expired.   SLP_INVALID_REGISTRATION is commonly returned when an attempt is made to deregister a service that was registered by a call to SLPReg() on a different host.
SLP_SCOPE_NOT_SUPPORTED -4 The API returns this error if the SA has been configured with net.slp.useScopes value-list of scopes and the SA request did not specify one or more of these allowable scopes, and no others. It may be returned by a DA or SA if the scope included in a request is not supported by the DA or SA. 
SLP_AUTHENTICATION_ABSENT -6 If the SLP framework supports authentication, this error arises when the UA or SA failed to send an authenticator for requests or registrations in a protected scope.
SLP_AUTHENTICATION_FAILED -7 If the SLP framework supports authentication, this error arises when a authentication on an SLP message failed
SLP_INVALID_UPDATE -13 An update for a non-existing registration was issued, or the update includes a service type or scope different than that in the initial registration, etc.
SLP_REFRESH_REJECTED -15 The SA attempted to refresh a registration more frequently than the minimum refresh interval. The SA should call the appropriate API function to obtain the minimum refresh interval to use.
SLP_NOT_IMPLEMENTED -17 If an unimplemented feature is used, this error is returned.
SLP_BUFFER_OVERFLOW -18 An outgoing request overflowed the maximum network MTU size. The request should be reduced in size or broken into pieces and tried again.
SLP_NETWORK_TIMED_OUT -19 When no reply can be obtained in the time specified by the configured timeout interval for a unicast request, this error is returned.
SLP_NETWORK_INIT_FAILED -20 If the network cannot initialize properly, this error is returned. Will also be returned if an SA or DA agent (slpd) can not be contacted. See SLPReg() and SLPDeReg() for more information.
SLP_MEMORY_ALLOC_FAILED  -21 Out of memory error
SLP_PARAMETER_BAD -22 If a parameter passed into a function is bad, this error is returned.
SLP_NETWORK_ERROR -23 The failure of networking during normal operations causes this error to be returned.
SLP_INTERNAL_SYSTEM_ERROR -24 A basic failure of the API causes this error to be returned. This occurs when a system call or library fails. The operation could not recover.
SLP_HANDLE_IN_USE -25 In the C API, callback functions are not permitted to recursively call into the API on the same SLPHandle, either directly or indirectly. If an attempt is made to do so, this error is returned from the called API function.
SLP_TYPE_ERROR  -26 If the API supports type checking of registrations against service type templates, this error can arise if the attributes in a registration do not match the service type template for the service.
openslp-1.2.1/doc/html/ProgrammersGuide/SLPFindAttrs.html0000644033442200000310000002466707326063215023233 0ustar rganesanfloppy OpenSLP Programmers Guide - SLPFindAttrs

SLPFindAttrs


Declaration

#include <slp.h>

SLPError SLPFindAttrs( SLPHandle hslp,
                       const char* srvurl,
                       const char* scopelist,
                       const char* attrids,
                       SLPAttrCallback callback,
                       void* cookie)

Description

This function returns service attributes matching the attrids for the indicated Service URL or service type.   OpenSLP does not support location of attributes by service type with attrids containing wildcards (see status below).

Parameters

hslp The language specific SLPHandle on which to search for attributes the service.
srvurl The service URL of the service to the attributes of.  See Syntax for more information SLP Service URLs.
attrids A comma separated list of attribute ids to return. Use the empty string ("") for all attributes.  Wildcards are not supported.
scopelist A pointer to a comma separated list of scope names.  May be the empty string if you wish to use scopes this machine is configured for.. 
callback The address of an SLPAttrCallback function that will be called to report the results of the operation.  May not be NULL. See Callbacks for more information on how callbacks are used by the SLPAPI.
cookie Pointer to memory that gets passed to the callback code.  May be NULL.

Returns

SLP_OK Indicates that the no error occurred during the operation.
SLP_PARSE_ERROR The SLP message was rejected by a remote SLP agent. The API returns this error only when no information was retrieved, and at least one SA or DA indicated a protocol error. The data supplied through the API may be malformed or a may have been damaged in transit.
SLP_AUTHENTICATION_ABSENT If the SLP framework supports authentication, this error arises when the UA or SA failed to send an authenticator for requests or registrations.
SLP_AUTHENTICATION_FAILED If the SLP framework supports authentication, this error arises when a authentication on an SLP message failed.
SLP_NETWORK_TIMED_OUT When no reply can be obtained in the time specified by the configured timeout interval for a unicast request, this error is returned.  In other words, slpd is running, but something is wrong with it
SLP_NETWORK_INIT_FAILED If the network cannot initialize properly, this error is returned. Will also be returned if an SA or DA agent (slpd) can not be contacted.  slpd must be running in order to call SLPReg() or SLPDereg().
SLP_MEMORY_ALLOC_FAILED  Out of memory error
SLP_PARAMETER_BAD If a parameter passed into a function is bad, this error is returned.
SLP_NETWORK_ERROR The failure of networking during normal operations causes this error to be returned.  In OpenSLP, this is the error you'll get if an underlying socket() call failed.
SLP_INTERNAL_SYSTEM_ERROR A basic failure of the API causes this error to be returned. This occurs when a system call or library fails. The operation could not recover.
SLP_HANDLE_IN_USE Callback functions are not permitted to recursively call into the API on the same SLPHandle, either directly or indirectly. If an attempt is made to do so, this error is returned from the called API function.

If no service types can be found, no error is returned.  However, no calls (other than the SLP_LAST_CALL) will be made to the SLPSrvTypesCallback.  Be aware, especially if the call is async, of error codes that may be passed to the SLPAttrCallback callback function.
 

Status

OpenSLP 0.9.1 Fully implemented as specified by RFC2614 except for finding attributes by service type or with attrids containing wildcards.  These behaviors are expected to be depreciated in the next RFC 2614 revision.

See Also

SLPSrvTypeCallback, Syntax, Callbacks
 

Example Code

SLPBoolean myAttrCallback(SLPHandle hslp,
                        const char* attrlist,
                        SLPError errcode,
                        void* cookie )
{
    if(errcode == SLP_OK)
    {
        printf("%s\n",attrlist);
    }

    return SLP_FALSE;
}
 

int main(int argc, char* argv[])
{
    SLPError    result;
    SLPHandle   hslp;

    if(SLPOpen("en",SLP_FALSE,&hslp) == SLP_OK)
    {

        result = SLPFindAttrs(hslp,
                             "service:myservice.x://myhost.mydomain.org"
                             "", /* return all attributes */
                             "", /* use configured scopes */
                             myAttrCallback,
                             NULL);
        if(result != SLP_OK)
        {
            printf("errorcode: %i\n",result);
        }

        result = SLPFindAttrs(hslp,
                             "service:myservice.x://myhost.mydomain.org"
                             "attr1,attr2", /* return attr1 and attr1 only */
                             "", /* use configured scopes */
                             myAttrCallback,
                             NULL);
        if(result != SLP_OK)
        {
            printf("errorcode: %i\n",result);
        }

        SLPClose(hslp);
    }
}

openslp-1.2.1/doc/html/ProgrammersGuide/SLPTypes.html0000644033442200000310000000472407142533111022422 0ustar rganesanfloppy OpenSLP Programmers Guide - SLP Data Types

SLP Data Types


SLPURLLifetime

An enumerated type with a range of 0 - 65535.  There are two defined values of:
SLP_LIFETIME_DEFAULT    10800
SLP_LIFETIME_MAXIMUM    65535

SLPError

An enumerated type with a range of -26 - 1.  See SLPError Codes for more detail.
 

SLPBoolean

A boolean value with one of the following values:
SLP_FALSE    0
SLP_TRUE     1

SLPSrvURL

Structure that is used to index the parts of a parsed Service URL that is returned by SLPParseSrvURL().  The structure contains the following members.
char* s_pcSrvType
A pointer to a character string containing the service type name, including naming authority.  The service type name includes the "service:" if the URL is of the service: scheme.
char* s_pcHost
A pointer to a character string containing the host identification information.
int s_iPort
The port number, or zero if none.  The port is only available if the transport is IP
char* s_pcNetFamily
A pointer to a character string containing the network address family identifier.  Possible values are "ipx" for the IPX family, "at" for the Appletalk family, and "" (the empty string) for IP address family.  OpenSLP only supports the IP address family.
char* s_pcSrvPart
The remainder of the URL.

SLPHandle

The SLPHandle type is returned by SLPOpen() and is a parameter to all SLP Functions.  The type is opaque to the caller. openslp-1.2.1/doc/html/ProgrammersGuide/SLPDereg.html0000644033442200000310000001326507433001333022343 0ustar rganesanfloppy OpenSLP Programmers Guide - SLPDereg()

SLPDereg


Declaration

#include <slp.h>

SLPError SLPDereg( SLPHandlehslp,
                   const char* srvurl,
                   SLPRegReport callback,
                   void* cookie )

Description

Deregisters the advertisement for URL srvurl in all scopes where the service is registered and all language locales. The deregistration is not just confined to the locale of the SLPHandle,.  The API library is required to perform the operation in all scopes obtained through configuration.
 

Parameters

hslp The language specific SLPHandle on which to de-register the service.
srvurl The SLP Service URL to de-register.  May not be the empty string.  May not be NULL.  Must conform to SLP Service URL syntax..  See Syntax for more information on SLP Service URL syntax.
callback The address of an SLPRegReport function that will be called to report the operation completion status.  May not be NULL. See Callbacks for more information on how callbacks are used by the SLPAPI.
cookie Pointer to memory that gets passed to the callback code.  May be NULL.

Returns

SLP_OK Indicates that the no error occurred during the operation.
SLP_INVALID_REGISTRATION The deregistered service url does not conform to valid service url syntax.  The service url being deregistered is not registered this means that either it was never registered via a call to SLPReg() or that the registration lifetime has expired.   SLP_INVALID_REGISTRATION is commonly returned when an attempt is made to deregister a service that was registered by a call to SLPReg() on a different host.
SLP_PARSE_ERROR The SLP message was rejected by a remote SLP agent. The API returns this error only when no information was retrieved, and at least one SA or DA indicated a protocol error. The data supplied through the API may be malformed or a may have been damaged in transit.
SLP_AUTHENTICATION_ABSENT If the SLP framework supports authentication, this error arises when the UA or SA failed to send an authenticator for requests or registrations.
SLP_AUTHENTICATION_FAILED If the SLP framework supports authentication, this error arises when a authentication on an SLP message failed.
SLP_NETWORK_TIMED_OUT When no reply can be obtained in the time specified by the configured timeout interval for a unicast request, this error is returned.  In other words, slpd is running, but something is wrong with it
SLP_NETWORK_INIT_FAILED If the network cannot initialize properly, this error is returned. Will also be returned if an SA or DA agent (slpd) can not be contacted.  slpd must be running in order to call SLPReg() or SLPDereg().
SLP_MEMORY_ALLOC_FAILED  Out of memory error
SLP_PARAMETER_BAD If a parameter passed into a function is bad, this error is returned.
SLP_NETWORK_ERROR The failure of networking during normal operations causes this error to be returned.  In OpenSLP, this is the error you'll get if an underlying socket() call failed.
SLP_INTERNAL_SYSTEM_ERROR A basic failure of the API causes this error to be returned. This occurs when a system call or library fails. The operation could not recover.
SLP_HANDLE_IN_USE Callback functions are not permitted to recursively call into the API on the same SLPHandle, either directly or indirectly. If an attempt is made to do so, this error is returned from the called API function.

Be aware, especially if the call is async, of error codes that may be passed to the SLPRegReport() callback function.
 

Status

OpenSLP 0.6.0 Fully implemented as specified by RFC 2614 

See Also

SLPReg(), Syntax, Callbacks openslp-1.2.1/doc/html/ProgrammersGuide/SLPSrvTypeCallback.html0000644033442200000310000000703607326063215024355 0ustar rganesanfloppy OpenSLP Programmers Guide - SLPSrvTypeCallback

SLPSrvTypeCallback


Declaration

typedef SLPBoolean SLPSrvTypeCallback( SLPHandle hslp,
                                       const char* srvtypes,
                                       SLPError errcode,
                                       void* cookie )

Description

The SLPSrvTypeCallback type is the type of the callback function passed as a parameter to the SLPFindSrvTypes() function.  If the hslp parameter was opened asynchronously, the results returned through the callback may be uncollated.  If the hslp handle parameter was opened synchronously, then the results will be collated to remove duplicates.

Parameters

hslp The language specific SLPHandle that was passed in to the SLPFindSrvTypes() function.
srvtypes Pointer to a comma separated list of service types.  See Syntax for more information on service type syntax. 
errcode An error code indicating if an error occurred during the operation.  The callback should check this error code before processing the parameters. 
cookie The same cookie that was passed as a parameter to the SLPFindSrvTypes() call
 

Returns

The callback should return SLP_TRUE if more data is desired.  The callback may continue to return SLP_TRUE until it is called with an errcode of SLP_LAST_CALL.  If no more data is requested the callback should return SLP_FALSE.
 

Status

OpenSLP 0.6.0 SLPSrvTyperCallback functions are not called because SLPFindSrvTypes() is not implemented

See Also

Syntax, Callbacks openslp-1.2.1/doc/html/ProgrammersGuide/SLPGetProperty.html0000644033442200000310000000376107326063215023611 0ustar rganesanfloppy OpenSLP Programmers Guide - SLPGetProperty()

SLPGetProperty


Declaration

#include <slp.h>

const char* SLPGetProperty( const char* name)
 

Description

Returns the value of the corresponding SLP property name.  The returned string is owned by the library and MUST NOT be freed.
 

Parameters

name The name of a net.slp property to get.  See OpenSLP Users Guide for a list of supported properties

Returns

A very thread unsafe character pointer to a string containing the property value.  If an error occurs, like the property name is not found, NULL is returned so don't forget to check for NULL!
 

Status

OpenSLP 0.6.0 Fully implemented as specified by RFC 2614.

Notes

For some reason the SLP API writers decided to make SLPGetProperty() and SLPSetProperty() calls impossible to implement in a thread safe manner.  For this reason OpenSLP only allows read only access to SLP properties.  Properties are read into static data structures when the process loads, and never changed so at least SLPGetProperty() can be called from threaded applications.

See Also

SLPSetProperty()Open SLP Users Guide openslp-1.2.1/doc/html/ProgrammersGuide/SLPFree.html0000644033442200000310000000275707540400637022213 0ustar rganesanfloppy OpenSLP Programmers Guide - SLPFree()

SLPFree


Declaration

#include <slp.h>

void SLPFree( void* mem)

Description

Frees memory that was returned from SLPParseSrvURL(), SLPFindScopes(), SLPEscape(), and SLPUnescape()
 

Parameters

mem A pointer to the memory to free

Returns

None
 

Status

OpenSLP 0.6.0 Fully implemented as specified by RFC 2614.

See Also

SLPParseSrvURL(), SLPFindScopes(), SLPEscape(), SLPUnescape() openslp-1.2.1/doc/html/ProgrammersGuide/SLPEscape.html0000644033442200000310000000522207326063215022517 0ustar rganesanfloppy OpenSLP Programmers Guide - SLPEscape()

SLPEscape


Declaration

#include <slp.h>

SLPError SLPEscape( const char* unescaped,
                    char** escaped,
                    SLPBoolean istag )

Description

Process the input string to escape any SLP reserved characters.  If the istag parameter is SLP_TRUE then SLPEscape() will look for bad tag characters.

Parameters

unescaped Pointer to the string to be escaped
escaped Pointer to a pointer for the dynamically allocated output string. The memory should be freed by a call to SLPFree() when no longer needed.
istag When SLP_TRUE the input buffer is checked for bad characters

Returns

SLP_OK Indicates that the no error occurred during the operation.
SLP_PARSE_ERROR The API returns this error only when no information was retrieved, and at least one SA or DA indicated a protocol error. The data supplied through the API may be malformed or a may have been damaged in transit.
SLP_MEMORY_ALLOC_FAILED  Out of memory error
SLP_PARAMETER_BAD If a parameter passed into a function is bad, this error is returned.

Status

OpenSLP 0.6.7 Fully implemented as specified by RFC 2614.

See Also

SLPUnescape(), SLPFree() openslp-1.2.1/doc/html/ProgrammersGuide/Divergence.html0000644033442200000310000002547507326063215023027 0ustar rganesanfloppy OpenSLP Programmers Guide - Divergence from RFC 2614

Divergence from RFC 2614


SLP Service URLs are required

SLP Service URL syntax is required for all functions that accept url strings.  The following is a list of affected functions:
  • SLPReg()
  • SLPDeReg()
  • SLPDelAttrs()
  • SLPFindAttrs()
  • SLPParseSrvURL()
  • SLPSrvURLCallback()
The decision to require SLP Service URL syntax was made based on in part the following scenario:
Suppose that two calls were made to SLPReg() with  srvurls and srvtypes of "192.168.100.2","http" and "192.168.100.2","ftp".  Now the developer wants to deregister one service with out deregistering the other.  How can it be done?  The SLPDeReg() call does not have a service type parameter so it would be impossible for the underlying implementation to distinguish between the two registrations.  In attempt to standardize, OpenSLP expects valid Service URLS.
OpenSLP requires strict Service URL syntax because a Service URL can be treated as a unique "database key" that identifies a registered service.   Not requiring Service URL syntax allows for several ambiguities like the one mentioned above.
 

Scopelist may be the empty string ("")

In the calls where a scope list is accepted as a parameters, RFC 2614 says that this parameter may not be the empty string or  NULL.   OpenSLP allows scope list to be NULL or the empty string.  If the empty string is passed in as a scopelist, then OpenSLP will use the scopelist the system administrator has configured for the machine.  This saves 99% of all developers the time of calling SLPFindScopes() and parsing the result.

Scoping is almost entirely an administrative task that is only required for scalebility of the SLP wire protocol.  Having to deal with and understand scopes will be a burdon to the large majority of programmers.  Unless they are writing some sort of SLP browser, they will be very content to use the scope that the machine is configured to use.
 

The SLPSetProperty() is ignored

The SLPSetProperty() and SLPGetProperty() calls are impossible implement in a way that would be both scalable and thread safe.  The SLPGetProperty() call could never be made thread safe unless return value was a pointer to a buffer dynamically allocated the library and freed by the caller. The SLPSetProperty() call would still access with the data store in such a way that mutexes would be required to ensure that SLPSetProperty() and SLPGetProperty() were never used the same buffers at the same time.  Even if a thread safe data store were devised, the SLPGetProperty() call would be used so frequently during internal operations of the library that performance might be adversely affected due to mutex bottlenecking or the amount of processing required to resolve the attribute name to a value.
 

NULL and empty string are acceptable parameters

According to RFC 2614, NULL is not exceptable value for any parameter.  Instead programmers are instructed to passed the empty string "".  OpenSLP allows programmers to use either NULL or the empty string.   It is very easy to deal with both NULL or empty string in the implementation, and allows developers to write more familiar and slightly more efficient code.  There should not be any reason why the compiler should be required to pass a pointer to a static constant empty string when NULL will do just a well.   This is why the vast majority of C APIs use NULL to indicate an ignored parameter or default value -- not the empty string ("").
 

Incremental registrations an de-registrations

The only reason I can think of ever wanting to expose the functionality of incremental registration and deregistration is to represent dynamic data via SLP attributes.  I can think of a long list of reasons why this is a very very bad idea.  With out doubt, it is best to instruct SLP developers to minimize when ever possible, the number of calls that ultimately generate SrvReg and SrvDereg messages.  If dynamic data is to be represented, it is best do do it via a specialized protocol optimized for the given service.  OpenSLP does not support incremental registrations and de-registrations via SLPReg() and SLPDelAttrs() because we have found that when developers really learn what happens "under the SLP covers" they are very careful *not* to call then very often.

In addition to poor usage of network resources, incremental registrations and de-registrations require additional code that decreases the efficiency of and increases the size, and complexity of API and agent implementations.

The work around for this behavior involves the following:

  • Design application usage of SLP such that SLP is not used to store great quantities of data
  • Design application usage of SLP such that SLP is not used to store dynamic data
  • If the need does arise to add or remove an attribute from an existing registration simply re-register the service with new attributes as "fresh" registration.

Addition of a very simple attribute parsing function

The following function is secretly included with OpenSLP and has proven to be very useful.

/*=========================================================================*/
SLPError SLPParseAttrs(const char* pcAttrList,
                       const char *pcAttrId,
                       char** ppcAttrVal);
/*                                                                         */
/* Used to get individual attribute values from an attribute string that   */
/* is passed to the SLPAttrCallback                                        */
/*                                                                         */
/* pcAttrList (IN) A character buffer containing a comma separated, null   */
/*                 terminated list of attribute id/value assignments, in   */
/*                 SLP wire format; i.e.  "(attr-id=attr-value-list)"      */
/*                                                                         */
/* pcAttrId (IN)   The string indicating which attribute value to return.  */
/*                 MUST not be null.  MUST not be the empty string ("").   */
/*                                                                         */
/* ppcAttrVal (OUT) A pointer to a pointer to the buffer to receive        */
/*                 attribute value.  The memory should be freed by a call  */
/*                 to SLPFree() when no longer needed.                     */
/*                                                                         */
/* Returns: Returns SLP_PARSE_ERROR if an attribute of the specified id    */
/*          was not found otherwise SLP_OK                                 */
/*=========================================================================*/
 

Some .conf properties are ignored

See the OpenSLP Users Guide for more details
  openslp-1.2.1/doc/html/ProgrammersGuide/SLPDelAttrs.html0000644033442200000310000000764507326063215023054 0ustar rganesanfloppy OpenSLP Programmers Guide - SLPDelAttrs()

SLPDelAttrs


Declaration

#include <slp.h>

SLPError SLPDelAttrs( SLPHandle hslp,
                      const char* srvurl,
                      const char* attrs,
                      SLPRegReport callback,
                      void* cookie )

Description

Deletes specified attributes from a registered service.   OpenSLP will not implement this function in the 1.0 development cycle because of a lack of interest and the existance of an obvious work-around replacement.    Instead of calling SLPDelAttrs() developers writing to OpenSLP should use simply SLPDeReg() to de-register the entire service then call SLPReg() to re-register the service with out the undesired attributes.

Parameters

hslp The language specific SLPHandle to use for deleting attributes.
srvurl The SLP Service URL of the registered service to delete attributes from.  May not be the empty string.  May not be NULL.  Must conform to SLP Service URL syntax or SLP_INVALID_REGISTRATION will be returned.  See Syntax for more information on SLP Service URL syntax.
attrs A comma separated list of attribute ids to be deleted from the registration.  May not be the empty string.  May not be NULL.
callback The address of an SLPRegReport function that will be called to report the operation completion status.  May not be NULL. See Callbacks for more information on how callbacks are used by the SLPAPI.
cookie Pointer to memory that gets passed to the callback code.  May be NULL.

Returns

Always returns SLP_NOT_IMPLEMENTED
 

Status

OpenSLP 1.0  Will not be implemented in the OpenSLP 1.0 development cycle.  Always returns SLP_NOT_IMPLEMENTED

See Also

SLPReg(), SLPDeReg(), Syntax, Callbacks openslp-1.2.1/doc/html/ProgrammersGuide/index.html0000644033442200000310000000530507326063215022051 0ustar rganesanfloppy OpenSLP Programmers Guide - Index  


Programmers Guide

SLP Handle Functions

Functions used to open and close SLPHandles:

SLPOpen()
SLPClose()

Parsing Functions

Useful parsing functions:

SLPParseSrvURL()
SLPEscape()
SLPUnescape()
SLPFree()

Service Registration Functions

Functions that should be called by applications that provide a service:

SLPReg()
SLPDereg()
SLPDelAttrs()

Configuration Functions

Functions that may be called to determine the configuration of the SLP on the local machine and on the network:

SLPGetRefreshInterval()
SLPFindScopes()
SLPGetProperty()
SLPSetProperty()

Service Location Functions

Functions that may be called by applications that use services:

SLPFindSrvs()
SLPFindSrvTypes()
SLPFindAttrs()

Misc Information

Quick links to useful information:

Callbacks
Syntax
Error Codes
Divergence from RFC 2614

Prepared by Caldera Systems, Inc
 
 
 
 
 
 
  openslp-1.2.1/doc/html/ProgrammersGuide/smalllogo.jpg0000644033442200000310000001243307075720153022551 0ustar rganesanfloppyÿØÿàJFIFHHÿþCreated with The GIMPÿÛC    $.' ",#(7),01444'9=82<.342ÿÛC  2!!22222222222222222222222222222222222222222222222222ÿÀj="ÿÄÿÄD !1AQaq"2‘¡±Áá#BbrÑ%3Rs’Âð$4CDSt²ÒñÿÄÿÄ!!1A"QÿÚ ?¿ÑXÊ@2™^KƒFIÂùÁU LM’Y#2Ã}è¶P•òž¡”ÐÉ4® Ž6—8ž€sZöªç\­ÐÖ:#˜j '$ œgÇ@z¸MQOC4”Ñ fkIdyƣܢvî-¬m£ÜեóÐèÉï§úÝL§xŽ'ÈFÍn¯‚§«®×ÖKV2×Ô;^üšÎ@‡ÕQ%&Ò‰êñÔ—>‹‘®Ï]׬•UÚnu”÷H$¦uLÒ–·¾¦S¥ÙäßoŒã²’Pq=Êç3¢·Ò2­¬v3Zcˆxk'sü!Ø\YuG› ¬­6VÇ/lÀàŽÍÜüñ¿šÜ…¡Àˆˆ" ˆ€""ˆ°€Ê,eeDDD@DDD@‚´j.QÇ'eL³e½Æó\úh™ 'õó7Àw¨çÍ÷7 Èêz—ÇV\Ý.c°dv}œï¶2¢R¢”N½Ö®º–Ù=I1kc l:Ãð.<•Ymâ˜-µ:èkae<™8íÚZÜ~É#ð8ÎØZfxê_-MôI9ë Œ†?9õ¸hØn3œî±OV&žFÄ韡„Fé°å¶p:ŽXé•~<ã;9•p&|M{†ç‘¶žªGz\ÍñûZpCŽã¦ß5.¶×ºŽÝGLE¬°5íÜcT…²È&‹Tëp•ñ4d´ƒŒŒoû*Fî$¹WGª68NÁ¨>&îý äcÙÇ_†Ë^¢Lr'Ù8¾qeª7Æž«@sb†¸Œ—à€6<Ô;uâò×Ü¢¥Àöåk£kKZHÃ@Ç,uÆ|VíŽÏ5Æ'Üýg’ÉXÐH <ýoíõðè¥ÜO,Œá¹ýŽ:´5ÚN\5rðʵ‘A\{)Aɨ¿¥sO¹YÛlˆöÕÖ6)Ú¾v;í·53¶Ü*øxÍn¼†6–µ”µ €GÇ\–ú¬éÏ ‰a¡5µrURFâi'‚LTœ7ëŒþ«i„Ís=f°8µÎÚAÛ¨?ŠÃÿO¶m(IÁ|>pœ¸gtO#=”¾¸ÇÎã—#…ÓntŒóðZCê¶9a °´má·B·%©€DDD@‚p2W6Kƒç™ÑQ³YnÅç^o•†žˆ1‡™Ú‡zâß+%µÙ#§¢peDîlM~3¤Ë½À{¢â¾›µ·J kÃ.—Èiäw&:@ß’õE_AsÏÝ·¨êç¢@üy€vPê8©¨Ë™Me~òJã—¼÷¸ó+jªÞ'kgžì•»=‡ÀÂå:³¶º%Ò×ÔP¹­¨,;Ùp8+Q—Ø/dû½3ø/xå±\ …k¥žÚé$ÖöÓ<Ÿ–Œü—ÖX)ªí®šXšücÕxoæ¥7ÙÖ‘+Ín3é1cËò\º®!‚–AïfrðÆÂ×4¼¸œcÖL¥œ4KN¥8=Þª†ÐÍ °QÓSÆÀbi%­Á+·}¤‹B’£Ò)Ù!ظnÜŠãÚ{Nɹ]Ž‹DfG~‰µ)n””ÒêÅ+€$gßšè´Ö¹¡Â®àãòZ7›5£žbÌàhpi>Ex´Eg†6Ö4ÖŽ@g`³¶iônMU4õ·hÿˆ€½G%\­޶ƒÈ€7ù*Æ(mñ \Ûiešxõ>GÆâvêBëGlŽ º[E0Ü> âb<×wØ¥Ñ85óÒ8 ¸Áaý¶.œr²V±ÙiÜÁ†£ïK^í#7ðrѰ]òÖÆóí ž]énŽJ:´KÑycƒÚ^–„D@CßSé\MRârÚq¡£åõQî0”TÖÁœ4à ¤Ý¡Øq8Àõ£®ùti;‰O_Þ+Ä•®dçi kG¹ÎþkÍ{6øjC喝ISJÉ,n×Ù³8uÛߟrᲂ•ÒDí¥Ž¯ÔrÒ;²­Î…­£i¢Œ}¡Çl‚­¬·@ãu•ä=¬iò6$r'~ËeùÑçÈœ·gÉ—H@æWg‡á’ äOã%ŽÐ0NGÖ'ÈeçžÕú³üYÊê¶qÒ'Žžénok_¤ÄÝË7ÂîYïP]`.hÑ+}¸Éåù*öÉzªŽ¥ÖúÙ÷·%޵·CÞ¼TÝßd½™éÈFÓ}¾»®ÆUÙÇÉåÖþÊ9ý–3QVvÐ97Íp®oEsMæøÊG¿vÁîÇü×2ßYè–¹kžK§‘®‘Î<ð£Ö©iùj«æ¢S©äÜ|û‡ ““ 4Mi+=635¢øéË9µÝýÄ^ð¶£âÉ£a‚zPê°àѾPÈk ¥¾Á%,Í{껡è}û­ž$¡ÐËœkËþ¾+œšz;I­“Uß*N$lëÜ>«œÚÛŒWYhi*ä™Á£Sä õQ« ÛEw–(å{šbÉÔ÷yDžõóâ´Ï­}2:Ðgtg”ôæ—zrb’DØSÈì‡]ê/]'o‚ù>ãr³¸Héý*›8!Üǽ@YiŠ_L¥f‰ë³!ÃÇ=T’šän6Û8–¸øŽ¿Š6ÐTÎçÜ"ž‚‚®#˜Üâ|¶ä±v§7XŒNñ¿´gŽÄ} YgûâÍ- œõÆOCŽ_U¯îãÃïô:êWÉ}À{GpÎÎõÙ_g´tèœËuY5‘HÑŸì©8»Xë)]Nú ÍC³HÇ¿ )ÛÜI<÷¶XœÓ j+®äÒb4³Ž¥˜ÏÉsØÖŽñFô|+HÉUK;&í9¹ûò¾÷ OC°LqŒýBŽÕI%¥Þ›n•Ì #[ ÈÇârñzŠåÀ¯¬ s‹›ÜíC!R’i¤KM4Ï£¦Ï ;þÔÿ⢶¬Kw„Ÿúm]?MÏã?ò¿å\^—µ¹Fîæ€¹Û;>‹n°7Ëe|)?¨o’û­ÌŽ}ñÚl•gº2¸©³j‹~…v¸‘ýŸW»º"¡–šï蘷ý“õXätÍ ´pè–¦ÞHÀú)µÖªššÐ)ÚZê‰@kX9]Ð\èa…¢´TiÒ4ºê#Ì·ãâ‹]×CAWQ7GÊ4þ,} ç±¥EqÝ’éëYe°ºIHÔÆlÞ®qäß<•´T=•ô°gÖdc_žË-MÆñPʺÏe‡1Dßa‡¿÷ŠpÍ¢GUvò’s•P_I“ÑbÑ8º¹î[+å;8€ð_U©˜DXÊ•»ÎûOÜ)ŸÙ­ž!À8.oTÇCs˜Î“äqü‚›ý¦ðô•”ÐÞi{zQ‰tŒ’·Ü~¾ C<JGG LbHóó Å’ã+7ƒ´O¸>ïF-1TKQQ‘ÍîÀÊäßïOâMÚß™¶Ò0jÔA峚Ñϯr…GNû5H>jL’Ç5Äh'bFvÇ=QϵUÁ§¸{'jcd~’Ó¿'úžñà­æo¢8QaÏÇÖXØÏF—·‘Äiaý¬¸q WÞ/}m0x‚(šÖ‡ tîïÉ?¨Û°† ’j׳³8ÝÁØ·Z1ØéöµÓzÚs¾|Or™årTTcôó~ºšø)˜sÙ‚O™ü—ÖÓTiî³G¿ªÏäµìÖ™ª'ô‰sä9õñ[Í¥ìx¦¶2=– ]’¨XNåF\棈ÝϬôV· Û#4.ÙUw ié.ͯÄ1ËË*kCö‰n ¶ÍUŒ6-8ñ+LY#ÇdÎ-³›ÅòCIÇÇOÌBÓ ø?‚ŒqÓ´¸ÆÌÿW¼þKï=[ÙWQxº¿5µD–D9ŸwAŒϦµÔ\ ©¬{I{²[ާÃÈl²¾RmÒ$Bå¢Ìf$`·%Ãoì,ÔÎ?ºòв½•4‹·tcK‡xèµ)£}†ã™£séœvs{»ÔŦêG_Va·Ê€C£°ÆAË¿õX©®¼] l𯯻P§ž1Ìù©ƒøªÃ toši±´MŒƒŸv\˜øšVÜ 7 ¢¥™Ûnu5¹çãðZÔì‹“øhQU:žÿ4n'Sbüµëj=#ˆDdûA¿E½1¥«ã*騤Ó9ƒCÀ ›øås«4ÁÄm‘çKZsîPŸì¦¿%“KE8R¾M9-¤‘ÃÜÒ¡‹sæå?¢ž*ž ¸¾öz$£-?¸Uuf‡6~]\¯;èœhóÃ7¨m±ÉUP\#a™=ÁOí\OdâÙ¾ìt6bÒZÉØ0ì ð{ÕFÀ>ïtYõÌ€î*A ÓX¸††ñغX¢ku|#àžÊ¤w“k‡S¹Î0°³øIQ;ß ÕZ)Ýq…Çõ;—rsGx*Æ£ãΫƒ[«Ù ±’ÉZZGËrŠq‡Á|¦6{# ­”ŽÖrÒÑ€y ýV“p¢+8bîjlo’S¹…Áß©ItwèUl$œv­?6­K«ÙKG®®\!æ³$,¤°IO#ÀšBÒÔî ú,1½6i/ˆë2¼ýÆÑ“þïþUŽ—µªñÇÑym9m”"Ÿü«K…n”¶™Cª\àÜçÕnS —-œšÖ‹ê”â¨×ñÝ»†ë™G4SO;™¬² =Q¿<Ÿ ß´ÛQVò;¢Æ~%@ëëïˆnW­2 Â#×± Åo<©-_eWÄô\GÀWzÊ0ö¢sdŽLjiÀ* j¸º¡ò?Uóáû­Þh§œ6ª¯!‘à’}Qø“ðKTÑPäsê°Ë;£H*4¸e±ÖÕè‘à0ନxf“C_$-v9†ªË…ê©íõåÕ2Ú\7!^Ö©!¨¡ŽhžÙ#pÙÍ9z1ÓFr´Î <:ð^>JAGC3 ­Àè²´ „D@åíaiƒÌYq7ÙÛ›Pk¬ìœö9ÆîŸÀ«=ys† ™EIlêm3îkkŒ5ÔBN„¸h'ê ×}Òþ³¬€»ûÀÉ]õ–ˆjAËBâÉÂÑå¬ܰ~:ÿM=…]EÖ¬vvêéZvÌmÔÄpé[xKKûzצvå¹ÎO‰ê¬H¬æºTöxã9!\p¥Ù.m‘û=‡½¾[(­|!œwth “U¸È›À ®¸3_F©òäî>ÈõÂïUCs–âŠHš³‰iû­g^k§õih!ŠGmÚ\!…÷ºÀ$¿ÊÃÈèú)½“‡Y%3]Ž‹ÉãÒ@Püuþö2—’éFó©Ö@]ýàä½Ç=Ö¸môŒ¤ŒìLC'üD¤þˆ<¹­ܾÑpþ9®/}cØWÖžÎL{YÉÏx¼ž¥y¼Øî”wFÔÓÛSÁ§-.û•«MgŽ,WHBÖ·ajñ§$©;²‹š§ˆ!–Œ½‡âµÛt¹“@¦yþ?tWZ#«'PÎW=¼/ C@÷,ÿž%{V ߥ²sOò^**ïUTòBúF±§ v@*ÚýgrÇèäg¢ïóÄ{PSÓWÓV¶L㾩]‚Û}UþT1± mú§>jÞ§²ÇØ/56FOÌ'ó¡ìe+,õµ ‘Ž·Ó¼]±à{Õ¯Àlš‹‡¡¦œ¼9ÎÒy€NËf>…Ôºô–ñOÉT1(»9)Ú7ÁÈYXej@DDD@ˆZ}¬ñ%ÂÁAor¾ê${e‘œÆÀϼü]MÆÍ§¨’¢J¹&™ãÎaÊýq´[îôÆžãG T'}°8(ÅgÙß –‘†…§Â ³ž>EFTR5|Y MI¨ô‡1ä þ¬ôV—ÙþªñAZ*Is ‘­äsÈ9OŠó/Ù•œË–Û)Ú;ƒ®Á`‚Í`¥‚8#:X܆>,9Z$Ã’ÊòÁ†¯KBB" 1”DD@ŒäÀîYDD@DDD@DDD@X k(€ó¡½Ád4‹(€""ˆˆ" ˆ€""ˆˆ" ˆ€""ˆˆ" ˆ€""ˆˆÿÙopenslp-1.2.1/doc/html/ProgrammersGuide/SLPFindScopes.html0000644033442200000310000000574407326063215023365 0ustar rganesanfloppy OpenSLP Programmers Guide - SLPFindScopes()

SLPFindScopes


Declaration

#include <slp.h>

SLPError SLPFindScopes( SLPHandle hslp,
                        char** scopelist )
 

Description

Sets the scopelist parameter to a pointer to a comma separated list of all available scope values.  The most desirable values are always placed first in the list.  There is always one value, "DEFAULT", in the list.
 

Parameters

hslp Pointer to the string to be un-escaped
scopelist Pointer to a pointer for the dynamically allocated list of scopes.  The memory should be freed by a call to SLPFree() when no longer needed.

Returns

SLP_OK Indicates that the no error occurred during the operation.
SLP_NETWORK_TIMED_OUT When no reply can be obtained in the time specified by the configured timeout interval for a unicast request, this error is returned.  In other words, slpd is running, but something is wrong with it
SLP_NETWORK_INIT_FAILED If the network cannot initialize properly, this error is returned. Will also be returned if an SA or DA agent (slpd) can not be contacted.  slpd must be running in order to call SLPReg() or SLPDereg().
SLP_MEMORY_ALLOC_FAILED  Out of memory error
SLP_NETWORK_ERROR The failure of networking during normal operations causes this error to be returned.  In OpenSLP, this is the error you'll get if an underlying socket() call failed.
SLP_INTERNAL_SYSTEM_ERROR A basic failure of the API causes this error to be returned. This occurs when a system call or library fails. The operation could not recover.

Status

OpenSLP 0.8.0 Fully implemented as specified by RFC 2608.

See Also

Open SLP Users Guide openslp-1.2.1/doc/html/ProgrammersGuide/SLPSrvURLCallback.html0000644033442200000310000000734507326063215024101 0ustar rganesanfloppy OpenSLP Programmers Guide - SLPSrvURLCallback

SLPSrvURLCallback


Declaration

typedef SLPBoolean SLPSrvURLCallback( SLPHandle hslp,
                                      const char* srvurl,
                                      unsigned short lifetime,
                                      SLPError errcode,
                                      void* cookie )

Description

The SLPSrvURLCallback type is the type of the callback function parameter to SLPFindSrvs() function. If the hslp handle parameter was opened asynchronously, the results returned through the callback MAY be uncollated.

Parameters

hslp The language specific SLPHandle on which to register the service.
srvurl Pointer to the SLP Service URL of the requested service.  See Syntax for more information about SLP Service URLs
lifetime The lifetime of the service in seconds
errcode An error code indicating if an error occurred during the operation.  The callback should check this error code before processing the parameters. 
cookie The same cookie that was passed as a parameter to the SLPFindSrvs() call
 

Returns

The callback should return SLP_TRUE if more data is desired.  The callback may continue to return SLP_TRUE until it is called with an errcode of SLP_LAST_CALL.  If no more data is requested the callback should return SLP_FALSE.
 

Status

OpenSLP 0.6.0 SLPSrvURLCallback functions are called as specified by RFC 2614

See Also

Syntax, Callbacks
 
  openslp-1.2.1/doc/html/ProgrammersGuide/SLPFindSrvTypes.html0000644033442200000310000001515307326063215023723 0ustar rganesanfloppy OpenSLP Programmers Guide - SLPFindSrvTypes()

SLPFindSrvTypes


Declaration

#include <slp.h>

SLPError SLPFindSrvTypes( SLPHandle hslp,
                          const char* namingauthority,
                          const char* scopelist,
                          SLPSrvTypeCallback callback,
                          void* cookie)

Description

The SLPFindSrvType() function issues an SLP service type request for service types in the scopes indicated by the scopelist. The results are returned through the callback parameter. The service types are independent of language locale, but only for services registered in one of scopes and for the indicated naming authority.

If the namingauthority is "*", then results are returned for all naming authorities. If the naming authority is the empty string, i.e. "", then the default naming authority, "IANA", is used. "IANA" is not a valid naming authority name, and it is a SLP_PARAMETER_BAD error to include it explicitly.

The service type names are returned with the naming authority intact. If the naming authority is the default (i.e. empty string) then it is omitted, as is the separating ".". Service type names from URLs of the service: scheme are returned with the "service:" prefix intact.

Parameters

hslp The language specific SLPHandle on which to register the service.
namingauthority The naming authorities to search.  Use "*" for all naming authorities and the empty string, "", for the default naming authority (IANA).  See Syntax for more information on naming authorities.
scopelist A pointer to a comma separated list of scope names.  May be the empty string if you wish to use scopes this machine is configured for.  May not be NULL.
callback The address of an SLPSrvTypeCallback function that will be called to report the operation completion status.  May not be NULL. See Callbacks for more information on how callbacks are used by the SLPAPI.
cookie Pointer to memory that gets passed to the callback code.  May be NULL.

Returns

SLP_OK Indicates that the no error occurred during the operation.
SLP_PARSE_ERROR The SLP message was rejected by a remote SLP agent. The API returns this error only when no information was retrieved, and at least one SA or DA indicated a protocol error. The data supplied through the API may be malformed or a may have been damaged in transit.
SLP_AUTHENTICATION_ABSENT If the SLP framework supports authentication, this error arises when the UA or SA failed to send an authenticator for requests or registrations.
SLP_AUTHENTICATION_FAILED If the SLP framework supports authentication, this error arises when a authentication on an SLP message failed.
SLP_NETWORK_TIMED_OUT When no reply can be obtained in the time specified by the configured timeout interval for a unicast request, this error is returned.  In other words, slpd is running, but something is wrong with it
SLP_NETWORK_INIT_FAILED If the network cannot initialize properly, this error is returned. 
SLP_MEMORY_ALLOC_FAILED  Out of memory error
SLP_PARAMETER_BAD If a parameter passed into a function is bad, this error is returned.
SLP_NETWORK_ERROR The failure of networking during normal operations causes this error to be returned.  In OpenSLP, this is the error you'll get if an underlying socket() call failed.
SLP_INTERNAL_SYSTEM_ERROR A basic failure of the API causes this error to be returned. This occurs when a system call or library fails. The operation could not recover.
SLP_HANDLE_IN_USE Callback functions are not permitted to recursively call into the API on the same SLPHandle, either directly or indirectly. If an attempt is made to do so, this error is returned from the called API function.

If no service types can be found, no error is returned.  However, no calls (other than the SLP_LAST_CALL) will be made to the SLPSrvTypesCallback.  Be aware, especially if the call is async, of error codes that may be passed to the SLPSrvTypeCallback callback function.
 

Status

OpenSLP 0.7.4 Fully implemented as specified by RFC 2614

See Also

SLPSrvTypeCallback, Syntax, Callbacks openslp-1.2.1/doc/html/ProgrammersGuide/SLPReg.html0000644033442200000310000003072507326063215022042 0ustar rganesanfloppy OpenSLP Programmers Guide - SLPReg()

SLPReg


Declaration

#include <slp.h>

SLPError SLPReg( SLPHandle hslp,
                 const char* srvurl,
                 unsigned short lifetime,
                 const char* srvtype,
                 const char* attrs,
                 SLPBoolean fresh,
                 SLPRegReport callback,
                 void* cookie )

Description

Registers the URL in srvurl having the lifetime lifetime with the attribute list in attrs. The attrs list is a comma separated list of attribute assignments in the wire format (including escaping of reserved characters). The lifetime parameter must be nonzero and less than or equal to SLP_LIFETIME_MAXIMUM. If the fresh flag is SLP_TRUE, then the registration is new (the SLP protocol FRESH flag is set) and the registration replaces any existing registrations. The srvtype parameter is a service type name and can be included for service URLs that are not in the service: scheme. If the URL is in the service: scheme, the srvtype parameter is ignored. If the fresh flag is SLP_FALSE, then an existing registration is updated. Registrations and updates take place in the language locale of the hslp handle.
 

Parameters

hslp The language specific SLPHandle on which to register the service.
srvurl The service URL to register.  May not be the empty string.  May not be NULL.  Must conform to SLP Service URL syntax. SLP_INVALID_REGISTRATION will be returned if srvurl is not a SLP Service URL. See Syntax for more information on Service URL syntax.
lifetime An unsigned short giving the lifetime of the service in seconds.  The value must be an unsigned integer less than or equal to SLP_LIFETIME_MAXIMUM and greater than zero.  If lifetime is set to SLP_LIFETIME_MAXIMUM, it will remain registered for the life of the calling process.
srvtype This parameter is always ignored because the Service URL syntax required for the srvurl parameter encapsulates the service-type.  See Syntax for more information on Service URL syntax.
attrs A list of attribute assignment expressions for the attributes of the registered service.  Use the empty string, "" for no attributes.  Example: "(attr1=val1),(attr2=val2),(attr3=val3)"
fresh An SLPBoolean that is SLP_TRUE if the registration is new or SLP_FALSE for a re-registration.  Currently, OpenSLP does not support incremental registrations.  If fresh is SLP_FALSE, SLPReg() will return SLP_NOT_IMPLEMENTED.
callback The address of an SLPRegReport function that will be called to report the operation completion status.  Man not be NULL. See Callbacks for more information on how callbacks are used by the SLPAPI.
cookie Pointer to memory that gets passed to the callback code.  May be NULL.

Returns

SLP_OK Indicates that the no error occurred during the operation.
SLP_INVALID_REGISTRATION The deregistered service url does not conform to valid service url syntax.  The service url being deregistered is not registered this means that either it was never registered via a call to SLPReg() or that the registration lifetime has expired.   SLP_INVALID_REGISTRATION is commonly returned when an attempt is made to deregister a service that was registered by a call to SLPReg() on a different host.
SLP_PARSE_ERROR The SLP message was rejected by a remote SLP agent. The API returns this error only when no information was retrieved, and at least one SA or DA indicated a protocol error. The data supplied through the API may be malformed or a may have been damaged in transit.
SLP_AUTHENTICATION_ABSENT If the SLP framework supports authentication, this error arises when the UA or SA failed to send an authenticator for requests or registrations.
SLP_AUTHENTICATION_FAILED If the SLP framework supports authentication, this error arises when a authentication on an SLP message failed.
SLP_NETWORK_TIMED_OUT When no reply can be obtained in the time specified by the configured timeout interval for a unicast request, this error is returned.  In other words, slpd is running, but something is wrong with it
SLP_NETWORK_INIT_FAILED If the network cannot initialize properly, this error is returned. Will also be returned if an SA or DA agent (slpd) can not be contacted.  slpd must be running in order to call SLPReg() or SLPDereg().
SLP_MEMORY_ALLOC_FAILED  Out of memory error
SLP_PARAMETER_BAD If a parameter passed into a function is bad, this error is returned.
SLP_NETWORK_ERROR The failure of networking during normal operations causes this error to be returned.  In OpenSLP, this is the error you'll get if an underlying socket() call failed.
SLP_INTERNAL_SYSTEM_ERROR A basic failure of the API causes this error to be returned. This occurs when a system call or library fails. The operation could not recover.
SLP_HANDLE_IN_USE Callback functions are not permitted to recursively call into the API on the same SLPHandle, either directly or indirectly. If an attempt is made to do so, this error is returned from the called API function.

Be aware, especially if the call is async, of error codes that may be passed to the SLPRegReport() callback function.

Status

OpenSLP 0.8.0 Fully implemented as specified by RFC 2614

See Also

SLPDeReg(), Syntax, Callbacks
 

Example Code

#include <slp.h>

void MySLPRegReport(SLPHandle hslp, SLPError errcode, void* cookie)
{
    /* return the error code in the cookie */
    *(SLPError*)cookie = errcode;

    /* You could do something else here like print out  */
    /* the errcode, etc.  Remember, as a general rule,  */
    /* do not try to do too much in a callback because  */
    /* it is being executed by the same thread that is  */
    /* reading slp packets from the wire.               */
}

int main(int argc, char* argv[])
{
    SLPError err;
    SLPError callbackerr;
    SLPHandle hslp;

    err = SLPOpen("en",SLP_FALSE,&hslp);
    if(err != SLP_OK)
    {
        printf("Error opening slp handle %i\n",err);
        return err;
    }

    /* Register a service with SLP */
    err = SLPReg( hslp,
                  "service:myservice.myorg://hostname.domain.com:6672",
                  SLP_LIFETIME_MAXIMUM,
                  0,
                  "(public_key=......my_pgp_key.......)",
                  SLP_TRUE,
                  MySLPRegReport,
                  &callbackerr );

    /* err may contain an error code that occurred as the slp library    */
    /* _prepared_ to make the call.                                     */
    if(( err != SLP_OK) || (callbackerr != SLP_OK))
    {
        printf("Error registering service with slp %i\n",err);
        return err;
    }

    /* callbackerr may contain an error code (that was assigned through */
    /* the callback cookie) that occurred as slp packets were sent on    */
    /* the wire */
    if( callbackerr != SLP_OK)
    {
        printf("Error registering service with slp %i\n",callbackerr);
        return callbackerr;
    }

    /* Now that we're done using slp, close the slp handle */
    SLPClose(hslp);

    /* rest of program */
}
 

openslp-1.2.1/doc/html/ProgrammersGuide/SLPRegReport.html0000644033442200000310000000350407142533111023222 0ustar rganesanfloppy OpenSLP Programmers Guide - SLPRegReport Callback

SLPRegReport


Declaration

typedef void SLPRegReport(SLPHandlehslp, SLPError errcode, void* cookie)
 

Description

The SLPRegReport callback type is used as the type for the callback function that is passed in to the SLPReg(), SLPDeReg() and SLPDelAttrs() functions.
 

Parameters

hslp The SLPHandle that was used to initiate the operation.
errcode An error code indicating if an error occurred during the operation.
cookie Pointer to the same memory that was passed into the initiating function call.
 

Returns

None
 

Status

OpenSLP 0.6.0 SLPRegReport() callbacks are called as specified by RFC 2614. 

See Also

Callbacks
  openslp-1.2.1/doc/html/ProgrammersGuide/Security.html0000644033442200000310000001035407271376276022566 0ustar rganesanfloppy OpenSLP Programmers Guide - Security

Writing Secure SLP Enabled Applications

Introduction

Major changes were made to the OpenSLP 0.8.x codebase to add SLPv2 message authentication support for OpenSLP 0.9.0.   Until this time, there were no plans to ever implement SLPv2 security due to the ideas expressed in a internal Caldera document entitled "OpenSLP and SLPv2 Authentication".    The document  (full text available) mostly references and draws conclusions from discussion from the srvloc@srvloc.org mailing list.   The following is the concluding paragraphs of the document.
 
For those that are not willing to endure the tedium of reading the entire mailing list discussion,  the conclusion was eventually made (at least by the author) that though SLP authentication may be  appropriate in some specialized SLP deployments, it is probably not beneficial in normal network computer environments.    This conclusion is based on the following premises:
    • Implementation of SLP authentication in the absence of public key infrastructure standards would require enough manual configuration to invalidate all claims SLP has to increased usability.
    • Common helper protocols DNS, DHCP, IP, even ARP are currently insecure for usability reasons.   SLP fits into this category of protocols where lack of security may be considered a feature when it allows for maximal usability.
    • Given the lack of security in the above mentioned (and other) protocols self-established authentication of end to end communication is required anyway for secure communication of network software entities.
    • In the presence of appropriate end to end security mechanisms,  SLP related security attacks are limited to the realm of "denial of service" or "disruptions" -- even when no authentication is implemented in SLP.   In other words there is not a risk of compromise of confidential information that can be attributed to SLP as long as appropriate end to end security is established.


    So, for the OpenSLP project, there are not any plans to implement SLPv2 security.   (This may change in the future depending on the success of ongoing PKI standardization efforts.)   There are, however, many things that could be done to reduce opportunities for "denial of service attacks" or other malicious SLP related disruptions.   These will be addressed in future versions of OpenSLP.    Also, in order to inform developers about the importance of writing secure applications, plans have been made to include an SLP Security HOWTO as part of the OpenSLP Documentation.

The existence of SLPv2 authentication in OpenSLP does not eliminate the need to provide secure end-to-end communication for service specific protocols   (read the full text of the paper if you don't know what I'm talking about here).  OpenSLP security does not do any good at all if the authentication, integrity, and/or privacy of service specific communication weak.
 

Who should read this document?

If you are a developer that writes SLP enabled software, you should read this document.  If you are a system or network administrator that is concerned with how to setup and maintain secure SLP installations, you should read the Security section of the OpenSLP Users guide.
 
 

*** PLEASE PATIENT UNTIL I GET SOME TIME TO WRITE THE REST OF THIS DOCUMENT *** openslp-1.2.1/doc/html/ProgrammersGuide/SLPSetProperty.html0000644033442200000310000000464407326063215023626 0ustar rganesanfloppy

SLPSetProperty


Declaration

#include <slp.h>

void SLPSetProperty( const char* name,
                     const char* value )
 

Description

This function is supposed to allow the caller to set SLP properties, but it is impossible to implement this function along with SLPGetProperty() in a way that is even remotely thread safe.  Therefore,  OpenSLP completely ignores all calls made to SLPSetProperty() so that SLPGetProperty() can be used in threaded applications.
 

Parameters

name Pointer to the name of a net.slp property to set.  See OpenSLP Users Guide for a list of supported properties
value Pointer to the new string value.

Returns

None

Status

OpenSLP 0.8.0 Not implemented.  See Notes.

Notes

For some reason the SLP API writers decided to make SLPGetProperty() and SLPSetProperty() calls impossible to implement in a thread safe manner.  For this reason OpenSLP only allows read only access to SLP properties.  Properties are read into static data structures when the process loads, and never changed so at least SLPGetProperty() can be called from threaded applications.

Some discussions have taken place on the srvloc mailing list and it looks like the SLP API will be revised to solve this problem.  Until this time OpenSLP will not implement SLPSetProperty().

See Also

SLPGetProperty()Open SLP Users Guide openslp-1.2.1/doc/html/ProgrammersGuide/Examples.html0000644033442200000310000000103307142533111022503 0ustar rganesanfloppy OpenSLP Programmers Guide - Examples

OpenSLP Example Code


< put example code here > openslp-1.2.1/doc/html/ProgrammersGuide/Syntax.html0000644033442200000310000001332607142533111022223 0ustar rganesanfloppy OpenSLP Programmers Guide - Syntax

SLP Syntaxes


SLP Service Type Syntax

The official definition of Service Type strings can be found in RFC 2609, "Service Templates and Service Schemes".  If you will be working with "well known" (IANA) service types, you should read it.  If you are developing applications for "proprietary" services then you will probably be satisfied with the following explanation:
Service-Type = "service:"<abstract-type.naming-authority>":"<concrete-type>
The abstract-type is simple (hopefully short) descriptive string that describes the type of service.  The naming-authority is the name (hopefully unique) name of the organization that named the service.  The naming-authority is optional, but if it is omitted then IANA is assumed to be the naming authority and IANA requires service-types to be registered (see RFC 2609).  The concrete-type is also optional.  Think of a concrete-type as a kind of sub-type of the abstract-type.  For example, "printer" is an abstract type (owned by IANA) and "printer:lpr" is a concrete type (owned by IANA).

Service Type Examples

"weather.nasa:wtp"  - A (fictitious) weather service type owned by NASA that uses WTP protocol
"weather.nasa:swtp" - A (fictitious) weather service type owned by NASA that uses SWTP protocol.
"chat.superchat" - A chat service type owned by SuperChat
"printer.samba" - A samba printer service type
"ftp" - An IANA ftp service type
"telnet" - An IANA telnet service type

Comparing Service Types

Since service types are an important in determining the urls that are return by the SLPFindSrvs() call you should understand how OpenSLP compares services.  Suppose that three services were registered with SLPReg() using a srvtype of "printer:lpr", "printer" and "printer.acme".  If a client program calls SLPFindSrvs() with a srvtype of "service:printer" the urls for both "printer:lpr" and "printer" are returned ("printer.acme" is not).  However, if SLPFindSrvs() is called with srvtype of "printer:lpr" or "printer.acme" then the urls for "printer:lpr" or "printer.acme" would be returned.  In other words, if a concrete type is used, only services with same abstract and concrete type are returned.  If only the abstract type is used then all services of that abstract type (and naming authority) are returned.

A word about naming authorities

It is our opinion that developers MUST use a naming authority if an IANA service template has not been defined that fits the type of service that is being supplied by their application.  If developers use a predefined IANA service template they must use it correctly.

SLP Service Url Syntax

URL strings passed as parameters to SLPReg(), SLPDeReg(), SLPDelAttrs(), SLPFindSrvs(), SLPParseSrvURL() functions and returned as a result to the SLPSrvURLCallback() callback function.  SLP defines a special type of URL called a Service URL that MUST be used when calling OpenSLP API functions.  If you decide to use Service URLs extensively, you should probably read RFC 2609, but if you just want to know what they look like, the following explanation should be good enough:
SLP Service URL = "service:"<service-type>"://"<addrspec>
The service-type is a service type as explained above. addrspec can be just about anything you want that fits URL syntax (    ) and can be translated as a network location.  The "service:" and "://" strings are required.

Service URL Examples

"service:weather.nasa:wtp://weather.nasa.com:12000"
"service:weather.nasa:swtp://weather.nasa.com:12001"
"service:chat.superchat://chat.superchat.com;auth=ldap"

Do I have to use the SLP Service URL syntax for my urls?

Yes.  With OpenSLP you are required to use Service URLs, API functions will return SLP_PARSE_ERROR if you do not.  The reason that OpenSLP requires Service URLs is because the SLP API designers do not allow the service-type to be passed in as a parameter to the SLPDeReg() call.  With out the service-type, SLPDeReg() does not allow the caller to distinguish between services of varying types that were registered with the same standard URL.
 

LDAPv3 Search Filter Syntax

An LDAP Search Filter string is passed parameter to the SLPFindSrvs() function.  If you want the definitive explanation of LDAP3 search filters you can read RFC 2254, "String Representation of LDAP Search Filters", or you can read the following definition that should be good enough for most applications.
  openslp-1.2.1/README0000644033442200000310000000720410202457231013737 0ustar rganesanfloppyOpenslp README =============== 1 - Introduction 2 - Roadmap 3 - Build 4 - Install 5 - Users Guide 6 - Developers Guide 7 - FAQ 1 - Introduction ----------------- The OpenSLP project is an effort to develop an open-source implementation of Service Location Protocol suitable for commercial and non-commercial application. OpenSLP 1.3.0 is a develper release of the cutting edge OpenSLP code. If you are looking for a stable release, you should download the latest revision of the 1.2.x series. OpenSLP 1.2.1 is the second release of the 1.2.x series. This release contains several bug fixes - mostly accumlated through the efforts of the SuSE team in Germany. However, others have contributed as well over time. Known Issues: - This code works on Linux and Windows, but has not been thoroughly tested on Solaris or other platforms. Please help out in this respect. Please feel free to send patches for your OS directly to me or to the openslp-devel@sourceforge.net mailing list. 2 - Roadmap ------------ For more information about the roadmap for OpenSLP 1.2.x please take a look at http://www.openslp.org/roadmap.html 3 - Building OpenSLP --------------------- Building OpenSLP requires the proper installation of automake, autoconf and libtool. To build OpenSLP please use the following steps: - Unzip and untar the openslp-x.x.x.tar.gz tarball. $ tar -zxf openslp-x.x.x.tar.gz - Run the autogen.sh script to generate configure script. Do not be alarmed if the autogen script prints a few errors. Try the resulting configure (next step) script anyway. If the ./configure script already exists, skip running ./autogen.sh $ cd openslp-x.x.x $ ./autogen.sh - Run the configure script to create openslp make files. Please note that the configure script accepts several --enable-xxxx and --disable-xxxx options that should be interesting to you. Run ./configure --help and read the details of each of these switches. If the configure script fails... now you have a problem. $ ./configure --help $ ./configure - Run the top level make file (you need to use GNU make) $ make - If the make is successful, look for the following binaries: slpd/slpd libslp/.libs/libslp.so test/.libs/* 4 - Installing OpenSLP ----------------------- To install OpenSLP make the install target in the top level make file $ make install Installation of OpenSLP creates the following files: /usr/sbin/slpd /usr/lib/libslp.so.x.x (and several appropriate links) /usr/lib/libslp.a /etc/slp.conf (old slp.conf is renamed) /etc/slp.reg (old slp.reg is renamed) 5 - OpenSLP Users Guide ------------------------ Rather than be repetitive in this document, the reader is refered to a fairly complete OpenSLP users guide that is available in the doc/html directory of the OpenSLP distribution or on the web at: http://www.openslp.org/doc/html/UsersGuide The OpenSLp users guide gives instruction on how network and system administrators should configure and use OpenSLP once it is installed 6 - OpenSLP Programmers Guide ------------------------------ Again, to avoid repetition, the reader is refered to a the Programmers Guide available in the doc/html directory of the OpenSLP distribution or on the web at: http://www.openslp.org/doc/html/ProgrammersGuide 7 - FAQ -------- The frequently asked questions have been moved to a faq.html file located in the doc directory of the OpenSLP tarball. openslp-1.2.1/libslpattr/0000755033442200000310000000000010211377552015243 5ustar rganesanfloppyopenslp-1.2.1/libslpattr/Makefile.am0000644033442200000310000000122010207404661017267 0ustar rganesanfloppy EXTRA_DIST = libslpattr.dsp libslpattr.dsw libslpattr.mak #if you're building on Irix, exchange commented and uncommented lines #noinst_LTLIBRARIES = libslpattr.a noinst_LTLIBRARIES = libslpattr.la if ENABLE_PREDICATES PREDICATE_SRCS = libslpattr.c else PREDICATE_SRCS = libslpattr_tiny.c endif #if you're building on Irix, exchange commented and uncommented lines #EXTRA_libslpattr_a_SOURCES = libslpattr.c libslpattr_tiny.c #libslpattr_a_SOURCES = $(PREDICATE_SRCS) libslpattr_internal.h EXTRA_libslpattr_la_SOURCES = libslpattr.c libslpattr_tiny.c libslpattr_la_SOURCES = $(PREDICATE_SRCS) libslpattr_internal.h noinst_HEADERS = libslpattr.h openslp-1.2.1/libslpattr/libslpattr.dsw0000644033442200000310000000100207166210735020137 0ustar rganesanfloppyMicrosoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "libslpattr"=.\libslpattr.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### openslp-1.2.1/libslpattr/libslpattr.mak0000644033442200000310000000654210202047477020124 0ustar rganesanfloppy# Microsoft Developer Studio Generated NMAKE File, Based on libslpattr.dsp !IF "$(CFG)" == "" CFG=libslpattr - Win32 Debug !MESSAGE No configuration specified. Defaulting to libslpattr - Win32 Debug. !ENDIF !IF "$(CFG)" != "libslpattr - Win32 Release" && "$(CFG)" != "libslpattr - Win32 Debug" !MESSAGE Invalid configuration "$(CFG)" specified. !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "libslpattr.mak" CFG="libslpattr - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "libslpattr - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "libslpattr - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE !ERROR An invalid configuration is specified. !ENDIF !IF "$(OS)" == "Windows_NT" NULL= !ELSE NULL=nul !ENDIF CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "libslpattr - Win32 Release" OUTDIR=.\Release INTDIR=.\Release # Begin Custom Macros OutDir=.\Release # End Custom Macros ALL : "$(OUTDIR)\libslpattr.lib" CLEAN : -@erase "$(INTDIR)\libslpattr.obj" -@erase "$(INTDIR)\vc60.idb" -@erase "$(OUTDIR)\libslpattr.lib" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP_PROJ=/nologo /MT /W3 /GX /O2 /I ".\\" /I "..\common" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBSLP_EXPORTS" /Fp"$(INTDIR)\libslpattr.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c BSC32=bscmake.exe BSC32_FLAGS=/nologo /o"$(OUTDIR)\libslpattr.bsc" BSC32_SBRS= \ LIB32=link.exe -lib LIB32_FLAGS=/nologo /out:"$(OUTDIR)\libslpattr.lib" LIB32_OBJS= \ "$(INTDIR)\libslpattr.obj" "$(OUTDIR)\libslpattr.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) $(LIB32) @<< $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) << !ELSEIF "$(CFG)" == "libslpattr - Win32 Debug" OUTDIR=.\Debug INTDIR=.\Debug # Begin Custom Macros OutDir=.\Debug # End Custom Macros ALL : "$(OUTDIR)\libslpattr.lib" CLEAN : -@erase "$(INTDIR)\libslpattr.obj" -@erase "$(INTDIR)\vc60.idb" -@erase "$(INTDIR)\vc60.pdb" -@erase "$(OUTDIR)\libslpattr.lib" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" CPP_PROJ=/nologo /MTd /W3 /Gm /GX /ZI /Od /I ".\\" /I "..\common" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBSLP_EXPORTS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c BSC32=bscmake.exe BSC32_FLAGS=/nologo /o"$(OUTDIR)\libslpattr.bsc" BSC32_SBRS= \ LIB32=link.exe -lib LIB32_FLAGS=/nologo /out:"$(OUTDIR)\libslpattr.lib" LIB32_OBJS= \ "$(INTDIR)\libslpattr.obj" "$(OUTDIR)\libslpattr.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) $(LIB32) @<< $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) << !ENDIF .c{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.obj:: $(CPP) @<< $(CPP_PROJ) $< << .c{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cpp{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << .cxx{$(INTDIR)}.sbr:: $(CPP) @<< $(CPP_PROJ) $< << !IF "$(NO_EXTERNAL_DEPS)" != "1" !IF EXISTS("libslpattr.dep") !INCLUDE "libslpattr.dep" !ELSE !MESSAGE Warning: cannot find "libslpattr.dep" !ENDIF !ENDIF !IF "$(CFG)" == "libslpattr - Win32 Release" || "$(CFG)" == "libslpattr - Win32 Debug" SOURCE=.\libslpattr.c "$(INTDIR)\libslpattr.obj" : $(SOURCE) "$(INTDIR)" !ENDIF openslp-1.2.1/libslpattr/libslpattr_tiny.c0000644033442200000310000002071310202047477020635 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slpd_database.c */ /* */ /* Abstract: A "tiny" implementation of slp_attr. Instead of providing */ /* the full functionality, we give a minimal interface for */ /* use in slpd. */ /***************************************************************************/ #include #include #include #include /***************************************************************************** * * Implemented functions. * ****************************************************************************/ /* The tiny attribute structure. */ struct xx_TinyAttr { char *attributes; /* A null terminated attribute string. */ int attr_len; /* The length of the attributes member. */ }; SLPError SLPAttrAlloc( const char *lang, const FILE *template_h, const SLPBoolean strict, SLPAttributes *slp_attr_h ) { struct xx_TinyAttr **slp_attr; slp_attr = (struct xx_TinyAttr**)slp_attr_h; /* Don't bother sanity checking. */ /* FIXME Should we check? */ (*slp_attr) = (struct xx_TinyAttr*)malloc( sizeof(struct xx_TinyAttr) ); if(*slp_attr == NULL) { return SLP_MEMORY_ALLOC_FAILED; } (*slp_attr)->attributes = NULL; (*slp_attr)->attr_len = 0; return SLP_OK; } void SLPAttrFree(SLPAttributes attr_h) { struct xx_TinyAttr *slp_attr = (struct xx_TinyAttr*)attr_h; /***** Free data. *****/ if(slp_attr->attributes) { free(slp_attr->attributes); } slp_attr->attr_len = 0; /***** Free struct. *****/ free(slp_attr); slp_attr = NULL; } /* TODO/FIXME Does not freshen, instead replaces. */ SLPError SLPAttrFreshen(SLPAttributes attr_h, const char *new_attrs) { struct xx_TinyAttr *slp_attr = (struct xx_TinyAttr*)attr_h; /***** Free old data. *****/ if(slp_attr->attributes) { free(slp_attr->attributes); } slp_attr->attr_len = 0; /***** Copy new data. *****/ slp_attr->attributes = strdup(new_attrs); if(slp_attr->attributes == NULL) { return SLP_MEMORY_ALLOC_FAILED; } slp_attr->attr_len = strlen(new_attrs); /***** Done. *****/ return SLP_OK; } SLPError SLPAttrSerialize(SLPAttributes attr_h, const char* tags /* NULL terminated */, char **out_buffer /* Where to write. if *out_buffer == NULL, space is alloc'd */, int bufferlen, /* Size of buffer. */ int* count, /* Bytes needed/written. */ SLPBoolean find_delta ) { struct xx_TinyAttr *slp_attr = (struct xx_TinyAttr*)attr_h; /* Write the amount of space we need. */ if(count != NULL) { *count = slp_attr->attr_len + 1; /* For the null. */ } /* Check that we have somewhere to write to. */ if(bufferlen < slp_attr->attr_len + 1) { /* +1 for null. */ return SLP_BUFFER_OVERFLOW; } assert(out_buffer != NULL && *out_buffer != NULL); /* Verify we have somewhere to write. */ /* Check for empty string. */ if(slp_attr->attr_len == 0) { **out_buffer = 0; /* Empty string. */ return SLP_OK; } /* Copy. */ strcpy(*out_buffer, slp_attr->attributes); return SLP_OK; } /***************************************************************************** * * Unimplemented functions. * ****************************************************************************/ SLPError SLPAttrAllocStr( const char *lang, const FILE *template_h, const SLPBoolean strict, SLPAttributes *slp_attr, const char *str ) { return SLP_NOT_IMPLEMENTED; } /* Attribute manipulation. */ SLPError SLPAttrSet_bool( SLPAttributes attr_h, const char *attribute_tag, SLPBoolean val ) { return SLP_NOT_IMPLEMENTED; } SLPError SLPAttrSet_str( SLPAttributes attr_h, const char *tag, const char *val, SLPInsertionPolicy pol ) { return SLP_NOT_IMPLEMENTED; } SLPError SLPAttrSet_keyw( SLPAttributes attr_h, const char *attribute_tag ) { return SLP_NOT_IMPLEMENTED; } SLPError SLPAttrSet_int( SLPAttributes attr_h, const char *tag, int val, SLPInsertionPolicy policy ) { return SLP_NOT_IMPLEMENTED; } SLPError SLPAttrSet_opaque( SLPAttributes attr_h, const char *tag, const char *val, const unsigned int len, SLPInsertionPolicy policy ) { return SLP_NOT_IMPLEMENTED; } SLPError SLPAttrSet_guess( SLPAttributes attr_h, const char *tag, const char *val, SLPInsertionPolicy policy ) { return SLP_NOT_IMPLEMENTED; } /* Attribute Querying. */ SLPError SLPAttrGet_bool( SLPAttributes attr_h, const char *tag, SLPBoolean *val ) { return SLP_NOT_IMPLEMENTED; } SLPError SLPAttrGet_keyw( SLPAttributes attr_h, const char *tag ) { return SLP_NOT_IMPLEMENTED; } SLPError SLPAttrGet_int( SLPAttributes attr_h, const char *tag, int *val[], int *size ) { return SLP_NOT_IMPLEMENTED; } SLPError SLPAttrGet_str( SLPAttributes attr_h, const char *tag, char ***val, int *size ) { return SLP_NOT_IMPLEMENTED; } SLPError SLPAttrGet_opaque( SLPAttributes attr_h, const char *tag, SLPOpaque ***val, int *size ) { return SLP_NOT_IMPLEMENTED; } /* Misc. */ SLPError SLPAttrGetType(SLPAttributes attr_h, const char *tag, SLPType *type) { return SLP_NOT_IMPLEMENTED; } /* Functions. */ SLPError SLPRegAttr( SLPHandle slp_h, const char* srvurl, unsigned short lifetime, const char* srvtype, SLPAttributes attr_h, SLPBoolean fresh, SLPRegReport callback, void* cookie ) { return SLP_NOT_IMPLEMENTED; } SLPError SLPFindAttrObj ( SLPHandle hslp, const char* srvurlorsrvtype, const char* scopelist, const char* attrids, SLPAttrObjCallback *callback, void* cookie ) { return SLP_NOT_IMPLEMENTED; } /***************************************************************************** * * Functions for the iterator struct * ****************************************************************************/ SLPError SLPAttrIteratorAlloc(SLPAttributes attr, SLPAttrIterator *iter) { return SLP_NOT_IMPLEMENTED; } void SLPAttrIteratorFree(SLPAttrIterator iter) { return ; } SLPBoolean SLPAttrIterNext(SLPAttrIterator iter_h, char const **tag, SLPType *type) { return SLP_NOT_IMPLEMENTED; } openslp-1.2.1/libslpattr/libslpattr.h0000644033442200000310000001445710202047477017607 0ustar rganesanfloppy #ifndef SLP_ATTR_H_INCLUDED #define SLP_ATTR_H_INCLUDED #include "../common/slp_compare.h" #include "../libslp/slp.h" #include #define SLP_TAG_BAD 300 #define SLP_TAG_ERROR 400 /* The type for SLP attributes. An opaque type that acts as a handle to an * attribute bundle. */ typedef void *SLPAttributes; typedef void *SLPAttrIterator; typedef void *SLPTemplate; /* The callback for receiving attributes from a SLPFindAttrObj(). */ typedef SLPBoolean SLPAttrObjCallback( SLPHandle hslp, const SLPAttributes attr, SLPError errcode, void* cookie ); /* A datatype to encapsulate opaque data.*/ typedef struct { int len; char *data; } SLPOpaque; /***************************************************************************** * * Datatype to represent the types of known attributes. * ****************************************************************************/ typedef int SLPType; #define SLP_BOOLEAN ((SLPType)1) #define SLP_INTEGER ((SLPType)2) #define SLP_KEYWORD ((SLPType)4) #define SLP_STRING ((SLPType)8) #define SLP_OPAQUE ((SLPType)16) /***************************************************************************** * * Datatype to represent modes of attribute modification. * ****************************************************************************/ typedef enum { SLP_ADD = 1, /* Appends to the attribute list.*/ SLP_REPLACE = 2 /* Replaces attribute. */ } SLPInsertionPolicy; /***************************************************************************** * * Functions for the attribute struct. One could almost call them methods. * ****************************************************************************/ SLPError SLPAttrAlloc( const char *lang, const FILE *template_h, const SLPBoolean strict, SLPAttributes *slp_attr ); SLPError SLPAttrAllocStr( const char *lang, const FILE *template_h, const SLPBoolean strict, SLPAttributes *slp_attr, const char *str ); void SLPAttrFree(SLPAttributes attr_h); /* Attribute manipulation. */ SLPError SLPAttrSet_bool( SLPAttributes attr_h, const char *attribute_tag, SLPBoolean val ); SLPError SLPAttrSet_str( SLPAttributes attr_h, const char *tag, const char *val, SLPInsertionPolicy ); SLPError SLPAttrSet_keyw( SLPAttributes attr_h, const char *attribute_tag ); SLPError SLPAttrSet_int( SLPAttributes attr_h, const char *tag, int val, SLPInsertionPolicy policy ); SLPError SLPAttrSet_opaque( SLPAttributes attr_h, const char *tag, const char *val, const unsigned int len, SLPInsertionPolicy policy ); SLPError SLPAttrSet_guess( SLPAttributes attr_h, const char *tag, const char *val, SLPInsertionPolicy policy ); /* Attribute Querying. */ SLPError SLPAttrGet_bool( SLPAttributes attr_h, const char *tag, SLPBoolean *val ); SLPError SLPAttrGet_keyw( SLPAttributes attr_h, const char *tag ); SLPError SLPAttrGet_int( SLPAttributes attr_h, const char *tag, int *val[], int *size ); SLPError SLPAttrGet_str( SLPAttributes attr_h, const char *tag, char ***val, int *size ); SLPError SLPAttrGet_opaque( SLPAttributes attr_h, const char *tag, SLPOpaque ***val, int *size ); /* Misc. */ SLPError SLPAttrGetType(SLPAttributes attr_h, const char *tag, SLPType *type); SLPError SLPAttrSerialize(SLPAttributes attr_h, const char* tags /* NULL terminated */, char **buffer, int bufferlen, /* Size of buffer. */ int* count, /* Bytes needed/written. */ SLPBoolean find_delta ); SLPError SLPAttrFreshen(SLPAttributes attr_h, const char *new_attrs); /* Functions. */ SLPError SLPRegAttr( SLPHandle slp_h, const char* srvurl, unsigned short lifetime, const char* srvtype, SLPAttributes attr_h, SLPBoolean fresh, SLPRegReport callback, void* cookie ); SLPError SLPFindAttrObj ( SLPHandle hslp, const char* srvurlorsrvtype, const char* scopelist, const char* attrids, SLPAttrObjCallback *callback, void* cookie ); /***************************************************************************** * * Functions for the iterator struct * ****************************************************************************/ SLPError SLPAttrIteratorAlloc(SLPAttributes attr, SLPAttrIterator *iter); void SLPAttrIteratorFree(SLPAttrIterator iter); SLPBoolean SLPAttrIterNext(SLPAttrIterator iter_h, char const **tag, SLPType *type); #endif openslp-1.2.1/libslpattr/libslpattr.dsp0000644033442200000310000000555407166210734020147 0ustar rganesanfloppy# Microsoft Developer Studio Project File - Name="libslpattr" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Static Library" 0x0104 CFG=libslpattr - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "libslpattr.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "libslpattr.mak" CFG="libslpattr - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "libslpattr - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "libslpattr - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "libslpattr - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c # ADD CPP /nologo /MT /W3 /GX /O2 /I ".\\" /I "..\common" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBSLP_EXPORTS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo !ELSEIF "$(CFG)" == "libslpattr - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I ".\\" /I "..\common" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBSLP_EXPORTS" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo !ENDIF # Begin Target # Name "libslpattr - Win32 Release" # Name "libslpattr - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=.\libslpattr.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # End Target # End Project openslp-1.2.1/libslpattr/libslpattr_internal.h0000644033442200000310000000563410202047477021500 0ustar rganesanfloppy/***** * Abstract: * * The internal structures that represent an attribute list. This is made * available for slpd to speed its access to values for predicate evaluation. ****/ /****************************************************************************** * * Individual values * * What is a value? * * In SLP an individual attribute can be associated with a list of values. A * value is the data associated with a tag. Depending on the type of * attribute, there can be zero, one, or many values associated with a single * tag. *****************************************************************************/ typedef struct xx_value_t { struct xx_value_t *next; int escaped_len; int unescaped_len; union { SLPBoolean va_bool; int va_int; char *va_str; /* This is used for keyword, string, and opaque. */ } data; /* Stores the value of the variable. Note, any string must be copied into the struct. */ /* Memory handling */ struct xx_value_t *next_chunk; /* The next chunk of allocated memory in the value list. */ struct xx_value_t *last_value_in_chunk; /* The last value in the chunk. Only set by the chunk head. */ } value_t; /****************************************************************************** * * Individual attributes (vars) * * What is a var? * * A var is a variable tag that is associated with a list of values. Zero or * more vars are kept in a single SLPAttributes object. Each value stored in * a var is kept in a value struct. *****************************************************************************/ /* An individual attribute in the struct. */ typedef struct xx_var_t { struct xx_var_t *next; /* Pointer to the next variable. */ SLPType type; /* The type of this variable. */ const char *tag; /* The name of this variable. */ unsigned int tag_len; /* The length of the tag. */ value_t *list; /* The list of values. */ int list_size; /* The number of values in the list. */ SLPBoolean modified; /* Flag. Set to be true if the attribute should be included in the next freshen. */ } var_t; /****************************************************************************** * * All the attributes. * *****************************************************************************/ /* The opaque struct representing a SLPAttributes handle. */ struct xx_SLPAttributes { SLPBoolean strict; /* Are we using strict typing? */ char *lang; /* Language. */ var_t *attrs; /* List of vars to be sent. */ int attr_count; /* The number of attributes */ }; /* Finds a variable by its tag. */ var_t *attr_val_find_str(struct xx_SLPAttributes *slp_attr, const char *tag, int tag_len); /* Finds the type of an attribute. */ SLPError SLPAttrGetType_len(SLPAttributes attr_h, const char *tag, int tag_len, SLPType *type); openslp-1.2.1/libslpattr/Makefile.in0000644033442200000310000003452710211377470017322 0ustar rganesanfloppy# Makefile.in generated by automake 1.8.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libslpattr_la_SOURCES) $(EXTRA_libslpattr_la_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_triplet = @host@ subdir = libslpattr DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(mkdir_p) CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libslpattr_la_LIBADD = am__libslpattr_la_SOURCES_DIST = libslpattr_tiny.c libslpattr.c \ libslpattr_internal.h @ENABLE_PREDICATES_FALSE@am__objects_1 = libslpattr_tiny.lo @ENABLE_PREDICATES_TRUE@am__objects_1 = libslpattr.lo am_libslpattr_la_OBJECTS = $(am__objects_1) libslpattr_la_OBJECTS = $(am_libslpattr_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/libslpattr.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/libslpattr_tiny.Plo COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libslpattr_la_SOURCES) $(EXTRA_libslpattr_la_SOURCES) DIST_SOURCES = $(am__libslpattr_la_SOURCES_DIST) \ $(EXTRA_libslpattr_la_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_ASYNC_API_FALSE = @ENABLE_ASYNC_API_FALSE@ ENABLE_ASYNC_API_TRUE = @ENABLE_ASYNC_API_TRUE@ ENABLE_PREDICATES_FALSE = @ENABLE_PREDICATES_FALSE@ ENABLE_PREDICATES_TRUE = @ENABLE_PREDICATES_TRUE@ ENABLE_SLPv1_FALSE = @ENABLE_SLPv1_FALSE@ ENABLE_SLPv1_TRUE = @ENABLE_SLPv1_TRUE@ ENABLE_SLPv2_SECURITY_FALSE = @ENABLE_SLPv2_SECURITY_FALSE@ ENABLE_SLPv2_SECURITY_TRUE = @ENABLE_SLPv2_SECURITY_TRUE@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ EXTRA_DIST = libslpattr.dsp libslpattr.dsw libslpattr.mak #if you're building on Irix, exchange commented and uncommented lines #noinst_LTLIBRARIES = libslpattr.a noinst_LTLIBRARIES = libslpattr.la @ENABLE_PREDICATES_FALSE@PREDICATE_SRCS = libslpattr_tiny.c @ENABLE_PREDICATES_TRUE@PREDICATE_SRCS = libslpattr.c #if you're building on Irix, exchange commented and uncommented lines #EXTRA_libslpattr_a_SOURCES = libslpattr.c libslpattr_tiny.c #libslpattr_a_SOURCES = $(PREDICATE_SRCS) libslpattr_internal.h EXTRA_libslpattr_la_SOURCES = libslpattr.c libslpattr_tiny.c libslpattr_la_SOURCES = $(PREDICATE_SRCS) libslpattr_internal.h noinst_HEADERS = libslpattr.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libslpattr/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu libslpattr/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" = "$$p" && dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libslpattr.la: $(libslpattr_la_OBJECTS) $(libslpattr_la_DEPENDENCIES) $(LINK) $(libslpattr_la_LDFLAGS) $(libslpattr_la_OBJECTS) $(libslpattr_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libslpattr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libslpattr_tiny.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: openslp-1.2.1/libslpattr/libslpattr.c0000644033442200000310000022506310204453052017567 0ustar rganesanfloppy#include #include #include #include #include "libslpattr.h" #include "libslpattr_internal.h" /* The strings used to represent non-string variables. */ #define BOOL_TRUE_STR "true" #define BOOL_TRUE_STR_LEN 4 #define BOOL_FALSE_STR "false" #define BOOL_FALSE_STR_LEN 5 /* The preamble to every variable. */ #define VAR_PREFIX '(' #define VAR_PREFIX_LEN 1 #define VAR_INFIX '=' #define VAR_INFIX_LEN 1 #define VAR_SUFFIX ')' #define VAR_SUFFIX_LEN 1 #define VAR_SEPARATOR ',' #define VAR_SEPARATOR_LEN 1 /* The cost of the '(=)' for a non-keyword attribute. */ #define VAR_NON_KEYWORD_SEMANTIC_LEN VAR_PREFIX_LEN + VAR_INFIX_LEN + VAR_SUFFIX_LEN /* The character with which to escape other characters. */ #define ESCAPE_CHARACTER '\\' /* The number of characters required to escape a single character. */ #define ESCAPED_LEN 3 /* The preamble for opaques ('\FF') -- this is only used when the attributes * are "put on the wire". */ #define OPAQUE_PREFIX "\\FF" #define OPAQUE_PREFIX_LEN 3 /****************************************************************************** * Utility *****************************************************************************/ /* Tests a character to see if it reserved (as defined in RFC 2608, p11). */ #define IS_RESERVED(x) \ (((x) == '(' || (x) == ')' || (x) == ',' || (x) == '\\' || (x) == '!' || (x) == '<' \ || (x) == '=' || (x) == '>' || (x) == '~') || \ ((((char)0x01 <= (x)) && ((char)0x1F >= (x))) || ((x) == (char)0x7F))) #define IS_INVALID_VALUE_CHAR(x) \ IS_RESERVED(x) #define IS_INVALID_TAG_CHAR(x) \ (IS_RESERVED(x) \ || ((x) == '*') || \ ((x) == (char)0x0D) || ((x) == (char)0x0A) || ((x) == (char)0x09) || ((x) == '_')) #define IS_VALID_TAG_CHAR(x) !IS_INVALID_TAG_CHAR(x) /* Tests a character to see if it is in set of known hex characters. */ #define IS_VALID_HEX(x) ( ((x >= '0') && (x <= '9')) /* Number */ \ || ((x >= 'A') && (x <= 'F')) /* ABCDEF */ \ || ((x >= 'a') && (x <= 'f')) /* abcdef */ \ ) /* Tests a character to see if it's a digit. */ #define IS_DIGIT(x) ((x) >= '0' && (x) <= '9') /* Find the end of a tag, while checking that said tag is valid. * * Returns: Pointer to the character immediately following the end of the tag, * or NULL if the tag is improperly formed. */ char const *find_tag_end(const char *tag) { char const *cur = tag; /* Pointer into the tag for working. */ while(*cur) { if(IS_INVALID_TAG_CHAR(*cur)) { break; } cur++; } return cur; } /* Unescapes an escaped character. * * val should point to the escape character starting the value. */ char unescape(char d1, char d2) { assert(isxdigit((int) d1)); assert(isxdigit((int) d2)); if((d1 >= 'A') && (d1 <= 'F')) d1 = d1 - 'A' + 0x0A; else if((d1 >= 'a') && (d1 <= 'f')) d1 = d1 - 'a' + 0x0A; else d1 = d1 - '0'; if((d2 >= 'A') && (d2 <= 'F')) d2 = d2 - 'A' + 0x0A; else if((d2 >= 'a') && (d2 <= 'f')) d2 = d2 - 'a' + 0x0A; else d2 = d2 - '0'; return d2 + (d1 * 0x10); } /* Unescapes a string. * * Params: * dest -- (IN) Where to write * src -- (IN) Unescaped string * len -- (IN) length of src * unescaped_len -- (OUT) number of characters in unescaped * * Returns: Pointer to start of unescaped string. If an error occurs, NULL is * returned (an error consists of an escaped value being truncated). */ char *unescape_into(char *dest, const char *src, int len, int *unescaped_len) { char *start, *write; int i; assert(dest); assert(src); write = start = dest; for(i = 0; i < len; i++, write++) { if(src[i] == ESCAPE_CHARACTER) { /*** Check that the characters are legal, and that the value has * not been truncated. ***/ if((i + 2 < len) && isxdigit((int) src[i+1]) && isxdigit((int) src[i+2])) { *write = unescape(src[i+1], src[i+2]); i += 2; } else { return NULL; } } else { *write = src[i]; } } /* Report the unescaped size. */ if(unescaped_len != NULL) { *unescaped_len = write - start; } return start; } /* Finds the end of a value list, while checking that the value contains legal * characters. * * PARAMS: * value -- (IN) The start of the value list * value_count -- (OUT) The number of values in the value list * type -- (OUT) The type of the value list * unescaped_size -- (OUT) The size of the unescaped value list. ASSUMING THAT THE LIST IS EITHER OPAQUE OR STRING! * cur -- (OUT) End of the parse. * * Returns: 0 on parse error. 1 on valid parse. */ int find_value_list_end(char const *value, int *value_count, SLPType *type, int *unescaped_len, char const **cur) { enum { START_VAL, /* We're at the start of a value */ IN_VAL /* We're in a val. */ } state = START_VAL; /* The state of the current read. */ enum { TYPE_UNKNOWN = -12, /* Could be anything. */ TYPE_INT = SLP_INTEGER, /* Either an int or a string. */ TYPE_OPAQUE = SLP_OPAQUE, /* Definitely an opaque. */ TYPE_STR = SLP_STRING, /* Definitely a string. */ TYPE_BOOL = SLP_BOOLEAN /* A bool, but it could be a string. */ } type_guess = TYPE_UNKNOWN; /* The current possible values for the type. */ *value_count = 1; *unescaped_len = 0; *cur = value; while(**cur) { if(**cur == '\\') { if(state == START_VAL) { /*** Test if we're starting an opaque. ***/ (*cur)++; if((**cur) != '0') { /* Panic: truncated escaped value. */ return 0; } (*cur)++; if((**cur) != '0') { /* Panic: truncated escaped value. */ return 0; } /*** We're starting an opaque. Ensure proper typing. ***/ if(type_guess == TYPE_UNKNOWN) { type_guess = TYPE_OPAQUE; } else if(type_guess != TYPE_OPAQUE) { /* An opaque is mixed in with non-opaques. Fail. */ return 0; } } else { /*** We're in the middle of a value. ***/ /** Check that next two characters are valid. **/ (*cur)++; if(!IS_VALID_HEX(**cur)) { return 0; } (*cur)++; if(!IS_VALID_HEX(**cur)) { return 0; } (*unescaped_len)++; } state = IN_VAL; } else if(**cur == VAR_SEPARATOR) { /* A separator. */ /** Check for empty values. **/ if(state != IN_VAL) { return 0; /* ERROR! commas side-by-side. */ } state = START_VAL; /** Type check. **/ if(type_guess == TYPE_BOOL) { /* Bools can only have _one_ value. */ /* Devolve to string. */ type_guess = TYPE_STR; } (*value_count)++; } else if(**cur == VAR_SUFFIX) { /* Nous sommes fini. */ break; } else if(IS_INVALID_VALUE_CHAR(**cur)) { /* Bad char. */ return 0; } else { /* Normal case */ /*** Ensure that the character is consistent with its type. ***/ /** Opaque. **/ if(type_guess == TYPE_OPAQUE) { /* Type error! The string starts with a \00, but has a bare character somewhere following. */ return 0; } /** Int. **/ else if(type_guess == TYPE_INT) { if(!(IS_DIGIT(**cur) || (state == START_VAL && **cur == '-'))) { /* Devolve to a string. */ type_guess = TYPE_STR; } } /** Bool. **/ else if(type_guess == TYPE_BOOL) { if(*unescaped_len < BOOL_TRUE_STR_LEN && **cur == BOOL_TRUE_STR[*unescaped_len]) { /* Do nothing. It's valid. */ } else if(*unescaped_len < BOOL_FALSE_STR_LEN && **cur == BOOL_FALSE_STR[*unescaped_len]) { /* Do nothing. It's also valid. */ } else { /* Devolve to a string. */ type_guess = TYPE_STR; } } /** Unknown. **/ else if(type_guess == TYPE_UNKNOWN) { if(IS_DIGIT(**cur) || (state == START_VAL && **cur == '-')) { type_guess = TYPE_INT; } else if(state == START_VAL && (BOOL_TRUE_STR[0] == **cur || **cur == BOOL_FALSE_STR[0])) { type_guess = TYPE_BOOL; } else { type_guess = TYPE_STR; } } (*unescaped_len)++; state = IN_VAL; } (*cur)++; } if (type_guess == TYPE_UNKNOWN) { return 0; /* empty */ } *type = type_guess; return 1; } /* Finds the end of a value, while checking that the value contains legal * characters. * * Returns: see find_tag_end(). */ char *find_value_end(char *value) { char *cur = value; /* Pointer into the value string. */ while(*cur) { if(IS_INVALID_VALUE_CHAR(*cur) && (*cur != '\\')) { break; } cur++; } return cur; } /* Find the number of digits (base 10) necessary to represent an integer. * * Returns the number of digits. */ int count_digits(int number) { int count = (number < 0) ? 1 : 0; /* do we need a negative sign ? */ /* special case: 0 */ if (number == 0) return 1; /* poor man's abs() function */ number = (number < 0 ) ? -number : number; /* count number of digits required; this only works with integers */ for ( ; number > 0; number /= 10) { count++; } return count; } /* Verifies that a tag contains only legal characters. */ SLPBoolean is_valid_tag(const char *tag) { /* TODO Check. */ return SLP_TRUE; } /* A boolean expression that tests a character to see if it must be escaped. */ #define ATTRIBUTE_RESERVED_TEST(x) \ (x == '(' || x == ')' || x == ',' || x == '\\' || x == '!' || x == '<' \ || x == '=' || x == '<' || x == '=' || x == '>' || x == '~' || x == '\0') /* Tests a character to see if it should be escaped. To be used for everything * but opaques. */ SLPBoolean is_legal_slp_char(const char to_test) { if(ATTRIBUTE_RESERVED_TEST(to_test)) { return SLP_FALSE; } return SLP_TRUE; } /* Tests a character to see if it should be escaped for an opaque. */ SLPBoolean opaque_test(const char to_test) { return SLP_FALSE; } /* Find the size of an unescaped string (given the escaped string). * * Note that len must be positive. * * Returns: If positive, the length of the string. If negative, there is some * sort of error. */ int find_unescaped_size(const char *str, int len) { int i; int size; assert(len > 0); size = len; for(i = 0; i < len; i++) { if(str[i] == ESCAPE_CHARACTER) { size -= ESCAPED_LEN - 1; /* -1 for the ESCAPE_CHARACTER. */ } } return size; } /* Find the size of an escaped string. * * The "optional" len argument is the length of the string. If it is * negative, the function treats the string as a null-terminated string. If it * is positive, the function will read exactly that number of characters. */ int find_escaped_size(const char *str, int len) { int i; /* Index into str. */ int escaped_size; /* The size of the thingy. */ i =0; escaped_size = 0; if(len < 0) { /***** String is null-terminated. *****/ for(i = 0; str[i]; i++) { if(is_legal_slp_char(str[i]) == SLP_TRUE) { escaped_size++; } else { escaped_size += ESCAPED_LEN; } } } else { for(i = 0; i < len; i++) { if(is_legal_slp_char(str[i]) == SLP_TRUE) { escaped_size++; } else { escaped_size += ESCAPED_LEN; } } } return escaped_size; } /* Escape a single character. Writes the escaped value into dest, and * increments dest. * * NOTE: Most of this code is stolen from Dave McCormack's SLPEscape() code. * (For OpenSLP). */ void escape(char to_escape, char **dest, SLPBoolean (test_fn)(const char)) { char hex_digit; if(test_fn(to_escape) == SLP_FALSE) { /* Insert the escape character. */ **dest = ESCAPE_CHARACTER; (*dest)++; /* Do the first digit. */ hex_digit = (to_escape & 0xF0)/0x0F; if((hex_digit >= 0) && (hex_digit <= 9)) **dest = hex_digit + '0'; else **dest = hex_digit + 'A' - 0x0A; (*dest)++; /* Do the last digit. */ hex_digit = to_escape & 0x0F; if((hex_digit >= 0) && (hex_digit <= 9)) **dest = hex_digit + '0'; else **dest = hex_digit + 'A' - 0x0A; (*dest)++; } else { /* It's legal. */ **dest = to_escape; (*dest)++; } } /* Escape the passed string (src), writing it into the other passed string * (dest). * * If the len argument is negative, the src is treated as null-terminated, * otherwise that length is escaped. * * Returns a pointer to where the addition has ended. */ char *escape_into(char *dest, char *src, int len) { char *cur_dest; /* Current character in dest. */ cur_dest = dest; if(len < 0) { /* Treat as null terminated. */ char *cur_src; /* Current character in src. */ cur_src = src; for(; *cur_src; cur_src++) { escape(*cur_src, &cur_dest, is_legal_slp_char); } } else { /* known length. */ int i; /* Index into src. */ for(i = 0; i < len; i++) { escape(src[i], &cur_dest, is_legal_slp_char); } } return cur_dest; } /* Special case for escaping opaque strings. Escapes _every_ character in the * string. * * Note that the size parameter _must_ be defined. * * Returns a pointer to where the addition has ended. */ char *escape_opaque_into(char *dest, char *src, int len) { int i; /* Index into src. */ char *cur_dest; cur_dest = dest; for(i = 0; i < len; i++) { escape(src[i], &cur_dest, opaque_test); } return cur_dest; } /****************************************************************************** * * Individual values * * What is a value? * * In SLP an individual attribute can be associated with a list of values. A * value is the data associated with a tag. Depending on the type of * attribute, there can be zero, one, or many values associated with a single * tag. *****************************************************************************/ /* See libslpattr_internal.h for implementation. */ /* Create and initialize a new value. * * Params: * extra -- amount of memory to allocate in addition to that needed for the value. This memory can be found at (return_value + sizeof(value_t)) */ value_t *value_new(int extra) { value_t *value = NULL; value = (value_t *)malloc(sizeof(value_t) + extra); if(value == NULL) return NULL; value->next = NULL; value->data.va_str = NULL; value->escaped_len = -1; value->unescaped_len = -1; value->next_chunk = NULL; value->last_value_in_chunk = value; return value; } /* Destroy a value. */ void value_free(value_t *value) { assert(value->next == NULL); free(value); } /****************************************************************************** * * Individual attributes (vars) * * What is a var? * * A var is a variable tag that is associated with a list of values. Zero or * more vars are kept in a single SLPAttributes object. Each value stored in * a var is kept in a value struct. *****************************************************************************/ /* See libslpattr_internal.h for struct. */ /* Create a new variable. * * FIXME should take tag_len as an argument */ var_t *var_new(char *tag, int tag_len) { var_t *var; /* Variable being created. */ assert(tag != NULL); /***** Allocate. *****/ var = (var_t *)malloc(sizeof(var_t) + tag_len + 1); /* +1 for null. */ if(var == NULL) return NULL; /***** Initialize. *****/ var->next = NULL; var->tag_len = tag_len; var->tag = ((char *)var) + sizeof(var_t); memcpy((void *)var->tag, tag, var->tag_len); ((char *)(var->tag))[var->tag_len] = 0; var->type = -1; var->list = NULL; var->list_size = 0; var->modified = SLP_TRUE; return var; } /* Destroy a value list. Note that the var is not free()'d, only reset. */ void var_list_destroy(var_t *var) { value_t *value; value_t *to_free; /* A pointer back in the value list to free. */ /***** Check for data. *****/ if(var->list == NULL) { assert(var->list_size == 0); return; } /***** Burrow through the value list deleting every chunk of memory behind us as we go. *****/ value = var->list; to_free = NULL; while(value) { to_free = value; value = value->next_chunk; free(to_free); } /***** Reset the list. *****/ var->list = NULL; var->list_size = 0; } /* Frees a variable. */ void var_free(var_t *var) { /***** Sanity check. *****/ assert(var->next == NULL); /***** Free variable. *****/ var_list_destroy(var); free(var); } /* Adds a value to a variable. */ SLPError var_insert(var_t *var, value_t *value, SLPInsertionPolicy policy) { assert(policy == SLP_ADD || policy == SLP_REPLACE); if(value == NULL) { return SLP_OK; } if(policy == SLP_REPLACE) { var_list_destroy(var); } /* Update list. */ value->last_value_in_chunk->next = var->list; value->next_chunk = var->list; /* Update the memory list too. */ var->list = value; var->list_size++; /* Set mod flag.*/ var->modified = SLP_TRUE; return SLP_OK; } /****************************************************************************** * * All the attributes. * *****************************************************************************/ /* * SLPAttrAlloc() creates and initializes a new instance of SLPAttributes. */ SLPError SLPAttrAlloc( const char *lang, const FILE *template_h, const SLPBoolean strict, SLPAttributes *slp_attr_h ) { struct xx_SLPAttributes **slp_attr; slp_attr = (struct xx_SLPAttributes **)slp_attr_h; /***** Sanity check *****/ if(strict == SLP_FALSE && template_h != NULL) { /* We can't be strict if we don't have a template. */ return SLP_PARAMETER_BAD; } if(strict != SLP_FALSE) { return SLP_NOT_IMPLEMENTED; } if(template_h != NULL) { return SLP_NOT_IMPLEMENTED; } /***** Create. *****/ (*slp_attr) = (struct xx_SLPAttributes *)malloc( sizeof(struct xx_SLPAttributes) ); if(*slp_attr == NULL) { return SLP_MEMORY_ALLOC_FAILED; } /***** Initialize *****/ (*slp_attr)->strict = SLP_FALSE; /* FIXME Add templates. */ (*slp_attr)->lang = strdup(lang); /* free()'d in SLPAttrFree(). */ (*slp_attr)->attrs = NULL; (*slp_attr)->attr_count = 0; /***** Report. *****/ return SLP_OK; } SLPError attr_destringify(struct xx_SLPAttributes *slp_attr, const char *str, SLPInsertionPolicy); /* Allocates a new attribute list from a string. */ SLPError SLPAttrAllocStr( const char *lang, const FILE *template_h, const SLPBoolean strict, SLPAttributes *slp_attr_h, const char *str ) { SLPError err; err = SLPAttrAlloc(lang, template_h, strict, slp_attr_h); if(err != SLP_OK) { return err; } err = attr_destringify((struct xx_SLPAttributes*)*slp_attr_h, str, SLP_ADD); if(err != SLP_OK) { SLPAttrFree(*slp_attr_h); } return err; } /* Destroys the passed SLPAttributes(). */ void SLPAttrFree(SLPAttributes slp_attr_h) { struct xx_SLPAttributes *slp_attr; slp_attr = (struct xx_SLPAttributes *)slp_attr_h; /***** Free held resources. *****/ while(slp_attr->attrs) { var_t *attr = slp_attr->attrs; slp_attr->attrs = attr->next; attr->next = NULL; var_free(attr); } free(slp_attr->lang); slp_attr->lang = NULL; /***** Free the handle *****/ free(slp_attr); slp_attr = NULL; } /* Insert a variable into the var list. */ void attr_add(struct xx_SLPAttributes *slp_attr, var_t *var) { var->next = slp_attr->attrs; slp_attr->attrs = var; slp_attr->attr_count++; } /* Find a variable by its tag. * * Returns a NULL if the value could not be found. */ var_t *attr_val_find_str(struct xx_SLPAttributes *slp_attr, const char *tag, int tag_len) { var_t *var; var = slp_attr->attrs; while(var) { /* Per RFC 2165 (Section 20.5 para 1), RFC 2608 (Section 6.4 para 3), * attr-tags are supposed to be case insensitive. * Using strncasecmp() so that comparision of tags are case-insensitive * atleast inside the ASCII range. */ if(var->tag_len == (unsigned)tag_len && strncasecmp(var->tag, tag, tag_len) == 0) { return var; } var = var->next; } return NULL; } /* Test a variable's type. Returns SLP_OK if the match is alright, or some * other error code (meant to be forwarded to the application) if the match is * bad. */ SLPError attr_type_verify(struct xx_SLPAttributes *slp_attr, var_t *var, SLPType type) { assert(var->type != -1); /* Check that it's been set. */ if(var->type == type) { return SLP_OK; } return SLP_TYPE_ERROR; /* FIXME: Check against template. */ } /****************************************************************************** * * Setting attributes * *****************************************************************************/ /*****************************************************************************/ SLPError generic_set_val(struct xx_SLPAttributes *slp_attr, const char *tag, int tag_len, value_t *value, SLPInsertionPolicy policy, SLPType attr_type) /* Finds and sets the value named in tag. */ /* * slp_attr - the attr object to add to. * tag - the name of the tag to add to. * value - the already-allocated value object with fields set * policy - the policy to use when inserting. * attr_type - the type of the value being added. *****************************************************************************/ { var_t *var; /***** Create a new attribute. *****/ if((var = attr_val_find_str(slp_attr, tag, strlen(tag))) == NULL) { /*** Couldn't find a value with this tag. Make a new one. ***/ var = var_new((char *)tag, tag_len); if(var == NULL) { return SLP_MEMORY_ALLOC_FAILED; } var->type = attr_type; /** Add variable to list. **/ attr_add(slp_attr, var); } else { SLPError err; /*** The attribute already exists. ***/ /*** Verify type. ***/ err = attr_type_verify(slp_attr, var, attr_type); if(err == SLP_TYPE_ERROR && policy == SLP_REPLACE) { var_list_destroy(var); var->type = attr_type; } else if(err != SLP_OK) { value_free(value); return err; } } /***** Set value *****/ var_insert(var, value, policy); return SLP_OK; } /* Set a boolean attribute. */ SLPError SLPAttrSet_bool( SLPAttributes attr_h, const char *tag, SLPBoolean val ) { struct xx_SLPAttributes *slp_attr = (struct xx_SLPAttributes *)attr_h; value_t *value = NULL; int escaped_len; /***** Sanity check. *****/ if(val != SLP_TRUE && val != SLP_FALSE) { return SLP_PARAMETER_BAD; } if(is_valid_tag(tag) == SLP_FALSE) { return SLP_TAG_BAD; } /***** Set the initial (and only) value. *****/ /**** Create ****/ value = value_new(0); assert(value); /**** Set escaped information. ****/ if(val == SLP_TRUE) { escaped_len = BOOL_TRUE_STR_LEN; } else { escaped_len = BOOL_FALSE_STR_LEN; } value->escaped_len = escaped_len; value->data.va_bool = val; /**** Set the value and return. ****/ return generic_set_val(slp_attr, tag, (int)strlen(tag), value, SLP_REPLACE, SLP_BOOLEAN); } /* Sets a string attribute. */ SLPError SLPAttrSet_str( SLPAttributes attr_h, const char *tag, const char *val, SLPInsertionPolicy policy ) { struct xx_SLPAttributes *slp_attr = (struct xx_SLPAttributes *)attr_h; value_t *value; int unescaped_len; /***** Sanity check. *****/ if(is_valid_tag(tag) == SLP_FALSE) { return SLP_TAG_BAD; } if(val == NULL) { return SLP_PARAMETER_BAD; } /***** Create new value. *****/ unescaped_len = strlen(val); value = value_new(unescaped_len); assert(value); /**** Copy data. ****/ value->data.va_str = ((char *)value) + sizeof(value_t); memcpy(value->data.va_str, val, unescaped_len); /**** Set lengths. ****/ value->unescaped_len = unescaped_len; value->escaped_len = find_escaped_size(value->data.va_str, unescaped_len); return generic_set_val(slp_attr, tag, (int)strlen(tag), value, policy, SLP_STRING); } /* Sets a keyword attribute. Takes a non-null terminated string. */ SLPError SLPAttrSet_keyw_len( SLPAttributes attr_h, const char *tag, int tag_len ) { struct xx_SLPAttributes *slp_attr = (struct xx_SLPAttributes *)attr_h; /***** Sanity check. *****/ if(is_valid_tag(tag) == SLP_FALSE) { return SLP_TAG_BAD; } return generic_set_val(slp_attr, tag, tag_len, NULL, SLP_REPLACE, SLP_KEYWORD); } SLPError SLPAttrSet_keyw( SLPAttributes attr_h, const char *tag ) { return SLPAttrSet_keyw_len(attr_h, tag, (int)strlen(tag)); } /* Sets an integer attribute. */ SLPError SLPAttrSet_int( SLPAttributes attr_h, const char *tag, int val, SLPInsertionPolicy policy ) { struct xx_SLPAttributes *slp_attr = (struct xx_SLPAttributes *)attr_h; value_t *value; /***** Sanity check. *****/ if(is_valid_tag(tag) == SLP_FALSE) { return SLP_TAG_BAD; } /***** Create new value. *****/ value = value_new(0); if(value == NULL) { return SLP_MEMORY_ALLOC_FAILED; } /**** Set ****/ value->data.va_int = val; value->escaped_len = count_digits(value->data.va_int); assert(value->escaped_len > 0); return generic_set_val(slp_attr, tag, (int)strlen(tag), value, policy, SLP_INTEGER); } /* Set an opaque attribute. */ SLPError SLPAttrSet_opaque( SLPAttributes attr_h, const char *tag, const char *val, const unsigned int len, SLPInsertionPolicy policy ) { struct xx_SLPAttributes *slp_attr = (struct xx_SLPAttributes *)attr_h; value_t *value; /***** Sanity check. *****/ if(is_valid_tag(tag) == SLP_FALSE) { return SLP_TAG_BAD; } if(val == NULL) { return SLP_PARAMETER_BAD; } /***** Create a new attribute. *****/ value = value_new(len); if(value == NULL) { return SLP_MEMORY_ALLOC_FAILED; } memcpy((void *)value->data.va_str, val, len); value->unescaped_len = len; value->escaped_len = (len * ESCAPED_LEN) + OPAQUE_PREFIX_LEN; return generic_set_val(slp_attr, tag, (int)strlen(tag), value, policy, SLP_OPAQUE); } SLPError SLPAttrStore(struct xx_SLPAttributes *slp_attr, const char *tag, const char *val, int len, SLPInsertionPolicy policy ); /* Set an attribute of unknown type. * * Note that the policy in this case is a special case: If the policy is * SLP_REPLACE, we delete the current list and replace it with the passed * value. If it's a multivalue list, we replace the current value with the * ENTIRE passed list. * * FIXME Should we "elide" whitespace? */ SLPError SLPAttrSet_guess( SLPAttributes attr_h, const char *tag, const char *val, SLPInsertionPolicy policy ) { SLPError err; int len; const char *cur, *end; /***** Sanity check. *****/ if(is_valid_tag(tag) == SLP_FALSE) { return SLP_TAG_BAD; } if(val == NULL) { return SLP_PARAMETER_BAD; } /***** * If we have a replace policy and we're inserting a multivalued list, * the values will clobber each other. Therefore if we have a replace, we * delete the current list, and use an add policy. *****/ if(policy == SLP_REPLACE) { var_t *var; var = attr_val_find_str((struct xx_SLPAttributes *)attr_h, tag, strlen(tag)); if(var) { var_list_destroy(var); } } /***** Check for multivalue list. *****/ cur = val; do { end = strchr(cur, VAR_SEPARATOR); if(end == NULL) { len = strlen(cur); } else { /*** It's multivalue. ***/ len = end - cur; } err = SLPAttrStore((struct xx_SLPAttributes *)attr_h, tag, cur, len, SLP_ADD); if(err != SLP_OK) { /* FIXME Ummm. Should we return or ignore? */ return err; } cur = end + VAR_SEPARATOR_LEN; } while(end); /***** Return *****/ return SLP_OK; } /****************************************************************************** * * Getting attributes * *****************************************************************************/ /* Get the value of a boolean attribute. Note that it _cannot_ be multivalued. */ SLPError SLPAttrGet_bool( SLPAttributes attr_h, const char *tag, SLPBoolean *val ) { struct xx_SLPAttributes *slp_attr = (struct xx_SLPAttributes *)attr_h; var_t *var; var = attr_val_find_str(slp_attr, tag, strlen(tag)); /***** Check that the tag exists. *****/ if(var == NULL) { return SLP_TAG_ERROR; } /* TODO Verify type against template. */ /***** Verify type. *****/ if(var->type != SLP_BOOLEAN) { return SLP_TYPE_ERROR; } assert(var->list != NULL); *val = var->list->data.va_bool; return SLP_OK; } /* Get the value of a keyword attribute. Since keywords either exist or don't * exist, no value is passed out. Instead, if the keyword exists, an SLP_OK is * returned, if it doesn't exist, an SLP_TAG_ERROR is returned. If the tag * does exist, but is associated with a non-keyword attribute, SLP_TYPE_ERROR * is returned. */ SLPError SLPAttrGet_keyw( SLPAttributes attr_h, const char *tag ) { struct xx_SLPAttributes *slp_attr = (struct xx_SLPAttributes *)attr_h; var_t *var; var = attr_val_find_str(slp_attr, tag, strlen(tag)); /***** Check that the tag exists. *****/ if(var == NULL) { return SLP_TAG_ERROR; } /* TODO Verify type against template. */ /***** Verify type. *****/ if(var->type != SLP_KEYWORD) { return SLP_TYPE_ERROR; } assert(var->list == NULL); return SLP_OK; } /* Get an integer value. Since integer attributes can be multivalued, an array * is returned that contains all values corresponding to the given tag. * * * Note: On success, an array of SLP_INTEGERs is created. It is the caller's * responsibility to free the memory returned through val. * * Returns: * SLP_OK * Returned if the attribute is found. The array containing the values is * placed in val, and size is set to the number of values in val. * SLP_TYPE_ERROR * Returned if the tag exists, but the associated value is not of type * SLP_INTEGER. * SLP_MEMORY_ALLOC_FAILED * Memory allocation failed. */ SLPError SLPAttrGet_int( SLPAttributes attr_h, const char *tag, int **val, int *size ) { struct xx_SLPAttributes *slp_attr = (struct xx_SLPAttributes *)attr_h; var_t *var; value_t *value; int i; var = attr_val_find_str(slp_attr, tag, strlen(tag)); /***** Check that the tag exists. *****/ if(var == NULL) { return SLP_TAG_ERROR; } /* TODO Verify type against template. */ /***** Verify type. *****/ if(var->type != SLP_INTEGER) { return SLP_TYPE_ERROR; } /***** Create return value. *****/ *size = var->list_size; *val = (int *)malloc( sizeof(int) * var->list_size ); if(*val == NULL) { return SLP_MEMORY_ALLOC_FAILED; } /***** Set values *****/ assert(var->list != NULL); value = var->list; for(i = 0; i < var->list_size; i++, value = value->next) { assert(value != NULL); (*val)[i] = value->data.va_int; } return SLP_OK; } /* Get string values. Since string attributes can be multivalued, an array * is returned that contains all values corresponding to the given tag. * * * Note: On success, an array of SLP_STRINGs is created. It is the caller's * responsibility to free the memory returned through val. Note that the array * referencing the strings is allocated separately from each string value, * meaning that each value must explicitly be deallocated. * * Returns: * SLP_OK * Returned if the attribute is found. The array containing the values is * placed in val, and size is set to the number of values in val. * SLP_TYPE_ERROR * Returned if the tag exists, but the associated value is not of type * SLP_INTEGER. * SLP_MEMORY_ALLOC_FAILED * Memory allocation failed. */ SLPError SLPAttrGet_str( SLPAttributes attr_h, const char *tag, char ***val, int *size ) { struct xx_SLPAttributes *slp_attr = (struct xx_SLPAttributes *)attr_h; var_t *var; value_t *value; int i; var = attr_val_find_str(slp_attr, tag, strlen(tag)); /***** Check that the tag exists. *****/ if(var == NULL) { return SLP_TAG_ERROR; } /* TODO Verify type against template. */ /***** Verify type. *****/ if(var->type != SLP_STRING) { return SLP_TYPE_ERROR; } /***** Create return value. *****/ *size = var->list_size; *val = (char **)malloc( sizeof(char *) * var->list_size ); if(*val == NULL) { return SLP_MEMORY_ALLOC_FAILED; } /***** Set values *****/ assert(var->list != NULL); value = var->list; for(i = 0; i < var->list_size; i++, value = value->next) { assert(value != NULL); /* (*val)[i] = strdup(value->data.va_str); */ (*val)[i] = malloc(value->unescaped_len + 1); assert((*val)[i] != NULL); memcpy((*val)[i], value->data.va_str, value->unescaped_len); (*val)[i][value->unescaped_len] = 0; } return SLP_OK; } /* Get opaque values. Since opaque attributes can be multivalued, an array * is returned that contains all values corresponding to the given tag. * * * Note: On success, an array of SLP_OPAQUEs is created. It is the caller's * responsibility to free the memory returned through val. Note that the array * referencing the opaques is allocated separately from each opaque struct, * and from the corresponding opaque value, meaning that each value must * explicitly be deallocated, as must each opaque struct. * * Returns: * SLP_OK * Returned if the attribute is found. The array containing the values is * placed in val, and size is set to the number of values in val. * SLP_TYPE_ERROR * Returned if the tag exists, but the associated value is not of type * SLP_INTEGER. * SLP_MEMORY_ALLOC_FAILED * Memory allocation failed. */ SLPError SLPAttrGet_opaque( SLPAttributes attr_h, const char *tag, SLPOpaque ***val, int *size ) { struct xx_SLPAttributes *slp_attr = (struct xx_SLPAttributes *)attr_h; var_t *var; value_t *value; int i; var = attr_val_find_str(slp_attr, tag, strlen(tag)); /***** Check that the tag exists. *****/ if(var == NULL) { return SLP_TAG_ERROR; } /* TODO Verify type against template. */ /***** Verify type. *****/ if(var->type != SLP_OPAQUE) { return SLP_TYPE_ERROR; } /***** Create return value. *****/ *size = var->list_size; *val = (SLPOpaque **)malloc( sizeof(SLPOpaque *) * var->list_size ); if(*val == NULL) { return SLP_MEMORY_ALLOC_FAILED; } /***** Set values *****/ assert(var->list != NULL); value = var->list; for(i = 0; i < var->list_size; i++, value = value->next) { assert(value != NULL); (*val)[i] = (SLPOpaque *)malloc( sizeof(SLPOpaque) ); if((*val)[i]->data == NULL) { /* TODO Deallocate everything and return. */ return SLP_MEMORY_ALLOC_FAILED; } (*val)[i]->len = value->unescaped_len; (*val)[i]->data = (char *)malloc( value->unescaped_len ); if((*val)[i]->data == NULL) { /* TODO Deallocate everything and return. */ return SLP_MEMORY_ALLOC_FAILED; } memcpy((*val)[i]->data, value->data.va_str, value->unescaped_len); } return SLP_OK; } /* Finds the type of the given attribute. * * Returns: * SLP_OK * If the attribute is set. The type is returned through the type * parameter. * SLP_TAG_ERROR * If the attribute is not set. */ SLPError SLPAttrGetType_len(SLPAttributes attr_h, const char *tag, int tag_len, SLPType *type) { struct xx_SLPAttributes *slp_attr = (struct xx_SLPAttributes *)attr_h; var_t *var; var = attr_val_find_str(slp_attr, tag, tag_len); /***** Check that the tag exists. *****/ if(var == NULL) { return SLP_TAG_ERROR; } if(type != NULL) { *type = var->type; } return SLP_OK; } SLPError SLPAttrGetType(SLPAttributes attr_h, const char *tag, SLPType *type) { return SLPAttrGetType_len(attr_h, tag, strlen(tag), type); } #if 1 /* Jim Meyer's byte allignment code */ /****************************************************************************** * * Fix memory alignment * *****************************************************************************/ char *fix_memory_alignment(char *p) { unsigned long address = (unsigned long)p; address = (address + sizeof(long) - 1) & ~(sizeof(long) - 1); return (char *)address; } #endif /****************************************************************************** * * Attribute (En|De)coding * *****************************************************************************/ /* Stores a list of serialized attributes. Takes advantage of foreknowledge of * stuff string sizes, etc. * * Params: * tag -- (IN) the name of the attribute * tag_len -- (IN) the length of the tag in bytes * attr_start -- (IN) the start of the attribute string * attr_end -- (IN) the end of the attribute string * val_count -- (IN) the number of values in the string * type -- (IN) the type of the string * unescaped_len -- (IN) the length of the unescaped data * * Returns: * 0 - Out of mem. * 1 - Success. */ int internal_store( struct xx_SLPAttributes *slp_attr, char const *tag, int tag_len, char const *attr_start, char const *attr_end, int val_count, SLPType type, int unescaped_len) { var_t *var; int block_size; char *mem_block; /* Pointer into allocated block. */ char const *cur_start; /* Pointer into attribute list (start of current data). */ char const *cur_end; /* Pointer into attribute list (end of current data). */ value_t *val = 0; value_t **next_val_ptr; /* Pointer from the previous val to the next val. */ assert(type == SLP_BOOLEAN || type == SLP_STRING || type == SLP_OPAQUE || type == SLP_INTEGER); /* Ensure that we're dealing with a known type. */ /***** Allocate space for the variable. *****/ block_size = sizeof(var_t) + (tag_len); /* The var_t */ var = (var_t *)malloc(block_size); if(var == NULL) { return 0; } /***** Allocate space for the values. *****/ block_size = (val_count * sizeof(value_t)) /* Size of each value */ + unescaped_len /* The size of the unescaped data. */ #if 1 /* Jim Meyer's byte allignment code */ + val_count * (sizeof(long) - 1); /* Padding */ #endif mem_block = (char *)malloc(block_size); if(mem_block == NULL) { free(val); return 0; } /***** Initialize var_t. *****/ var->tag_len = tag_len; var->tag = ((char *)var) + sizeof(var_t); memcpy((char *)var->tag, tag, var->tag_len); var->type = type; var->list_size = val_count; var->modified = SLP_TRUE; next_val_ptr = &var->list; /* Initialize next_val_ptr */ *next_val_ptr = NULL; /***** Initialize values. *****/ cur_end = cur_start = attr_start; while(cur_end < attr_end) { /**** Find the size of the data. ****/ cur_end = memchr(cur_start, VAR_SEPARATOR, attr_end - cur_start); if(cur_end == NULL) { cur_end = attr_end; } /**** Create the value. ****/ *next_val_ptr = val = (value_t *)mem_block; val->next = NULL; /* Set forward pointer to null. */ val->next_chunk = NULL; /* This is not the first. */ val->last_value_in_chunk = NULL; /**** Update kept data. ****/ next_val_ptr = &val->next; /* Book-keeping for next write. */ mem_block += sizeof(value_t); /* Move along. */ /**** FIXME Write the data. ****/ switch(type) { case(SLP_BOOLEAN): assert(val_count == 1); /* Set value. */ if(*cur_start == 't' || *cur_start == 'T') { assert(strncasecmp(cur_start, BOOL_TRUE_STR, BOOL_TRUE_STR_LEN) == 0); /* Make sure that we do, in actual fact, have the string "true". */ val->data.va_bool = SLP_TRUE; val->escaped_len = BOOL_TRUE_STR_LEN; } else if(*cur_start == 'f' || *cur_start == 'F') { assert(strncasecmp(cur_start, BOOL_FALSE_STR, BOOL_FALSE_STR_LEN) == 0); /* Make sure that we do, in actual fact, have the string "false". */ val->data.va_bool = SLP_FALSE; val->escaped_len = BOOL_FALSE_STR_LEN; } else { assert(0); } mem_block += val->unescaped_len; break; case(SLP_INTEGER): val->data.va_int = (int) strtol(cur_start, NULL, 0); val->escaped_len = count_digits(val->data.va_int); /* FIXME Check errno. */ break; case(SLP_OPAQUE): case(SLP_STRING): { char *err; val->data.va_str = mem_block; val->escaped_len = cur_end - cur_start; err = unescape_into(val->data.va_str, cur_start, val->escaped_len, &val->unescaped_len); if(err == NULL) { /* FIXME */ } mem_block += val->unescaped_len; } break; default: assert(0); /* Unknown type. */ } #if 1 /* Jim Meyer's byte allignment code */ mem_block = fix_memory_alignment(mem_block); #endif cur_start = cur_end + 1; /* +1 to move past comma. */ } /***** Set pointers for memory management. *****/ var->list->last_value_in_chunk = val; mem_block = mem_block + sizeof(value_t); attr_add(slp_attr, var); return 1; /* Success. */ } /* Iterates across a set of variables. Either by using a given list of tag * names, or looping across all list members. * * Params: * slp_attr -- (IN) the attribute list we're working in * tag_cur -- (IN/OUT) the current position in the tag string. Must be * initialized to point to the start of a tag list. * tag_end -- (IN/OUT) the end of the current tag. Must be initialized to * the same value as tag_cur. * var -- (IN/OUT) the variable in question. Must be initialized to the first * variable in a list of attributes. * * Returns: * 1 if there are more vars to be iterated over * 0 if there are no more vars to be iterated over */ int var_iter(struct xx_SLPAttributes *slp_attr, char **tag_cur, char **tag_end, var_t **var) { /*** Get the next var. ***/ if(*tag_cur) { /*** We're doing a tag perusal: find next tag name. ***/ if(**tag_end) { /* There are more tags to be looked at */ if(*tag_end != *tag_cur) { /* This is _not_ our first time thru the loop: push pointers ahead. */ *tag_cur = *tag_end + 1; } *tag_end = strchr(*tag_cur, ','); /* This is the last tag. */ if(*tag_end == NULL) { *tag_end = *tag_cur + strlen(*tag_cur); } } else { /* There are no more tags to be looked at. Stop looping. */ return 0; } /*** Get named var. ***/ *var = attr_val_find_str(slp_attr, *tag_cur, *tag_end - *tag_cur); return 1; } else { /*** We're getting all vars: get the next var. ***/ if(*var) { *var = (*var)->next; } else { /* First time into the iterator. */ *var = slp_attr->attrs; } if(*var == NULL) { /* Last var. Stop looping. */ return 0; } return 1; } } /* Gets the escaped stringified version of an attribute list. * * The string returned must be free()'d by the caller. * * Params: * attr_h -- (IN) Attribute handle to add serialize. * tags -- (IN) The tags to serialize. If NULL, all tags are serialized. * out_buffer -- (IN/OUT) A buffer to write the serialized string to. If * (*out_buffer == NULL), then a new buffer is allocated by * the API. * bufferlen -- (IN) The length of the buffer. Ignored if * (*out_buffer == NULL). * count -- (OUT) The size needed/used of out_buffer (includes trailing null). * find_delta -- (IN) If find_delta is set to true, only the attributes that * have changed since the last serialize are updated. * * Returns: * SLP_OK -- Serialization occured. * SLP_BUFFER_OVERFLOW -- If (*out_buffer) is defined, but bufferlen is * smaller than the amount of memory necessary to serialize * the attr. list. * SLP_MEMORY_ALLOC_FAILED -- Ran out of memory. */ SLPError SLPAttrSerialize(SLPAttributes attr_h, const char* tags /* NULL terminated */, char **out_buffer /* Where to write. if *out_buffer == NULL, space is alloc'd */, int bufferlen, /* Size of buffer. */ int* count, /* Bytes needed/written. */ SLPBoolean find_delta ) { struct xx_SLPAttributes *slp_attr = (struct xx_SLPAttributes *)attr_h; var_t *var; /* For iterating over attributes to serialize. */ unsigned int size; /* Size of the string to allocate. */ unsigned int var_count; /* To count the number of variables. */ char *build_str; /* The string that is being built. */ char *cur; /* Current location within the already allocated str. */ char *tag_cur; /* Current position within tag string. */ char *tag_end; /* end of current position within tag string. */ size = 0; var_count = 0; /***** Decide on our looping mode. *****/ if(tags == NULL || *tags == 0) { tag_cur = NULL; } else { tag_cur = (char *)tags; } tag_end = tag_cur; var = NULL; /***** Find the size of string needed for the attribute string. *****/ while(var_iter(slp_attr, &tag_cur, &tag_end, &var)) { /*** Skip bad tags? ***/ if(var == NULL) { continue; } /*** Skip old attributes. ***/ if(find_delta == SLP_TRUE && var->modified == SLP_FALSE) { continue; } /*** Get size of tag ***/ size += var->tag_len; /*** Count the size needed for the value list ***/ if(var->type != SLP_KEYWORD) { value_t *value; /** Get size of data **/ value = var->list; while(value) { size += value->escaped_len; value = value->next; } /** Count number of commas needed for multivalued attributes. **/ assert(var->list_size >= 0); size += (var->list_size - 1) * VAR_SEPARATOR_LEN; /** Count the semantics needed to store a multivalue list **/ size += VAR_NON_KEYWORD_SEMANTIC_LEN; } else { assert(var->list == NULL); } /*** Count number of variables ***/ var_count++; } /*** Count the number of characters between attributes. ***/ if(var_count > 0) { size += (var_count - 1) * VAR_SEPARATOR_LEN; } /***** Return the size needed/used. *****/ if(count != NULL) { *count = size + 1; } /***** Create the string. *****/ if(*out_buffer == NULL) { /* We have to locally alloc the string. */ build_str = (char *)malloc( size + 1); if(build_str == NULL) { return SLP_MEMORY_ALLOC_FAILED; } } else { /* We write into a pre-alloc'd buffer. */ /**** Check that out_buffer is big enough. ****/ if((int)size + 1 > bufferlen) { return SLP_BUFFER_OVERFLOW; } build_str = *out_buffer; } build_str[0] = '\0'; /***** Add values *****/ /**** Decide on our looping mode. ****/ if(tags == NULL || *tags == 0) { tag_cur = NULL; } else { tag_cur = (char *)tags; } tag_end = tag_cur; var = NULL; /**** Find the size of string needed for the attribute string. ****/ cur = build_str; while(var_iter(slp_attr, &tag_cur, &tag_end, &var)) { /*** Skip bad tags? ***/ if(var == NULL) { continue; } /*** Skip old attributes. ***/ if(find_delta == SLP_TRUE && var->modified == SLP_FALSE) { continue; } if(var->type == SLP_KEYWORD) { /**** Handle keywords. ****/ memcpy(cur, var->tag, var->tag_len); cur += var->tag_len; } else { /**** Handle everything else. ****/ char *to_add; int to_add_len; value_t *value; /*** Add the prefix. ***/ *cur = VAR_PREFIX; cur += VAR_PREFIX_LEN; /*** Add the tag. ***/ memcpy(cur, var->tag, var->tag_len); cur += var->tag_len; /*** Add the infix. ***/ *cur = VAR_INFIX; cur += VAR_INFIX_LEN; /*** Insert value (list) ***/ value = var->list; assert(value); while(value) { /* foreach member value of an attribute. */ assert(var->type != SLP_KEYWORD); switch(var->type) { case(SLP_BOOLEAN): assert(value->next == NULL); /* Can't be a multivalued list. */ assert(value->data.va_bool == SLP_TRUE || value->data.va_bool == SLP_FALSE); if(value->data.va_bool == SLP_TRUE) { to_add = BOOL_TRUE_STR; to_add_len = BOOL_TRUE_STR_LEN; } else { to_add = BOOL_FALSE_STR; to_add_len = BOOL_FALSE_STR_LEN; } memcpy(cur, to_add, to_add_len); cur += to_add_len; break; case(SLP_STRING): cur = escape_into(cur, value->data.va_str, value->unescaped_len); break; case(SLP_INTEGER): sprintf(cur, "%d", value->data.va_int); cur += value->escaped_len; break; case(SLP_OPAQUE): memcpy(cur, OPAQUE_PREFIX, OPAQUE_PREFIX_LEN); cur += OPAQUE_PREFIX_LEN; cur = escape_opaque_into(cur, value->data.va_str, value->unescaped_len); break; default: printf("Unknown type (%s:%d).\n", __FILE__, __LINE__); /* TODO Clean up memory leak: the output string */ return SLP_INTERNAL_SYSTEM_ERROR; } value = value->next; /*** Add separator (if necessary) ***/ if(value != NULL) { *cur = VAR_SEPARATOR; cur += VAR_SEPARATOR_LEN; *cur = 0; } } /*** Add the suffix. ***/ *cur = VAR_SUFFIX; cur += VAR_SUFFIX_LEN; *cur = 0; } /*** Add separator. This is fixed for the last val outside the loop ***/ /* if (var->next != NULL) { */ if((unsigned)(cur - build_str) < size) { *cur = VAR_SEPARATOR; cur += VAR_SEPARATOR_LEN; *cur = 0; } /*** Reset the modified flag. ***/ var->modified = SLP_FALSE; } /**** Shift back to erase the last comma. ****/ /***** Append a null (This is actually done by strcpy, but its better to * be safe than sorry =) *****/ *cur = '\0'; assert((unsigned)(cur - build_str) == size && size == strlen(build_str)); *out_buffer = build_str; return SLP_OK; } /* Stores an escaped value into an attribute. Determines type of attribute at * the same time. * * tag must be null terminated. * val must be of length len. * policy will only be respected where it can be (ints, strings, and opaques). * * the contents of tag are NOT verified. * * Returns: * SLP_PARAMETER_BAD - Syntax error in the value. * SLP_MEMORY_ALLOC_FAILED */ SLPError SLPAttrStore(struct xx_SLPAttributes *slp_attr, const char *tag, const char *val, int len, SLPInsertionPolicy policy ) { int i; /* Index into val. */ SLPBoolean is_str; /* Flag used for checking if given is string. */ char *unescaped; int unescaped_len; /* Length of the unescaped text. */ /***** Check opaque. *****/ if(strncmp(val, OPAQUE_PREFIX, OPAQUE_PREFIX_LEN) == 0) { /*** Verify length (ie, that it is the multiple of the size of an * escaped character). ***/ if(len % ESCAPED_LEN != 0) { return SLP_PARAMETER_BAD; } unescaped_len = (len / ESCAPED_LEN) - 1; /* -1 to drop the OPAQUE_PREFIX. */ /*** Verify that every character has been escaped. ***/ /* TODO */ /***** Unescape the value. *****/ unescaped = (char *)malloc(unescaped_len); if(unescaped == NULL) { return SLP_MEMORY_ALLOC_FAILED; /* FIXME: Real error code. */ } if(unescape_into(unescaped, (char *)(val + OPAQUE_PREFIX_LEN), len - OPAQUE_PREFIX_LEN, NULL) != NULL) { SLPError err; err = SLPAttrSet_opaque((SLPAttributes)slp_attr, tag, unescaped, (len - OPAQUE_PREFIX_LEN) / 3, policy); free(unescaped);/* FIXME This should be put into the val, and free()'d in val_destroy(). */ return err; } return SLP_PARAMETER_BAD; /* FIXME Verify. Is this really a bad parameter?*/ } /***** Check boolean. *****/ if((BOOL_TRUE_STR_LEN == len) && (strncmp(val, BOOL_TRUE_STR, len) == 0)) { return SLPAttrSet_bool((SLPAttributes)slp_attr, tag, SLP_TRUE); } if((BOOL_FALSE_STR_LEN == len) && strncmp(val, BOOL_FALSE_STR, len) == 0) { return SLPAttrSet_bool((SLPAttributes)slp_attr, tag, SLP_FALSE); } /***** Check integer *****/ if(*val == '-' || isdigit((int)*val)) { /*** Verify. ***/ SLPBoolean is_int = SLP_TRUE; /* Flag true if the attr is an int. */ for(i = 1; i < len; i++) { /* We start at 1 since first char has already been checked. */ if(!isdigit((int)val[i])) { is_int = SLP_FALSE; break; } } /*** Handle the int-ness. ***/ if(is_int == SLP_TRUE) { char *end; /* To verify that the correct length was read. */ SLPError err; err = SLPAttrSet_int((SLPAttributes)slp_attr, tag, (int) strtol(val, &end, 10), policy); assert(end == val + len); return err; } } /***** Check string. *****/ is_str = SLP_TRUE; for(i = 0; i < len; i++) { if(IS_RESERVED(val[i]) && (val[i] != '\\')) { is_str = SLP_FALSE; break; } } if(is_str == SLP_TRUE) { unescaped_len = find_unescaped_size(val, len); unescaped = (char *)malloc( unescaped_len + 1 ); if(unescape_into(unescaped, val, len, NULL) != NULL) { SLPError err; unescaped[unescaped_len] = '\0'; err = SLPAttrSet_str((SLPAttributes)slp_attr, tag, unescaped, policy); free(unescaped); /* FIXME This should be put into the val, and free()'d in val_destroy(). */ return err; } return SLP_PARAMETER_BAD; } /* We don't bother checking for a keyword attribute since it can't have a * value. */ return SLP_PARAMETER_BAD; /* Could not determine type. */ } /* Converts an attribute string into an attr struct. * * Note that the attribute string is trashed. * * Returns: * SLP_PARAMETER_BAD -- If there is a parse error in the attribute string. * SLP_OK -- If everything went okay. */ SLPError attr_destringify( struct xx_SLPAttributes *slp_attr, char const *str, SLPInsertionPolicy policy ) { char const *cur; /* Current index into str. */ enum { /* Note: everything contained in []s in this enum is a production from * RFC 2608's grammar defining attribute lists. */ START_ATTR /* The start of an individual [attribute]. */, START_TAG /* The start of a [attr-tag]. */, VALUE /* The start of an [attr-val]. */, STOP_VALUE /* The end of an [attr-val]. */ } state = START_ATTR; /* The current state of the parse. */ char const *tag; /* A tag that has been parsed. (carries data across state changes)*/ int tag_len = 0; /* length of the tag (in bytes) */ assert(str != NULL); if(strlen(str) == 0) { return SLP_OK; } tag = NULL; cur = str; /***** Pull apart str. *****/ while(*cur) { char const *end; /* The end of a parse entity. */ switch(state) { case(START_ATTR): /* At the beginning of an attribute. */ if(*cur == VAR_PREFIX) { /* At the start of a non-keyword. */ state = START_TAG; cur += VAR_PREFIX_LEN; } else { /* At the start of a keyword: * Gobble up the keyword and set it. */ end = find_tag_end(cur); if(end == NULL) { /* FIXME Ummm, I dunno. */ assert(0); } /*** Check that the tag ends on a legal ending char. ***/ if(*end == ',') { /** Add the keyword. **/ SLPAttrSet_keyw_len((SLPAttributes)slp_attr, cur, end - cur); cur = end + 1; break; } else if(*end == '\0') { SLPAttrSet_keyw_len((SLPAttributes)slp_attr, cur, end - cur); return SLP_OK; /* FIXME Return success. */ break; } else { return SLP_PARAMETER_BAD; /* FIXME Return error code. -- Illegal tag char */ } } break; case(START_TAG): /* At the beginning of a tag, in brackets. */ end = find_tag_end(cur); if(end == NULL) { return SLP_PARAMETER_BAD; /* FIXME Err. code -- Illegal char. */ } if(*end == '\0') { return SLP_PARAMETER_BAD; /* FIXME err: Premature end. */ } /*** Check the the end character is valid. ***/ if(*end == VAR_INFIX) { tag_len = (int)(end - cur); /* Note that end is on the character _after_ the last character of the tag (the =). */ assert(tag == NULL); tag = cur; cur = end + VAR_INFIX_LEN; state = VALUE; } else { /** ERROR! **/ return SLP_PARAMETER_BAD; /* FIXME Err. code.-- Logic error. */ } break; case(VALUE): /* At the beginning of the value portion. */ assert(tag != NULL); /* We should not be able to get into this state: is the string is malformed? */ { /*** Find the end of the entire value list. ***/ int errval; int val_count; SLPType type; char const *start; int unescaped_len; start = cur; errval = find_value_list_end(start, &val_count, &type, &unescaped_len, &cur); if(errval != 1) { return SLP_PARAMETER_BAD; } errval = internal_store(slp_attr, tag, tag_len, start, cur, val_count, type, unescaped_len); if(errval != 1) { return SLP_MEMORY_ALLOC_FAILED; } state = STOP_VALUE; } break; case(STOP_VALUE): /* At the end of a value. */ /***** Check to see which state we should move into next.*****/ /*** Done? ***/ if(*cur == '\0') { return SLP_OK; } /*** Another value? (ie, we're in a value list) ***/ // else if (*cur == VAR_SEPARATOR) { // cur += VAR_SEPARATOR_LEN; // state = VALUE; // } /*** End of the attribute? ***/ else if(*cur == VAR_SUFFIX) { assert(tag != NULL); tag = NULL; cur += VAR_SUFFIX_LEN; /*** Are we at string end? ***/ if(*cur == '\0') { return SLP_OK; } /*** Ensure that there is a seperator ***/ if(*cur != VAR_SEPARATOR) { return SLP_PARAMETER_BAD; /* FIXME err -- unexpected character. */ } cur += VAR_SEPARATOR_LEN; state = START_ATTR; } /*** Error. ***/ else { return SLP_PARAMETER_BAD; /* FIXME err -- Illegal char at value end. */ } break; default: printf("Unknown state %d\n", state); } } return SLP_OK; } void destringify(SLPAttributes slp_attr_h, const char *str) { attr_destringify((struct xx_SLPAttributes*)slp_attr_h, (char *)str, SLP_ADD); } /* Adds the tags named in attrs to the receiver. Note that the new attributes * _replace_ the old ones. * * Returns: * SLP_OK -- Update occured as expected. * SLP_MEMORY_ALLOC_FAILED -- Guess. * SLP_PARAMETER_BAD -- Syntax error in the attribute string. Although * slp_attr_h is still valid, its contents may have arbitrarily changed. */ SLPError SLPAttrFreshen(SLPAttributes slp_attr_h, const char *str) { SLPError err; struct xx_SLPAttributes *slp_attr = (struct xx_SLPAttributes*)slp_attr_h; // char *mangle; /* A copy of the passed in string, since attr_destringify tends to chew data. */ // // mangle = strdup(str); // if (str == NULL) { // return SLP_MEMORY_ALLOC_FAILED; // } err = attr_destringify(slp_attr, str, SLP_ADD); // free(mangle); return err; } /****************************************************************************** * * SLP Control Functions * *****************************************************************************/ /* Register attributes. */ //SLPError SLPRegAttr( // SLPHandle slp_h, // const char* srvurl, // unsigned short lifetime, // const char* srvtype, // SLPAttributes attr_h, // SLPBoolean fresh, // SLPRegReport callback, // void* cookie //) { // char *str; // SLPError err; // //// err = SLPAttrSerialize(attr_h, int *count, char **str, SLPBoolean find_delta); // // if (str == NULL) { // return SLP_INTERNAL_SYSTEM_ERROR; // } // // err = SLPReg(slp_h, srvurl, lifetime, srvtype, str, fresh, callback, cookie); // // free(str); // // return err; //} struct hop_attr { SLPAttrObjCallback *cb; void *cookie; }; SLPBoolean attr_callback ( SLPHandle hslp, const char* attrlist, SLPError errcode, void* cookie ) { struct hop_attr *hop = (struct hop_attr *)cookie; SLPAttributes attr; SLPBoolean result; assert(errcode == SLP_OK || errcode == SLP_LAST_CALL); if(errcode == SLP_OK) { if(SLPAttrAlloc("en", NULL, SLP_FALSE, &attr) != SLP_OK) { /* FIXME Ummm, should prolly tell application about the internal * error. */ return SLP_FALSE; } destringify(attr, attrlist); result = hop->cb(hslp, attr, errcode, hop->cookie); assert(result == SLP_TRUE || result == SLP_FALSE); SLPAttrFree(attr); } else if(errcode == SLP_LAST_CALL) { result = hop->cb(hslp, NULL, errcode, hop->cookie); } else { result = hop->cb(hslp, NULL, errcode, hop->cookie); } return result; } /* Find the attributes of a given service. */ //SLPError SLPFindAttrObj( // SLPHandle hslp, // const char* srvurlorsrvtype, // const char* scopelist, // const char* attrids, // SLPAttrObjCallback *callback, // void* cookie //) { // struct hop_attr *hop; // SLPError err; // // hop = (struct hop_attr*)malloc(sizeof(struct hop_attr)); // hop->cb = callback; // hop->cookie = cookie; // // err = SLPFindAttrs(hslp, srvurlorsrvtype, scopelist, attrids, attr_callback, hop); // // free(hop); // // return err; //} /****************************************************************************** * * Iterators * *****************************************************************************/ ///* An iterator to make for easy looping across the struct. */ //struct xx_SLPAttrIterator { // int element_count; /* Number of elements. */ // char **tags; /* Array of tags. */ // int current; /* Current index into the attribute iterator. */ // struct xx_SLPAttributes *slp_attr; //}; // // // ///* Allocates a new iterator for the given attribute handle. */ //SLPError SLPAttrIteratorAlloc(SLPAttributes attr_h, SLPAttrIterator *iter_h) { // struct xx_SLPAttrIterator *iter; // struct xx_SLPAttributes *slp_attr = (struct xx_SLPAttributes *)attr_h; // var_t *var; // int i; // // assert(slp_attr != NULL); // // iter = (struct xx_SLPAttrIterator *)malloc(sizeof(struct xx_SLPAttrIterator)); /* free()'d in SLPAttrIteratorFree(). */ // if (iter == NULL) { // return SLP_MEMORY_ALLOC_FAILED; // } // // iter->element_count = (int)slp_attr->attr_count; // iter->current = -1; // iter->slp_attr = slp_attr; // // iter->tags = (char **)malloc(sizeof(char *) * iter->element_count); // if (iter->tags == NULL) { // free(iter); // return SLP_MEMORY_ALLOC_FAILED; // } // // var = slp_attr->attrs; // // for (i = 0; i < iter->element_count; i++, var = var->next) { // assert(var != NULL); // // iter->tags[i] = strdup(var->tag); // // /***** Check that strdup succeeded. *****/ // if (iter->tags[i] == NULL) { // /**** Unallocate structure. ****/ // int up_to_i; // /*** Unallocate the tag list members. ***/ // for (up_to_i = 0; up_to_i < i; up_to_i++) { // free(iter->tags[up_to_i]); // } // // /*** Unallocate the tag list ***/ // free(iter->tags); // // return SLP_MEMORY_ALLOC_FAILED; // } // } // // *iter_h = (SLPAttrIterator)iter; // // return SLP_OK; //} // // ///* Dealloc's an iterator and the associated memory. // * // * Everything free()'d here was alloc'd in SLPAttrIteratorAlloc(). // */ //void SLPAttrIteratorFree(SLPAttrIterator iter_h) { // struct xx_SLPAttrIterator *iter = (struct xx_SLPAttrIterator*)iter_h; // int i; // // /***** Free the tag list. *****/ // for(i = 0; i < iter->element_count; i++) { // free(iter->tags[i]); // iter->tags[i] = NULL; // } // // free(iter->tags); // // free(iter); //} // // ///* Gets the next tag name (and type). // * // * Note: The value of tag _must_ be copied out before the next call to // * SLPAttrIterNext(). In other words, DO NOT keep pointers to the tag string // * after the next call to SLPAttrIterNext(). // * // * Returns SLP_FALSE if there are no tags left to iterate over, or SLP_TRUE. // */ //SLPBoolean SLPAttrIterNext(SLPAttrIterator iter_h, char const **tag, SLPType *type) { // struct xx_SLPAttrIterator *iter = (struct xx_SLPAttrIterator*)iter_h; // SLPError err; // // iter->current++; // if (iter->current >= iter->element_count) { // *tag = NULL; // return SLP_FALSE; /* FIXME Return Done. */ // } // *tag = iter->tags[iter->current]; // err = SLPAttrGetType(iter->slp_attr, *tag, type); // // if (err != SLP_OK) { // return SLP_FALSE; /* FIXME Ummm, try to get the next one. */ // } // // return SLP_TRUE; //} // // // // /* An iterator to make for easy looping across the struct. */ struct xx_SLPAttrIterator { struct xx_SLPAttributes *slp_attr; var_t *current; }; /* Allocates a new iterator for the given attribute handle. */ SLPError SLPAttrIteratorAlloc(SLPAttributes attr_h, SLPAttrIterator *iter_h) { struct xx_SLPAttrIterator *iter; struct xx_SLPAttributes *slp_attr = (struct xx_SLPAttributes *)attr_h; assert(slp_attr != NULL); iter = (struct xx_SLPAttrIterator *)malloc(sizeof(struct xx_SLPAttrIterator)); /* free()'d in SLPAttrIteratorFree(). */ if(iter == NULL) { return SLP_MEMORY_ALLOC_FAILED; } iter->current = NULL; iter->slp_attr = slp_attr; *iter_h = (SLPAttrIterator)iter; return SLP_OK; } /* Dealloc's an iterator and the associated memory. * * Everything free()'d here was alloc'd in SLPAttrIteratorAlloc(). */ void SLPAttrIteratorFree(SLPAttrIterator iter_h) { struct xx_SLPAttrIterator *iter = (struct xx_SLPAttrIterator*)iter_h; free(iter); } /* Gets the next tag name (and type). * * Note: The value of tag _must_ be copied out before the next call to * SLPAttrIterNext(). In other words, DO NOT keep pointers to the tag string * after the next call to SLPAttrIterNext(). * * Returns SLP_FALSE if there are no tags left to iterate over, or SLP_TRUE. */ SLPBoolean SLPAttrIterNext(SLPAttrIterator iter_h, char const **tag, SLPType *type) { struct xx_SLPAttrIterator *iter = (struct xx_SLPAttrIterator*)iter_h; if(iter->current == NULL) { iter->current = iter->slp_attr->attrs; } else { iter->current = iter->current->next; if(iter->current == NULL) { return SLP_FALSE; /* Done. */ } } *tag = iter->current->tag; *type = iter->current->type; return SLP_TRUE; } openslp-1.2.1/acinclude.m40000644033442200000310000000243610201756742015262 0ustar rganesanfloppydnl dnl We cannot use the AC_CHECK_TYPE macro to check for socklen_t because that dnl macro only checks in standard headers. This one checks in sys/socket.h dnl also. This code has been copied from Unix Network Programming examples dnl by W. Richard Stevens dnl dnl OPENSLP_CHECK_TYPE(TYPE, DEFAULT, DESCRIPTION) AC_DEFUN([OPENSLP_CHECK_TYPE], [AC_REQUIRE([AC_HEADER_STDC])dnl AC_MSG_CHECKING(for $1) AC_CACHE_VAL(ac_cv_type_$1, [AC_EGREP_CPP(dnl changequote(<<,>>)dnl <<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl changequote([,]), [#include #if STDC_HEADERS #include #include #endif #include ], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl AC_MSG_RESULT($ac_cv_type_$1) if test $ac_cv_type_$1 = no; then AC_DEFINE($1, $2, $3) fi ]) dnl Check for the presence of SA_RESTORER field in struct sigaction. dnl dnl OPENSLP_STRUCT_SA_RESTORER AC_DEFUN([OPENSLP_STRUCT_SA_RESTORER], [AC_CACHE_CHECK([for sa_restorer in struct sigaction], ac_cv_struct_sa_restorer, [AC_TRY_COMPILE([#include #include ], [struct sigaction s; s.sa_restorer;], ac_cv_struct_sa_restorer=yes, ac_cv_struct_sa_restorer=no)]) if test $ac_cv_struct_sa_restorer = yes; then AC_DEFINE(HAVE_SA_RESTORER, 1, [defined if struct sigaction has member sa_restorer]) fi ]) openslp-1.2.1/common/0000755033442200000310000000000010211377552014353 5ustar rganesanfloppyopenslp-1.2.1/common/slp_attr.h0000644033442200000310000000362710202047412016351 0ustar rganesanfloppy/******************************************************************* * Description: encode/decode attribute lists * * Originated: 03-07-2000 * Original Author: Mike Day - md@soft-hackle.net * Project: * * $Header: /cvsroot/openslp/openslp/common/slp_attr.h,v 1.4 2002/09/10 04:38:25 mpeterson Exp $ * * Copyright (C) Michael Day, 1999-2001 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *******************************************************************/ #ifndef SLP_ATTR_H_INCLUDED #define SLP_ATTR_H_INCLUDED typedef enum attrTypes { head = -1, string, integer, boolean, opaque, tag }SLPTypes; typedef union SLP_attr_value { char *stringVal; unsigned long intVal; int boolVal; void *opaqueVal; }SLPAttrVal; typedef struct SLP_attr_list { struct SLP_attr_list *next; struct SLP_attr_list *prev; int isHead; unsigned char *name; SLPTypes type; SLPAttrVal val; }SLPAttrList; SLPAttrList *SLPAllocAttr(char *name, SLPTypes type, void *val, int len); SLPAttrList *SLPAllocAttrList(void); void SLPFreeAttr(SLPAttrList *attr); void SLPFreeAttrList(SLPAttrList *list, int staticFlag); SLPAttrList *SLPDecodeAttrString(char *s); #endif /* SLP_ATTR_H_INCLUDED */ openslp-1.2.1/common/slp_attr_y.c0000644033442200000310000011636610211377550016712 0ustar rganesanfloppy/* A Bison parser, made by GNU Bison 1.875. */ /* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* Written by Richard Stallman by simplifying the original so called ``semantic'' parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Using locations. */ #define YYLSP_NEEDED 0 /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { _TRUE = 258, _FALSE = 259, _MULTIVAL = 260, _INT = 261, _ESCAPED = 262, _TAG = 263, _STRING = 264 }; #endif #define _TRUE 258 #define _FALSE 259 #define _MULTIVAL 260 #define _INT 261 #define _ESCAPED 262 #define _TAG 263 #define _STRING 264 /* Copy the first part of user declarations. */ #line 23 "slp_attr_y.y" #include #include #include #include "slp_attr.h" #include "slp_linkedlist.h" /* prototypes and globals go here */ #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE (!FALSE) #endif #define yymaxdepth slp_attr_maxdepth #define yyparse slp_attr_parse #define yylex slp_attr_lex #define yyerror slp_attr_error #define yylval slp_attr_lval #define yychar slp_attr_char #define yydebug slp_attr_debug #define yypact slp_attr_pact #define yyr1 slp_attr_r1 #define yyr2 slp_attr_r2 #define yydef slp_attr_def #define yychk slp_attr_chk #define yypgo slp_attr_pgo #define yyact slp_attr_act #define yyexca slp_attr_exca #define yyerrflag slp_attr_errflag #define yynerrs slp_attr_nerrs #define yyps slp_attr_ps #define yypv slp_attr_pv #define yys slp_attr_s #define yy_yys slp_attr_yys #define yystate slp_attr_state #define yytmp slp_attr_tmp #define yyv slp_attr_v #define yy_yyv slp_attr_yyv #define yyval slp_attr_val #define yylloc slp_attr_lloc #define yyreds slp_attr_reds #define yytoks slp_attr_toks #define yylhs slp_attr_yylhs #define yylen slp_attr_yylen #define yydefred slp_attr_yydefred #define yydgoto slp_attr_yydgoto #define yysindex slp_attr_yysindex #define yyrindex slp_attr_yyrindex #define yygindex slp_attr_yygindex #define yytable slp_attr_yytable #define yycheck slp_attr_yycheck #define yyname slp_attr_yyname #define yyrule slp_attr_yyrule static int bt = TRUE; static int bf = FALSE; static SLPAttrList attrHead = {&attrHead, &attrHead, TRUE, NULL, head, {0L}}; static SLPAttrList inProcessAttr = {&inProcessAttr, &inProcessAttr, TRUE, NULL, head, {0L}}; static SLPAttrList inProcessTag = {&inProcessTag, &inProcessTag, TRUE, NULL, head, {0L}}; int slp_attr_parse(void); void slp_attr_error(char *, ...); int slp_attr_wrap(void); int slp_attr_lex(void); void slp_attr_close_lexer(unsigned int handle); unsigned int slp_attr_init_lexer(char *s); /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) #line 102 "slp_attr_y.y" typedef union YYSTYPE { int _i; char *_s; SLPAttrList *_atl; } YYSTYPE; /* Line 191 of yacc.c. */ #line 175 "slp_attr_y.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif /* Copy the second part of user declarations. */ /* Line 214 of yacc.c. */ #line 187 "slp_attr_y.c" #if ! defined (yyoverflow) || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # if YYSTACK_USE_ALLOCA # define YYSTACK_ALLOC alloca # else # ifndef YYSTACK_USE_ALLOCA # if defined (alloca) || defined (_ALLOCA_H) # define YYSTACK_ALLOC alloca # else # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # else # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif # define YYSTACK_ALLOC malloc # define YYSTACK_FREE free # endif #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ #if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ || (YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { short yyss; YYSTYPE yyvs; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ register YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (0) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if defined (__STDC__) || defined (__cplusplus) typedef signed char yysigned_char; #else typedef short yysigned_char; #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 6 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 17 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 14 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 5 /* YYNRULES -- Number of rules. */ #define YYNRULES 13 /* YYNRULES -- Number of states. */ #define YYNSTATES 21 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 264 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const unsigned char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 11, 12, 2, 2, 10, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 13, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const unsigned char yyprhs[] = { 0, 0, 3, 5, 9, 11, 15, 21, 23, 27, 29, 31, 33, 35 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yysigned_char yyrhs[] = { 15, 0, -1, 16, -1, 15, 10, 16, -1, 8, -1, 11, 8, 12, -1, 11, 8, 13, 17, 12, -1, 18, -1, 17, 5, 18, -1, 3, -1, 4, -1, 7, -1, 9, -1, 6, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned char yyrline[] = { 0, 118, 118, 129, 141, 149, 157, 169, 176, 184, 188, 192, 197, 201 }; #endif #if YYDEBUG || YYERROR_VERBOSE /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "_TRUE", "_FALSE", "_MULTIVAL", "_INT", "_ESCAPED", "_TAG", "_STRING", "','", "'('", "')'", "'='", "$accept", "attr_list", "attr", "attr_val_list", "attr_val", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const unsigned short yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 44, 40, 41, 61 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const unsigned char yyr1[] = { 0, 14, 15, 15, 16, 16, 16, 17, 17, 18, 18, 18, 18, 18 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const unsigned char yyr2[] = { 0, 2, 1, 3, 1, 3, 5, 1, 3, 1, 1, 1, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const unsigned char yydefact[] = { 0, 4, 0, 0, 2, 0, 1, 0, 5, 0, 3, 9, 10, 13, 11, 12, 0, 7, 0, 6, 8 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yysigned_char yydefgoto[] = { -1, 3, 4, 16, 17 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -12 static const yysigned_char yypact[] = { -6, -12, -2, 0, -12, -9, -12, -6, -12, 8, -12, -12, -12, -12, -12, -12, -4, -12, 8, -12, -12 }; /* YYPGOTO[NTERM-NUM]. */ static const yysigned_char yypgoto[] = { -12, -12, 2, -12, -11 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const unsigned char yytable[] = { 6, 18, 1, 8, 9, 2, 5, 20, 19, 10, 7, 11, 12, 0, 13, 14, 0, 15 }; static const yysigned_char yycheck[] = { 0, 5, 8, 12, 13, 11, 8, 18, 12, 7, 10, 3, 4, -1, 6, 7, -1, 9 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const unsigned char yystos[] = { 0, 8, 11, 15, 16, 8, 0, 10, 12, 13, 16, 3, 4, 6, 7, 9, 17, 18, 5, 12, 18 }; #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ #endif #if ! defined (YYSIZE_T) && defined (size_t) # define YYSIZE_T size_t #endif #if ! defined (YYSIZE_T) # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif #endif #if ! defined (YYSIZE_T) # define YYSIZE_T unsigned int #endif #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ yyerror ("syntax error: cannot back up");\ YYERROR; \ } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Compute the default location (before the actions are run). */ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ Current.first_line = Rhs[1].first_line; \ Current.first_column = Rhs[1].first_column; \ Current.last_line = Rhs[N].last_line; \ Current.last_column = Rhs[N].last_column; #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else # define YYLEX yylex () #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) # define YYDSYMPRINT(Args) \ do { \ if (yydebug) \ yysymprint Args; \ } while (0) # define YYDSYMPRINTF(Title, Token, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yysymprint (stderr, \ Token, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (cinluded). | `------------------------------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yy_stack_print (short *bottom, short *top) #else static void yy_stack_print (bottom, top) short *bottom; short *top; #endif { YYFPRINTF (stderr, "Stack now"); for (/* Nothing. */; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yy_reduce_print (int yyrule) #else static void yy_reduce_print (yyrule) int yyrule; #endif { int yyi; unsigned int yylineno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", yyrule - 1, yylineno); /* Print the symbols being reduced, and their result. */ for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (Rule); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YYDSYMPRINT(Args) # define YYDSYMPRINTF(Title, Token, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #if YYMAXDEPTH == 0 # undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined (__GLIBC__) && defined (_STRING_H) # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T # if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) # else yystrlen (yystr) const char *yystr; # endif { register const char *yys = yystr; while (*yys++ != '\0') continue; return yys - yystr - 1; } # endif # endif # ifndef yystpcpy # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * # if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) # else yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; # endif { register char *yyd = yydest; register const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif #endif /* !YYERROR_VERBOSE */ #if YYDEBUG /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) #else static void yysymprint (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE *yyvaluep; #endif { /* Pacify ``unused variable'' warnings. */ (void) yyvaluep; if (yytype < YYNTOKENS) { YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); # ifdef YYPRINT YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # endif } else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); switch (yytype) { default: break; } YYFPRINTF (yyoutput, ")"); } #endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yydestruct (int yytype, YYSTYPE *yyvaluep) #else static void yydestruct (yytype, yyvaluep) int yytype; YYSTYPE *yyvaluep; #endif { /* Pacify ``unused variable'' warnings. */ (void) yyvaluep; switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) int yyparse (void *YYPARSE_PARAM); # else int yyparse (); # endif #else /* ! YYPARSE_PARAM */ #if defined (__STDC__) || defined (__cplusplus) int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) int yyparse (void *YYPARSE_PARAM) # else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; # endif #else /* ! YYPARSE_PARAM */ #if defined (__STDC__) || defined (__cplusplus) int yyparse (void) #else int yyparse () #endif #endif { register int yystate; register int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Lookahead token as an internal (translated) token number. */ int yytoken = 0; /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ short yyssa[YYINITDEPTH]; short *yyss = yyssa; register short *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; #define YYPOPSTACK (yyvsp--, yyssp--) YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; /* When reducing, the number of symbols on the RHS of the reduced rule. */ int yylen; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyoverflowlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyoverflowlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { short *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. */ /* Read a lookahead token if we need one and don't already have one. */ /* yyresume: */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: #line 119 "slp_attr_y.y" { while ( !SLP_IS_HEAD(inProcessAttr.next) ) { yyval._atl = inProcessAttr.next; SLP_UNLINK(yyval._atl); SLP_INSERT_BEFORE(yyval._atl, &attrHead); } /* all we really want to do here is link each attribute */ /* to the global list head. */ } break; case 3: #line 130 "slp_attr_y.y" { /* both of these non-terminals are really lists */ /* ignore the first non-terminal */ while ( !SLP_IS_HEAD(inProcessAttr.next) ) { yyval._atl = inProcessAttr.next; SLP_UNLINK(yyval._atl); SLP_INSERT_BEFORE(yyval._atl, &attrHead); } } break; case 4: #line 142 "slp_attr_y.y" { yyval._atl = SLPAllocAttr(yyvsp[0]._s, tag, NULL, 0); if ( NULL != yyval._atl ) { SLP_INSERT_BEFORE(yyval._atl, &inProcessAttr); } } break; case 5: #line 150 "slp_attr_y.y" { yyval._atl = SLPAllocAttr(yyvsp[-1]._s, tag, NULL, 0); if (NULL != yyval._atl) { SLP_INSERT_BEFORE(yyval._atl, &inProcessAttr); } } break; case 6: #line 158 "slp_attr_y.y" { yyval._atl = inProcessTag.next; while (!SLP_IS_HEAD(yyval._atl)) { yyval._atl->name = strdup(yyvsp[-3]._s); SLP_UNLINK(yyval._atl); SLP_INSERT_BEFORE(yyval._atl, &inProcessAttr); yyval._atl = inProcessTag.next; } } break; case 7: #line 170 "slp_attr_y.y" { if(NULL != yyvsp[0]._atl) { SLP_INSERT(yyvsp[0]._atl, &inProcessTag); } } break; case 8: #line 177 "slp_attr_y.y" { if (NULL != yyvsp[0]._atl) { SLP_INSERT_BEFORE(yyvsp[0]._atl, &inProcessTag); } } break; case 9: #line 185 "slp_attr_y.y" { yyval._atl = SLPAllocAttr(NULL, boolean, &bt, sizeof(int)); } break; case 10: #line 189 "slp_attr_y.y" { yyval._atl = SLPAllocAttr(NULL, boolean, &bf, sizeof(int)); } break; case 11: #line 193 "slp_attr_y.y" { /* treat it as a string because it is already encoded */ yyval._atl = SLPAllocAttr(NULL, string, yyvsp[0]._s, strlen(yyvsp[0]._s) + 1); } break; case 12: #line 198 "slp_attr_y.y" { yyval._atl = SLPAllocAttr(NULL, string, yyvsp[0]._s, strlen(yyvsp[0]._s) + 1); } break; case 13: #line 202 "slp_attr_y.y" { yyval._atl = SLPAllocAttr(NULL, integer, &(yyvsp[0]._i), sizeof(int)); } break; } /* Line 991 of yacc.c. */ #line 1185 "slp_attr_y.c" yyvsp -= yylen; yyssp -= yylen; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if YYERROR_VERBOSE yyn = yypact[yystate]; if (YYPACT_NINF < yyn && yyn < YYLAST) { YYSIZE_T yysize = 0; int yytype = YYTRANSLATE (yychar); char *yymsg; int yyx, yycount; yycount = 0; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) yysize += yystrlen (yytname[yyx]) + 15, yycount++; yysize += yystrlen ("syntax error, unexpected ") + 1; yysize += yystrlen (yytname[yytype]); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); yyp = yystpcpy (yyp, yytname[yytype]); if (yycount < 5) { yycount = 0; for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { const char *yyq = ! yycount ? ", expecting " : " or "; yyp = yystpcpy (yyp, yyq); yyp = yystpcpy (yyp, yytname[yyx]); yycount++; } } yyerror (yymsg); YYSTACK_FREE (yymsg); } else yyerror ("syntax error; also virtual memory exhausted"); } else #endif /* YYERROR_VERBOSE */ yyerror ("syntax error"); } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ /* Return failure if at end of input. */ if (yychar == YYEOF) { /* Pop the error token. */ YYPOPSTACK; /* Pop the rest of the stack. */ while (yyss < yyssp) { YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct (yystos[*yyssp], yyvsp); YYPOPSTACK; } YYABORT; } YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); yydestruct (yytoken, &yylval); yychar = YYEMPTY; } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab2; /*----------------------------------------------------. | yyerrlab1 -- error raised explicitly by an action. | `----------------------------------------------------*/ yyerrlab1: /* Suppress GCC warning that yyerrlab1 is unused when no action invokes YYERROR. */ #if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__) \ && !defined __cplusplus __attribute__ ((__unused__)) #endif goto yyerrlab2; /*---------------------------------------------------------------. | yyerrlab2 -- pop states until the error token can be shifted. | `---------------------------------------------------------------*/ yyerrlab2: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct (yystos[yystate], yyvsp); yyvsp--; yystate = *--yyssp; YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #ifndef yyoverflow /*----------------------------------------------. | yyoverflowlab -- parser overflow comes here. | `----------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ #endif yyreturn: #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } #line 207 "slp_attr_y.y" SLPAttrList *SLPAllocAttr(char *name, SLPTypes type, void *val, int len) { SLPAttrList *attr; if ( NULL != (attr = (SLPAttrList *)calloc(1, sizeof(SLPAttrList))) ) { if ( name != NULL ) { if ( NULL == (attr->name = strdup(name)) ) { free(attr); return(NULL); } } attr->type = type; if ( type == head ) /* listhead */ return(attr); if ( val != NULL ) { switch ( type ) { case string: if ( NULL != (attr->val.stringVal = strdup((unsigned char *)val)) ) return(attr); break; case integer: attr->val.intVal = *(unsigned int *)val; break; case boolean: attr->val.boolVal = *(int *)val; break; case opaque: #if 0 if ( len > 0 ) { int encLen; opq_EncodeOpaque(val, len, (char **)&(attr->val.opaqueVal), &encLen); if ( NULL != attr->val.opaqueVal ) { /* first two bytes contain length of attribute */ SLP_SETSHORT(((char *)attr->val.opaqueVal), encLen, 0 ); } } #endif break; default: break; } } } return(attr); } SLPAttrList *SLPAllocAttrList(void) { SLPAttrList *temp; if ( NULL != (temp = SLPAllocAttr(NULL, head, NULL, 0)) ) { temp->next = temp->prev = temp; temp->isHead = TRUE; } return(temp); } /* attr MUST be unlinked from its list ! */ void SLPFreeAttr(SLPAttrList *attr) { if ( attr->name != NULL ) { free(attr->name); } if ( attr->type == string && attr->val.stringVal != NULL ) { free(attr->val.stringVal); } else if ( attr->type == opaque && attr->val.opaqueVal != NULL ) { free(attr->val.opaqueVal); } free(attr); } void SLPFreeAttrList(SLPAttrList *list, int staticFlag) { SLPAttrList *temp; while ( ! (SLP_IS_EMPTY(list)) ) { temp = list->next; SLP_UNLINK(temp); SLPFreeAttr(temp); } if ( staticFlag == TRUE ) { SLPFreeAttr(list); } return; } void SLPInitInternalAttrList(void) { attrHead.next = attrHead.prev = &attrHead; attrHead.isHead = TRUE; inProcessAttr.next = inProcessAttr.prev = &inProcessAttr; inProcessAttr.isHead = TRUE; inProcessTag.next = inProcessTag.prev = &inProcessTag; inProcessTag.isHead = TRUE; return; } SLPAttrList *_SLPDecodeAttrString(char *s) { unsigned int lexer = 0; SLPAttrList *temp = NULL; SLPInitInternalAttrList(); if ( s != NULL ) { if ( NULL != (temp = SLPAllocAttrList()) ) { if ((0 != (lexer = slp_attr_init_lexer(s))) && yyparse() ) { SLPFreeAttrList(temp,0); while ( !SLP_IS_HEAD(inProcessTag.next) ) { temp = inProcessTag.next; SLP_UNLINK(temp); SLPFreeAttr(temp); } while ( !SLP_IS_HEAD(inProcessAttr.next) ) { temp = inProcessAttr.next; SLP_UNLINK(temp); SLPFreeAttr(temp); } while ( !SLP_IS_HEAD(attrHead.next) ) { temp = attrHead.next; SLP_UNLINK(temp); SLPFreeAttr(temp); } slp_attr_close_lexer(lexer); return(NULL); } if ( !SLP_IS_EMPTY(&attrHead) ) { SLP_LINK_HEAD(temp, &attrHead); } if ( lexer != 0 ) { slp_attr_close_lexer(lexer); } } } return(temp); } openslp-1.2.1/common/slp_utf8.h0000644033442200000310000001551410202047412016263 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slp_utf8.h */ /* */ /* Abstract: Do conversions between UTF-8 and other character encodings */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLP_UTF8_INCLUDED #define SLP_UTF8_INCLUDED #ifndef INT_MAX #include #endif /*=========================================================================*/ int SLPv1ToEncoding(char *string, int *len, int encoding, const char *utfstring, int utflen); /* Converts a UTF-8 character string to a SLPv1 encoded string. */ /* When called with string set to null returns number of bytes needed */ /* in string. */ /* */ /* string - (OUT) SLPv1 encoded string. */ /* */ /* len - (INOUT) IN - bytes available in string */ /* OUT - bytes used up in string */ /* */ /* encoding - (IN) encoding of the string passed in */ /* */ /* utfstring - (IN) pointer to UTF-8 string */ /* */ /* utflen - (IN) length of UTF-8 string */ /* */ /* Returns - Zero on success, SLP_ERROR_PARSE_ERROR, or */ /* SLP_ERROR_INTERNAL_ERROR if out of memory. string and len */ /* invalid if return is not successful. */ /* */ /*=========================================================================*/ /*=========================================================================*/ int SLPv1AsUTF8(int encoding, char *string, int *len); /* Converts a SLPv1 encoded string to a UTF-8 character string in */ /* place. If string does not have enough space to hold the encoded string */ /* we are dead. */ /* */ /* encoding - (IN) unicode encoding of the string passed in */ /* */ /* string - (INOUT) IN - pointer to SLPv1 encoded string */ /* OUT - pointer to converted UTF-8 string. */ /* */ /* len - (INOUT) IN - length of SLPv1 encoded string (in bytes) */ /* OUT - length of UTF-8 string (in bytes) */ /* */ /* Returns - Zero on success, SLP_ERROR_PARSE_ERROR, or */ /* SLP_ERROR_INTERNAL_ERROR if out of memory. string and len */ /* invalid if return is not successful. */ /* */ /*=========================================================================*/ #endif openslp-1.2.1/common/Makefile.am0000644033442200000310000000247010202047441016401 0ustar rganesanfloppynoinst_LTLIBRARIES = libcommonslpd.la libcommonlibslp.la EXTRA_DIST = if ENABLE_SLPv1 slp_v1message_SRCS = slp_v1message.c slp_utf8.c endif if ENABLE_SLPv2_SECURITY slp_security_SRCS = slp_auth.c slp_crypto.c slp_spi.c endif libcommonlibslp_la_SOURCES = \ slp_compare.c \ slp_buffer.c \ slp_message.c \ slp_property.c \ slp_linkedlist.c \ slp_xid.c \ slp_network.c \ slp_database.c \ slp_xmalloc.c \ slp_xcast.c \ slp_iface.c \ slp_parse.c \ slp_pid.c \ slp_dhcp.c \ $(slp_v1message_SRCS) \ $(slp_security_SRCS) libcommonslpd_la_SOURCES = \ slp_compare.c \ slp_buffer.c \ slp_message.c \ slp_property.c \ slp_linkedlist.c \ slp_xid.c \ slp_database.c \ slp_xmalloc.c \ slp_parse.c \ slp_iface.c \ slp_net.c \ slp_pid.c \ slp_attr_y.y \ slp_attr_l.l \ slp_filter_y.y \ slp_filter_l.l \ slp_predicate.c \ slp_dhcp.c \ $(slp_v1message_SRCS) \ $(slp_security_SRCS) noinst_HEADERS = \ slp_buffer.h \ slp_network.h \ slp_xid.h \ slp_compare.h \ slp_linkedlist.h \ slp_database.h \ slp_message.h \ slp_v1message.h \ slp_property.h \ slp_crypto.h \ slp_auth.h \ slp_spi.h \ slp_xmalloc.h \ slp_utf8.h \ slp_xcast.h \ slp_iface.h \ slp_parse.h \ slp_net.h \ slp_pid.h \ slp_attr.h \ slp_attr_y.h \ slp_filter.h \ slp_filter_y.h \ slp_predicate.h \ slp_dhcp.h AM_YFLAGS = -d openslp-1.2.1/common/slp_message.c0000644033442200000310000011560610211370457017027 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_message.h */ /* */ /* Abstract: Header file that defines structures and constants that are */ /* specific to the SLP wire protocol messages. */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slp_message.h" #include "slp_xmalloc.h" #ifndef _WIN32 #include #include #endif #if defined(ENABLE_SLPv1) #include #endif /*=========================================================================*/ int SLPMessageParseHeader(SLPBuffer buffer, SLPHeader* header) /* Fill out a header structure with what ever is in the buffer */ /* */ /* buffer (IN) the buffer to be parsed */ /* */ /* header (IN/OUT) pointer to the header structure to fill out */ /*=========================================================================*/ { if (buffer->end - buffer->start < 2) { return SLP_ERROR_PARSE_ERROR; } header->version = *(buffer->curpos); header->functionid = *(buffer->curpos + 1); if(header->version != 2) { return SLP_ERROR_VER_NOT_SUPPORTED; } /* check for invalid length 18 bytes is the smallest v2 message*/ if (buffer->end - buffer->start < 18) { return SLP_ERROR_PARSE_ERROR; } header->length = AsUINT24(buffer->curpos + 2); header->flags = AsUINT16(buffer->curpos + 5); header->encoding = 0; /* not used for SLPv2 */ header->extoffset = AsUINT24(buffer->curpos + 7); header->xid = AsUINT16(buffer->curpos + 10); header->langtaglen = AsUINT16(buffer->curpos + 12); header->langtag = buffer->curpos + 14; /* check for invalid function id */ if(header->functionid > SLP_FUNCT_SAADVERT) { return SLP_ERROR_PARSE_ERROR; } if(header->length != buffer->end - buffer->start) { return SLP_ERROR_PARSE_ERROR; } /* check for invalid flags */ if(header->flags & 0x1fff) { return SLP_ERROR_PARSE_ERROR; } buffer->curpos = buffer->curpos + header->langtaglen + 14; /* check for invalid langtaglen */ if((void*)(header->langtag + header->langtaglen) > (void*)buffer->end) { return SLP_ERROR_PARSE_ERROR; } /* check for invalid ext offset */ if(buffer->start + header->extoffset > buffer->end) { return SLP_ERROR_PARSE_ERROR; } return 0; } /*--------------------------------------------------------------------------*/ int ParseAuthBlock(SLPBuffer buffer, SLPAuthBlock* authblock) /* Returns - Zero on success, SLP_ERROR_INTERNAL_ERROR (out of memory) or */ /* SLP_ERROR_PARSE_ERROR. */ /*--------------------------------------------------------------------------*/ { /* make sure that min size is met */ if(buffer->end - buffer->curpos < 10) { return SLP_ERROR_PARSE_ERROR; } authblock->opaque = buffer->curpos; authblock->bsd = AsUINT16(buffer->curpos); authblock->length = AsUINT16(buffer->curpos + 2); if(authblock->length > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } authblock->timestamp = AsUINT32(buffer->curpos + 4); authblock->spistrlen = AsUINT16(buffer->curpos + 8); authblock->spistr = buffer->curpos + 10; if(authblock->spistrlen > buffer->end - buffer->curpos + 10) { return SLP_ERROR_PARSE_ERROR; } authblock->authstruct = buffer->curpos + authblock->spistrlen + 10; authblock->opaquelen = authblock->length; buffer->curpos = buffer->curpos + authblock->length; return 0; } /*--------------------------------------------------------------------------*/ int ParseUrlEntry(SLPBuffer buffer, SLPUrlEntry* urlentry) /* */ /* Returns - Zero on success, SLP_ERROR_INTERNAL_ERROR (out of memory) or */ /* SLP_ERROR_PARSE_ERROR. */ /*--------------------------------------------------------------------------*/ { int result; int i; /* make sure that min size is met */ if(buffer->end - buffer->curpos < 6) { return SLP_ERROR_PARSE_ERROR; } urlentry->opaque = buffer->curpos; /* parse out reserved */ urlentry->reserved = *(buffer->curpos); buffer->curpos = buffer->curpos + 1; /* parse out lifetime */ urlentry->lifetime = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; /* parse out url */ urlentry->urllen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(urlentry->urllen + 1 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } urlentry->url = buffer->curpos; buffer->curpos = buffer->curpos + urlentry->urllen; /* parse out auth block count */ urlentry->authcount = *(buffer->curpos); buffer->curpos = buffer->curpos + 1; /* parse out the auth block (if any) */ if(urlentry->authcount) { urlentry->autharray = (SLPAuthBlock*)xmalloc(sizeof(SLPAuthBlock) * urlentry->authcount); if(urlentry->autharray == 0) { return SLP_ERROR_INTERNAL_ERROR; } memset(urlentry->autharray,0,sizeof(SLPAuthBlock) * urlentry->authcount); for(i=0;iauthcount;i++) { result = ParseAuthBlock(buffer,&(urlentry->autharray[i])); if(result) return result; } } urlentry->opaquelen = (char*)buffer->curpos - urlentry->opaque; return 0; } /*--------------------------------------------------------------------------*/ int ParseSrvRqst(SLPBuffer buffer, SLPSrvRqst* srvrqst) /*--------------------------------------------------------------------------*/ { /* make sure that min size is met */ if(buffer->end - buffer->curpos < 10) { return SLP_ERROR_PARSE_ERROR; } /* parse the prlist */ srvrqst->prlistlen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(srvrqst->prlistlen + 2 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } srvrqst->prlist = buffer->curpos; buffer->curpos = buffer->curpos + srvrqst->prlistlen; /* parse the service type */ srvrqst->srvtypelen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(srvrqst->srvtypelen + 2 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } srvrqst->srvtype = buffer->curpos; buffer->curpos = buffer->curpos + srvrqst->srvtypelen; /* parse the scope list */ srvrqst->scopelistlen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(srvrqst->scopelistlen + 2 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } srvrqst->scopelist = buffer->curpos; buffer->curpos = buffer->curpos + srvrqst->scopelistlen; /* parse the predicate string */ srvrqst->predicatever = 2; /* SLPv2 predicate (LDAPv3) */ srvrqst->predicatelen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(srvrqst->predicatelen + 2 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } srvrqst->predicate = buffer->curpos; buffer->curpos = buffer->curpos + srvrqst->predicatelen; /* parse the slpspi string */ srvrqst->spistrlen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(srvrqst->spistrlen > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } srvrqst->spistr = buffer->curpos; buffer->curpos = buffer->curpos + srvrqst->spistrlen; return 0; } /*--------------------------------------------------------------------------*/ int ParseSrvRply(SLPBuffer buffer, SLPSrvRply* srvrply) /*--------------------------------------------------------------------------*/ { int result; int i; /* make sure that min size is met */ if(buffer->end - buffer->curpos < 4) { return SLP_ERROR_PARSE_ERROR; } /* parse out the error code */ srvrply->errorcode = AsUINT16(buffer->curpos); if(srvrply->errorcode) { /* We better not trust the rest of the packet */ memset( srvrply, 0, sizeof(SLPSrvRply)); srvrply->errorcode = AsUINT16(buffer->curpos); return 0; } buffer->curpos = buffer->curpos + 2; /* parse out the url entry count */ srvrply->urlcount = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; /* parse out the url entries (if any) */ if(srvrply->urlcount) { srvrply->urlarray = (SLPUrlEntry*)xmalloc(sizeof(SLPUrlEntry) * srvrply->urlcount); if(srvrply->urlarray == 0) { return SLP_ERROR_INTERNAL_ERROR; } memset(srvrply->urlarray,0,sizeof(SLPUrlEntry) * srvrply->urlcount); for(i=0;iurlcount;i++) { result = ParseUrlEntry(buffer,&(srvrply->urlarray[i])); if(result) return result; } } else { srvrply->urlarray = 0; } return 0; } /*--------------------------------------------------------------------------*/ int ParseSrvReg(SLPBuffer buffer, SLPSrvReg* srvreg) /*--------------------------------------------------------------------------*/ { int result; int i; /* Parse out the url entry */ result = ParseUrlEntry(buffer,&(srvreg->urlentry)); if(result) { return result; } if(buffer->end - buffer->curpos < 2) { return SLP_ERROR_PARSE_ERROR; } /* parse the service type */ srvreg->srvtypelen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(srvreg->srvtypelen + 2 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } srvreg->srvtype = buffer->curpos; buffer->curpos = buffer->curpos + srvreg->srvtypelen; /* parse the scope list */ srvreg->scopelistlen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(srvreg->scopelistlen + 2 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } srvreg->scopelist = buffer->curpos; buffer->curpos = buffer->curpos + srvreg->scopelistlen; /* parse the attribute list*/ srvreg->attrlistlen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(srvreg->attrlistlen + 1 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } srvreg->attrlist = buffer->curpos; buffer->curpos = buffer->curpos + srvreg->attrlistlen; /* parse out attribute auth block count */ srvreg->authcount = *(buffer->curpos); buffer->curpos = buffer->curpos + 1; /* parse out the auth block (if any) */ if(srvreg->authcount) { srvreg->autharray = (SLPAuthBlock*)xmalloc(sizeof(SLPAuthBlock) * srvreg->authcount); if(srvreg->autharray == 0) { return SLP_ERROR_INTERNAL_ERROR; } memset(srvreg->autharray,0,sizeof(SLPAuthBlock) * srvreg->authcount); for(i=0;iauthcount;i++) { result = ParseAuthBlock(buffer,&(srvreg->autharray[i])); if(result) return result; } } return 0; } /*--------------------------------------------------------------------------*/ int ParseSrvDeReg(SLPBuffer buffer, SLPSrvDeReg* srvdereg) /*--------------------------------------------------------------------------*/ { int result; /* make sure that min size is met */ if(buffer->end - buffer->curpos < 4) { return SLP_ERROR_PARSE_ERROR; } /* parse the scope list */ srvdereg->scopelistlen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(srvdereg->scopelistlen > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } srvdereg->scopelist = buffer->curpos; buffer->curpos = buffer->curpos + srvdereg->scopelistlen; /* parse the url entry */ result = ParseUrlEntry(buffer,&(srvdereg->urlentry)); if(result) { return result; } /* parse the tag list */ if(buffer->end - buffer->curpos < 2) { return SLP_ERROR_PARSE_ERROR; } srvdereg->taglistlen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(srvdereg->taglistlen > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } srvdereg->taglist = buffer->curpos; buffer->curpos = buffer->curpos + srvdereg->taglistlen; return 0; } /*--------------------------------------------------------------------------*/ int ParseSrvAck(SLPBuffer buffer, SLPSrvAck* srvack) /*--------------------------------------------------------------------------*/ { srvack->errorcode = AsUINT16(buffer->curpos); return 0; } /*--------------------------------------------------------------------------*/ int ParseAttrRqst(SLPBuffer buffer, SLPAttrRqst* attrrqst) /*--------------------------------------------------------------------------*/ { /* make sure that min size is met */ if(buffer->end - buffer->curpos < 10) { return SLP_ERROR_PARSE_ERROR; } /* parse the prlist */ attrrqst->prlistlen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(attrrqst->prlistlen + 2 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } attrrqst->prlist = buffer->curpos; buffer->curpos = buffer->curpos + attrrqst->prlistlen; /* parse the url */ attrrqst->urllen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(attrrqst->urllen + 2 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } attrrqst->url = buffer->curpos; buffer->curpos = buffer->curpos + attrrqst->urllen; /* parse the scope list */ attrrqst->scopelistlen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(attrrqst->scopelistlen + 2 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } attrrqst->scopelist = buffer->curpos; buffer->curpos = buffer->curpos + attrrqst->scopelistlen; /* parse the taglist string */ attrrqst->taglistlen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(attrrqst->taglistlen + 2 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } attrrqst->taglist = buffer->curpos; buffer->curpos = buffer->curpos + attrrqst->taglistlen; /* parse the slpspi string */ attrrqst->spistrlen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(attrrqst->spistrlen > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } attrrqst->spistr = buffer->curpos; buffer->curpos = buffer->curpos + attrrqst->spistrlen; return 0; } /*--------------------------------------------------------------------------*/ int ParseAttrRply(SLPBuffer buffer, SLPAttrRply* attrrply) /*--------------------------------------------------------------------------*/ { int result; int i; /* make sure that min size is met */ if(buffer->end - buffer->curpos < 4) { return SLP_ERROR_PARSE_ERROR; } /* parse out the error code */ attrrply->errorcode = AsUINT16(buffer->curpos); if(attrrply->errorcode) { /* We better not trust the rest of the packet */ memset(attrrply,0,sizeof(SLPAttrRply)); attrrply->errorcode = AsUINT16(buffer->curpos); return 0; } buffer->curpos = buffer->curpos + 2; /* parse out the attrlist */ attrrply->attrlistlen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(attrrply->attrlistlen + 1 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } attrrply->attrlist = buffer->curpos; buffer->curpos = buffer->curpos + attrrply->attrlistlen; /* parse out auth block count */ attrrply->authcount = *(buffer->curpos); buffer->curpos = buffer->curpos + 1; /* parse out the auth block (if any) */ if(attrrply->authcount) { attrrply->autharray = (SLPAuthBlock*)xmalloc(sizeof(SLPAuthBlock) * attrrply->authcount); if(attrrply->autharray == 0) { return SLP_ERROR_INTERNAL_ERROR; } memset(attrrply->autharray,0,sizeof(SLPAuthBlock) * attrrply->authcount); for(i=0;iauthcount;i++) { result = ParseAuthBlock(buffer,&(attrrply->autharray[i])); if(result) return result; } } return 0; } /*-------------------------------------------------------------------------*/ int ParseDAAdvert(SLPBuffer buffer, SLPDAAdvert* daadvert) /*-------------------------------------------------------------------------*/ { int result; int i; /* make sure that min size is met */ if(buffer->end - buffer->curpos < 4) { return SLP_ERROR_PARSE_ERROR; } /* parse out the error code */ daadvert->errorcode = AsUINT16(buffer->curpos); if(daadvert->errorcode) { /* We better not trust the rest of the packet */ memset(daadvert,0,sizeof(SLPDAAdvert)); daadvert->errorcode = AsUINT16(buffer->curpos); return 0; } buffer->curpos = buffer->curpos + 2; /* parse out the bootstamp */ if(buffer->end - buffer->curpos < 6) { return SLP_ERROR_PARSE_ERROR; } daadvert->bootstamp = AsUINT32(buffer->curpos); buffer->curpos = buffer->curpos + 4; /* parse out the url */ daadvert->urllen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(daadvert->urllen + 2 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } daadvert->url = buffer->curpos; buffer->curpos = buffer->curpos + daadvert->urllen; /* parse the scope list */ daadvert->scopelistlen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(daadvert->scopelistlen + 2 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } daadvert->scopelist = buffer->curpos; buffer->curpos = buffer->curpos + daadvert->scopelistlen; /* parse the attr list */ daadvert->attrlistlen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(daadvert->attrlistlen + 2 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } daadvert->attrlist = buffer->curpos; buffer->curpos = buffer->curpos + daadvert->attrlistlen; /* parse the SPI list */ daadvert->spilistlen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(daadvert->spilistlen + 1 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } daadvert->spilist = buffer->curpos; buffer->curpos = buffer->curpos + daadvert->spilistlen; /* parse out auth block count */ daadvert->authcount = *(buffer->curpos); buffer->curpos = buffer->curpos + 1; /* parse out the auth block (if any) */ if(daadvert->authcount) { daadvert->autharray = (SLPAuthBlock*)xmalloc(sizeof(SLPAuthBlock) * daadvert->authcount); if(daadvert->autharray == 0) { return SLP_ERROR_INTERNAL_ERROR; } memset(daadvert->autharray,0,sizeof(SLPAuthBlock) * daadvert->authcount); for(i=0;iauthcount;i++) { result = ParseAuthBlock(buffer,&(daadvert->autharray[i])); if(result) return result; } } return 0; } /*-------------------------------------------------------------------------*/ int ParseSAAdvert(SLPBuffer buffer, SLPSAAdvert* saadvert) /*-------------------------------------------------------------------------*/ { int result; int i; /* make sure that min size is met */ if(buffer->end - buffer->curpos < 4) { return SLP_ERROR_PARSE_ERROR; } /* parse out the url */ saadvert->urllen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(saadvert->urllen + 2 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } saadvert->url = buffer->curpos; buffer->curpos = buffer->curpos + saadvert->urllen; /* parse the scope list */ saadvert->scopelistlen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(saadvert->scopelistlen + 2 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } saadvert->scopelist = buffer->curpos; buffer->curpos = buffer->curpos + saadvert->scopelistlen; /* parse the attr list */ saadvert->attrlistlen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(saadvert->attrlistlen + 1 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } saadvert->attrlist = buffer->curpos; buffer->curpos = buffer->curpos + saadvert->attrlistlen; /* parse out auth block count */ saadvert->authcount = *(buffer->curpos); buffer->curpos = buffer->curpos + 1; /* parse out the auth block (if any) */ if(saadvert->authcount) { saadvert->autharray = (SLPAuthBlock*)xmalloc(sizeof(SLPAuthBlock) * saadvert->authcount); if(saadvert->autharray == 0) { return SLP_ERROR_INTERNAL_ERROR; } memset(saadvert->autharray,0,sizeof(SLPAuthBlock) * saadvert->authcount); for(i=0;iauthcount;i++) { result = ParseAuthBlock(buffer,&(saadvert->autharray[i])); if(result) return result; } } return 0; } /*--------------------------------------------------------------------------*/ int ParseSrvTypeRqst(SLPBuffer buffer, SLPSrvTypeRqst* srvtyperqst) /*--------------------------------------------------------------------------*/ { /* make sure that min size is met */ if(buffer->end - buffer->curpos < 6) { return SLP_ERROR_PARSE_ERROR; } /* parse the prlist */ srvtyperqst->prlistlen = AsUINT16(buffer->curpos); buffer->curpos += 2; if(srvtyperqst->prlistlen + 2 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } srvtyperqst->prlist = srvtyperqst->prlistlen ? buffer->curpos : 0; buffer->curpos += srvtyperqst->prlistlen; /* parse the naming authority if present */ srvtyperqst->namingauthlen = AsUINT16(buffer->curpos); buffer->curpos += 2; if(!srvtyperqst->namingauthlen || srvtyperqst->namingauthlen == 0xffff) { srvtyperqst->namingauth = 0; } else { if(srvtyperqst->namingauthlen > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } srvtyperqst->namingauth = buffer->curpos; buffer->curpos += srvtyperqst->namingauthlen; } /* parse the scope list */ if(buffer->end - buffer->curpos < 2) { return SLP_ERROR_PARSE_ERROR; } srvtyperqst->scopelistlen = AsUINT16(buffer->curpos); buffer->curpos += 2; if(srvtyperqst->scopelistlen > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } srvtyperqst->scopelist = buffer->curpos; buffer->curpos += srvtyperqst->scopelistlen; return 0; } /*--------------------------------------------------------------------------*/ int ParseSrvTypeRply(SLPBuffer buffer, SLPSrvTypeRply* srvtyperply) /*--------------------------------------------------------------------------*/ { /* make sure that min size is met */ if(buffer->end - buffer->curpos < 4) { return SLP_ERROR_PARSE_ERROR; } /* parse out the error code */ srvtyperply->errorcode = AsUINT16(buffer->curpos); if(srvtyperply->errorcode) { /* We better not trust the rest of the packet */ memset(srvtyperply,0,sizeof(SLPSrvTypeRply)); srvtyperply->errorcode = AsUINT16(buffer->curpos); return 0; } buffer->curpos += 2; /* parse out the error srvtype-list length */ srvtyperply->srvtypelistlen = AsUINT16(buffer->curpos); buffer->curpos += 2; if(srvtyperply->srvtypelistlen > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } srvtyperply->srvtypelist = buffer->curpos; return 0; } /*--------------------------------------------------------------------------*/ int ParseExtension(SLPBuffer buffer, SLPMessage message) /* Parse extensions *after* all standard protocol fields are parsed */ /*--------------------------------------------------------------------------*/ { int extid; int nextoffset; int result = SLP_ERROR_OK; nextoffset = message->header.extoffset; while(nextoffset) { buffer->curpos = buffer->start + nextoffset; if(buffer->curpos + 5 >= buffer->end) { /* Extension takes us past the end of the buffer */ result = SLP_ERROR_PARSE_ERROR; goto CLEANUP; } extid = AsUINT16(buffer->curpos); buffer->curpos += 2; nextoffset = AsUINT24(buffer->curpos); buffer->curpos += 3; switch(extid) { case SLP_EXTENSION_ID_REG_PID: if(message->header.functionid == SLP_FUNCT_SRVREG) { /* check to see if buffer is large enough to contain the 4 byte pid */ if(buffer->curpos + 4 > buffer->end) { result = SLP_ERROR_PARSE_ERROR; goto CLEANUP; } message->body.srvreg.pid = AsUINT32(buffer->curpos); buffer->curpos += 4; } break; default: if (extid >= 0x4000 && extid <= 0x7FFF ) { /* This is a required extension. We better error out */ result = SLP_ERROR_MESSAGE_NOT_SUPPORTED; goto CLEANUP; } break; } } CLEANUP: return result; } /*=========================================================================*/ void SLPMessageFreeInternals(SLPMessage message) /*=========================================================================*/ { int i; switch(message->header.functionid) { case SLP_FUNCT_SRVRPLY: if(message->body.srvrply.urlarray) { for(i=0;ibody.srvrply.urlcount;i++) { if(message->body.srvrply.urlarray[i].autharray) { xfree(message->body.srvrply.urlarray[i].autharray); message->body.srvrply.urlarray[i].autharray = 0; } } xfree(message->body.srvrply.urlarray); message->body.srvrply.urlarray = 0; } break; case SLP_FUNCT_SRVREG: if(message->body.srvreg.urlentry.autharray) { xfree(message->body.srvreg.urlentry.autharray); message->body.srvreg.urlentry.autharray = 0; } if(message->body.srvreg.autharray) { xfree(message->body.srvreg.autharray); message->body.srvreg.autharray = 0; } break; case SLP_FUNCT_SRVDEREG: if(message->body.srvdereg.urlentry.autharray) { xfree(message->body.srvdereg.urlentry.autharray); message->body.srvdereg.urlentry.autharray = 0; } break; case SLP_FUNCT_ATTRRPLY: if(message->body.attrrply.autharray) { xfree(message->body.attrrply.autharray); message->body.attrrply.autharray = 0; } break; case SLP_FUNCT_DAADVERT: if(message->body.daadvert.autharray) { xfree(message->body.daadvert.autharray); message->body.daadvert.autharray = 0; } break; case SLP_FUNCT_SAADVERT: if(message->body.saadvert.autharray) { xfree(message->body.saadvert.autharray); message->body.saadvert.autharray = 0; } break; case SLP_FUNCT_ATTRRQST: case SLP_FUNCT_SRVACK: case SLP_FUNCT_SRVRQST: case SLP_FUNCT_SRVTYPERQST: case SLP_FUNCT_SRVTYPERPLY: default: /* don't do anything */ break; } } /*=========================================================================*/ SLPMessage SLPMessageAlloc() /* Allocates memory for a SLP message descriptor */ /* */ /* Returns - A newly allocated SLPMessage pointer of NULL on ENOMEM */ /*=========================================================================*/ { SLPMessage result = (SLPMessage)xmalloc(sizeof(struct _SLPMessage)); if(result) { memset(result,0,sizeof(struct _SLPMessage)); } return result; } /*=========================================================================*/ SLPMessage SLPMessageRealloc(SLPMessage msg) /* Reallocates memory for a SLP message descriptor */ /* */ /* Returns - A newly allocated SLPMessage pointer of NULL on ENOMEM */ /*=========================================================================*/ { if(msg == 0) { msg = SLPMessageAlloc(); if(msg == 0) { return 0; } } else { SLPMessageFreeInternals(msg); } return msg; } /*=========================================================================*/ void SLPMessageFree(SLPMessage message) /* Frees memory that might have been allocated by the SLPMessage for */ /* UrlEntryLists or AuthBlockLists. */ /* */ /* message - (IN) the SLPMessage to free */ /*=========================================================================*/ { if(message) { SLPMessageFreeInternals(message); xfree(message); } } /*=========================================================================*/ int SLPMessageParseBuffer(struct sockaddr_in* peerinfo, SLPBuffer buffer, SLPMessage message) /* Initializes a message descriptor by parsing the specified buffer. */ /* */ /* buffer - (IN) pointer the SLPBuffer to parse */ /* */ /* message - (OUT) set to describe the message from the buffer */ /* */ /* Returns - Zero on success, SLP_ERROR_PARSE_ERROR, or */ /* SLP_ERROR_INTERNAL_ERROR if out of memory. SLPMessage is */ /* invalid return is not successful. */ /* */ /* WARNING - If successful, pointers in the SLPMessage reference memory in*/ /* the parsed SLPBuffer. If SLPBufferFree() is called then the */ /* pointers in SLPMessage will be invalidated. */ /*=========================================================================*/ { int result; /* Copy in the peer info */ memcpy(&message->peer,peerinfo,sizeof(message->peer)); /* Get ready to parse */ SLPMessageFreeInternals(message); buffer->curpos = buffer->start; /* parse the header first */ result = SLPMessageParseHeader(buffer,&(message->header)); if(result == 0) { /* switch on the function id to parse the body */ switch(message->header.functionid) { case SLP_FUNCT_SRVRQST: result = ParseSrvRqst(buffer,&(message->body.srvrqst)); break; case SLP_FUNCT_SRVRPLY: result = ParseSrvRply(buffer,&(message->body.srvrply)); break; case SLP_FUNCT_SRVREG: result = ParseSrvReg(buffer,&(message->body.srvreg)); break; case SLP_FUNCT_SRVDEREG: result = ParseSrvDeReg(buffer,&(message->body.srvdereg)); break; case SLP_FUNCT_SRVACK: result = ParseSrvAck(buffer,&(message->body.srvack)); break; case SLP_FUNCT_ATTRRQST: result = ParseAttrRqst(buffer,&(message->body.attrrqst)); break; case SLP_FUNCT_ATTRRPLY: result = ParseAttrRply(buffer,&(message->body.attrrply)); break; case SLP_FUNCT_DAADVERT: result = ParseDAAdvert(buffer,&(message->body.daadvert)); break; case SLP_FUNCT_SRVTYPERQST: result = ParseSrvTypeRqst(buffer,&(message->body.srvtyperqst)); break; case SLP_FUNCT_SRVTYPERPLY: result = ParseSrvTypeRply(buffer,&(message->body.srvtyperply)); break; case SLP_FUNCT_SAADVERT: result = ParseSAAdvert(buffer,&(message->body.saadvert)); break; default: result = SLP_ERROR_MESSAGE_NOT_SUPPORTED; } } if(result == 0 && message->header.extoffset) { result = ParseExtension(buffer,message); } return result; } /*=========================================================================*/ /* Functions used to parse buffers */ /*-------------------------------------------------------------------------*/ unsigned short AsUINT16(const char *charptr) /*-------------------------------------------------------------------------*/ { unsigned char *ucp = (unsigned char *) charptr; return(ucp[0] << 8) | ucp[1]; } /*-------------------------------------------------------------------------*/ unsigned int AsUINT24(const char *charptr) /*-------------------------------------------------------------------------*/ { unsigned char *ucp = (unsigned char *) charptr; return(ucp[0] << 16) | (ucp[1] << 8) | ucp[2]; } /*-------------------------------------------------------------------------*/ unsigned int AsUINT32(const char *charptr) /*-------------------------------------------------------------------------*/ { unsigned char *ucp = (unsigned char *) charptr; return(ucp[0] << 24) | (ucp[1] << 16) | (ucp[2] << 8) | ucp[3]; } /*=========================================================================*/ /* Functions used to set buffers */ /*-------------------------------------------------------------------------*/ void ToUINT16(char *charptr, unsigned int val) /*-------------------------------------------------------------------------*/ { charptr[0] = (val >> 8) & 0xff; charptr[1] = val & 0xff; } /*-------------------------------------------------------------------------*/ void ToUINT24(char *charptr, unsigned int val) /*-------------------------------------------------------------------------*/ { charptr[0] = (val >> 16) & 0xff; charptr[1] = (val >> 8) & 0xff; charptr[2] = val & 0xff; } /*-------------------------------------------------------------------------*/ void ToUINT32(char *charptr, unsigned int val) /*-------------------------------------------------------------------------*/ { charptr[0] = (val >> 24) & 0xff; charptr[1] = (val >> 16) & 0xff; charptr[2] = (val >> 8) & 0xff; charptr[3] = val & 0xff; } openslp-1.2.1/common/slp_xid.h0000644033442200000310000001145010202047412016154 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_xid.h */ /* */ /* Abstract: Header file that defines structures and constants and */ /* functions that are used to generate SLP transaction ids */ /* */ /* Author(s): Matthew Peterson */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #if(!defined SLP_XID_H_INCLUDED) #define SLP_XID_H_INCLUDED /*=========================================================================*/ extern int G_Xid; /* Global variable that is incremented before SLPGenerateXid() returns */ /*=========================================================================*/ /*=========================================================================*/ void SLPXidSeed(); /* Seeds the XID generator. Should only be called 1 time per process! */ /* currently called when the first handle is opened. */ /*=========================================================================*/ /*=========================================================================*/ unsigned short SLPXidGenerate(); /* */ /* Returns: A hopefully unique 16-bit value */ /*=========================================================================*/ #endif openslp-1.2.1/common/slp_attr_l.c0000644033442200000310000013367010211377550016672 0ustar rganesanfloppy/* A lexical scanner generated by flex */ /* Scanner skeleton version: * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #include /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ #ifdef c_plusplus #ifndef __cplusplus #define __cplusplus #endif #endif #ifdef __cplusplus #include #include /* Use prototypes in function declarations. */ #define YY_USE_PROTOS /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ #if __STDC__ #define YY_USE_PROTOS #define YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef __TURBOC__ #pragma warn -rch #pragma warn -use #include #include #define YY_USE_CONST #define YY_USE_PROTOS #endif #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif #ifdef YY_USE_PROTOS #define YY_PROTO(proto) proto #else #define YY_PROTO(proto) () #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN yy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((yy_start - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #define YY_BUF_SIZE 16384 typedef struct yy_buffer_state *YY_BUFFER_STATE; extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* The funky do-while in the following #define is used to turn the definition * int a single C statement (which needs a semi-colon terminator). This * avoids problems with code like: * * if ( condition_holds ) * yyless( 5 ); * else * do_something_else(); * * Prior to using the do-while the compiler would get upset at the * "else" because it interpreted the "if" statement as being all * done when it reached the ';' after the yyless() call. */ /* Return all but the first 'n' matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ *yy_cp = yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, yytext_ptr ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ typedef unsigned int yy_size_t; struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; static YY_BUFFER_STATE yy_current_buffer = 0; /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". */ #define YY_CURRENT_BUFFER yy_current_buffer /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 1; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart YY_PROTO(( FILE *input_file )); void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); void yy_load_buffer_state YY_PROTO(( void )); YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); static void *yy_flex_alloc YY_PROTO(( yy_size_t )); static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); static void yy_flex_free YY_PROTO(( void * )); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) #define yywrap() 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern char *yytext; #define yytext_ptr yytext static yy_state_type yy_get_previous_state YY_PROTO(( void )); static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); static int yy_get_next_buffer YY_PROTO(( void )); static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yytext_ptr = yy_bp; \ yyleng = (int) (yy_cp - yy_bp); \ yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; #define YY_NUM_RULES 23 #define YY_END_OF_BUFFER 24 static yyconst short int yy_accept[60] = { 0, 1, 1, 6, 6, 11, 11, 24, 5, 1, 23, 1, 4, 3, 2, 10, 6, 6, 8, 9, 7, 22, 11, 11, 19, 21, 19, 12, 15, 15, 19, 19, 22, 1, 1, 4, 6, 6, 8, 11, 11, 19, 13, 13, 15, 19, 19, 19, 0, 19, 16, 19, 19, 20, 14, 19, 17, 0, 18, 0 } ; static yyconst int yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 5, 5, 5, 5, 5, 5, 6, 7, 8, 9, 10, 9, 5, 5, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 5, 5, 1, 13, 1, 5, 5, 14, 15, 15, 15, 16, 17, 5, 5, 5, 5, 5, 18, 5, 5, 5, 5, 5, 19, 20, 21, 22, 5, 5, 23, 5, 5, 5, 24, 5, 5, 8, 5, 14, 15, 15, 15, 16, 17, 5, 5, 5, 5, 5, 18, 5, 5, 5, 5, 5, 19, 20, 21, 22, 5, 5, 23, 5, 5, 5, 5, 5, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 } ; static yyconst int yy_meta[25] = { 0, 1, 2, 1, 2, 2, 1, 1, 3, 2, 1, 4, 4, 5, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 1 } ; static yyconst short int yy_base[67] = { 0, 0, 24, 48, 72, 96, 0, 122, 183, 7, 183, 10, 92, 183, 183, 183, 13, 14, 91, 183, 183, 183, 17, 18, 90, 183, 21, 183, 119, 67, 27, 34, 0, 36, 40, 86, 41, 55, 85, 58, 61, 62, 57, 72, 33, 132, 68, 44, 0, 145, 0, 69, 65, 23, 0, 75, 37, 0, 33, 183, 162, 167, 171, 174, 177, 4, 1 } ; static yyconst short int yy_def[67] = { 0, 60, 60, 61, 61, 59, 5, 59, 59, 59, 59, 62, 62, 59, 59, 59, 59, 63, 63, 59, 59, 59, 59, 64, 64, 59, 64, 59, 64, 28, 64, 64, 65, 59, 62, 62, 59, 63, 63, 59, 64, 64, 28, 28, 28, 28, 64, 64, 66, 45, 45, 64, 64, 59, 49, 64, 64, 65, 64, 0, 59, 59, 59, 59, 59, 59, 59 } ; static yyconst short int yy_nxt[208] = { 0, 8, 9, 10, 11, 53, 13, 8, 48, 33, 14, 33, 33, 8, 34, 36, 36, 36, 37, 39, 39, 39, 40, 59, 8, 8, 9, 10, 11, 59, 13, 8, 42, 43, 14, 59, 59, 8, 33, 59, 33, 46, 33, 36, 34, 36, 59, 57, 8, 15, 16, 10, 17, 47, 15, 19, 41, 36, 15, 37, 39, 20, 39, 39, 59, 40, 52, 59, 43, 43, 59, 59, 15, 15, 16, 10, 17, 59, 15, 19, 49, 56, 15, 43, 43, 20, 51, 59, 59, 55, 41, 58, 59, 59, 59, 41, 15, 21, 22, 10, 23, 24, 21, 25, 21, 26, 27, 28, 29, 24, 24, 24, 24, 30, 24, 24, 24, 31, 24, 24, 32, 59, 59, 59, 59, 59, 59, 59, 59, 59, 44, 44, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 45, 50, 50, 59, 50, 50, 50, 50, 59, 59, 59, 59, 59, 41, 54, 54, 59, 54, 54, 54, 54, 12, 12, 12, 12, 12, 18, 18, 18, 18, 18, 35, 35, 35, 38, 38, 38, 41, 59, 41, 41, 7, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59 } ; static yyconst short int yy_chk[208] = { 0, 1, 1, 1, 1, 66, 1, 1, 65, 9, 1, 9, 11, 1, 11, 16, 17, 16, 17, 22, 23, 22, 23, 26, 1, 2, 2, 2, 2, 30, 2, 2, 26, 26, 2, 58, 31, 2, 33, 56, 33, 30, 34, 36, 34, 36, 47, 53, 2, 3, 3, 3, 3, 31, 3, 3, 44, 37, 3, 37, 39, 3, 39, 40, 41, 40, 47, 52, 42, 42, 46, 51, 3, 4, 4, 4, 4, 55, 4, 4, 42, 52, 4, 43, 43, 4, 46, 38, 35, 51, 29, 55, 24, 18, 12, 43, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 28, 7, 0, 0, 0, 0, 0, 0, 0, 28, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 45, 45, 0, 45, 45, 45, 45, 0, 0, 0, 0, 0, 45, 49, 49, 0, 49, 49, 49, 49, 60, 60, 60, 60, 60, 61, 61, 61, 61, 61, 62, 62, 62, 63, 63, 63, 64, 0, 64, 64, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "slp_attr_l.l" #define INITIAL 0 /******************************************************************* * Description: encode/decode attribute lists * * Originated: 03-06-2000 * Original Author: Mike Day - md@soft-hackle.net * * Copyright (C) Michael Day, 2000-2001 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *******************************************************************/ #line 27 "slp_attr_l.l" #undef YYLMAX #define YYLMAX 2048 #define yymaxdepth slp_attr_maxdepth #define yyparse slp_attr_parse #define yylex slp_attr_lex #define yyerror slp_attr_error #define yylval slp_attr_lval #define yychar slp_attr_char #define yydebug slp_attr_debug #define yypact slp_attr_pact #define yyr1 slp_attr_r1 #define yyr2 slp_attr_r2 #define yydef slp_attr_def #define yychk slp_attr_chk #define yypgo slp_attr_pgo #define yyact slp_attr_act #define yyexca slp_attr_exca #define yyerrflag slp_attr_errflag #define yynerrs slp_attr_nerrs #define yyps slp_attr_ps #define yypv slp_attr_pv #define yys slp_attr_s #define yy_yys slp_attr_yys #define yystate slp_attr_state #define yytmp slp_attr_tmp #define yyv slp_attr_v #define yy_yyv slp_attr_yyv #define yyval slp_attr_val #define yylloc slp_attr_lloc #define yyreds slp_attr_reds #define yytoks slp_attr_toks #define yylhs slp_attr_yylhs #define yylen slp_attr_yylen #define yydefred slp_attr_yydefred #define yydgoto slp_attr_yydgoto #define yysindex slp_attr_yysindex #define yyrindex slp_attr_yyrindex #define yygindex slp_attr_yygindex #define yytable slp_attr_yytable #define yycheck slp_attr_yycheck #define yyname slp_attr_yyname #define yyrule slp_attr_yyrule #define YY_NO_UNPUT #include "slp_attr.h" #include "slp_attr_y.h" #include "slp_xmalloc.h" static char buf[2052]; void slp_attr_error(char *, ...); int slp_attr_wrap(void); int slp_attr_lex(void); void slp_attr_close_lexer(unsigned int handle); unsigned int slp_attr_init_lexer(char *s); /* {} */ /* this lexer cycles through three states. in the initial state, it is looking strictly for attribute tags. If, in the initial state it finds a '(' it anticipates an attribute-value pair and changes to ATTRIBUTE state . in the ATTRIBUTE state is is looking for either a closing ')' or a '='. If it sees a closing ')' it changes to the initial state. if it sees an '=' it changes to the VALUE state and looks for the attribute value. After seeing the attribute value, it looks for a either a ')' or a ','. If it sees a ')' it closes the attribute and returns to the initial state. if, during the VALUE state the lexer sees a ',' it decides it is looking at a multi-valued attribute and returns a special _MULTIVAL token to the parser. The parser uses this to construct additional attribute-value pairs for each value in the multi-val statement. */ #define ATTR 1 #define VALUE 2 #line 537 "slp_attr_l.c" /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap YY_PROTO(( void )); #else extern int yywrap YY_PROTO(( void )); #endif #endif #ifndef YY_NO_UNPUT static void yyunput YY_PROTO(( int c, char *buf_ptr )); #endif #ifndef yytext_ptr static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen YY_PROTO(( yyconst char * )); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput YY_PROTO(( void )); #else static int input YY_PROTO(( void )); #endif #endif #if YY_STACK_USED static int yy_start_stack_ptr = 0; static int yy_start_stack_depth = 0; static int *yy_start_stack = 0; #ifndef YY_NO_PUSH_STATE static void yy_push_state YY_PROTO(( int new_state )); #endif #ifndef YY_NO_POP_STATE static void yy_pop_state YY_PROTO(( void )); #endif #ifndef YY_NO_TOP_STATE static int yy_top_state YY_PROTO(( void )); #endif #else #define YY_NO_PUSH_STATE 1 #define YY_NO_POP_STATE 1 #define YY_NO_TOP_STATE 1 #endif #ifdef YY_MALLOC_DECL YY_MALLOC_DECL #else #if __STDC__ #ifndef __cplusplus #include #endif #else /* Just try to get by without declaring the routines. This will fail * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) * or sizeof(void*) != sizeof(int). */ #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( yy_current_buffer->yy_is_interactive ) \ { \ int c = '*', n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL int yylex YY_PROTO(( void )) #endif /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 123 "slp_attr_l.l" #line 691 "slp_attr_l.c" if ( yy_init ) { yy_init = 0; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! yy_start ) yy_start = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = yy_c_buf_p; /* Support of yytext. */ *yy_cp = yy_hold_char; /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = yy_start; yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 60 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 183 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = yy_hold_char; yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; goto yy_find_action; case 1: YY_RULE_SETUP #line 125 "slp_attr_l.l" { ; } YY_BREAK case 2: YY_RULE_SETUP #line 127 "slp_attr_l.l" { yylval._i = *yytext; return(yylval._i); } YY_BREAK case 3: YY_RULE_SETUP #line 128 "slp_attr_l.l" { BEGIN ATTR; yylval._i = *yytext; return(yylval._i); } YY_BREAK case 4: YY_RULE_SETUP #line 129 "slp_attr_l.l" { if (yyleng > 0) { if(NULL != (yylval._s = xstrdup(yytext))) return(_TAG); else return(0L); } } YY_BREAK /* anything else in the initial state is an error */ case 5: YY_RULE_SETUP #line 139 "slp_attr_l.l" {yyerror("error in lexer - initial state\n");} YY_BREAK case 6: YY_RULE_SETUP #line 141 "slp_attr_l.l" { ; } YY_BREAK case 7: YY_RULE_SETUP #line 142 "slp_attr_l.l" {BEGIN VALUE; yylval._i = *yytext; return(yylval._i);} YY_BREAK case 8: YY_RULE_SETUP #line 143 "slp_attr_l.l" { if (yyleng > 0 ) { if(NULL != (yylval._s = xstrdup(yytext))) return(_TAG); else return(0L); } } YY_BREAK /* make it legal to have just an attr tag enclosed in parens */ case 9: YY_RULE_SETUP #line 153 "slp_attr_l.l" {BEGIN INITIAL; yylval._i = *yytext; return(yylval._i); } YY_BREAK /* anything else in the attribute state is an error */ case 10: YY_RULE_SETUP #line 156 "slp_attr_l.l" {yyerror("error in lexer - attribute state\n");} YY_BREAK case 11: YY_RULE_SETUP #line 158 "slp_attr_l.l" { ; } YY_BREAK case 12: YY_RULE_SETUP #line 159 "slp_attr_l.l" {yylval._i = *yytext; return(_MULTIVAL);} YY_BREAK case 13: #line 162 "slp_attr_l.l" case 14: YY_RULE_SETUP #line 162 "slp_attr_l.l" { yylval._i = strtol(yytext, (char **) 0, 0); return _INT ;}; YY_BREAK case 15: #line 165 "slp_attr_l.l" case 16: YY_RULE_SETUP #line 165 "slp_attr_l.l" { yylval._i = strtoul(yytext, (char **)0, 0); return _INT; }; YY_BREAK case 17: YY_RULE_SETUP #line 168 "slp_attr_l.l" {return(_TRUE);} YY_BREAK case 18: YY_RULE_SETUP #line 169 "slp_attr_l.l" {return(_FALSE);} YY_BREAK case 19: YY_RULE_SETUP #line 171 "slp_attr_l.l" { if (yyleng > 0) { if(NULL != (yylval._s = xstrdup(yytext))) return(_STRING); else return(0L); } } YY_BREAK case 20: YY_RULE_SETUP #line 180 "slp_attr_l.l" { if (yyleng > 0) { if(NULL != (yylval._s = xstrdup(yytext))) return(_ESCAPED); else return(0L); } } YY_BREAK case 21: YY_RULE_SETUP #line 190 "slp_attr_l.l" {BEGIN INITIAL; yylval._i = *yytext; return(yylval._i);} YY_BREAK /* anything else in the value state is an error */ case 22: YY_RULE_SETUP #line 193 "slp_attr_l.l" {yyerror("error in lexer - value state\n");} YY_BREAK case 23: YY_RULE_SETUP #line 195 "slp_attr_l.l" ECHO; YY_BREAK #line 915 "slp_attr_l.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(ATTR): case YY_STATE_EOF(VALUE): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yy_hold_char; YY_RESTORE_YY_MORE_OFFSET if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between yy_current_buffer and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ yy_n_chars = yy_current_buffer->yy_n_chars; yy_current_buffer->yy_input_file = yyin; yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) { /* This was really a NUL. */ yy_state_type yy_next_state; yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = yytext_ptr + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++yy_c_buf_p; yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = yy_c_buf_p; goto yy_find_action; } } else switch ( yy_get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { yy_did_buffer_switch_on_eof = 0; if ( yywrap() ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: yy_c_buf_p = &yy_current_buffer->yy_ch_buf[yy_n_chars]; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer() { register char *dest = yy_current_buffer->yy_ch_buf; register char *source = yytext_ptr; register int number_to_move, i; int ret_val; if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( yy_current_buffer->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ yy_current_buffer->yy_n_chars = yy_n_chars = 0; else { int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ #ifdef YY_USES_REJECT YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = yy_current_buffer; int yy_c_buf_p_offset = (int) (yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yy_flex_realloc( (void *) b->yy_ch_buf, b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; #endif } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), yy_n_chars, num_to_read ); yy_current_buffer->yy_n_chars = yy_n_chars; } if ( yy_n_chars == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart( yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; yy_current_buffer->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; yy_n_chars += number_to_move; yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state() { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = yy_start; for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 60 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ #ifdef YY_USE_PROTOS static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) #else static yy_state_type yy_try_NUL_trans( yy_current_state ) yy_state_type yy_current_state; #endif { register int yy_is_jam; register char *yy_cp = yy_c_buf_p; register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 60 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 59); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT #ifdef YY_USE_PROTOS static void yyunput( int c, register char *yy_bp ) #else static void yyunput( c, yy_bp ) int c; register char *yy_bp; #endif { register char *yy_cp = yy_c_buf_p; /* undo effects of setting up yytext */ *yy_cp = yy_hold_char; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = yy_n_chars + 2; register char *dest = &yy_current_buffer->yy_ch_buf[ yy_current_buffer->yy_buf_size + 2]; register char *source = &yy_current_buffer->yy_ch_buf[number_to_move]; while ( source > yy_current_buffer->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); yy_current_buffer->yy_n_chars = yy_n_chars = yy_current_buffer->yy_buf_size; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; yytext_ptr = yy_bp; yy_hold_char = *yy_cp; yy_c_buf_p = yy_cp; } #endif /* ifndef YY_NO_UNPUT */ #ifdef __cplusplus static int yyinput() #else static int input() #endif { int c; *yy_c_buf_p = yy_hold_char; if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) /* This was really a NUL. */ *yy_c_buf_p = '\0'; else { /* need more input */ int offset = yy_c_buf_p - yytext_ptr; ++yy_c_buf_p; switch ( yy_get_next_buffer() ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart( yyin ); /* fall through */ case EOB_ACT_END_OF_FILE: { if ( yywrap() ) return EOF; if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + offset; break; } } } c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ *yy_c_buf_p = '\0'; /* preserve yytext */ yy_hold_char = *++yy_c_buf_p; return c; } #ifdef YY_USE_PROTOS void yyrestart( FILE *input_file ) #else void yyrestart( input_file ) FILE *input_file; #endif { if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_init_buffer( yy_current_buffer, input_file ); yy_load_buffer_state(); } #ifdef YY_USE_PROTOS void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) #else void yy_switch_to_buffer( new_buffer ) YY_BUFFER_STATE new_buffer; #endif { if ( yy_current_buffer == new_buffer ) return; if ( yy_current_buffer ) { /* Flush out information for old buffer. */ *yy_c_buf_p = yy_hold_char; yy_current_buffer->yy_buf_pos = yy_c_buf_p; yy_current_buffer->yy_n_chars = yy_n_chars; } yy_current_buffer = new_buffer; yy_load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ yy_did_buffer_switch_on_eof = 1; } #ifdef YY_USE_PROTOS void yy_load_buffer_state( void ) #else void yy_load_buffer_state() #endif { yy_n_chars = yy_current_buffer->yy_n_chars; yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; yyin = yy_current_buffer->yy_input_file; yy_hold_char = *yy_c_buf_p; } #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) #else YY_BUFFER_STATE yy_create_buffer( file, size ) FILE *file; int size; #endif { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer( b, file ); return b; } #ifdef YY_USE_PROTOS void yy_delete_buffer( YY_BUFFER_STATE b ) #else void yy_delete_buffer( b ) YY_BUFFER_STATE b; #endif { if ( ! b ) return; if ( b == yy_current_buffer ) yy_current_buffer = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yy_flex_free( (void *) b->yy_ch_buf ); yy_flex_free( (void *) b ); } #ifndef YY_ALWAYS_INTERACTIVE #ifndef YY_NEVER_INTERACTIVE extern int isatty YY_PROTO(( int )); #endif #endif #ifdef YY_USE_PROTOS void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) #else void yy_init_buffer( b, file ) YY_BUFFER_STATE b; FILE *file; #endif { yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; #if YY_ALWAYS_INTERACTIVE b->yy_is_interactive = 1; #else #if YY_NEVER_INTERACTIVE b->yy_is_interactive = 0; #else b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; #endif #endif } #ifdef YY_USE_PROTOS void yy_flush_buffer( YY_BUFFER_STATE b ) #else void yy_flush_buffer( b ) YY_BUFFER_STATE b; #endif { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == yy_current_buffer ) yy_load_buffer_state(); } #ifndef YY_NO_SCAN_BUFFER #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) #else YY_BUFFER_STATE yy_scan_buffer( base, size ) char *base; yy_size_t size; #endif { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer( b ); return b; } #endif #ifndef YY_NO_SCAN_STRING #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) #else YY_BUFFER_STATE yy_scan_string( yy_str ) yyconst char *yy_str; #endif { int len; for ( len = 0; yy_str[len]; ++len ) ; return yy_scan_bytes( yy_str, len ); } #endif #ifndef YY_NO_SCAN_BYTES #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) #else YY_BUFFER_STATE yy_scan_bytes( bytes, len ) yyconst char *bytes; int len; #endif { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; buf = (char *) yy_flex_alloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < len; ++i ) buf[i] = bytes[i]; buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer( buf, n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #endif #ifndef YY_NO_PUSH_STATE #ifdef YY_USE_PROTOS static void yy_push_state( int new_state ) #else static void yy_push_state( new_state ) int new_state; #endif { if ( yy_start_stack_ptr >= yy_start_stack_depth ) { yy_size_t new_size; yy_start_stack_depth += YY_START_STACK_INCR; new_size = yy_start_stack_depth * sizeof( int ); if ( ! yy_start_stack ) yy_start_stack = (int *) yy_flex_alloc( new_size ); else yy_start_stack = (int *) yy_flex_realloc( (void *) yy_start_stack, new_size ); if ( ! yy_start_stack ) YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); } yy_start_stack[yy_start_stack_ptr++] = YY_START; BEGIN(new_state); } #endif #ifndef YY_NO_POP_STATE static void yy_pop_state() { if ( --yy_start_stack_ptr < 0 ) YY_FATAL_ERROR( "start-condition stack underflow" ); BEGIN(yy_start_stack[yy_start_stack_ptr]); } #endif #ifndef YY_NO_TOP_STATE static int yy_top_state() { return yy_start_stack[yy_start_stack_ptr - 1]; } #endif #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif #ifdef YY_USE_PROTOS static void yy_fatal_error( yyconst char msg[] ) #else static void yy_fatal_error( msg ) char msg[]; #endif { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ yytext[yyleng] = yy_hold_char; \ yy_c_buf_p = yytext + n; \ yy_hold_char = *yy_c_buf_p; \ *yy_c_buf_p = '\0'; \ yyleng = n; \ } \ while ( 0 ) /* Internal utility routines. */ #ifndef yytext_ptr #ifdef YY_USE_PROTOS static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) #else static void yy_flex_strncpy( s1, s2, n ) char *s1; yyconst char *s2; int n; #endif { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN #ifdef YY_USE_PROTOS static int yy_flex_strlen( yyconst char *s ) #else static int yy_flex_strlen( s ) yyconst char *s; #endif { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif #ifdef YY_USE_PROTOS static void *yy_flex_alloc( yy_size_t size ) #else static void *yy_flex_alloc( size ) yy_size_t size; #endif { return (void *) malloc( size ); } #ifdef YY_USE_PROTOS static void *yy_flex_realloc( void *ptr, yy_size_t size ) #else static void *yy_flex_realloc( ptr, size ) void *ptr; yy_size_t size; #endif { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } #ifdef YY_USE_PROTOS static void yy_flex_free( void *ptr ) #else static void yy_flex_free( ptr ) void *ptr; #endif { free( ptr ); } #if YY_MAIN int main() { yylex(); return 0; } #endif #line 195 "slp_attr_l.l" unsigned int slp_attr_init_lexer(char *s) { memset(&buf[0], 0x00, 2052); strncpy(&buf[0], s, 2052); return((unsigned int)yy_scan_buffer(&buf[0], strlen(s) + 2)); } void attr_close_lexer(unsigned int handle) { // assert(handle != 0); yy_delete_buffer((YY_BUFFER_STATE)handle); } void yyerror(char *s, ...) { return; } openslp-1.2.1/common/slp_filter_l.c0000644033442200000310000012666110211377550017207 0ustar rganesanfloppy/* A lexical scanner generated by flex */ /* Scanner skeleton version: * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #include /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ #ifdef c_plusplus #ifndef __cplusplus #define __cplusplus #endif #endif #ifdef __cplusplus #include #include /* Use prototypes in function declarations. */ #define YY_USE_PROTOS /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ #if __STDC__ #define YY_USE_PROTOS #define YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef __TURBOC__ #pragma warn -rch #pragma warn -use #include #include #define YY_USE_CONST #define YY_USE_PROTOS #endif #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif #ifdef YY_USE_PROTOS #define YY_PROTO(proto) proto #else #define YY_PROTO(proto) () #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN yy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((yy_start - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #define YY_BUF_SIZE 16384 typedef struct yy_buffer_state *YY_BUFFER_STATE; extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* The funky do-while in the following #define is used to turn the definition * int a single C statement (which needs a semi-colon terminator). This * avoids problems with code like: * * if ( condition_holds ) * yyless( 5 ); * else * do_something_else(); * * Prior to using the do-while the compiler would get upset at the * "else" because it interpreted the "if" statement as being all * done when it reached the ';' after the yyless() call. */ /* Return all but the first 'n' matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ *yy_cp = yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, yytext_ptr ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ typedef unsigned int yy_size_t; struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; static YY_BUFFER_STATE yy_current_buffer = 0; /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". */ #define YY_CURRENT_BUFFER yy_current_buffer /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 1; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart YY_PROTO(( FILE *input_file )); void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); void yy_load_buffer_state YY_PROTO(( void )); YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); static void *yy_flex_alloc YY_PROTO(( yy_size_t )); static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); static void yy_flex_free YY_PROTO(( void * )); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) #define yywrap() 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern char *yytext; #define yytext_ptr yytext static yy_state_type yy_get_previous_state YY_PROTO(( void )); static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); static int yy_get_next_buffer YY_PROTO(( void )); static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yytext_ptr = yy_bp; \ yyleng = (int) (yy_cp - yy_bp); \ yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; #define YY_NUM_RULES 21 #define YY_END_OF_BUFFER 22 static yyconst short int yy_accept[47] = { 0, 3, 3, 0, 0, 22, 20, 3, 8, 1, 6, 4, 5, 20, 16, 16, 21, 9, 21, 20, 20, 7, 21, 2, 21, 20, 3, 14, 14, 16, 20, 11, 12, 10, 20, 20, 13, 2, 20, 17, 20, 20, 15, 20, 18, 19, 0 } ; static yyconst int yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 5, 1, 1, 1, 6, 1, 7, 8, 9, 10, 1, 10, 1, 1, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 1, 1, 13, 14, 15, 1, 1, 16, 17, 17, 17, 18, 19, 1, 1, 1, 1, 1, 20, 1, 1, 1, 1, 1, 21, 22, 23, 24, 1, 1, 25, 1, 1, 1, 1, 1, 1, 1, 1, 16, 17, 17, 17, 18, 19, 1, 1, 1, 1, 1, 20, 1, 1, 1, 1, 1, 21, 22, 23, 24, 1, 1, 25, 1, 1, 1, 26, 1, 27, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst int yy_meta[28] = { 0, 1, 2, 3, 4, 1, 4, 4, 4, 1, 1, 1, 1, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4 } ; static yyconst short int yy_base[50] = { 0, 0, 0, 25, 50, 73, 0, 70, 105, 0, 105, 105, 105, 23, 25, 30, 57, 61, 55, 52, 46, 105, 52, 0, 105, 0, 60, 34, 32, 36, 67, 105, 105, 105, 41, 36, 105, 0, 76, 0, 33, 31, 0, 12, 0, 0, 105, 95, 99, 102 } ; static yyconst short int yy_def[50] = { 0, 46, 1, 47, 47, 46, 48, 46, 46, 48, 46, 46, 46, 48, 48, 48, 46, 46, 46, 48, 48, 46, 46, 49, 46, 48, 46, 48, 48, 48, 48, 46, 46, 46, 48, 48, 46, 49, 48, 30, 48, 48, 38, 48, 48, 48, 0, 46, 46, 46 } ; static yyconst short int yy_nxt[133] = { 0, 6, 7, 6, 8, 9, 10, 11, 12, 6, 13, 14, 15, 16, 17, 18, 6, 6, 6, 19, 6, 6, 6, 20, 6, 6, 21, 22, 24, 24, 45, 24, 24, 24, 27, 28, 29, 29, 24, 24, 24, 29, 29, 28, 28, 28, 28, 29, 29, 44, 30, 24, 24, 24, 24, 43, 24, 24, 24, 38, 41, 40, 26, 24, 24, 24, 36, 35, 34, 33, 32, 31, 26, 46, 46, 46, 24, 24, 39, 39, 46, 46, 46, 39, 39, 39, 39, 42, 42, 46, 46, 46, 42, 42, 42, 42, 23, 23, 23, 23, 25, 46, 25, 37, 37, 5, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46 } ; static yyconst short int yy_chk[133] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 43, 3, 3, 3, 13, 13, 14, 14, 3, 3, 3, 15, 15, 28, 28, 27, 27, 29, 29, 41, 14, 3, 3, 4, 4, 40, 4, 4, 4, 27, 35, 34, 26, 4, 4, 4, 22, 20, 19, 18, 17, 16, 7, 5, 0, 0, 4, 4, 30, 30, 0, 0, 0, 30, 30, 30, 30, 38, 38, 0, 0, 0, 38, 38, 38, 38, 47, 47, 47, 47, 48, 0, 48, 49, 49, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "slp_filter_l.l" #define INITIAL 0 /******************************************************************* * Description: encode/decode LDAP filters * * Originated: 04-21-2001 * Original Author: Mike Day - md@soft-hackle.net * * Copyright (C) Michael Day, 2001 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *******************************************************************/ #line 25 "slp_filter_l.l" #undef YYLMAX #define YYLMAX 2048 #define yymaxdepth slp_filter_maxdepth #define yyparse slp_filter_parse #define yylex slp_filter_lex #define yyerror slp_filter_error #define yylval slp_filter_lval #define yychar slp_filter_char #define yydebug slp_filter_debug #define yypact slp_filter_pact #define yyr1 slp_filter_r1 #define yyr2 slp_filter_r2 #define yydef slp_filter_def #define yychk slp_filter_chk #define yypgo slp_filter_pgo #define yyact slp_filter_act #define yyexca slp_filter_exca #define yyerrflag slp_filter_errflag #define yynerrs slp_filter_nerrs #define yyps slp_filter_ps #define yypv slp_filter_pv #define yys slp_filter_s #define yy_yys slp_filter_yys #define yystate slp_filter_state #define yytmp slp_filter_tmp #define yyv slp_filter_v #define yy_yyv slp_filter_yyv #define yyval slp_filter_val #define yylloc slp_filter_lloc #define yyreds slp_filter_reds #define yytoks slp_filter_toks #define yylhs slp_filter_yylhs #define yylen slp_filter_yylen #define yydefred slp_filter_yydefred #define yydgoto slp_filter_yydgoto #define yysindex slp_filter_yysindex #define yyrindex slp_filter_yyrindex #define yygindex slp_filter_yygindex #define yytable slp_filter_yytable #define yycheck slp_filter_yycheck #define yyname slp_filter_yyname #define yyrule slp_filter_yyrule #define YY_NO_UNPUT #include "slp_filter.h" #include "slp_filter_y.h" #include "slp_xmalloc.h" static char buf[2052]; void slp_filter_error(char *, ...); void slp_filter_close_lexer(unsigned int handle); unsigned int slp_filter_init_lexer(const char *s); /* regex macros for the lexer */ /* special lexer states */ #define QUOTED_STRING 1 /* table size directives */ #line 495 "slp_filter_l.c" /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap YY_PROTO(( void )); #else extern int yywrap YY_PROTO(( void )); #endif #endif #ifndef YY_NO_UNPUT static void yyunput YY_PROTO(( int c, char *buf_ptr )); #endif #ifndef yytext_ptr static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen YY_PROTO(( yyconst char * )); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput YY_PROTO(( void )); #else static int input YY_PROTO(( void )); #endif #endif #if YY_STACK_USED static int yy_start_stack_ptr = 0; static int yy_start_stack_depth = 0; static int *yy_start_stack = 0; #ifndef YY_NO_PUSH_STATE static void yy_push_state YY_PROTO(( int new_state )); #endif #ifndef YY_NO_POP_STATE static void yy_pop_state YY_PROTO(( void )); #endif #ifndef YY_NO_TOP_STATE static int yy_top_state YY_PROTO(( void )); #endif #else #define YY_NO_PUSH_STATE 1 #define YY_NO_POP_STATE 1 #define YY_NO_TOP_STATE 1 #endif #ifdef YY_MALLOC_DECL YY_MALLOC_DECL #else #if __STDC__ #ifndef __cplusplus #include #endif #else /* Just try to get by without declaring the routines. This will fail * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) * or sizeof(void*) != sizeof(int). */ #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( yy_current_buffer->yy_is_interactive ) \ { \ int c = '*', n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL int yylex YY_PROTO(( void )) #endif /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 97 "slp_filter_l.l" #line 649 "slp_filter_l.c" if ( yy_init ) { yy_init = 0; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! yy_start ) yy_start = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = yy_c_buf_p; /* Support of yytext. */ *yy_cp = yy_hold_char; /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = yy_start; yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 47 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 105 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = yy_hold_char; yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; goto yy_find_action; case 1: YY_RULE_SETUP #line 99 "slp_filter_l.l" { BEGIN QUOTED_STRING; yyless(0); } YY_BREAK case 2: YY_RULE_SETUP #line 100 "slp_filter_l.l" { BEGIN INITIAL; if(NULL != (yylval.filter_string = xstrdup(yytext))) return(OPERAND) ; else return(0L) ; } YY_BREAK case 3: YY_RULE_SETUP #line 109 "slp_filter_l.l" { ; } YY_BREAK case 4: YY_RULE_SETUP #line 110 "slp_filter_l.l" { yylval.filter_int = L_PAREN; return L_PAREN ; } YY_BREAK case 5: YY_RULE_SETUP #line 111 "slp_filter_l.l" { yylval.filter_int = R_PAREN; return R_PAREN ; } YY_BREAK case 6: YY_RULE_SETUP #line 112 "slp_filter_l.l" { yylval.filter_int = OP_AND; return OP_AND ; } YY_BREAK case 7: YY_RULE_SETUP #line 113 "slp_filter_l.l" { yylval.filter_int = OP_OR; return OP_OR ; } YY_BREAK case 8: YY_RULE_SETUP #line 114 "slp_filter_l.l" { yylval.filter_int = OP_NOT; return OP_NOT ; } YY_BREAK case 9: YY_RULE_SETUP #line 115 "slp_filter_l.l" { yylval.filter_int = OP_EQU; return OP_EQU ; } YY_BREAK case 10: YY_RULE_SETUP #line 116 "slp_filter_l.l" { yylval.filter_int = OP_GT; return OP_GT ; } YY_BREAK case 11: YY_RULE_SETUP #line 117 "slp_filter_l.l" { yylval.filter_int = OP_LT; return OP_LT ; } YY_BREAK case 12: YY_RULE_SETUP #line 118 "slp_filter_l.l" { yylval.filter_int = OP_PRESENT; return OP_PRESENT ; } YY_BREAK case 13: YY_RULE_SETUP #line 119 "slp_filter_l.l" { yylval.filter_int = OP_APPROX; return OP_APPROX ; } YY_BREAK case 14: #line 123 "slp_filter_l.l" case 15: YY_RULE_SETUP #line 123 "slp_filter_l.l" { yylval.filter_int = strtol(yytext, (char **) 0, 0) ; return VAL_INT; } YY_BREAK case 16: #line 129 "slp_filter_l.l" case 17: YY_RULE_SETUP #line 129 "slp_filter_l.l" { yylval.filter_int = strtoul(yytext, (char **) 0, 0); return VAL_INT; } YY_BREAK case 18: YY_RULE_SETUP #line 134 "slp_filter_l.l" { yylval.filter_int = 1; return VAL_BOOL; } YY_BREAK case 19: YY_RULE_SETUP #line 139 "slp_filter_l.l" { yylval.filter_int = 0; return VAL_BOOL; } YY_BREAK case 20: YY_RULE_SETUP #line 144 "slp_filter_l.l" { if(NULL != (yylval.filter_string = xstrdup(yytext))) return(OPERAND) ; else return(0L) ; } YY_BREAK case 21: YY_RULE_SETUP #line 151 "slp_filter_l.l" ECHO; YY_BREAK #line 852 "slp_filter_l.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(QUOTED_STRING): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yy_hold_char; YY_RESTORE_YY_MORE_OFFSET if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between yy_current_buffer and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ yy_n_chars = yy_current_buffer->yy_n_chars; yy_current_buffer->yy_input_file = yyin; yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) { /* This was really a NUL. */ yy_state_type yy_next_state; yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = yytext_ptr + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++yy_c_buf_p; yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = yy_c_buf_p; goto yy_find_action; } } else switch ( yy_get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { yy_did_buffer_switch_on_eof = 0; if ( yywrap() ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: yy_c_buf_p = &yy_current_buffer->yy_ch_buf[yy_n_chars]; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer() { register char *dest = yy_current_buffer->yy_ch_buf; register char *source = yytext_ptr; register int number_to_move, i; int ret_val; if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( yy_current_buffer->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ yy_current_buffer->yy_n_chars = yy_n_chars = 0; else { int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ #ifdef YY_USES_REJECT YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = yy_current_buffer; int yy_c_buf_p_offset = (int) (yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yy_flex_realloc( (void *) b->yy_ch_buf, b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; #endif } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), yy_n_chars, num_to_read ); yy_current_buffer->yy_n_chars = yy_n_chars; } if ( yy_n_chars == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart( yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; yy_current_buffer->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; yy_n_chars += number_to_move; yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state() { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = yy_start; for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 47 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ #ifdef YY_USE_PROTOS static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) #else static yy_state_type yy_try_NUL_trans( yy_current_state ) yy_state_type yy_current_state; #endif { register int yy_is_jam; register char *yy_cp = yy_c_buf_p; register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 47 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 46); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT #ifdef YY_USE_PROTOS static void yyunput( int c, register char *yy_bp ) #else static void yyunput( c, yy_bp ) int c; register char *yy_bp; #endif { register char *yy_cp = yy_c_buf_p; /* undo effects of setting up yytext */ *yy_cp = yy_hold_char; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = yy_n_chars + 2; register char *dest = &yy_current_buffer->yy_ch_buf[ yy_current_buffer->yy_buf_size + 2]; register char *source = &yy_current_buffer->yy_ch_buf[number_to_move]; while ( source > yy_current_buffer->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); yy_current_buffer->yy_n_chars = yy_n_chars = yy_current_buffer->yy_buf_size; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; yytext_ptr = yy_bp; yy_hold_char = *yy_cp; yy_c_buf_p = yy_cp; } #endif /* ifndef YY_NO_UNPUT */ #ifdef __cplusplus static int yyinput() #else static int input() #endif { int c; *yy_c_buf_p = yy_hold_char; if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) /* This was really a NUL. */ *yy_c_buf_p = '\0'; else { /* need more input */ int offset = yy_c_buf_p - yytext_ptr; ++yy_c_buf_p; switch ( yy_get_next_buffer() ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart( yyin ); /* fall through */ case EOB_ACT_END_OF_FILE: { if ( yywrap() ) return EOF; if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + offset; break; } } } c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ *yy_c_buf_p = '\0'; /* preserve yytext */ yy_hold_char = *++yy_c_buf_p; return c; } #ifdef YY_USE_PROTOS void yyrestart( FILE *input_file ) #else void yyrestart( input_file ) FILE *input_file; #endif { if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_init_buffer( yy_current_buffer, input_file ); yy_load_buffer_state(); } #ifdef YY_USE_PROTOS void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) #else void yy_switch_to_buffer( new_buffer ) YY_BUFFER_STATE new_buffer; #endif { if ( yy_current_buffer == new_buffer ) return; if ( yy_current_buffer ) { /* Flush out information for old buffer. */ *yy_c_buf_p = yy_hold_char; yy_current_buffer->yy_buf_pos = yy_c_buf_p; yy_current_buffer->yy_n_chars = yy_n_chars; } yy_current_buffer = new_buffer; yy_load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ yy_did_buffer_switch_on_eof = 1; } #ifdef YY_USE_PROTOS void yy_load_buffer_state( void ) #else void yy_load_buffer_state() #endif { yy_n_chars = yy_current_buffer->yy_n_chars; yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; yyin = yy_current_buffer->yy_input_file; yy_hold_char = *yy_c_buf_p; } #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) #else YY_BUFFER_STATE yy_create_buffer( file, size ) FILE *file; int size; #endif { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer( b, file ); return b; } #ifdef YY_USE_PROTOS void yy_delete_buffer( YY_BUFFER_STATE b ) #else void yy_delete_buffer( b ) YY_BUFFER_STATE b; #endif { if ( ! b ) return; if ( b == yy_current_buffer ) yy_current_buffer = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yy_flex_free( (void *) b->yy_ch_buf ); yy_flex_free( (void *) b ); } #ifndef YY_ALWAYS_INTERACTIVE #ifndef YY_NEVER_INTERACTIVE extern int isatty YY_PROTO(( int )); #endif #endif #ifdef YY_USE_PROTOS void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) #else void yy_init_buffer( b, file ) YY_BUFFER_STATE b; FILE *file; #endif { yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; #if YY_ALWAYS_INTERACTIVE b->yy_is_interactive = 1; #else #if YY_NEVER_INTERACTIVE b->yy_is_interactive = 0; #else b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; #endif #endif } #ifdef YY_USE_PROTOS void yy_flush_buffer( YY_BUFFER_STATE b ) #else void yy_flush_buffer( b ) YY_BUFFER_STATE b; #endif { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == yy_current_buffer ) yy_load_buffer_state(); } #ifndef YY_NO_SCAN_BUFFER #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) #else YY_BUFFER_STATE yy_scan_buffer( base, size ) char *base; yy_size_t size; #endif { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer( b ); return b; } #endif #ifndef YY_NO_SCAN_STRING #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) #else YY_BUFFER_STATE yy_scan_string( yy_str ) yyconst char *yy_str; #endif { int len; for ( len = 0; yy_str[len]; ++len ) ; return yy_scan_bytes( yy_str, len ); } #endif #ifndef YY_NO_SCAN_BYTES #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) #else YY_BUFFER_STATE yy_scan_bytes( bytes, len ) yyconst char *bytes; int len; #endif { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; buf = (char *) yy_flex_alloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < len; ++i ) buf[i] = bytes[i]; buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer( buf, n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #endif #ifndef YY_NO_PUSH_STATE #ifdef YY_USE_PROTOS static void yy_push_state( int new_state ) #else static void yy_push_state( new_state ) int new_state; #endif { if ( yy_start_stack_ptr >= yy_start_stack_depth ) { yy_size_t new_size; yy_start_stack_depth += YY_START_STACK_INCR; new_size = yy_start_stack_depth * sizeof( int ); if ( ! yy_start_stack ) yy_start_stack = (int *) yy_flex_alloc( new_size ); else yy_start_stack = (int *) yy_flex_realloc( (void *) yy_start_stack, new_size ); if ( ! yy_start_stack ) YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); } yy_start_stack[yy_start_stack_ptr++] = YY_START; BEGIN(new_state); } #endif #ifndef YY_NO_POP_STATE static void yy_pop_state() { if ( --yy_start_stack_ptr < 0 ) YY_FATAL_ERROR( "start-condition stack underflow" ); BEGIN(yy_start_stack[yy_start_stack_ptr]); } #endif #ifndef YY_NO_TOP_STATE static int yy_top_state() { return yy_start_stack[yy_start_stack_ptr - 1]; } #endif #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif #ifdef YY_USE_PROTOS static void yy_fatal_error( yyconst char msg[] ) #else static void yy_fatal_error( msg ) char msg[]; #endif { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ yytext[yyleng] = yy_hold_char; \ yy_c_buf_p = yytext + n; \ yy_hold_char = *yy_c_buf_p; \ *yy_c_buf_p = '\0'; \ yyleng = n; \ } \ while ( 0 ) /* Internal utility routines. */ #ifndef yytext_ptr #ifdef YY_USE_PROTOS static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) #else static void yy_flex_strncpy( s1, s2, n ) char *s1; yyconst char *s2; int n; #endif { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN #ifdef YY_USE_PROTOS static int yy_flex_strlen( yyconst char *s ) #else static int yy_flex_strlen( s ) yyconst char *s; #endif { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif #ifdef YY_USE_PROTOS static void *yy_flex_alloc( yy_size_t size ) #else static void *yy_flex_alloc( size ) yy_size_t size; #endif { return (void *) malloc( size ); } #ifdef YY_USE_PROTOS static void *yy_flex_realloc( void *ptr, yy_size_t size ) #else static void *yy_flex_realloc( ptr, size ) void *ptr; yy_size_t size; #endif { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } #ifdef YY_USE_PROTOS static void yy_flex_free( void *ptr ) #else static void yy_flex_free( ptr ) void *ptr; #endif { free( ptr ); } #if YY_MAIN int main() { yylex(); return 0; } #endif #line 151 "slp_filter_l.l" void filter_close_lexer(unsigned int handle) { yy_delete_buffer((YY_BUFFER_STATE)handle); } unsigned int slp_filter_init_lexer(const char *s) { memset(&buf[0], 0x00, 2052); strncpy(&buf[0], s, 2048); return((unsigned int)yy_scan_buffer(&buf[0], strlen(s) + 2)); } void slp_filter_error(char *s, ...) { return; } openslp-1.2.1/common/slp_compare.h0000644033442200000310000003672610204452352017040 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_string.h */ /* */ /* Abstract: Various functions that deal with SLP strings and */ /* string-lists */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #if(!defined SLP_STRING_H_INCLUDED) #define SLP_STRING_H_INCLUDED #ifdef _WIN32 # define strncasecmp(String1, String2, Num) strnicmp(String1, String2, Num) # define strcasecmp(String1, String2, Num) stricmp(String1, String2, Num) # define inet_aton(opt,bind) ((bind)->s_addr = inet_addr(opt)) #else # ifdef HAVE_CONFIG_H # include "config.h" # endif # ifndef HAVE_STRNCASECMP int strncasecmp(const char *s1, const char *s2, size_t len); # endif # ifndef HAVE_STRCASECMP int strcasecmp(const char *s1, const char *s2); # endif #endif /*=========================================================================*/ int SLPCompareString(int str1len, const char* str1, int str2len, const char* str2); /* Does a lexical string compare as described in RFC 2608 section 6.4. */ /* */ /* TODO: Handle the whole utf8 spec */ /* */ /* str1 - pointer to string to be compared */ /* */ /* str1len - length of str1 in bytes */ /* */ /* str2 - pointer to string to be compared */ /* */ /* str2len - length of str2 in bytes */ /* */ /* Returns - zero if strings are equal. >0 if str1 is greater than str2 */ /* <0 if s1 is less than str2 */ /*=========================================================================*/ /*=========================================================================*/ int SLPCompareNamingAuth(int srvtypelen, const char* srvtype, int namingauthlen, const char* namingauth); /* Does srvtype match namingauth */ /* */ /* TODO: Handle the whole utf8 spec */ /* */ /* srvtype - pointer to service type to be compared */ /* */ /* srvtypelen - length of srvtype in bytes */ /* */ /* namingauth - pointer to naming authority to be matched */ /* */ /* namingauthlen - length of naming authority in bytes */ /* */ /* Returns - zero if srvtype matches the naming authority. Nonzero if */ /* it doesn't */ /*=========================================================================*/ int SLPCompareSrvType(int srvtype1len, const char* srvtype1, int srvtype2len, const char* srvtype2); /* Compares two service type strings */ /* */ /* TODO: Handle the whole utf8 spec */ /* */ /* srvtype1 - pointer to string to be compared */ /* */ /* srvtype1len - length of str1 in bytes */ /* */ /* srvtype2 - pointer to string to be compared */ /* */ /* srvtype2len - length of str2 in bytes */ /* */ /* Returns - zero if srvtypes are equal. >0 if str1 is greater than str2 */ /* <0 if s1 is less than str2 */ /*=========================================================================*/ /*=========================================================================*/ int SLPContainsStringList(int listlen, const char* list, int stringlen, const char* string); /* Checks a string-list for the occurence of a string */ /* */ /* list - pointer to the string-list to be checked */ /* */ /* listlen - length in bytes of the list to be checked */ /* */ /* string - pointer to a string to find in the string-list */ /* */ /* stringlen - the length of the string in bytes */ /* */ /* Returns - zero if string is NOT contained in the list. non-zero if it*/ /* is. */ /*=========================================================================*/ /*=========================================================================*/ int SLPIntersectStringList(int list1len, const char* list1, int list2len, const char* list2); /* Calculates the number of common entries between two string-lists */ /* */ /* list1 - pointer to the string-list to be checked */ /* */ /* list1len - length in bytes of the list to be checked */ /* */ /* list2 - pointer to the string-list to be checked */ /* */ /* list2len - length in bytes of the list to be checked */ /* */ /* Returns - The number of common entries. */ /*=========================================================================*/ /*=========================================================================*/ int SLPUnionStringList(int list1len, const char* list1, int list2len, const char* list2, int* unionlistlen, char * unionlist); /* Generate a string list that is a union of two string lists */ /* */ /* list1len - length in bytes of list1 */ /* */ /* list1 - pointer to a string-list */ /* */ /* list2len - length in bytes of list2 */ /* */ /* list2 - pointer to a string-list */ /* */ /* unionlistlen - pointer to the size in bytes of the unionlist buffer. */ /* also receives the size in bytes of the unionlist buffer */ /* on successful return. */ /* */ /* unionlist - pointer to the buffer that will receive the union list. */ /* */ /* */ /* Returns - Length of the resulting union list or negative if */ /* unionlist is not big enough. If negative is returned */ /* *unionlist will be changed indicate the size of unionlist */ /* buffer needed */ /* */ /* Important: In order ensure that unionlist does not contain any */ /* duplicates, at least list1 must not have any duplicates. */ /* Also, for speed optimization if list1 and list2 are both */ /* with out duplicates, the larger list should be passed in */ /* as list1. */ /* */ /* Note: A good size for unionlist (so that non-zero will never be */ /* returned) is list1len + list2len + 1 */ /*=========================================================================*/ /*=========================================================================*/ int SLPSubsetStringList(int listlen, const char* list, int sublistlen, const char* sublist); /* Test if sublist is a set of list */ /* */ /* list - pointer to the string-list to be checked */ /* */ /* listlen - length in bytes of the list to be checked */ /* */ /* sublistlistlen - pointer to the string-list to be checked */ /* */ /* sublist - length in bytes of the list to be checked */ /* */ /* Returns - non-zero is sublist is a subset of list. Zero otherwise */ /*=========================================================================*/ /*=========================================================================*/ int SLPCheckServiceUrlSyntax(const char* srvurl, int srvurllen); /* Test if a service url conforms to accepted syntax * * srvurl - (IN) service url string to check * * srvurllen - (IN) length of srvurl in bytes * * Returns - zero if srvurl has acceptable syntax, non-zero on failure * *=========================================================================*/ /*=========================================================================*/ int SLPCheckAttributeListSyntax(const char* attrlist, int attrlistlen); /* Test if a service url conforms to accepted syntax * * attrlist - (IN) attribute list string to check * * attrlistlen - (IN) length of attrlist in bytes * * Returns - zero if srvurl has acceptable syntax, non-zero on failure * *=========================================================================*/ #endif openslp-1.2.1/common/slp_filter_l.l0000644033442200000310000001332110210657231017200 0ustar rganesanfloppy/******************************************************************* * Description: encode/decode LDAP filters * * Originated: 04-21-2001 * Original Author: Mike Day - md@soft-hackle.net * * Copyright (C) Michael Day, 2001 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *******************************************************************/ %{ #undef YYLMAX #define YYLMAX 2048 #define yymaxdepth slp_filter_maxdepth #define yyparse slp_filter_parse #define yylex slp_filter_lex #define yyerror slp_filter_error #define yylval slp_filter_lval #define yychar slp_filter_char #define yydebug slp_filter_debug #define yypact slp_filter_pact #define yyr1 slp_filter_r1 #define yyr2 slp_filter_r2 #define yydef slp_filter_def #define yychk slp_filter_chk #define yypgo slp_filter_pgo #define yyact slp_filter_act #define yyexca slp_filter_exca #define yyerrflag slp_filter_errflag #define yynerrs slp_filter_nerrs #define yyps slp_filter_ps #define yypv slp_filter_pv #define yys slp_filter_s #define yy_yys slp_filter_yys #define yystate slp_filter_state #define yytmp slp_filter_tmp #define yyv slp_filter_v #define yy_yyv slp_filter_yyv #define yyval slp_filter_val #define yylloc slp_filter_lloc #define yyreds slp_filter_reds #define yytoks slp_filter_toks #define yylhs slp_filter_yylhs #define yylen slp_filter_yylen #define yydefred slp_filter_yydefred #define yydgoto slp_filter_yydgoto #define yysindex slp_filter_yysindex #define yyrindex slp_filter_yyrindex #define yygindex slp_filter_yygindex #define yytable slp_filter_yytable #define yycheck slp_filter_yycheck #define yyname slp_filter_yyname #define yyrule slp_filter_yyrule #define YY_NO_UNPUT #include "slp_filter.h" #include "slp_filter_y.h" #include "slp_xmalloc.h" static char buf[2052]; void slp_filter_error(char *, ...); void slp_filter_close_lexer(unsigned int handle); unsigned int slp_filter_init_lexer(const char *s); %} /* regex macros for the lexer */ hexdigit [0-9a-fA-F] reserved [()\&|!=<>~\n] /* newline in reserved set for convinience */ not_reserved [^()\&|!=<>~\n] /* special lexer states */ %x QUOTED_STRING /* table size directives */ %option noyywrap %% "\"" { BEGIN QUOTED_STRING; yyless(0); } [^()\&|!=<>~\n]+ { BEGIN INITIAL; if(NULL != (yylval.filter_string = xstrdup(yytext))) return(OPERAND) ; else return(0L) ; } [ \t\v\f]* { ; } "(" { yylval.filter_int = L_PAREN; return L_PAREN ; } ")" { yylval.filter_int = R_PAREN; return R_PAREN ; } "&" { yylval.filter_int = OP_AND; return OP_AND ; } "|" { yylval.filter_int = OP_OR; return OP_OR ; } "!" { yylval.filter_int = OP_NOT; return OP_NOT ; } "=" { yylval.filter_int = OP_EQU; return OP_EQU ; } ">=" { yylval.filter_int = OP_GT; return OP_GT ; } "<=" { yylval.filter_int = OP_LT; return OP_LT ; } "=*" { yylval.filter_int = OP_PRESENT; return OP_PRESENT ; } "~=" { yylval.filter_int = OP_APPROX; return OP_APPROX ; } [-+][0-9]+ | [-+]"0"[xX]{hexdigit}+ { yylval.filter_int = strtol(yytext, (char **) 0, 0) ; return VAL_INT; } [0-9]+ | "0"[xX]{hexdigit}+ { yylval.filter_int = strtoul(yytext, (char **) 0, 0); return VAL_INT; } [tT][rR][uU][eE] { yylval.filter_int = 1; return VAL_BOOL; } [fF][aA][lL][sS][eE] { yylval.filter_int = 0; return VAL_BOOL; } [^()\&|!=<>~ \t\v\f]+ { if(NULL != (yylval.filter_string = xstrdup(yytext))) return(OPERAND) ; else return(0L) ; } %% void filter_close_lexer(unsigned int handle) { yy_delete_buffer((YY_BUFFER_STATE)handle); } unsigned int slp_filter_init_lexer(const char *s) { memset(&buf[0], 0x00, 2052); strncpy(&buf[0], s, 2048); return((unsigned int)yy_scan_buffer(&buf[0], strlen(s) + 2)); } void slp_filter_error(char *s, ...) { return; } openslp-1.2.1/common/slp_v1message.c0000644033442200000310000005226410211370457017276 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_v1message.c */ /* */ /* Abstract: Source file specific to the SLPv1 wire protocol messages. */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU Lesser General Public License as published */ /* by the Free Software Foundation; either version 2.1 of the License, or */ /* (at your option) any later version. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* You should have received a copy of the GNU Lesser General Public */ /* License along with this program; see the file COPYING. If not, */ /* please obtain a copy from http://www.gnu.org/copyleft/lesser.html */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /***************************************************************************/ #include #include #ifndef _WIN32 #include #include #include #endif #include "slp_v1message.h" #include "slp_utf8.h" #include "slp_compare.h" /* Implementation Note: * * This file duplicates the parsing routines in slp_message.c. Even * though the format of the messages are mostly identical, handling of * the character encoding makes it enough of a problem to keep this * code independent. * * Unicode handling is currently a hack. We assume that we have enough * space the UTF-8 string in place instead of the unicode string. This * assumption is not always correct 16-bit unicode encoding. */ /*=========================================================================*/ int SLPv1MessageParseHeader(SLPBuffer buffer, SLPHeader* header) /* */ /* Returns - Zero on success, SLP_ERROR_VER_NOT_SUPPORTED, or */ /* SLP_ERROR_PARSE_ERROR. */ /*=========================================================================*/ { if (buffer->end - buffer->start < 12) { /* invalid length 12 bytes is the smallest v1 message*/ return SLP_ERROR_PARSE_ERROR; } header->version = *(buffer->curpos); header->functionid = *(buffer->curpos + 1); header->length = AsUINT16(buffer->curpos + 2); header->flags = *(buffer->curpos + 4); header->encoding = AsUINT16(buffer->curpos + 8); header->extoffset = 0; /* not used for SLPv1 */ header->xid = AsUINT16(buffer->curpos + 10); header->langtaglen = 2; header->langtag = buffer->curpos + 6; if(header->functionid > SLP_FUNCT_SRVTYPERQST) { /* invalid function id */ return SLP_ERROR_PARSE_ERROR; } if(header->encoding != SLP_CHAR_ASCII && header->encoding != SLP_CHAR_UTF8 && header->encoding != SLP_CHAR_UNICODE16 && header->encoding != SLP_CHAR_UNICODE32) { return SLP_ERROR_CHARSET_NOT_UNDERSTOOD; } if(header->length != buffer->end - buffer->start) { return SLP_ERROR_PARSE_ERROR; } /* TODO - do something about the other flags */ if(header->flags & 0x07) { /* invalid flags */ return SLP_ERROR_PARSE_ERROR; } buffer->curpos += 12; return 0; } /*--------------------------------------------------------------------------*/ int v1ParseUrlEntry(SLPBuffer buffer, SLPHeader* header, SLPUrlEntry* urlentry) /* */ /* Returns - Zero on success, SLP_ERROR_INTERNAL_ERROR (out of memory) or */ /* SLP_ERROR_PARSE_ERROR. */ /*--------------------------------------------------------------------------*/ { int result; /* make sure that min size is met */ if(buffer->end - buffer->curpos < 4) { return SLP_ERROR_PARSE_ERROR; } /* no reserved stuff for SLPv1 */ urlentry->reserved = 0; /* parse out lifetime */ urlentry->lifetime = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; /* parse out url */ urlentry->urllen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(urlentry->urllen > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } urlentry->url = buffer->curpos; buffer->curpos = buffer->curpos + urlentry->urllen; result = SLPv1AsUTF8(header->encoding, (char *) urlentry->url, &urlentry->urllen); if(result) { return result; } /* we don't support auth blocks for SLPv1 - no one uses them anyway */ urlentry->authcount = 0; urlentry->autharray = 0; return 0; } /*--------------------------------------------------------------------------*/ int v1ParseSrvRqst(SLPBuffer buffer, SLPHeader* header, SLPSrvRqst* srvrqst) /*--------------------------------------------------------------------------*/ { char *tmp; int result; /* make sure that min size is met */ if(buffer->end - buffer->curpos < 4) { return SLP_ERROR_PARSE_ERROR; } /* parse the prlist */ srvrqst->prlistlen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(srvrqst->prlistlen + 2 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } srvrqst->prlist = buffer->curpos; buffer->curpos = buffer->curpos + srvrqst->prlistlen; result = SLPv1AsUTF8(header->encoding, (char *) srvrqst->prlist, &srvrqst->prlistlen); if(result) return result; /* parse the predicate string */ srvrqst->predicatelen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(srvrqst->predicatelen > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } srvrqst->predicate = buffer->curpos; buffer->curpos = buffer->curpos + srvrqst->predicatelen; result = SLPv1AsUTF8(header->encoding, (char *) srvrqst->predicate, &srvrqst->predicatelen); if(result) { return result; } /* null terminate the predicate */ * (char *) (srvrqst->predicate + srvrqst->predicatelen) = '\0'; /* Now split out the service type */ srvrqst->srvtype = srvrqst->predicate; tmp = strchr(srvrqst->srvtype, '/'); if(!tmp) return SLP_ERROR_PARSE_ERROR; *tmp = 0; /* null terminate service type */ srvrqst->srvtypelen = tmp - srvrqst->srvtype; /* Parse out the predicate */ srvrqst->predicatever = 1; /* SLPv1 predicate (a bit messy) */ srvrqst->predicatelen -= srvrqst->srvtypelen + 1; srvrqst->predicate += srvrqst->srvtypelen + 1; /* Now split out the scope (if any) */ /* Special case DA discovery, empty scope is allowed here */ if(*srvrqst->predicate == '/' && SLPCompareString(srvrqst->srvtypelen, srvrqst->srvtype, 15, "directory-agent") != 0) { /* no scope - so set default scope */ srvrqst->scopelist = "default"; srvrqst->scopelistlen = 7; srvrqst->predicate++; srvrqst->predicatelen--; } else { srvrqst->scopelist = srvrqst->predicate; tmp = strchr(srvrqst->scopelist, '/'); if(!tmp) return SLP_ERROR_PARSE_ERROR; /* null terminate scope list */ *tmp = 0; srvrqst->scopelistlen = tmp - srvrqst->scopelist; srvrqst->predicate += srvrqst->scopelistlen + 1; srvrqst->predicatelen -= srvrqst->scopelistlen + 1; } srvrqst->predicatelen--; tmp = (char*)(srvrqst->predicate + srvrqst->predicatelen); /* null term. pred */ *tmp = 0; /* SLPv1 service requests don't have SPI strings */ srvrqst->spistrlen = 0; srvrqst->spistr = 0; return 0; } /*--------------------------------------------------------------------------*/ int v1ParseSrvReg(SLPBuffer buffer, SLPHeader* header, SLPSrvReg* srvreg) /*--------------------------------------------------------------------------*/ { char *tmp; int result; /* Parse out the url entry */ result = v1ParseUrlEntry(buffer, header, &(srvreg->urlentry)); if(result) { return result; } /* SLPv1 registration requests don't have a separate service type. They must be parsed from the url */ srvreg->srvtype = srvreg->urlentry.url; tmp = strstr(srvreg->srvtype, ":/"); if(!tmp) return SLP_ERROR_PARSE_ERROR; srvreg->srvtypelen = tmp - srvreg->srvtype; /* parse the attribute list */ if(buffer->end - buffer->curpos < 2) { return SLP_ERROR_PARSE_ERROR; } srvreg->attrlistlen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(srvreg->attrlistlen > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } srvreg->attrlist = buffer->curpos; buffer->curpos = buffer->curpos + srvreg->attrlistlen; result = SLPv1AsUTF8(header->encoding, (char *) srvreg->attrlist, &srvreg->attrlistlen); if(result) { return result; } /* SLPv1 registration requests don't include a scope either. The scope is included in the attribute list */ if((tmp = strstr(srvreg->attrlist, "SCOPE")) || (tmp = strstr(srvreg->attrlist, "scope"))) { tmp += 5; /* go past the scope */ while(*tmp && (isspace((unsigned char)*tmp) || *tmp == '=')) tmp++; /* go past = and white space */ srvreg->scopelist = tmp; while(*tmp && !isspace((unsigned char)*tmp) && *tmp != ')') tmp++; /* find end of scope */ srvreg->scopelistlen = tmp - srvreg->scopelist; } else { srvreg->scopelist = "default"; srvreg->scopelistlen = 7; } /* we don't support auth blocks for SLPv1 - no one uses them anyway */ srvreg->authcount = 0; srvreg->autharray = 0; return 0; } /*--------------------------------------------------------------------------*/ int v1ParseSrvDeReg(SLPBuffer buffer, SLPHeader* header, SLPSrvDeReg* srvdereg) /*--------------------------------------------------------------------------*/ { int result; /* make sure that min size is met */ if(buffer->end - buffer->curpos < 4) { return SLP_ERROR_PARSE_ERROR; } /* SLPv1 deregistrations do not have a separate scope list */ srvdereg->scopelistlen = 0; srvdereg->scopelist = 0; /* parse the url */ srvdereg->urlentry.reserved = 0; /* not present in SLPv1 */ srvdereg->urlentry.lifetime = 0; /* not present in SLPv1 */ srvdereg->urlentry.urllen = AsUINT16(buffer->curpos); buffer->curpos += 2; if(srvdereg->urlentry.urllen + 2 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } srvdereg->urlentry.url = buffer->curpos; buffer->curpos += srvdereg->urlentry.urllen; result = SLPv1AsUTF8(header->encoding, (char *) srvdereg->urlentry.url, &srvdereg->urlentry.urllen); if(result) { return result; } /* parse the tag list */ srvdereg->taglistlen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(srvdereg->taglistlen > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } srvdereg->taglist = buffer->curpos; buffer->curpos = buffer->curpos + srvdereg->taglistlen; result = SLPv1AsUTF8(header->encoding, (char *) srvdereg->taglist, &srvdereg->taglistlen); if(result) return result; return 0; } /*--------------------------------------------------------------------------*/ int v1ParseAttrRqst(SLPBuffer buffer, SLPHeader* header, SLPAttrRqst* attrrqst) /*--------------------------------------------------------------------------*/ { int result; /* make sure that min size is met */ if(buffer->end - buffer->curpos < 10) { return SLP_ERROR_PARSE_ERROR; } /* parse the prlist */ attrrqst->prlistlen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(attrrqst->prlistlen + 2 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } attrrqst->prlist = buffer->curpos; buffer->curpos = buffer->curpos + attrrqst->prlistlen; result = SLPv1AsUTF8(header->encoding, (char *) attrrqst->prlist, &attrrqst->prlistlen); if(result) return result; /* parse the url */ attrrqst->urllen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(attrrqst->urllen + 2 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } attrrqst->url = buffer->curpos; buffer->curpos = buffer->curpos + attrrqst->urllen; result = SLPv1AsUTF8(header->encoding, (char *) attrrqst->url, &attrrqst->urllen); if(result) return result; /* parse the scope list */ attrrqst->scopelistlen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(attrrqst->scopelistlen + 2 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } if(attrrqst->scopelistlen) { attrrqst->scopelist = buffer->curpos; buffer->curpos += attrrqst->scopelistlen; result = SLPv1AsUTF8(header->encoding, (char *) attrrqst->scopelist, &attrrqst->scopelistlen); if(result) return result; } else { attrrqst->scopelist = "default"; attrrqst->scopelistlen = 7; } /* parse the taglist string */ attrrqst->taglistlen = AsUINT16(buffer->curpos); buffer->curpos = buffer->curpos + 2; if(attrrqst->taglistlen > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } attrrqst->taglist = buffer->curpos; buffer->curpos = buffer->curpos + attrrqst->taglistlen; result = SLPv1AsUTF8(header->encoding, (char *) attrrqst->taglist, &attrrqst->taglistlen); if(result) return result; /* SLPv1 service requests don't have SPI strings */ attrrqst->spistrlen = 0; attrrqst->spistr = 0; return 0; } /*--------------------------------------------------------------------------*/ int v1ParseSrvTypeRqst(SLPBuffer buffer, SLPHeader* header, SLPSrvTypeRqst* srvtyperqst) /*--------------------------------------------------------------------------*/ { int result; /* make sure that min size is met */ if(buffer->end - buffer->curpos < 6) { return SLP_ERROR_PARSE_ERROR; } /* parse the prlist */ srvtyperqst->prlistlen = AsUINT16(buffer->curpos); buffer->curpos += 2; if(srvtyperqst->prlistlen + 2 > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } srvtyperqst->prlist = srvtyperqst->prlistlen ? buffer->curpos : 0; buffer->curpos += srvtyperqst->prlistlen; result = SLPv1AsUTF8(header->encoding, (char *) srvtyperqst->prlist, &srvtyperqst->prlistlen); if(result) return result; /* parse the naming authority if present */ srvtyperqst->namingauthlen = AsUINT16(buffer->curpos); buffer->curpos += 2; if(!srvtyperqst->namingauthlen || srvtyperqst->namingauthlen == 0xffff) { srvtyperqst->namingauth = 0; } else { if(srvtyperqst->namingauthlen > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } srvtyperqst->namingauth = buffer->curpos; buffer->curpos += srvtyperqst->namingauthlen; result = SLPv1AsUTF8(header->encoding, (char *) srvtyperqst->namingauth, &srvtyperqst->namingauthlen); if(result) return result; } /* parse the scope list */ if(buffer->end - buffer->curpos < 2) { return SLP_ERROR_PARSE_ERROR; } srvtyperqst->scopelistlen = AsUINT16(buffer->curpos); buffer->curpos += 2; if(srvtyperqst->scopelistlen > buffer->end - buffer->curpos) { return SLP_ERROR_PARSE_ERROR; } if(srvtyperqst->scopelistlen) { srvtyperqst->scopelist = buffer->curpos; buffer->curpos += srvtyperqst->scopelistlen; result = SLPv1AsUTF8(header->encoding, (char *) srvtyperqst->scopelist, &srvtyperqst->scopelistlen); if(result) return result; } else { srvtyperqst->scopelist = "default"; srvtyperqst->scopelistlen = 7; } return 0; } /*=========================================================================*/ int SLPv1MessageParseBuffer(struct sockaddr_in* peerinfo, SLPBuffer buffer, SLPMessage message) /* Initializes a SLPv1 message descriptor by parsing the specified buffer. */ /* */ /* peerinfo - (IN pointer to information about where buffer came from */ /* */ /* buffer - (IN) pointer the SLPBuffer to parse */ /* */ /* message - (OUT) set to describe the message from the buffer */ /* */ /* Returns - Zero on success, SLP_ERROR_PARSE_ERROR, or */ /* SLP_ERROR_INTERNAL_ERROR if out of memory. SLPMessage is */ /* invalid return is not successful. */ /* */ /* WARNING - If successful, pointers in the SLPMessage reference memory in*/ /* the parsed SLPBuffer. If SLPBufferFree() is called then the */ /* pointers in SLPMessage will be invalidated. */ /*=========================================================================*/ { int result; /* Copy in the peer info */ memcpy(&message->peer,peerinfo,sizeof(message->peer)); /* Get ready to parse */ SLPMessageFreeInternals(message); buffer->curpos = buffer->start; /* parse the header first */ result = SLPv1MessageParseHeader(buffer,&(message->header)); if(result == 0) { /* switch on the function id to parse the body */ switch(message->header.functionid) { case SLP_FUNCT_SRVRQST: result = v1ParseSrvRqst(buffer, &(message->header), &(message->body.srvrqst)); break; case SLP_FUNCT_SRVREG: result = v1ParseSrvReg(buffer, &(message->header), &(message->body.srvreg)); break; case SLP_FUNCT_SRVDEREG: result = v1ParseSrvDeReg(buffer, &(message->header), &(message->body.srvdereg)); break; case SLP_FUNCT_ATTRRQST: result = v1ParseAttrRqst(buffer, &(message->header), &(message->body.attrrqst)); break; case SLP_FUNCT_DAADVERT: /* We are a SLPv2 DA, drop advertisements from other v1 DAs (including ourselves). The message will be ignored by SLPDv1ProcessMessage(). */ result = 0; break; case SLP_FUNCT_SRVTYPERQST: result = v1ParseSrvTypeRqst(buffer, &(message->header), &(message->body.srvtyperqst)); break; default: result = SLP_ERROR_MESSAGE_NOT_SUPPORTED; } } return result; } openslp-1.2.1/common/slp_xcast.h0000644033442200000310000001570210202047412016516 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_xcast.h */ /* */ /* Abstract: Functions used to multicast and broadcast SLP messages */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLP_XCAST_H_INCLUDED #define SLP_XCAST_H_INCLUDED #include "slp_iface.h" #include "slp_buffer.h" typedef struct _SLPXcastSockets { int sock_count; int sock[SLP_MAX_IFACES]; struct sockaddr_in peeraddr[SLP_MAX_IFACES]; }SLPXcastSockets; /*========================================================================*/ int SLPBroadcastSend(const SLPIfaceInfo* ifaceinfo, SLPBuffer msg, SLPXcastSockets* socks); /* Description: * Broadcast a message. * * Parameters: * ifaceinfo (IN) Pointer to the SLPIfaceInfo structure that contains * information about the interfaces to send on * msg (IN) Buffer to send * * socks (OUT) Sockets used broadcast multicast. May be used to * recv() responses. MUST be close by caller using * SLPXcastSocketsClose() * * Returns: * Zero on sucess. Non-zero with errno set on error *========================================================================*/ /*========================================================================*/ int SLPMulticastSend(const SLPIfaceInfo* ifaceinfo, SLPBuffer msg, SLPXcastSockets* socks); /* Description: * Multicast a message. * * Parameters: * ifaceinfo (IN) Pointer to the SLPIfaceInfo structure that contains * information about the interfaces to send on * msg (IN) Buffer to send * * socks (OUT) Sockets used to multicast. May be used to recv() * responses. MUST be close by caller using * SLPXcastSocketsClose() * * Returns: * Zero on sucess. Non-zero with errno set on error *========================================================================*/ /*=========================================================================*/ int SLPXcastRecvMessage(const SLPXcastSockets* sockets, SLPBuffer* buf, struct sockaddr_in* peeraddr, struct timeval* timeout); /* Description: * Receives datagram messages from one of the sockets in the specified * SLPXcastsSockets structure * * Parameters: * sockets (IN) Pointer to the SOPXcastSockets structure that describes * which sockets to read messages from. * buf (OUT) Pointer to SLPBuffer that will contain the message upon * successful return. * peeraddr (OUT) Pointer to struc sockaddr_in that will contain the * address of the peer that sent the received message. * timeout (IN/OUT) pointer to the struct timeval that indicates how much * time to wait for a message to arrive * * Returns: * Zero on success, errno on failure. *========================================================================*/ /*========================================================================*/ int SLPXcastSocketsClose(SLPXcastSockets* socks); /* Description: * Closes sockets that were opened by calls to SLPMulticastSend() and * SLPBroadcastSend() * * Parameters: * socks (IN) Pointer to the SLPXcastSockets structure being close * * Returns: * Zero on sucess. Non-zero with errno set on error *========================================================================*/ #endif openslp-1.2.1/common/slp_pid.c0000644033442200000310000001213510202047412016140 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_pid.c */ /* */ /* Abstract: Common code to obtain process identifier information */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slp_pid.h" #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include #else #include #include #include #include #endif /*=========================================================================*/ uint32_t SLPPidGet() /* Description: * Get a process 32 bit integer identifier for the current process * loopback interface * * Parameters: * * Returns: * 32 bit integer identifier for the current process *=========================================================================*/ { #ifdef _WIN32 return GetCurrentProcessId(); #else return getpid(); #endif } /*=========================================================================*/ int SLPPidExists(uint32_t pid) /* Description: * (quickly) determine whether or not the process with the specified * identifier exists (is alive) * * Parameters: * pid (IN) 32 bit integer identifier for the process to check for * * Returns: * Boolean value. Zero if process does not exist, non-zero if it does *=========================================================================*/ { #ifndef _WIN32 if(kill(pid,0)) { if(errno == ESRCH) { /* pid does not exist */ return 0; } } #else HANDLE h; if (!(h = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, (DWORD)pid))) { /* pid does not exist - or we have so few rights we shouldn't be running! */ return 0; } CloseHandle(h); #endif return 1; } openslp-1.2.1/common/slp_property.h0000644033442200000310000001712110202047412017255 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_property.h */ /* */ /* Abstract: Internal declarations for SLP properties */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #if(!defined SLP_PROPERTY_H_INCLUDED) #define SLP_PROPERTY_H_INCLUDED #include "slp_linkedlist.h" extern SLPList G_SLPPropertyList; /*=========================================================================*/ typedef struct _SLPProperty /*=========================================================================*/ { SLPListItem listitem; char* propertyName; char* propertyValue; }SLPProperty; /*=========================================================================*/ const char* SLPPropertyGet(const char* pcName); /* */ /* Returns the value of the corresponding SLP property name. The returned */ /* string is owned by the library and MUST NOT be freed. */ /* */ /* pcName Null terminated string with the property name, from */ /* Section 2.1 of RFC 2614. */ /* */ /* Returns: If no error, returns a pointer to a character buffer containing*/ /* the property value. If the property was not set, returns the */ /* default value. If an error occurs, returns NULL. The returned */ /* string MUST NOT be freed. */ /*=========================================================================*/ /*=========================================================================*/ int SLPPropertySet(const char *pcName, const char *pcValue); /* */ /* Sets the value of the SLP property to the new value. The pcValue */ /* parameter should be the property value as a string. */ /* */ /* pcName Null terminated string with the property name, from Section 2.1*/ /* of RFC 2614. */ /* */ /* pcValue Null terminated string with the property value, in UTF-8 */ /* character encoding. */ /*=========================================================================*/ /*=========================================================================*/ int SLPPropertyReadFile(const char* conffile); /* Reads and sets properties from the specified configuration file */ /* */ /* conffile (IN) the path of the config file to read. */ /* */ /* Returns - zero on success. non-zero on error. Properties will be set*/ /* to default on error. */ /*=========================================================================*/ /*=========================================================================*/ int SLPPropertyAsBoolean(const char* property); /*=========================================================================*/ /*=========================================================================*/ int SLPPropertyAsInteger(const char* property); /*=========================================================================*/ /*=========================================================================*/ int SLPPropertyAsIntegerVector(const char* property, int* vector, int vectorsize); /*=========================================================================*/ /*=========================================================================*/ void SLPPropertyFreeAll(); /*=========================================================================*/ #endif openslp-1.2.1/common/slp_iface.h0000644033442200000310000001513010204452352016443 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_iface.h */ /* */ /* Abstract: Common code to obtain network interface information */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLP_IFACE_H_INCLUDED #define SLP_IFACE_H_INCLUDED #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef _WIN32 # define WIN32_LEAN_AND_MEAN # include # include #endif #define SLP_MAX_IFACES 10 /*=========================================================================*/ typedef struct _SLPInterfaceInfo /*=========================================================================*/ { int iface_count; struct sockaddr_in iface_addr[SLP_MAX_IFACES]; struct sockaddr_in bcast_addr[SLP_MAX_IFACES]; }SLPIfaceInfo; /*=========================================================================*/ int SLPIfaceGetInfo(const char* useifaces, SLPIfaceInfo* ifaces); /* Description: * Get the network interface addresses for this host. Exclude the * loopback interface * * Parameters: * useifaces (IN) Pointer to comma delimited string of interface IPv4 * addresses to get interface information for. Pass * NULL or empty string to get all interfaces (except * loopback) * ifaceinfo (OUT) Information about requested interfaces. * * Returns: * zero on success, non-zero (with errno set) on error. *=========================================================================*/ /*=========================================================================*/ int SLPIfaceSockaddrsToString(const struct sockaddr_in* addrs, int addrcount, char** addrstr); /* Description: * Get the comma delimited string of addresses from an array of sockaddrs * * Parameters: * addrs (IN) Pointer to array of sockaddrs to convert * addrcount (IN) Number of sockaddrs in addrs. * addrstr (OUT) pointer to receive xmalloc() allocated address string. * Caller must xfree() addrstr when no longer needed. * * Returns: * zero on success, non-zero (with errno set) on error. *=========================================================================*/ /*=========================================================================*/ int SLPIfaceStringToSockaddrs(const char* addrstr, struct sockaddr_in* addrs, int* addrcount); /* Description: * Fill an array of struct sockaddrs from the comma delimited string of * addresses. * * Parameters: * addrstr (IN) Address string to convert. * addrcount (OUT) sockaddr array to fill. * addrcount (INOUT) The number of sockaddr stuctures in the addr array * on successful return will contain the number of * sockaddrs that were filled in the addr array * * Returns: * zero on success, non-zero (with errno set) on error. *=========================================================================*/ #endif openslp-1.2.1/common/slp_xid.c0000644033442200000310000001230410202047412016146 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slplib_xid.c */ /* */ /* Abstract: Internal implementation for generating unique XIDs. */ /* Provides functions that are supposed to generate 16-bit */ /* values that won't be generated for a long time in this */ /* process and hopefully won't be generated by other process */ /* for a long time. */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include #include #else #include #include #endif #include "slp_xid.h" #include "slp_pid.h" /*=========================================================================*/ int G_Xid = 0; /* Global variable that is incremented before SLPGenerateXid() returns */ /*=========================================================================*/ /*=========================================================================*/ void SLPXidSeed() /* Seeds the XID generator. Should only be called 1 time per process! */ /* currently called when the first handle is opened. */ /*=========================================================================*/ { /* Generate a random start*/ #ifdef _WIN32 srand(SLPPidGet() | G_Xid); G_Xid = (unsigned short)rand(); #else srandom(SLPPidGet() | G_Xid); G_Xid = (unsigned short)random(); #endif } /*=========================================================================*/ unsigned short SLPXidGenerate() /* */ /* Returns: A 16-bit value */ /*=========================================================================*/ { G_Xid++; return G_Xid; } openslp-1.2.1/common/slp_compare.c0000644033442200000310000005406310204453217017026 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_string.c */ /* */ /* Abstract: Various functions that deal with SLP strings and */ /* string-lists */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include #include #include "slp_compare.h" #ifndef _WIN32 # ifndef HAVE_STRNCASECMP int strncasecmp(const char *s1, const char *s2, size_t len) { while ( *s1 && (*s1 == *s2 || tolower(*s1) == tolower(*s2)) ) { len--; if(len == 0) return 0; s1++; s2++; } return(int) *(unsigned char *)s1 - (int) *(unsigned char *)s2; } # endif # ifndef HAVE_STRCASECMP int strcasecmp(const char *s1, const char *s2) { while ( *s1 && (*s1 == *s2 || tolower(*s1) == tolower(*s2)) ) { s1++; s2++; } return(int) *(unsigned char *)s1 - (int) *(unsigned char *)s2; } # endif #endif /*=========================================================================*/ int SLPCompareString(int str1len, const char* str1, int str2len, const char* str2) /* Does a lexical string compare as described in RFC 2608 section 6.4. */ /* */ /* TODO: Handle the whole utf8 spec */ /* */ /* str1 - pointer to string to be compared */ /* */ /* str1len - length of str1 in bytes */ /* */ /* str2 - pointer to string to be compared */ /* */ /* str2len - length of str2 in bytes */ /* */ /* Returns - zero if strings are equal. >0 if str1 is greater than str2 */ /* <0 if s1 is less than str2 */ /*=========================================================================*/ { /* TODO: fold whitespace and handle escapes*/ if(str1len == str2len) { if (str1len <= 0) return(0); return strncasecmp(str1,str2,str1len); } else if(str1len > str2len) { return -1; } return 1; } /*=========================================================================*/ int SLPCompareNamingAuth(int srvtypelen, const char* srvtype, int namingauthlen, const char* namingauth) /* Does srvtype match namingauth */ /* */ /* TODO: Handle the whole utf8 spec */ /* */ /* srvtype - pointer to service type to be compared */ /* */ /* srvtypelen - length of srvtype in bytes */ /* */ /* namingauth - pointer to naming authority to be matched */ /* */ /* namingauthlen - length of naming authority in bytes */ /* */ /* Returns - zero if srvtype matches the naming authority. Nonzero if */ /* it doesn't */ /*=========================================================================*/ { const char *dot; if(namingauthlen == 0xffff) /* match all naming authorities */ return 0; /* Skip "service:" */ if ((srvtypelen > 8) && (strncasecmp(srvtype,"service:",8) == 0)) { srvtypelen -= 8; srvtype += 8; } /* stop search at colon after naming authority (if there is one) */ dot = memchr(srvtype,':',srvtypelen); if (dot) srvtypelen = dot - srvtype; dot = memchr(srvtype,'.',srvtypelen); if(!namingauthlen) /* IANA naming authority */ return dot ? 1 : 0; if (dot) { int srvtypenalen = srvtypelen - (dot + 1 - srvtype); if(srvtypenalen != namingauthlen) return 1; if(strncasecmp(dot + 1, namingauth, namingauthlen) == 0) return 0; } return 1; } /*=========================================================================*/ int SLPCompareSrvType(int lsrvtypelen, const char* lsrvtype, int rsrvtypelen, const char* rsrvtype) /* Does lsrvtype = rsrvtype? */ /* */ /* TODO: Handle the whole utf8 spec */ /* */ /* lsrvtype - pointer to string to be compared */ /* */ /* lsrvtypelen - length of str1 in bytes */ /* */ /* rsrvtype - pointer to string to be compared */ /* */ /* rsrvtypelen - length of str2 in bytes */ /* */ /* Returns - zero if srvtypes are equal. Nonzero if they are not */ /*=========================================================================*/ { char* colon; /* Skip "service:" */ if(strncasecmp(lsrvtype,"service:",lsrvtypelen > 8 ? 8 : lsrvtypelen) == 0) { lsrvtypelen = lsrvtypelen - 8; lsrvtype = lsrvtype + 8; } if(strncasecmp(rsrvtype,"service:",rsrvtypelen > 8 ? 8 : rsrvtypelen) == 0) { rsrvtypelen = rsrvtypelen - 8; rsrvtype = rsrvtype + 8; } if(memchr(lsrvtype,':',lsrvtypelen)) { /* lsrvtype is uses concrete type so strings must be identical */ if(lsrvtypelen == rsrvtypelen) { return strncasecmp(lsrvtype,rsrvtype,lsrvtypelen); } return 1; } colon = memchr(rsrvtype,':',rsrvtypelen); if(colon) { /* lsrvtype is abstract only and rsrvtype is concrete */ if(lsrvtypelen == (colon - rsrvtype)) { return strncasecmp(lsrvtype,rsrvtype,lsrvtypelen); } return 1; } /* lsrvtype and rsrvtype are abstract only */ if(lsrvtypelen == rsrvtypelen) { return strncasecmp(lsrvtype,rsrvtype,lsrvtypelen); } return 1; } /*=========================================================================*/ int SLPContainsStringList(int listlen, const char* list, int stringlen, const char* string) /* Checks a string-list for the occurence of a string */ /* */ /* list - pointer to the string-list to be checked */ /* */ /* listlen - length in bytes of the list to be checked */ /* */ /* string - pointer to a string to find in the string-list */ /* */ /* stringlen - the length of the string in bytes */ /* */ /* Returns - zero if string is NOT contained in the list. non-zero if it*/ /* is. */ /*=========================================================================*/ { char* listend = (char*)list + listlen; char* itembegin = (char*)list; char* itemend = itembegin; while(itemend < listend) { itembegin = itemend; /* seek to the end of the next list item */ while(1) { if(itemend == listend || *itemend == ',') { if(*(itemend - 1) != '\\') { break; } } itemend ++; } if(SLPCompareString(itemend - itembegin, itembegin, stringlen, string) == 0) { return 1; } itemend ++; } return 0; } /*=========================================================================*/ int SLPIntersectStringList(int list1len, const char* list1, int list2len, const char* list2) /* Calculates the number of common entries between two string-lists */ /* */ /* list1 - pointer to the string-list to be checked */ /* */ /* list1len - length in bytes of the list to be checked */ /* */ /* list2 - pointer to the string-list to be checked */ /* */ /* list2len - length in bytes of the list to be checked */ /* */ /* Returns - The number of common entries. */ /*=========================================================================*/ { int result = 0; char* listend = (char*)list1 + list1len; char* itembegin = (char*)list1; char* itemend = itembegin; while(itemend < listend) { itembegin = itemend; /* seek to the end of the next list item */ while(1) { if(itemend == listend || *itemend == ',') { if(*(itemend - 1) != '\\') { break; } } itemend ++; } if(SLPContainsStringList(list2len, list2, itemend - itembegin, itembegin)) { result ++; } itemend ++; } return result; } /*=========================================================================*/ int SLPUnionStringList(int list1len, const char* list1, int list2len, const char* list2, int* unionlistlen, char * unionlist) /* Generate a string list that is a union of two string lists */ /* */ /* list1len - length in bytes of list1 */ /* */ /* list1 - pointer to a string-list */ /* */ /* list2len - length in bytes of list2 */ /* */ /* list2 - pointer to a string-list */ /* */ /* unionlistlen - pointer to the size in bytes of the unionlist buffer. */ /* also receives the size in bytes of the unionlist buffer */ /* on successful return. */ /* */ /* unionlist - pointer to the buffer that will receive the union list. */ /* */ /* */ /* Returns - Length of the resulting union list or negative if */ /* unionlist is not big enough. If negative is returned */ /* *unionlist will be changed indicate the size of unionlist */ /* buffer needed */ /* */ /* Important: In order ensure that unionlist does not contain any */ /* duplicates, at least list1 must not have any duplicates. */ /* Also, for speed optimization if list1 and list2 are both */ /* with out duplicates, the larger list should be passed in */ /* as list1. */ /* */ /* Note: A good size for unionlist (so that non-zero will never be */ /* returned) is list1len + list2len + 1 */ /*=========================================================================*/ { char* listend = (char*)list2 + list2len; char* itembegin = (char*)list2; char* itemend = itembegin; int itemlen; int copiedlen; if(unionlist == 0 || *unionlistlen == 0 || *unionlistlen < list1len) { *unionlistlen = list1len + list2len + 1; return -1; } /* Copy list1 into the unionlist since it should not have any duplicates */ memcpy(unionlist,list1,list1len); copiedlen = list1len; while(itemend < listend) { itembegin = itemend; /* seek to the end of the next list item */ while(1) { if(itemend == listend || *itemend == ',') { if(*(itemend - 1) != '\\') { break; } } itemend ++; } itemlen = itemend - itembegin; if(SLPContainsStringList(list1len, list1, itemlen, itembegin) == 0) { if(copiedlen + itemlen + 1 > *unionlistlen) { *unionlistlen = list1len + list2len + 1; return -1; } /* append a comma if not the first entry*/ if(copiedlen) { unionlist[copiedlen] = ','; copiedlen++; } memcpy(unionlist + copiedlen, itembegin, itemlen); copiedlen += itemlen; } itemend ++; } *unionlistlen = copiedlen; return copiedlen; } /*=========================================================================*/ int SLPSubsetStringList(int listlen, const char* list, int sublistlen, const char* sublist) /* Test if sublist is a set of list */ /* */ /* list - pointer to the string-list to be checked */ /* */ /* listlen - length in bytes of the list to be checked */ /* */ /* sublistlistlen - pointer to the string-list to be checked */ /* */ /* sublist - length in bytes of the list to be checked */ /* */ /* Returns - non-zero is sublist is a subset of list. Zero otherwise */ /*=========================================================================*/ { /* count the items in sublist */ int curpos; int sublistcount; if(sublistlen ==0 || listlen == 0) { return 0; } curpos = 0; sublistcount = 1; while(curpos < sublistlen) { if(sublist[curpos] == ',') { sublistcount ++; } curpos ++; } if(SLPIntersectStringList(listlen, list, sublistlen, sublist) == sublistcount) { return sublistcount; } return 0; } /*=========================================================================*/ int SLPCheckServiceUrlSyntax(const char* srvurl, int srvurllen) /* Test if a service url conforms to accepted syntax * * srvurl - (IN) service url string to check * * srvurllen - (IN) length of srvurl in bytes * * Returns - zero if srvurl has acceptable syntax, non-zero on failure * *=========================================================================*/ { /* TODO: Do we actually need to do something here to ensure correct * service-url syntax, or should we expect that it will be used * by smart developers who know that ambiguities could be encountered * if they don't? if(srvurllen < 8) { return 1; } if(strncasecmp(srvurl,"service:",8)) { return 1; } return 0; */ return 0; } /*=========================================================================*/ int SLPCheckAttributeListSyntax(const char* attrlist, int attrlistlen) /* Test if a service url conforms to accepted syntax * * attrlist - (IN) attribute list string to check * * attrlistlen - (IN) length of attrlist in bytes * * Returns - zero if srvurl has acceptable syntax, non-zero on failure * *=========================================================================*/ { const char* slider; const char* end; if(attrlistlen) { slider = attrlist; end = attrlist + attrlistlen; while(slider != end) { if(*slider == '(') { while(slider != end) { if(*slider == '=') { return 0; } slider++; } return 1; } slider++; } } return 0; } openslp-1.2.1/common/slp_auth.h0000644033442200000310000003543610202047412016343 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_auth.h */ /* */ /* Abstract: Common for OpenSLP's SLPv2 authentication implementation */ /* Currently only bsd 0x0002 (DSA-SHA1) is supported */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLP_AUTH_H_INCLUDED #define SLP_AUTH_H_INCLUDED #include "slp_message.h" #include "slp_spi.h" #define SLPAUTH_SHA1_DIGEST_SIZE 20 /*=========================================================================*/ int SLPAuthVerifyString(SLPSpiHandle hspi, int emptyisfail, unsigned short stringlen, const char* string, int authcount, const SLPAuthBlock* autharray); /* Verify authenticity of the specified attribute list */ /* */ /* Parameters: hspi (IN) open SPI handle */ /* emptyisfail (IN) if non-zero, messages without authblocks */ /* will fail */ /* stringlen (IN) the length of string to verify */ /* string (IN) the list to verify */ /* authcount (IN) the number of blocks in autharray */ /* autharray (IN) array of authblocks */ /* */ /* Returns: 0 on success or SLP_ERROR_xxx code on failure */ /*=========================================================================*/ /*=========================================================================*/ int SLPAuthVerifyUrl(SLPSpiHandle hspi, int emptyisfail, const SLPUrlEntry* urlentry); /* Verify authenticity of the specified url entry */ /* */ /* Parameters: hspi (IN) open SPI handle */ /* emptyisfail (IN) if non-zero, messages without authblocks */ /* will fail */ /* urlentry (IN) the url entry to verify */ /* */ /* Returns: 0 on success or SLP_ERROR_xxx code on failure */ /*=========================================================================*/ /*=========================================================================*/ int SLPAuthVerifyDAAdvert(SLPSpiHandle hspi, int emptyisfail, const SLPDAAdvert* daadvert); /* Verify authenticity of the specified DAAdvert */ /* */ /* Parameters: hspi (IN) open SPI handle */ /* (IN) if non-zero, messages without authblocks */ /* will fail */ /* spistrlen (IN) length of the spi string */ /* sprstr (IN) the spi string */ /* daadvert (IN) the DAAdvert to verify */ /* */ /* Returns: 0 on success or SLP_ERROR_xxx code on failure */ /*=========================================================================*/ /*=========================================================================*/ int SLPAuthVerifySAAdvert(SLPSpiHandle hspi, int emptyisfail, const SLPSAAdvert* saadvert); /* Verify authenticity of the specified SAAdvert */ /* */ /* Parameters: hspi (IN) open SPI handle */ /* emptyisfail (IN) if non-zero, messages without authblocks */ /* will fail */ /* spistrlen (IN) length of the spi string */ /* sprstr (IN) the spi string */ /* saadvert (IN) the SAADVERT to verify */ /* */ /* Returns: 0 on success or SLP_ERROR_xxx code on failure */ /*=========================================================================*/ /*=========================================================================*/ int SLPAuthSignString(SLPSpiHandle hspi, int spistrlen, const char* spistr, unsigned short stringlen, const char* string, int* authblocklen, unsigned char** authblock); /* Generate an authblock signature for an attribute list */ /* */ /* Parameters: hspi (IN) open SPI handle */ /* spistrlen (IN) length of the SPI string */ /* spistr (IN) SPI to sign with */ /* attrlistlen (IN) the length of the URL to sign */ /* attrlist (IN) the url to sign */ /* authblocklen (OUT) the length of the authblock signature */ /* authblock (OUT) buffer containing authblock signature */ /* must be freed by the caller */ /* */ /* Returns: 0 on success or SLP_ERROR_xxx code on failure */ /*=========================================================================*/ /*=========================================================================*/ int SLPAuthSignUrl(SLPSpiHandle hspi, int spistrlen, const char* spistr, unsigned short urllen, const char* url, int* authblocklen, unsigned char** authblock); /* Generate an authblock signature for a Url */ /* */ /* Parameters: hspi (IN) open SPI handle */ /* spistrlen (IN) length of the SPI string */ /* spistr (IN) SPI to sign with */ /* urllen (IN) the length of the URL to sign */ /* url (IN) the url to sign */ /* authblocklen (OUT) the length of the authblock signature */ /* authblock (OUT) buffer containing authblock signature */ /* must be freed by the caller */ /* */ /* Returns: 0 on success or SLP_ERROR_xxx code on failure */ /*=========================================================================*/ /*=========================================================================*/ int SLPAuthSignDAAdvert(SLPSpiHandle hspi, unsigned short spistrlen, const char* spistr, unsigned long bootstamp, unsigned short urllen, const char* url, unsigned short attrlistlen, const char* attrlist, unsigned short scopelistlen, const char* scopelist, unsigned short daspistrlen, const char* daspistr, int* authblocklen, unsigned char** authblock); /* Generate an authblock signature for a DAADVERT */ /* */ /* Parameters: hspi (IN) open SPI handle */ /* spistrlen (IN) length of the spi string */ /* sprstr (IN) the spi string */ /* bootstamp (IN) the statless DA boot timestamp */ /* urllen (IN) the length of the URL to sign */ /* url (IN) the url to sign */ /* attrlistlen (IN) the length of the URL to sign */ /* attrlist (IN) the url to sign */ /* scopelistlen (IN) the length of the DA's scope list */ /* scopelist (IN) the DA's scope list */ /* daspistrlen (IN) the length of the list of DA's SPIs */ /* daspistr (IN) the list of the DA's SPI's */ /* authblocklen (OUT) the length of the authblock signature */ /* authblock (OUT) buffer containing authblock signature must */ /* be freed by the caller */ /* */ /* Returns: 0 on success or SLP_ERROR_xxx code on failure */ /*=========================================================================*/ /*=========================================================================*/ int SLPAuthSignSAAdvert(unsigned short spistrlen, const char* spistr, unsigned short urllen, const char* url, unsigned short attrlistlen, const char* attrlist, unsigned short scopelistlen, const char* scopelist, int* authblocklen, unsigned char** authblock); /* Generate an authblock signature for a SAADVERT */ /* */ /* Parameters: spistrlen (IN) length of the spi string */ /* sprstr (IN) the spi string */ /* urllen (IN) the length of the URL to sign */ /* url (IN) the url to sign */ /* attrlistlen (IN) the length of the URL to sign */ /* attrlist (IN) the url to sign */ /* scopelistlen (IN) the length of the DA's scope list */ /* scopelist (IN) the DA's scope list */ /* authblocklen (OUT) the length of the authblock signature */ /* authblock (OUT) buffer containing authblock signature must */ /* be freed by the caller */ /* */ /* Returns: 0 on success or SLP_ERROR_xxx code on failure */ /*=========================================================================*/ #endif openslp-1.2.1/common/slp_parse.c0000644033442200000310000002543710202047412016507 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_parse.c */ /* */ /* Abstract: Common string parsing functionality */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slp_parse.h" #include "slp_xmalloc.h" #include /*=========================================================================*/ int SLPParseSrvUrl(int srvurllen, const char* srvurl, SLPParsedSrvUrl** parsedurl) /* * Description: * Parses a service URL into its parts * * Parameters: * srvurllen (IN) size of srvurl in bytes * srvurl (IN) pointer to service URL to parse * parsedurl (OUT) pointer to SLPParsedSrvUrl pointer that will be * set to xmalloc()ed parsed url parts. Returned * pointer must be freed by caller with call to xfree() * * Returns: zero on success, errno on failure.. *=========================================================================*/ { char* empty; /* always points to an empty string */ char* buf; /* points to location in the SLPSrvUrl buffer */ char* slider1; /* points to parse locations in srvurl */ char* slider2; /* points to parse locations srvurl */ char* end; /* points at the end of srvurl */ /* Allocate memory and set up sliders */ *parsedurl = (SLPParsedSrvUrl*)xmalloc(srvurllen + sizeof(SLPParsedSrvUrl) + 5); /* +5 ensures space for 5 null terminations */ if(*parsedurl == 0) { return ENOMEM; } memset(*parsedurl,0,srvurllen + sizeof(SLPParsedSrvUrl) + 5); buf = ((char*)*parsedurl) + sizeof(SLPParsedSrvUrl); slider1 = slider2 = (char*)srvurl; end = slider1 + srvurllen; /* Set empty */ empty = buf; buf++; /* parse out the service type */ slider2 = (char*)strstr(slider2,":/"); if(slider2 == 0) { xfree(*parsedurl); *parsedurl = 0; return EINVAL; } memcpy(buf,slider1,slider2-slider1); (*parsedurl)->srvtype = buf; buf += (slider2 - slider1) + 1; /* parse out the host */ slider2 = slider1 = slider2 + 3; /* + 3 skips the "://" */ while(slider2 < end && *slider2 != '/' && *slider2 != ':') slider2++; if(slider2-slider1 < 1) { /* no host part (this is okay according to RFC2609) */ (*parsedurl)->host = empty; } else { memcpy(buf,slider1,slider2-slider1); (*parsedurl)->host = buf; buf += (slider2 - slider1) + 1; } /* parse out the port */ if(*slider2 == ':') { slider2 ++; /* + 1 skips the ":" */ slider1 = slider2; /* set up slider1 at the start of the port str */ while(*slider2 && (*slider2 != '/' && *slider2 != ';')) slider2++; if (slider2 - slider1 < 1) { /* FIXME: no port, default to 80? */ (*parsedurl)->port = 80; } else { memcpy(buf,slider1,slider2-slider1); (*parsedurl)->port = atoi(buf); buf += (slider2-slider1) + 1; } } /* parse out the remainder of the url */ if(slider2 < end) { slider1 = slider2; memcpy(buf,slider1,end-slider1); (*parsedurl)->remainder = buf; buf += (end - slider2) + 1; } else { /* no remainder portion */ (*parsedurl)->remainder = empty; } /* set the net family to always be an empty string for IP */ (*parsedurl)->family = empty; return 0; } /*=========================================================================== * TESTING CODE enabled by removing #define comment and compiling with the * following command line: * * $ gcc -g -DSLP_PARSE_TEST -DDEBUG slp_parse.c slp_xmalloc.c slp_linkedlist.c *==========================================================================*/ #ifdef SLP_PARSE_TEST #define TESTSRVTYPE1 "service:printer.x" #define TESTHOST1 "192.168.100.2" #define TESTPORT1 "4563" #define TESTREMAINDER1 "/hello/good/world" #define TESTURL1 TESTSRVTYPE1"://"TESTHOST1":"TESTPORT1 TESTREMAINDER1 #define TESTURL2 TESTSRVTYPE1"://"TESTHOST1":"TESTPORT1 #define TESTURL3 TESTSRVTYPE1"://"TESTHOST1 #define TESTURL4 "service:badurl" int main(int argc, char* argv[]) { SLPParsedSrvUrl* parsedurl; printf("Testing srvurl: %s\n",TESTURL1); if(SLPParseSrvUrl(strlen(TESTURL1), TESTURL1, &parsedurl) != 0) { printf("FAILURE: SLPParseSrvUrl returned error\n"); return -1; } if(strcmp(parsedurl->srvtype,TESTSRVTYPE1)) { printf("FAILURE: wrong srvtype\n"); } else if(strcmp(parsedurl->host,TESTHOST1)) { printf("FAILURE: wrong host\n"); } else if(parsedurl->port != atoi(TESTPORT1)) { printf("FAILURE: wrong port\n"); } else if(strcmp(parsedurl->remainder,TESTREMAINDER1)) { printf("FAILURE: wrong remainder\n"); } else if(*(parsedurl->family)) { printf("FAILURE: wrong family\n"); } else { printf("Success!\n"); } if(parsedurl) xfree(parsedurl); /* TESTURL2 */ printf("Testing srvurl: %s\n",TESTURL2); if(SLPParseSrvUrl(strlen(TESTURL2), TESTURL2, &parsedurl) != 0) { printf("FAILURE: SLPParseSrvUrl returned error\n"); return -1; } if(strcmp(parsedurl->srvtype,TESTSRVTYPE1)) { printf("FAILURE: wrong srvtype\n"); } else if(strcmp(parsedurl->host,TESTHOST1)) { printf("FAILURE: wrong host\n"); } else if(parsedurl->port != atoi(TESTPORT1)) { printf("FAILURE: wrong port\n"); } /* else if(strcmp(parsedurl->remainder,TESTREMAINDER1)) { printf("FAILURE: wrong remainder\n"); } */ else if(*(parsedurl->family)) { printf("FAILURE: wrong family\n"); } else { printf("Success!\n"); } if(parsedurl) xfree(parsedurl); /* TESTURL3 */ printf("Testing srvurl: %s\n",TESTURL3); if(SLPParseSrvUrl(strlen(TESTURL3), TESTURL3, &parsedurl) != 0) { printf("FAILURE: SLPParseSrvUrl returned error\n"); return -1; } if(strcmp(parsedurl->srvtype,TESTSRVTYPE1)) { printf("FAILURE: wrong srvtype\n"); } else if(strcmp(parsedurl->host,TESTHOST1)) { printf("FAILURE: wrong host\n"); } /* else if(parsedurl->port != atoi(TESTPORT1)) { printf("FAILURE: wrong port\n"); } else if(strcmp(parsedurl->remainder,TESTREMAINDER1)) { printf("FAILURE: wrong remainder\n"); } */ else if(*(parsedurl->family)) { printf("FAILURE: wrong family\n"); } else { printf("Success!\n"); } if(parsedurl) xfree(parsedurl); /* TESTURL4 */ printf("Testing srvurl: %s\n",TESTURL4); if(SLPParseSrvUrl(strlen(TESTURL4), TESTURL4, &parsedurl) == 0) { printf("FAILURE: SLPParseSrvUrl should have returned an error\n"); } else { printf("Success!\n"); } if(parsedurl) xfree(parsedurl); return 0; } #endif openslp-1.2.1/common/slp_xmalloc.h0000644033442200000310000001455310207404657017053 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_xmalloc.h */ /* */ /* Abstract: Debug memory allocator */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLP_XMALLOC_H_INCLUDED #define SLP_XMALLOC_H_INCLUDED #include #ifdef _WIN32 #include #endif #include #include #ifdef DEBUG #include "slp_linkedlist.h" /* needed for snprintf to work */ #define snprintf _snprintf #define SLPXMALLOC_MAX_WHERE_LEN 256 #define SLPXMALLOC_MAX_BUF_LOG_LEN 32 /*=========================================================================*/ extern SLPList G_xmalloc_list; /*=========================================================================*/ /*=========================================================================*/ typedef struct xallocation /*=========================================================================*/ { SLPListItem listitem; char where[SLPXMALLOC_MAX_WHERE_LEN]; void* buf; size_t size; }xallocation_t; /*=========================================================================*/ void* _xmalloc(const char* file, int line, size_t size); /*=========================================================================*/ /*=========================================================================*/ void* _xrealloc(const char* file, int line, void* buf, size_t size); /*=========================================================================*/ /*=========================================================================*/ void _xfree(const char* file, int line, void* buf); /*=========================================================================*/ /*=========================================================================*/ char* _xstrdup(const char* file, int line, const char* str); /*=========================================================================*/ /*=========================================================================*/ int xmalloc_init(const char* filename, size_t freemem); /*=========================================================================*/ /*=========================================================================*/ int xmalloc_report(); /*=========================================================================*/ /*=========================================================================*/ void xmalloc_deinit(); /*=========================================================================*/ #define xmalloc(x) _xmalloc(__FILE__,__LINE__,(x)) #define xrealloc(x,y) _xrealloc(__FILE__,__LINE__,(x),(y)) #define xfree(x) _xfree(__FILE__,__LINE__,(x)) #define xstrdup(x) _xstrdup(__FILE__,__LINE__,(x)) #else #define xmalloc(x) malloc((x)) #define xrealloc(x,y) realloc((x),(y)) #define xfree(x) free((x)) #define xstrdup(x) strdup((x)) #endif #endif openslp-1.2.1/common/slp_database.c0000644033442200000310000003300210202047412017124 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_database.c */ /* */ /* Abstract: An SLP message database. The SLP message database holds */ /* actual SLP "wire" message buffers as well as structures */ /* that interpret the message buffer. The database exposes */ /* an interface suitable linked-list based implementation */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slp_database.h" #include "slp_xmalloc.h" /*=========================================================================*/ int SLPDatabaseInit(SLPDatabase* database) /* Initialize a SLPDatabase. */ /* */ /* Parameters: database (IN) pointer to the database to initialize */ /* */ /* */ /* Returns: zero on success. Non-zero on error */ /*=========================================================================*/ { if(database && database->head) { SLPDatabaseDeinit(database); } return 0; } /*=========================================================================*/ void SLPDatabaseDeinit(SLPDatabase* database) /* Deinitialze a SLPDatabase */ /* */ /* Parameters: database (IN) pointer to the database to de-initialize */ /* */ /* Returns: none */ /*=========================================================================*/ { while(database->count) { SLPDatabaseEntryDestroy((SLPDatabaseEntry*)SLPListUnlink(database,database->head)); } memset(database,0,sizeof(SLPDatabase)); } /*=========================================================================*/ SLPDatabaseEntry* SLPDatabaseEntryCreate(SLPMessage msg, SLPBuffer buf) /* Create a SLPDatabaseEntry. */ /* */ /* Parameters: msg (IN) The interpreting message structure for buf */ /* buf (IN) The SLP message buffer */ /* */ /* Returns: Pointer to a new SLPDatabaseEntry. NULL if out of memory */ /* */ /* Note: VERY IMPORTANT. The msg and especially the buf are owned by the */ /* returned SLPDatabaseEntry and MUST NOT be freed by the caller */ /* via SLPMessageFree() or SLPBufferFree()! Instead, the caller */ /* should use SLPDatabaseEntryDestroy() only to free memory */ /*=========================================================================*/ { SLPDatabaseEntry* result; result = (SLPDatabaseEntry*)xmalloc(sizeof(SLPDatabaseEntry)); if(result) { result->msg = msg; result->buf = buf; } return result; } /*=========================================================================*/ void SLPDatabaseEntryDestroy(SLPDatabaseEntry* entry) /* Free resources associated with the specified entry */ /* */ /* Parameters: entry (IN) pointer to the entry to destroy */ /* */ /* Returns: none */ /*=========================================================================*/ { SLPMessageFree(entry->msg); SLPBufferFree(entry->buf); xfree(entry); } /*=========================================================================*/ SLPDatabaseHandle SLPDatabaseOpen(SLPDatabase* database) /* Open a handle that is used with subsequent calls to SLPDatabaseEnum(), */ /* SLPDatabaseAdd() and SLPDatabaseRemove() */ /* */ /* Parameters (IN) pointer an initialized SLPDatabase */ /* */ /* Returns: Valid handle. NULL on error. */ /* */ /* Note: It is important to make sure that handles returned by this */ /* function are used and closed as quickly as possible. Future */ /* may use handles to ensure syncronized access to the database */ /* in threaded environments */ /*=========================================================================*/ { SLPDatabaseHandle result; result = (SLPDatabaseHandle) xmalloc(sizeof(struct _SLPDatabaseHandle)); if(result) { result->database = database; result->current = (SLPDatabaseEntry*)database->head; } return result; } /*=========================================================================*/ SLPDatabaseEntry* SLPDatabaseEnum(SLPDatabaseHandle dh) /* Used to enumerate through entries of a SLPDatabase */ /* */ /* Parameters: dh (IN) A handle obtained via SLPDatabaseOpen() */ /* */ /* Returns: Pointer to a SLPDatabase entry or NULL if end of enumeration */ /* has been reached. */ /*=========================================================================*/ { SLPDatabaseEntry* result; result = dh->current; if(result) { dh->current = (SLPDatabaseEntry*)((SLPListItem*)(dh->current))->next; } return result; } /*=========================================================================*/ void SLPDatabaseRewind(SLPDatabaseHandle dh) /* Reset handle so SLPDatabaseEnum starts at the beginning again */ /* */ /* Parameters: eh (IN) A handle obtained via SLPDatabaseOpen() */ /* */ /* Returns: None */ /*=========================================================================*/ { dh->current = (SLPDatabaseEntry*) dh->database->head; } /*=========================================================================*/ void SLPDatabaseClose(SLPDatabaseHandle dh) /* Closes a handle obtained from SLPDatabaseOpen() */ /* */ /* Parameters: dh (IN) a handle obtained from SLPDatabaseOpenEnum() */ /* */ /* Returns: None */ /*=========================================================================*/ { xfree(dh); dh = 0; } /*=========================================================================*/ void SLPDatabaseRemove(SLPDatabaseHandle dh, SLPDatabaseEntry* entry) /* Removes the specified entry */ /* */ /* Parameters: dh (IN) The SLPDatabaseEnumHandle used to obtain */ /* the entry in the first place */ /* entry (IN) The entry to remove */ /* */ /* Returns: None */ /* */ /* Note: During removal SLPDatabaseEntryDestroy() is called on entry. */ /* This means that you MUST NOT use entry after it is removed */ /*=========================================================================*/ { SLPDatabaseEntryDestroy((SLPDatabaseEntry*)(SLPListUnlink(dh->database,(SLPListItem*)entry))); } /*=========================================================================*/ void SLPDatabaseAdd(SLPDatabaseHandle dh, SLPDatabaseEntry* entry) /* Add the specified entry */ /* */ /* Parameters: dh (IN) handle obtained from SLPDatabseOpen() */ /* entry (IN) the entry to add */ /* */ /* Return: None */ /* */ /* Note: DO NOT call SLPDatabaseEntryDestroy() on an entry that has been */ /* added to the database. Instead call SLPDatabaseDeinit() or */ /* SLPDatabaseRemove() to free resources associated with an added */ /* entry */ /*=========================================================================*/ { SLPListLinkTail(dh->database, (SLPListItem*)entry); } /*=========================================================================*/ int SLPDatabaseCount(SLPDatabaseHandle dh) /* Returns the number of entries that are in the database */ /*=========================================================================*/ { return dh->database->count; } #ifdef TEST_SLP_DATABASE_TEST int main(int argc, char* argv[]) { SLPDatabase testdb; SLPDatabaseEntry* testentry; SLPDatabaseInit(&testdb); SLPDatabaseDeinit(&testdb); } #endif openslp-1.2.1/common/slp_predicate.h0000644033442200000310000000035510202047412017332 0ustar rganesanfloppy#include "slp_attr.h" #include "slp_filter.h" #ifdef DEBUG void dumpAttrList(int level, const SLPAttrList *attrs); void dumpFilterTree(const SLPLDAPFilter *filter); #endif int SLP_predicate_match(const SLPAttrList *a, const char *b); openslp-1.2.1/common/slp_spi.h0000644033442200000310000002354510202047412016173 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slp_spi.h */ /* */ /* Abstract: Functions for fetching SPI information from the filesystem */ /* Current implementation uses OpenSSL. For details see */ /* (see http://www.openssl.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLP_SPI_H_INCLUDED #define SLP_SPI_H_INCLUDED #include "slp_linkedlist.h" #include "slp_crypto.h" /*-------------------------------------------------------------------------*/ typedef struct _SLPSpiEntry /*-------------------------------------------------------------------------*/ { SLPListItem listitem; int spistrlen; char* spistr; char* keyfilename; SLPCryptoDSAKey* key; int keytype; }SLPSpiEntry; /*-----------------*/ /* Key type values */ /*-----------------*/ #define SLPSPI_KEY_TYPE_ANY 0 #define SLPSPI_KEY_TYPE_PUBLIC 1 #define SLPSPI_KEY_TYPE_PRIVATE 2 /*=========================================================================*/ typedef struct _SLPSpiHandle /*=========================================================================*/ { char* spifile; int cacheprivate; SLPList cache; }* SLPSpiHandle; /*=========================================================================*/ SLPSpiHandle SLPSpiOpen(const char* spifile, int cacheprivate); /* Initializes SLP SPI data storage. */ /* */ /* Parameters: spifile (IN) path of slp.spi file */ /* cacheprivate (IN) should private keys be cached in handle */ /* */ /* Returns: valid pointer. NULL on failure */ /*=========================================================================*/ /*=========================================================================*/ void SLPSpiClose(SLPSpiHandle hspi); /* Release SLP SPI data storage associated with the specified SLPSpiHandle */ /* */ /* Parameters: hspi (IN) SLPSpiHandle to deinitialize */ /*=========================================================================*/ /*=========================================================================*/ SLPCryptoDSAKey* SLPSpiGetDSAKey(SLPSpiHandle hspi, int keytype, int spistrlen, const char* spistr, SLPCryptoDSAKey **key); /* Fetches a copy of the private key file used to sign SLP messages. */ /* */ /* Parameters: hspi (IN) handle obtained from call to SLPSpiOpen() */ /* keytype (IN) the type of key desired */ /* spistrlen (IN) the length of the spistr */ /* spistr (IN) spistr associated with the key */ /* key (OUT) the private key. Caller should use */ /* SLPCryptoDSAKeyDestroy() to free key memory */ /* */ /* Returns: A valid pointer. NULL on failure. Caller should use */ /* SLPCryptoDSAKeyDestroy() to free key memory */ /*=========================================================================*/ /*=========================================================================*/ char* SLPSpiGetDefaultSPI(SLPSpiHandle hspi, int keytype, int* spistrlen, char** spistr); /* Gets a reference to the default SPI string for the specified keytype */ /* */ /* Parameters: hspi (IN) handle obtained from call to SLPSpiOpen() */ /* keytype (IN) type of key */ /* spistrlen (OUT) length or the returned spistr */ /* spistr (OUT) pointer to spistr. MUST be freed by */ /* caller!! */ /* */ /* Returns: Pointer to the default SPI string. Pointer may *not* be NULL */ /* terminated */ /*=========================================================================*/ /*=========================================================================*/ int SLPSpiCanVerify(SLPSpiHandle hspi, int spistrlen, const char* spistr); /* Determine if we understand the specified SPI. No SPI is always */ /* returns true */ /* */ /* Parameters: hspi (IN) handle obtained from call to SLPSpiOpen() */ /* spistrlen (IN) the length of the spistr */ /* spistr (IN) the SPI string */ /* */ /* Returns Non-zero if we verify specified the SPI */ /*=========================================================================*/ /*=========================================================================*/ int SLPSpiCanSign(SLPSpiHandle hspi, int spistrlen, const char* spistr); /* Determine if we understand the specified SPI. No SPI is always */ /* return true */ /* */ /* Parameters: hspi (IN) handle obtained from call to SLPSpiOpen() */ /* spistrlen (IN) the length of the spistr */ /* spistr (IN) the SPI string */ /* */ /* Returns Non-zero if we sign using the specified SPI */ /*=========================================================================*/ #endif openslp-1.2.1/common/slp_xcast.c0000644033442200000310000003727410207404657016536 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_xcast.c */ /* */ /* Abstract: Functions used to multicast and broadcast SLP messages */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include #include #include #define ETIMEDOUT 110 #define ENOTCONN 107 #else #include #include #include #include #include #include #include #include #include #include #endif #ifndef UNICAST_NOT_SUPPORTED #include "../libslp/slp.h" #endif #include "slp_xcast.h" #include "slp_message.h" #include "slp_property.h" /*========================================================================*/ int SLPBroadcastSend(const SLPIfaceInfo* ifaceinfo, SLPBuffer msg, SLPXcastSockets* socks) /* Description: * Broadcast a message. * * Parameters: * ifaceinfo (IN) Pointer to the SLPIfaceInfo structure that contains * information about the interfaces to send on * msg (IN) Buffer to send * * socks (OUT) Sockets used broadcast multicast. May be used to * recv() responses. MUST be close by caller using * SLPXcastSocketsClose() * * Returns: * Zero on sucess. Non-zero with errno set on error *========================================================================*/ { int xferbytes; int flags = 0; #ifdef _WIN32 char on = 1; #else int on = 1; #endif #if defined(MSG_NOSIGNAL) flags = MSG_NOSIGNAL; #endif for (socks->sock_count = 0; socks->sock_count < ifaceinfo->iface_count; socks->sock_count++) { socks->sock[socks->sock_count] = socket(AF_INET, SOCK_DGRAM, 0); if (socks->sock[socks->sock_count] < 0) { /* error creating socket */ return -1; } if( (setsockopt(socks->sock[socks->sock_count], SOL_SOCKET, SO_BROADCAST, &on, sizeof(on))) ) { /* Error setting socket option */ return -1; } socks->peeraddr[socks->sock_count].sin_family = AF_INET; socks->peeraddr[socks->sock_count].sin_port = htons(SLP_RESERVED_PORT); socks->peeraddr[socks->sock_count].sin_addr.s_addr = ifaceinfo->bcast_addr[socks->sock_count].sin_addr.s_addr; xferbytes = sendto(socks->sock[socks->sock_count], msg->start, msg->end - msg->start, 0, (struct sockaddr *) &(socks->peeraddr[socks->sock_count]), sizeof(struct sockaddr_in)); if(xferbytes < 0) { /* Error sending to broadcast */ return -1; } } return 0; } /*========================================================================*/ int SLPMulticastSend(const SLPIfaceInfo* ifaceinfo, SLPBuffer msg, SLPXcastSockets* socks) /* Description: * Multicast a message. * * Parameters: * ifaceinfo (IN) Pointer to the SLPIfaceInfo structure that contains * information about the interfaces to send on * msg (IN) Buffer to send * * socks (OUT) Sockets used to multicast. May be used to recv() * responses. MUST be close by caller using * SLPXcastSocketsClose() * * Returns: * Zero on sucess. Non-zero with errno set on error *========================================================================*/ { int flags = 0; int xferbytes; struct in_addr saddr; int optarg; #if defined(MSG_NOSIGNAL) flags = MSG_NOSIGNAL; #endif optarg = atoi(SLPPropertyGet("net.slp.multicastTTL")); for (socks->sock_count = 0; socks->sock_count < ifaceinfo->iface_count; socks->sock_count++) { socks->sock[socks->sock_count] = socket(AF_INET, SOCK_DGRAM, 0); if (socks->sock[socks->sock_count] < 0) { /* error creating socket */ return -1; } saddr.s_addr = ifaceinfo->iface_addr[socks->sock_count].sin_addr.s_addr; if( setsockopt(socks->sock[socks->sock_count], IPPROTO_IP, IP_MULTICAST_IF, (char*)&saddr, sizeof(struct in_addr))) { /* error setting socket option */ return -1; } if(setsockopt(socks->sock[socks->sock_count], IPPROTO_IP, IP_MULTICAST_TTL, (char*)&optarg, sizeof(optarg))) { return -1; } socks->peeraddr[socks->sock_count].sin_family = AF_INET; socks->peeraddr[socks->sock_count].sin_port = htons(SLP_RESERVED_PORT); socks->peeraddr[socks->sock_count].sin_addr.s_addr = htonl(SLP_MCAST_ADDRESS); xferbytes = sendto(socks->sock[socks->sock_count], msg->start, msg->end - msg->start, flags, (struct sockaddr *) &(socks->peeraddr[socks->sock_count]), sizeof(struct sockaddr_in)); if (xferbytes <= 0) { /* error sending */ return -1; } } return 0; } /*========================================================================*/ int SLPXcastSocketsClose(SLPXcastSockets* socks) /* Description: * Closes sockets that were opened by calls to SLPMulticastSend() and * SLPBroadcastSend() * * Parameters: * socks (IN) Pointer to the SLPXcastSockets structure being close * * Returns: * Zero on sucess. Non-zero with errno set on error *========================================================================*/ { while(socks->sock_count) { socks->sock_count = socks->sock_count - 1; #ifdef _WIN32 closesocket(socks->sock[socks->sock_count]); #else close(socks->sock[socks->sock_count]); #endif } return 0; } /*=========================================================================*/ int SLPXcastRecvMessage(const SLPXcastSockets* sockets, SLPBuffer* buf, struct sockaddr_in* peeraddr, struct timeval* timeout) /* Description: * Receives datagram messages from one of the sockets in the specified * SLPXcastsSockets structure * * Parameters: * sockets (IN) Pointer to the SOPXcastSockets structure that describes * which sockets to read messages from. * buf (OUT) Pointer to SLPBuffer that will contain the message upon * successful return. * peeraddr (OUT) Pointer to struc sockaddr_in that will contain the * address of the peer that sent the received message. * timeout (IN/OUT) pointer to the struct timeval that indicates how much * time to wait for a message to arrive * * Returns: * Zero on success, non-zero with errno set on failure. *==========================================================================*/ { fd_set readfds; int highfd; int i; int readable; size_t bytesread; int recvloop; int peeraddrlen = sizeof(struct sockaddr_in); char peek[16]; int result; /* recv loop */ result = -1; recvloop = 1; while(recvloop) { /* Set the readfds */ FD_ZERO(&readfds); highfd = 0; for (i=0; isock_count; i++) { FD_SET(sockets->sock[i],&readfds); if(sockets->sock[i] > highfd) { highfd = sockets->sock[i]; } } /* Select */ readable = select(highfd + 1,&readfds,NULL,NULL,timeout); if(readable > 0) { /* Read the datagram */ for (i=0; isock_count; i++) { if(FD_ISSET(sockets->sock[i],&readfds)) { /* Peek at the first 16 bytes of the header */ bytesread = recvfrom(sockets->sock[i], peek, 16, MSG_PEEK, (struct sockaddr *)peeraddr, &peeraddrlen); if(bytesread == 16 #ifdef _WIN32 /* Win32 returns WSAEMSGSIZE if the message is larger than * the requested size, even with MSG_PEEK. But if this is the * error code we can be sure that the message is at least 16 * bytes */ || (bytesread == (size_t)-1 && WSAGetLastError() == WSAEMSGSIZE) #endif ) { if(AsUINT24(peek + 2) <= SLP_MAX_DATAGRAM_SIZE) { *buf = SLPBufferRealloc(*buf, AsUINT24(peek + 2)); bytesread = recv(sockets->sock[i], (*buf)->curpos, (*buf)->end - (*buf)->curpos, 0); if(bytesread != AsUINT24(peek + 2)) { /* This should never happen but we'll be paranoid*/ (*buf)->end = (*buf)->curpos + bytesread; } /* Message read. We're done! */ result = 0; recvloop = 0; break; } else { /* we got a bad message, or one that is too big! */ #ifndef UNICAST_NOT_SUPPORTED /* Reading SLP_MAX_DATAGRAM_SIZE bytes on the socket */ *buf = SLPBufferRealloc(*buf, SLP_MAX_DATAGRAM_SIZE); bytesread = recv(sockets->sock[i], (*buf)->curpos, (*buf)->end - (*buf)->curpos, 0); if(bytesread != SLP_MAX_DATAGRAM_SIZE) { /* This should never happen but we'll be paranoid*/ (*buf)->end = (*buf)->curpos + bytesread; } result = SLP_RETRY_UNICAST; recvloop = 0; return result; #endif } } else { /* Not even 16 bytes available */ } } } } else if(readable == 0) { result = -1; errno = ETIMEDOUT; recvloop = 0; } else { result = -1; recvloop = 0; } } return result; } /*=========================================================================== * TESTING CODE may be compiling with the following command line: * * $ gcc -g -DDEBUG -DSLP_XMIT_TEST slp_xcast.c slp_iface.c slp_buffer.c * slp_linkedlist.c slp_compare.c slp_xmalloc.c *==========================================================================*/ #ifdef SLP_XMIT_TEST main() { SLPIfaceInfo ifaceinfo; SLPXcastSockets socks; SLPBuffer buffer; #ifdef _WIN32 WSADATA wsadata; WSAStartup(MAKEWORD(2,2), &wsadata); #endif buffer = SLPBufferAlloc(SLP_MAX_DATAGRAM_SIZE); if(buffer) { strcpy(buffer->start,"testdata"); SLPIfaceGetInfo(NULL,&ifaceinfo); if (SLPBroadcastSend(&ifaceinfo, buffer,&socks) !=0) printf("\n SLPBroadcastSend failed \n"); SLPXcastSocketsClose(&socks); if (SLPMulticastSend(&ifaceinfo, buffer, &socks) !=0) printf("\n SLPMulticast failed \n"); SLPXcastSocketsClose(&socks); printf("Success\n"); SLPBufferFree(buffer); } #ifdef _WIN32 WSACleanup(); #endif } #endif openslp-1.2.1/common/slp_buffer.h0000644033442200000310000002212010202047412016635 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_buffer.h */ /* */ /* Abstract: Header file that defines structures and constants and */ /* functions that are used to handle memory allocation for */ /* slp message buffers. */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #if(!defined SLP_BUFFER_H_INCLUDED) #define SLP_BUFFER_H_INCLUDED #include #include #include "slp_linkedlist.h" /*=========================================================================*/ typedef struct _SLPBuffer /*=========================================================================*/ { SLPListItem listitem; /* SLPListItem so that SLPBuffers can be linked into a list*/ /* the allocated size of this buffer (the actual xmalloc'd size is one byte more than this to null terminate C strings) */ size_t allocated; unsigned char* start; /* ALWAYS points to the start of the xmalloc() buffer */ unsigned char* curpos; /* "slider" pointer. Range is ALWAYS (start < curpos < end) */ unsigned char* end; /* ALWAYS set to point to the byte after the last meaningful byte */ /* Data beyond this index may not be valid */ }*SLPBuffer; /*=========================================================================*/ SLPBuffer SLPBufferAlloc(size_t size); /* Must be called to initially allocate a SLPBuffer */ /* */ /* size - (IN) number of bytes to allocate */ /* */ /* returns - newly allocated SLPBuffer or NULL on ENOMEM. An extra byte */ /* is allocated to null terminating strings. This extra byte */ /* is not counted in the buffer size */ /*=========================================================================*/ /*=========================================================================*/ SLPBuffer SLPBufferRealloc(SLPBuffer buf, size_t size); /* Must be called to initially allocate a SLPBuffer */ /* */ /* size - (IN) number of bytes to allocate */ /* */ /* returns - newly (re)allocated SLPBuffer or NULL on ENOMEM. An extra */ /* byte is allocated to null terminating strings. This extra */ /* byte is not counted in the buffer size */ /*=========================================================================*/ /*=========================================================================*/ SLPBuffer SLPBufferDup(SLPBuffer buf); /* Returns a duplicate buffer. Duplicate buffer must be freed by a call */ /* to SLPBufferFree() */ /* */ /* size - (IN) number of bytes to allocate */ /* */ /* returns - a newly allocated SLPBuffer or NULL on ENOMEM */ /*=========================================================================*/ /*=========================================================================*/ void SLPBufferFree(SLPBuffer buf); /* Free a previously allocated SLPBuffer */ /* */ /* msg - (IN) the SLPBuffer to free */ /* */ /* returns - none */ /*=========================================================================*/ /*=========================================================================*/ SLPBuffer SLPBufferListRemove(SLPBuffer* list, SLPBuffer buf); /* Removed the specified SLPBuffer from a SLPBuffer list */ /* */ /* list (IN/OUT) pointer to the list */ /* */ /* buf (IN) buffer to remove */ /* */ /* Returns the previous item in the list (may be NULL) */ /*=========================================================================*/ /*=========================================================================*/ SLPBuffer SLPBufferListAdd(SLPBuffer* list, SLPBuffer buf); /* Add the specified SLPBuffer from a SLPBuffer list */ /* */ /* list (IN/OUT) pointer to the list */ /* */ /* buf (IN) buffer to add */ /* */ /* Returns the added item in the list. */ /*=========================================================================*/ /*=========================================================================*/ void* memdup(const void* src, int srclen); /*=========================================================================*/ #endif openslp-1.2.1/common/slp_dhcp.h0000644033442200000310000001476210202047412016317 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_dhcp.h */ /* */ /* Abstract: Common for DHCP Lookup routines for OpenSLP. */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /***************************************************************************/ #ifndef SLP_DHCP_H_INCLUDED #define SLP_DHCP_H_INCLUDED #include /* Applicable IANA BOOTP/DHCP option tag values */ #define TAG_PAD 0 /* Fixed size, 1 byte (0), no length */ #define TAG_DHCP_MSG_TYPE 53 #define TAG_DHCP_PARAM_REQ 55 #define TAG_CLIENT_IDENTIFIER 61 #define TAG_SLP_DA 78 #define TAG_SLP_SCOPE 79 #define TAG_END 255 /* The Novell (pre-rfc2610 or draft 3) format for the DHCP TAG_SLP_DA option has the 'mandatory' flag containing other bits besides simply 'mandatory'. These flags are important because if the DA_NAME_PRESENT flag is set, then we know we are parsing this format, otherwise it's the rfc2610 format. */ #define DA_NAME_PRESENT 0x80 /* DA name present in option */ #define DA_NAME_IS_DNS 0x40 /* DA name is host name or DNS name */ #define DISABLE_DA_MCAST 0x20 /* Multicast for DA's is disabled */ #define SCOPE_PRESENT 0x10 /* Scope is present in option */ /* Character type encodings that we expect to be supported. */ #define CT_ASCII 3 /* standard 7 or 8 bit ASCII */ #define CT_UTF8 106 /* UTF-8 */ #define CT_UNICODE 1000 /* normal Unicode */ /*=========================================================================*/ typedef int DHCPInfoCallBack(int tag, void *optdata, size_t optdatasz, void *context); /* Callback routine used by DHCPGetOptionInfo - called once for each */ /* option specified in the option array passed to that routine. If this */ /* routine returns a non-zero value, that value will be immediately */ /* returned to the caller of DHCPGetOptionInfo. */ /* */ /* Returns - zero on success, non-zero on 'stop processing options'. */ /*=========================================================================*/ /*=========================================================================*/ int DHCPGetOptionInfo(unsigned char *dhcpOptCodes, int dhcpOptCodeCnt, DHCPInfoCallBack *dhcpInfoCB, void *context); /* Calls dhcpInfoCB once for each requested option in dhcpOptCodes. */ /* */ /* Returns - zero on success, non-zero on failure */ /*=========================================================================*/ /*=========================================================================*/ int DHCPParseSLPTags(int tag, void *optdata, size_t optdatasz, void *context); /* Callback routined tests each DA discovered from DHCP and add it to the */ /* DA cache. */ /* */ /* Returns: 0 on success, or nonzero to stop being called. */ /* This type definition is used as the context block by this callback. */ typedef struct _DHCPContext { int addrlistlen; int scopelistlen; char scopelist[256]; unsigned char addrlist[256]; } DHCPContext; /*=========================================================================*/ #endif openslp-1.2.1/common/slp_crypto.c0000644033442200000310000002405410202235737016720 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_crpyto.c */ /* */ /* Abstract: Primitive cryptographic functions to support DSA signature */ /* of SHA1 digests. Current implementation is uses the */ /* OpenSSL (http://www.openssl.org)) crypto library. */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slp_crypto.h" #include "slp_message.h" /*=========================================================================*/ int SLPCryptoSHA1Digest(const unsigned char* data, int datalen, unsigned char* digest) /* Generate a SHA1 digest for the specified block data */ /* */ /* Parameters: data (IN) pointer to buffer that to be hashed */ /* datalen (IN) size of the data buffer in bytes */ /* digest (OUT) pointer to buffer of at least 20 bytes in */ /* size where the digest will be copied */ /* */ /* Returns: zero on success. non-zero on failure */ /*=========================================================================*/ { if(SHA1(data,datalen,digest)) { return 0; } return -1; } /*=========================================================================*/ SLPCryptoDSAKey* SLPCryptoDSAKeyDup(SLPCryptoDSAKey* dsa) /* Duplicates the specified key */ /* */ /* Parameters: dsa (IN) the key to duplicate */ /* */ /* Returns: Pointer to the duplicated key. NULL on failure. Caller is */ /* responsible for SLPCryptoDSAKeyDestroy()ing the returned */ /* pointer */ /*=========================================================================*/ { SLPCryptoDSAKey* result; result = DSA_new(); if(result) { result->p = BN_dup(dsa->p); result->q = BN_dup(dsa->q); result->g = BN_dup(dsa->g); result->priv_key = BN_dup(dsa->priv_key); result->pub_key = BN_dup(dsa->pub_key); } return result; } /*=========================================================================*/ void SLPCryptoDSAKeyDestroy(SLPCryptoDSAKey* dsa) /* Destroy a key that was created by SLPCryptoDSAKeyCreate(). Care should */ /* be taken to make sure all private keys are destroyed */ /* */ /* Parameters: dsa (IN) the key to destroy */ /* */ /* Returns: None */ /*=========================================================================*/ { DSA_free(dsa); } /*=========================================================================*/ int SLPCryptoDSASignLen(SLPCryptoDSAKey* key) /* Determine the length of a signatures produced with specified key. */ /* */ /* Parameters: key (IN) the key that will be used for signing */ /* */ /* Returns: The length of signatures in bytes */ /*=========================================================================*/ { return DSA_size(key); } /*=========================================================================*/ int SLPCryptoDSASign(SLPCryptoDSAKey* key, const unsigned char* digest, int digestlen, unsigned char* signature, int* signaturelen) /* Sign the specified digest with the specified DSA key */ /* */ /* Parameters: key (IN) Signing (private) key */ /* digest (IN) pointer to digest buffer */ /* digestlen (IN) length of the digest buffer */ /* signature (OUT) buffer that will hold the ASN.1 DER */ /* encoded signature. */ /* signaturelen (OUT) The length of the signature buffer */ /* SLPCryptoDSASignLen(key) should be */ /* called to determine how big signature */ /* should be. */ /* */ /* Returns: zero on success. non-zero on failure */ /*=========================================================================*/ { return DSA_sign(0, /* it does not look like the type param is used? */ digest, digestlen, signature, signaturelen, key) == 0; } /*=========================================================================*/ int SLPCryptoDSAVerify(SLPCryptoDSAKey* key, const unsigned char* digest, int digestlen, const unsigned char* signature, int signaturelen) /* Verify a DSA signature to ensure it matches the specified digest */ /* */ /* Parameters: key (IN) Verifying (public) key */ /* (IN) pointer to the digest buffer */ /* (IN) length of the digest buffer */ /* (IN) the ASN.1 DER encoded signature */ /* (IN) the length of the signature */ /* */ /* Returns: 1 if the signature is valid, 0 of it is not */ /*=========================================================================*/ { return DSA_verify(0, /* it does not look like the type param is used? */ digest, digestlen, (unsigned char*)signature, /* broken DSA_verify() declaration */ signaturelen, key); } openslp-1.2.1/common/slp_attr_y.h0000644033442200000310000000366510211377550016714 0ustar rganesanfloppy/* A Bison parser, made by GNU Bison 1.875. */ /* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { _TRUE = 258, _FALSE = 259, _MULTIVAL = 260, _INT = 261, _ESCAPED = 262, _TAG = 263, _STRING = 264 }; #endif #define _TRUE 258 #define _FALSE 259 #define _MULTIVAL 260 #define _INT 261 #define _ESCAPED 262 #define _TAG 263 #define _STRING 264 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) #line 102 "slp_attr_y.y" typedef union YYSTYPE { int _i; char *_s; SLPAttrList *_atl; } YYSTYPE; /* Line 1249 of yacc.c. */ #line 60 "slp_attr_y.h" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif extern YYSTYPE yylval; openslp-1.2.1/common/slp_iface.c0000644033442200000310000003564510211115112016437 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_iface.c */ /* */ /* Abstract: Common code to obtain network interface information */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slp_iface.h" #include "slp_xmalloc.h" #include "slp_compare.h" #include "slp_net.h" #include #include #include #ifdef SOLARIS #include #endif #ifndef _WIN32 #include #include #include #else #ifndef UINT32_T_DEFINED #define UINT32_T_DEFINED typedef unsigned int uint32_t; #endif #endif #if defined(LINUX) || defined(AIX) || defined(SOLARIS) || defined(HPUX) /*=========================================================================*/ int SLPIfaceGetInfo(const char* useifaces, SLPIfaceInfo* ifaceinfo) /* Description: * Get the network interface addresses for this host. Exclude the * loopback interface * * Parameters: * useifaces (IN) Pointer to comma delimited string of interface IPv4 * addresses to get interface information for. Pass * NULL or empty string to get all interfaces (except * loopback) * ifaceinfo (OUT) Information about requested interfaces. * * Returns: * zero on success, non-zero (with errno set) on error. *=========================================================================*/ { struct sockaddr* sa; struct sockaddr_in* sin; struct ifreq ifrlist[SLP_MAX_IFACES]; struct ifreq ifrflags; struct ifconf ifc; int fd; int i; int useifaceslen; #ifdef DEBUG if(ifaceinfo == NULL ) { errno = EINVAL; /* bad parameters */ return 1; } #endif ifc.ifc_len = sizeof(struct ifreq) * SLP_MAX_IFACES ; ifc.ifc_req = ifrlist; fd = socket(AF_INET,SOCK_STREAM,0); if(fd == -1) { /* failed to create socket */ #ifdef DEBUG fprintf(stderr,"%s:%i Failed to created socket\n",__FILE__,__LINE__); #endif return 1; } #ifdef AIX if (ioctl(fd,OSIOCGIFCONF,&ifc) == -1) #else if (ioctl(fd,SIOCGIFCONF,&ifc) == -1) #endif { perror("ioctl failed"); #ifdef _WIN32 closesocket(fd); #else close(fd); #endif return 1; } if(useifaces && *useifaces) { useifaceslen = strlen(useifaces); } else { useifaceslen = 0; } memset(ifaceinfo,0,sizeof(SLPIfaceInfo)); for (i = 0; i < ifc.ifc_len/sizeof(struct ifreq); i++) { sa = (struct sockaddr *)&(ifrlist[i].ifr_addr); if(sa->sa_family == AF_INET) { /* Get interface flags */ memcpy(&ifrflags,&(ifrlist[i]),sizeof(struct ifreq)); if(ioctl(fd,SIOCGIFFLAGS, &ifrflags) == 0) { /* skip the loopback interfaces */ if((ifrflags.ifr_flags & IFF_LOOPBACK) == 0) { /* Only include those interfaces in the requested list */ sin = (struct sockaddr_in*)sa; if(useifaceslen == 0 || SLPContainsStringList(useifaceslen, useifaces, strlen(inet_ntoa(sin->sin_addr)), inet_ntoa(sin->sin_addr))) { memcpy(&(ifaceinfo->iface_addr[ifaceinfo->iface_count]), sin, sizeof(struct sockaddr_in)); #ifdef AIX if(ioctl(fd,OSIOCGIFBRDADDR,&(ifrlist[i])) == 0) #else if(ioctl(fd,SIOCGIFBRDADDR,&(ifrlist[i])) == 0) #endif { sin = (struct sockaddr_in *)&(ifrlist[i].ifr_broadaddr); memcpy(&(ifaceinfo->bcast_addr[ifaceinfo->iface_count]), sin, sizeof(struct sockaddr_in)); } ifaceinfo->iface_count ++; } } } } } #ifdef _WIN32 closesocket(fd); #else close(fd); #endif return 0; } #else /*=========================================================================*/ int SLPIfaceGetInfo(const char* useifaces, SLPIfaceInfo* ifaceinfo) /* Description: * Get the network interface addresses for this host. Exclude the * loopback interface * * Parameters: * useifaces (IN) Pointer to comma delimited string of interface IPv4 * addresses to get interface information for. Pass * NULL or empty string to get all interfaces (except * loopback) * ifaceinfo (OUT) Information about requested interfaces. * * Returns: * zero on success, non-zero (with errno set) on error. *=========================================================================*/ { /*---------------------------------------------------*/ /* Use gethostbyname(). Not necessarily the best way */ /*---------------------------------------------------*/ struct hostent* myhostent; char* myname; struct in_addr ifaddr; uint32_t** haddr; int useifaceslen; if(SLPNetGetThisHostname(&myname,0) == 0) { myhostent = gethostbyname(myname); if(myhostent != 0) { if(myhostent->h_addrtype == AF_INET) { if(useifaces && *useifaces) { useifaceslen = strlen(useifaces); } else { useifaceslen = 0; } ifaceinfo->iface_count = 0; haddr = (uint32_t**)(myhostent->h_addr_list); /* count the interfaces */ while(*haddr) { ifaddr.s_addr = **haddr; if(useifaceslen == 0 || SLPContainsStringList(useifaceslen, useifaces, strlen(inet_ntoa(ifaddr)), inet_ntoa(ifaddr))) { memcpy(&(ifaceinfo->iface_addr[ifaceinfo->iface_count].sin_addr), &ifaddr, sizeof(ifaddr)); /* There is no way to deterine the broadcast address */ /* Set it to global broadcast */ ifaceinfo->bcast_addr[ifaceinfo->iface_count].sin_addr.s_addr = INADDR_BROADCAST; ifaceinfo->iface_count ++; } haddr ++; } } } xfree(myname); } return 0; } #endif /*=========================================================================*/ int SLPIfaceSockaddrsToString(const struct sockaddr_in* addrs, int addrcount, char** addrstr) /* Description: * Get the comma delimited string of addresses from an array of sockaddrs * * Parameters: * addrs (IN) Pointer to array of sockaddrs to convert * addrcount (IN) Number of sockaddrs in addrs. * addrstr (OUT) pointer to receive malloc() allocated address string. * Caller must free() addrstr when no longer needed. * * Returns: * zero on success, non-zero (with errno set) on error. *=========================================================================*/ { int i; #ifdef DEBUG if(addrs == NULL || addrcount == 0 || addrstr == NULL) { /* invalid paramaters */ errno = EINVAL; return 1; } #endif /* 16 is the maximum size of a string representation of * an IPv4 address (including the comman for the list) */ *addrstr = (char *)xmalloc(addrcount * 16); *addrstr[0] = 0; for (i=0;i #include #include #define ETIMEDOUT 110 #define ENOTCONN 107 #else /* non-win32 platforms close sockets with 'close' */ #define closesocket close #include #include #include #include #include #include #include #endif #include #include #include #include /* UDP port numbers, server and client. */ #define IPPORT_BOOTPS 67 #define IPPORT_BOOTPC 68 /* BOOTP header op codes */ #define BOOTREQUEST 1 #define BOOTREPLY 2 /* BOOTP header field value maximums */ #define MAXHTYPES 7 /* Number of htypes defined */ #define MAXHADDRLEN 6 /* Max hw address length in bytes */ #define MAXSTRINGLEN 80 /* Max string length */ /* Some other useful constants */ #define MAX_MACADDR_SIZE 64 /* Max hardware address length */ #define MAX_DHCP_RETRIES 2 /* Max dhcp request retries */ /* timeout values */ #define USECS_PER_MSEC 1000 #define MSECS_PER_SEC 1000 #define USECS_PER_SEC (USECS_PER_MSEC * MSECS_PER_SEC) #define INIT_TMOUT_USECS (250 * USECS_PER_MSEC) /* DHCP vendor area cookie values */ #define DHCP_COOKIE1 99 #define DHCP_COOKIE2 130 #define DHCP_COOKIE3 83 #define DHCP_COOKIE4 99 /* DHCP Message Types for TAG_DHCP_MSG_TYPE */ #define DHCP_MSG_DISCOVER 1 #define DHCP_MSG_OFFER 2 #define DHCP_MSG_REQUEST 3 #define DHCP_MSG_DECLINE 4 #define DHCP_MSG_ACK 5 #define DHCP_MSG_NAK 6 #define DHCP_MSG_RELEASE 7 #define DHCP_MSG_INFORM 8 /*=========================================================================*/ static int dhcpCreateBCSkt(struct sockaddr_in* peeraddr) /* Creates a socket and provides a broadcast addr to which DHCP requests should be sent. Also binds the socket to the DHCP client port. peeraddr (OUT) ptr to rcv addr to which DHCP requests are sent Returns Valid socket or -1 if no DA connection can be made =========================================================================*/ { int sockfd; #ifdef _WIN32 BOOL on = 1; #else int on = 1; #endif /* setup dhcp broadcast-to-server address structure */ if((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) >= 0) { struct sockaddr_in localaddr; localaddr.sin_family = AF_INET; localaddr.sin_port = htons(IPPORT_BOOTPC); localaddr.sin_addr.s_addr = htonl(INADDR_ANY); if(bind(sockfd, (struct sockaddr*)&localaddr, sizeof(localaddr)) || setsockopt(sockfd, SOL_SOCKET, SO_BROADCAST, (char*)&on, sizeof(on))) { closesocket(sockfd); return -1; } peeraddr->sin_family = AF_INET; peeraddr->sin_port = htons(IPPORT_BOOTPS); peeraddr->sin_addr.s_addr = htonl(INADDR_BROADCAST); } return sockfd; } /*=========================================================================*/ static int dhcpSendRequest(int sockfd, void *buf, size_t bufsz, struct sockaddr* peeraddr, struct timeval* timeout) /* Sends a buffer to PEERADDR, times out after period specified in TIMEOUT Returns - zero on success non-zero on failure errno EPIPE error during write ETIMEDOUT read timed out =========================================================================*/ { fd_set writefds; int xferbytes; int flags = 0; #if defined(MSG_NOSIGNAL) flags = MSG_NOSIGNAL; #endif FD_ZERO(&writefds); FD_SET(sockfd, &writefds); if((xferbytes = select(sockfd + 1, 0, &writefds, 0, timeout)) > 0) { if((xferbytes = sendto(sockfd, (char*)buf, (int)bufsz, flags, peeraddr, sizeof(struct sockaddr_in))) <= 0) { errno = EPIPE; return -1; } } else if(xferbytes == 0) { errno = ETIMEDOUT; return -1; } else { errno = EPIPE; return -1; } return 0; } /*=========================================================================*/ static int dhcpRecvResponse(int sockfd, void *buf, size_t bufsz, struct timeval* timeout) /* Receives a DHCP response from a DHCP server. Since DHCP responses are broadcasts, we compare XID with received response to ensure we are returning the correct response from a prior request. Returns - zero on success, non-zero on failure errno ENOTCONN error during read ETIMEDOUT read timed out =========================================================================*/ { int xferbytes; fd_set readfds; FD_ZERO(&readfds); FD_SET(sockfd, &readfds); if((xferbytes = select(sockfd + 1, &readfds, 0 , 0, timeout)) > 0) { if((xferbytes = recvfrom(sockfd, (char*)buf, (int)bufsz, 0, 0, 0)) <= 0) { errno = ENOTCONN; return -1; } return xferbytes; } else if(xferbytes == 0) { errno = ETIMEDOUT; return -1; } errno = ENOTCONN; return -1; } /*=========================================================================*/ static int dhcpProcessOptions(unsigned char *data, size_t datasz, DHCPInfoCallBack *dhcpInfoCB, void *context) /* Calls dhcpInfoCB once for each option returned by the dhcp server. Returns - zero on success, non-zero on failure errno ENOTCONN error during read ETIME read timed out ENOMEM out of memory EINVAL parse error =========================================================================*/ { int err, taglen; unsigned char tag; /* validate vendor data header */ if(datasz < 4 || *data++ != DHCP_COOKIE1 || *data++ != DHCP_COOKIE2 || *data++ != DHCP_COOKIE3 || *data++ != DHCP_COOKIE4) return -1; /* invalid dhcp response */ datasz -= 4; /* account for DHCP cookie values */ /* validate and process each tag in the vendor data */ while(datasz-- > 0 && (tag = *data++) != TAG_END) { if(tag != TAG_PAD) { if(!datasz-- || (taglen = *data++) > (int)datasz) return -1; /* tag length greater than total data length */ if((err = dhcpInfoCB(tag, data, taglen, context))) return err; datasz -= taglen; data += taglen; } } return 0; } /*=========================================================================*/ static int dhcpGetAddressInfo(unsigned char *ipaddr, unsigned char *chaddr, unsigned char *hlen, unsigned char *htype) /* return hardware MAC address for specified ip address. Returns - zero on success, non-zero on failure =========================================================================*/ { #ifdef _WIN32 HMODULE hmod; DWORD (WINAPI *pGetAdaptersInfo)(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen); char ipastr[16]; *hlen = 0; sprintf(ipastr, "%d.%d.%d.%d", ipaddr[0], ipaddr[1], ipaddr[2], ipaddr[3]); if((hmod = LoadLibrary("iphlpapi.dll")) != 0) { if((pGetAdaptersInfo = (DWORD(WINAPI *)(PIP_ADAPTER_INFO,PULONG)) GetProcAddress(hmod, "GetAdaptersInfo")) != 0) { DWORD dwerr; ULONG bufsz = 0; IP_ADAPTER_INFO *aip = 0; if((dwerr = (*pGetAdaptersInfo)(aip, &bufsz)) == ERROR_BUFFER_OVERFLOW && (aip = (IP_ADAPTER_INFO *)xmalloc(bufsz)) != 0 && (dwerr = (*pGetAdaptersInfo)(aip, &bufsz)) == ERROR_SUCCESS) { IP_ADAPTER_INFO *pcur; for(pcur = aip; pcur && !*hlen; pcur = pcur->Next) { IP_ADDR_STRING *caddrp; for(caddrp = &pcur->IpAddressList; caddrp && !*hlen; caddrp = caddrp->Next) { if(strcmp(ipastr, caddrp->IpAddress.String) == 0) { *hlen = pcur->AddressLength; *htype = pcur->Type; /* win32 returns iana ARP values */ memcpy(chaddr, pcur->Address, pcur->AddressLength); break; } } } if(!*hlen) /* couldn't find the one we wanted, just use the first */ { *hlen = aip->AddressLength; *htype = aip->Type; memcpy(chaddr, aip->Address, aip->AddressLength); } } xfree(aip); } FreeLibrary(hmod); } #elif defined(SIOCGARP) /* Query the ARP cache for our hardware address */ int sockfd; struct arpreq arpreq; struct sockaddr_in *sin; if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return -1; *hlen = 0; sin = (struct sockaddr_in *)&arpreq.arp_pa; memset(sin, 0, sizeof(struct sockaddr_in)); sin->sin_family = AF_INET; memcpy(&sin->sin_addr, ipaddr, sizeof(struct in_addr)); if (ioctl(sockfd, SIOCGARP, &arpreq) >= 0 && (arpreq.arp_flags & ATF_COM)) { *hlen = 6; /* assume IEEE802 compatible */ *htype = arpreq.arp_ha.sa_family; memcpy(chaddr, arpreq.arp_ha.sa_data, 6); } closesocket(sockfd); #else /* figure out another way ... */ (void)ipaddr; (void)chaddr; (void)htype; *hlen = 0; #endif return *hlen? 0: -1; } /*=========================================================================*/ int DHCPGetOptionInfo(unsigned char *dhcpOptCodes, int dhcpOptCodeCnt, DHCPInfoCallBack *dhcpInfoCB, void *context) /* Calls dhcpInfoCB once for each requested option in dhcpOptCodes. Returns - zero on success, non-zero on failure errno ENOTCONN error during read ETIME read timed out ENOMEM out of memory EINVAL parse error BOOTP/DHCP packet header format: Offs Len Name Description 0 1 opcode Message opcode: 1 = BOOTREQUEST, 2 = BOOTREPLY 1 1 htype Hardware address type (eg., 1 = 10mb ethernet) 2 1 hlen Hardware address length (eg., 6 = 10mb ethernet) 3 1 hops Client sets to zero, optionally used by relay agents 4 4 xid Transaction ID, random number chosen by client 8 2 secs Client sets to seconds since start of boot process 10 2 flags Bit 0: broadcast response bit 12 4 ciaddr Client IP address - only filled if client is bound 16 4 yiaddr 'your' (Client) IP address 20 4 siaddr IP address of next server to use in bootstrap 24 4 giaddr Relay agent IP address, used in booting via RA 28 16 chaddr Client hardware address 44 64 sname Optional server host name, null-terminated string 108 128 file Boot file name, null-terminated string 236 var options Optional parameters field The options field has the following format: Offs Len Name Description 0 4 cookie 4-byte cookie field: 99.130.83.99 (0x63825363) Followed by 1-byte option codes and 1-byte option lengths, except for the two special fixed length options, pad (0) and end (255). Options are defined in slp_dhcp.h as TAG_XXX values. The two we really care about here are options TAG_SLP_DA and TAG_SLP_SCOPE, 78 and 79, respectively. The format for TAG_SLP_DA (starting with the tag) is: Offs Len Name Description 0 1 tag TAG_SLP_DA - directory agent ip addresses 1 1 length length of remaining data in the option 2 1 mand flag: the use of these DA's is mandatory 3 4 a(0) 4-byte ip address ... 3+n*4 4 a(n) 4-byte ip address The format for TAG_SLP_SCOPE (starting with the tag) is: Offs Len Name Description 0 1 tag TAG_SLP_SCOPE - directory scopes to use 1 1 length length of remaining data in the option 2 1 mand flag: the use of these scopes is mandatory 3 var scopes a null-terminated, comma-separated string of scopes The "DHCP Message Type" option must be included in every DHCP message. All tags except for TAG_PAD(0) and TAG_END(255) begin with a tag value followed by a length of remaining data value. =========================================================================*/ { UINT32 xid; time_t timer; struct timeval tv; int sockfd, retries; struct sockaddr_in sendaddr; unsigned char chaddr[MAX_MACADDR_SIZE]; unsigned char hlen, htype; unsigned char sndbuf[512]; unsigned char rcvbuf[512]; struct hostent *hep; unsigned char *p; size_t rcvbufsz = 0; char host[256]; /* Get our IP and MAC addresses */ if(gethostname(host, (int)sizeof(host)) || !(hep = gethostbyname(host)) || dhcpGetAddressInfo((unsigned char *)hep->h_addr, chaddr, &hlen, &htype)) return -1; /* get a reasonably random transaction id value */ xid = (UINT32)time(&timer); /* BOOTP request header */ memset(sndbuf, 0, 236); /* clear bootp header */ p = sndbuf; *p++ = BOOTREQUEST; /* opcode */ *p++ = htype; *p++ = hlen; p++; /* hops */ ToUINT32(p, xid); p += 2 * sizeof(UINT32); /* xid, secs, flags */ memcpy(p, hep->h_addr, 4); p += 4 * sizeof(UINT32); /* ciaddr, yiaddr, siaddr, giaddr */ memcpy(p, chaddr, hlen); p += 16 + 64 + 128; /* chaddr, sname and file */ *p++ = DHCP_COOKIE1; /* options, cookies 1-4 */ *p++ = DHCP_COOKIE2; *p++ = DHCP_COOKIE3; *p++ = DHCP_COOKIE4; /* DHCP Message Type option */ *p++ = TAG_DHCP_MSG_TYPE; *p++ = 1; /* option length */ *p++ = DHCP_MSG_INFORM; /* message type is DHCPINFORM */ /* DHCP Parameter Request option */ *p++ = TAG_DHCP_PARAM_REQ; /* request for DHCP parms */ *p++ = (unsigned char)dhcpOptCodeCnt; memcpy(p, dhcpOptCodes, dhcpOptCodeCnt); p += dhcpOptCodeCnt; /* DHCP Client Identifier option */ *p++ = TAG_CLIENT_IDENTIFIER; *p++ = hlen + 1; /* option length */ *p++ = htype; /* client id is htype/haddr */ memcpy(p, chaddr, hlen); p += hlen; /* End option */ *p++ = TAG_END; /* get a broadcast send/recv socket and address */ if((sockfd = dhcpCreateBCSkt(&sendaddr)) < 0) return -1; /* setup select timeout */ tv.tv_sec = 0; tv.tv_usec = INIT_TMOUT_USECS; retries = 0; srand((unsigned)time(&timer)); while (retries++ < MAX_DHCP_RETRIES) { if(dhcpSendRequest(sockfd, sndbuf, p - sndbuf, (struct sockaddr *)&sendaddr, &tv) < 0) { if (errno != ETIMEDOUT) { closesocket(sockfd); return -1; } } else if((rcvbufsz = dhcpRecvResponse(sockfd, rcvbuf, sizeof(rcvbuf), &tv)) < 0) { if (errno != ETIMEDOUT) { closesocket(sockfd); return -1; } } else if(rcvbufsz >= 236 && AsUINT32(&rcvbuf[4]) == xid) break; /* exponential backoff randomized by a uniform number between -1 and 1 */ tv.tv_usec = tv.tv_usec * 2 + (rand() % 3) - 1; tv.tv_sec = tv.tv_usec / USECS_PER_SEC; tv.tv_usec %= USECS_PER_SEC; } closesocket(sockfd); return rcvbufsz? dhcpProcessOptions(rcvbuf + 236, rcvbufsz - 236, dhcpInfoCB, context): -1; } /*-------------------------------------------------------------------------*/ int DHCPParseSLPTags(int tag, void *optdata, size_t optdatasz, void *context) /* Callback routined tests each DA discovered from DHCP and add it to the */ /* DA cache. */ /* */ /* Returns: 0 on success, or nonzero to stop being called. */ /*-------------------------------------------------------------------------*/ { int cpysz, bufsz; DHCPContext *ctxp = (DHCPContext *)context; unsigned char *p = (unsigned char *)optdata; unsigned char flags, dasize; int encoding; /* filter out zero length options */ if (!optdatasz) return 0; switch(tag) { case TAG_SLP_SCOPE: /* Draft 3 format is only supported for ASCII and UNICODE character encodings - UTF8 encodings must use rfc2610 format. To determine the format, we parse 2 bytes and see if the result is a valid encoding. If so it's draft 3, otherwise rfc2610. */ encoding = (optdatasz > 1)? AsUINT16(p): 0; if (encoding != CT_ASCII && encoding != CT_UNICODE) { /* rfc2610 format */ if (optdatasz == 1) break; /* UA's should ignore statically configured scopes for this interface - add code to handle this later... */ flags = *p++; /* pick up the mandatory flag... */ optdatasz--; if (flags) ; /* ...and add code to handle it later... */ /* copy utf8 string into return buffer */ cpysz = optdatasz < sizeof(ctxp->scopelist)? optdatasz: sizeof(ctxp->scopelist); strncpy(ctxp->scopelist, (char*)p, cpysz); ctxp->scopelist[sizeof(ctxp->scopelist) - 1] = 0; } else { /* draft 3 format: defined to configure scopes for SA's only so we should flag the scopes to be used only as registration filter scopes - add code to handle this case later... offs len name description 0 2 encoding character encoding used 2 n scopelist list of scopes as asciiz string. */ optdatasz -= 2; /* skip encoding bytes */ p += 2; /* if UNICODE encoding is used convert to utf8 */ if (encoding == CT_UNICODE) wcstombs(ctxp->scopelist, (wchar_t*)p, sizeof(ctxp->scopelist)); else { cpysz = optdatasz < sizeof(ctxp->scopelist)? optdatasz: sizeof(ctxp->scopelist); strncpy(ctxp->scopelist, (char*)p, cpysz); ctxp->scopelist[sizeof(ctxp->scopelist) - 1] = 0; } } break; case TAG_SLP_DA: flags = *p++; optdatasz--; /* If the flags byte has the high bit set, we know we are using draft 3 format, otherwise rfc2610 format. */ if (!(flags & DA_NAME_PRESENT)) { /* rfc2610 format */ if (flags) { /* If the mandatory byte is non-zero, indicate that multicast is not to be used to dynamically discover directory agents on this interface by setting the LACBF_STATIC_DA flag in the LACB for this interface. */ /* skip this for now - deal with it later... */ } bufsz = sizeof(ctxp->addrlist) - ctxp->addrlistlen; cpysz = (int)optdatasz < bufsz? optdatasz: bufsz; memcpy(ctxp->addrlist + ctxp->addrlistlen, p, cpysz); ctxp->addrlistlen += cpysz; } else { /* pre-rfc2610 (draft 3) format: offs len name description 0 1 flags contains 4 flags (defined above) 1 1 dasize name or addr length 2 dasize daname da name or ip address (flags) */ dasize = *p++; optdatasz--; if (dasize > optdatasz) dasize = optdatasz; if (flags & DA_NAME_IS_DNS) ; /* DA name contains dns name - we have to resolve - later... */ else { /* DA name is one 4-byte ip address */ if (dasize < 4) break; /* oops, bad option format */ dasize = 4; bufsz = sizeof(ctxp->addrlist) - ctxp->addrlistlen; cpysz = dasize < bufsz? dasize: bufsz; memcpy(ctxp->addrlist + ctxp->addrlistlen, p, cpysz); ctxp->addrlistlen += cpysz; } if (flags & DISABLE_DA_MCAST) ; /* this is the equivalent of the rfc2610 mandatory bit */ } break; } return 0; } openslp-1.2.1/common/slp_xmalloc.c0000644033442200000310000002644510207404657017051 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_xmalloc.h */ /* */ /* Abstract: Debug memory allocator */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifdef DEBUG #include "slp_xmalloc.h" /*=========================================================================*/ SLPList G_xmalloc_list = {0,0,0}; FILE* G_xmalloc_fh = 0; size_t G_xmalloc_freemem = 0; size_t G_xmalloc_allocmem = 0; /*=========================================================================*/ /*-------------------------------------------------------------------------*/ void _xmalloc_log(xallocation_t* x) /*-------------------------------------------------------------------------*/ { size_t i; if(G_xmalloc_fh) { fprintf(G_xmalloc_fh,"xmalloced memory:\n"); fprintf(G_xmalloc_fh," x->where = %s\n",x->where); fprintf(G_xmalloc_fh," x->size = %i\n",x->size); fprintf(G_xmalloc_fh," x->buf = %p {",x->buf); for (i=0;isize && i < SLPXMALLOC_MAX_BUF_LOG_LEN;i++) { fprintf(G_xmalloc_fh,"%c",((char*)(x->buf))[i]); } fprintf(G_xmalloc_fh,"}\n"); } } /*-------------------------------------------------------------------------*/ xallocation_t* _xmalloc_find(void* buf) /*-------------------------------------------------------------------------*/ { xallocation_t* x; x = (xallocation_t*)G_xmalloc_list.head; while(x) { if(x->buf == buf) { break; } x = (xallocation_t*)(x->listitem.next); } return x; } /*=========================================================================*/ void* _xmalloc(const char* file, int line, size_t size) /*=========================================================================*/ { xallocation_t* x; if(G_xmalloc_freemem && G_xmalloc_allocmem + size > G_xmalloc_freemem) { if(G_xmalloc_fh) { fprintf(G_xmalloc_fh,"\n*** Simulating out of memory error ***\n\n"); } return NULL; } x = malloc(sizeof(xallocation_t)); if(x == NULL) { if(G_xmalloc_fh) { fprintf(G_xmalloc_fh,"\n*** Real out of memory error ***\n\n"); } return NULL; } x->buf = malloc(size); if(x->buf == NULL) { if(G_xmalloc_fh) { fprintf(G_xmalloc_fh,"\n*** Real out of memory error ***\n\n"); } return NULL; } SLPListLinkTail(&G_xmalloc_list, (SLPListItem*)x); x->size = size; snprintf(x->where,SLPXMALLOC_MAX_WHERE_LEN,"%s:%i",file,line); G_xmalloc_allocmem += size; if(G_xmalloc_fh) { fprintf(G_xmalloc_fh,"Called xmalloc() %s:%i ",file,line); _xmalloc_log(x); } return x->buf; } /*=========================================================================*/ void _xfree(const char* file, int line, void* buf) /*=========================================================================*/ { xallocation_t* x; x =_xmalloc_find(buf); if(x == NULL) { if(G_xmalloc_fh) { fprintf(G_xmalloc_fh, "*** xfree called on non xmalloced memory ***\n"); } return; } if(G_xmalloc_fh) { fprintf(G_xmalloc_fh,"Called xfree() %s:%i ",file,line); _xmalloc_log(x); } G_xmalloc_allocmem -= x->size; free(x->buf); free(SLPListUnlink(&G_xmalloc_list, (SLPListItem*)x)); } /*=========================================================================*/ void* _xrealloc(const char* file, int line, void* buf, size_t size) /*=========================================================================*/ { xallocation_t* x; if(G_xmalloc_freemem && G_xmalloc_allocmem + size > G_xmalloc_freemem) { if(G_xmalloc_fh) { fprintf(G_xmalloc_fh,"\n*** Simulating out of memory error ***\n\n"); } return NULL; } if(buf) { x =_xmalloc_find(buf); if(x == NULL) { if(G_xmalloc_fh) { fprintf(G_xmalloc_fh, "*** xrealloc called on non xmalloced memory ***\n"); } return NULL; } G_xmalloc_allocmem -= x->size; } else { x = malloc(sizeof(xallocation_t)); if(x == NULL) { if(G_xmalloc_fh) { fprintf(G_xmalloc_fh,"\n*** Real out of memory error ***\n\n"); } return NULL; } SLPListLinkTail(&G_xmalloc_list, (SLPListItem*)x); } x->buf = realloc(buf,size); if(x->buf == NULL) { if(G_xmalloc_fh) { fprintf(G_xmalloc_fh,"\n*** Real out of memory error ***\n\n"); } return NULL; } snprintf(x->where,SLPXMALLOC_MAX_WHERE_LEN,"%s:%i",file,line); x->size = size; G_xmalloc_allocmem += size; if(G_xmalloc_fh) { fprintf(G_xmalloc_fh,"Called xrealloc() %s:%i ", file, line); _xmalloc_log(x); } return x->buf; } /*=========================================================================*/ char* _xstrdup(const char* file, int line, const char* str) /*=========================================================================*/ { xallocation_t* x; size_t strlength = strlen(str); if(G_xmalloc_freemem && G_xmalloc_allocmem + strlength > G_xmalloc_freemem) { if(G_xmalloc_fh) { fprintf(G_xmalloc_fh,"\n*** Simulating out of memory error ***\n\n"); } return NULL; } x = malloc(sizeof(xallocation_t)); if(x == NULL) { if(G_xmalloc_fh) { fprintf(G_xmalloc_fh,"\n*** Real out of memory error ***\n\n"); } return NULL; } x->buf = strdup(str); if(x->buf == NULL) { if(G_xmalloc_fh) { fprintf(G_xmalloc_fh,"\n*** Real out of memory error ***\n\n"); } return NULL; } x->size = strlength; snprintf(x->where,SLPXMALLOC_MAX_WHERE_LEN,"%s:%i",file,line); G_xmalloc_allocmem += strlength; if(G_xmalloc_fh) { fprintf(G_xmalloc_fh,"Called xstrdup() %s:%i ",file,line); _xmalloc_log(x); } SLPListLinkTail(&G_xmalloc_list, (SLPListItem*)x); return (char*)x->buf; } /*=========================================================================*/ int xmalloc_init(const char* filename, size_t freemem) /*=========================================================================*/ { G_xmalloc_fh = fopen(filename, "w"); if(G_xmalloc_fh) { return 0; } G_xmalloc_freemem = freemem; return 1; } /*=========================================================================*/ int xmalloc_report() /*=========================================================================*/ { xallocation_t* x; if(G_xmalloc_fh) { fprintf(G_xmalloc_fh, "\n*** Start of xmalloc_report ***\n"); } x = (xallocation_t*)G_xmalloc_list.head; while(x) { _xmalloc_log(x); x = (xallocation_t*)(x->listitem.next);; } if(G_xmalloc_fh) { fprintf(G_xmalloc_fh, "*** End of xmalloc_report ***\n\n"); } return 0; } /*=========================================================================*/ void xmalloc_deinit() /*=========================================================================*/ { xmalloc_report(); if(G_xmalloc_fh) { fclose(G_xmalloc_fh); G_xmalloc_fh = NULL; } while(G_xmalloc_list.count) { free((xallocation_t*)SLPListUnlink(&G_xmalloc_list,G_xmalloc_list.head)); } memset(&G_xmalloc_list,0,sizeof(G_xmalloc_list)); } #endif openslp-1.2.1/common/slp_utf8.c0000644033442200000310000002534110204465532016266 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slp_utf8.c */ /* */ /* Abstract: Do conversions between UTF-8 and other character encodings */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include #include "slp_message.h" #include "slp_v1message.h" /* The following two routines are adapted from Ken Thompson's fss-utf.c. * See ftp://ftp.informatik.uni-erlangen.de/pub/doc/ISO/charsets/utf-8.c */ typedef struct { int cmask; int cval; int shift; long lmask; long lval; } Tab; static Tab tab[] = { { 0x80, 0x00, 0*6, 0x7F, 0}, /* 1 byte sequence */ { 0xE0, 0xC0, 1*6, 0x7FF, 0x80}, /* 2 byte sequence */ { 0xF0, 0xE0, 2*6, 0xFFFF, 0x800}, /* 3 byte sequence */ { 0xF8, 0xF0, 3*6, 0x1FFFFF, 0x10000}, /* 4 byte sequence */ { 0xFC, 0xF8, 4*6, 0x3FFFFFF, 0x200000}, /* 5 byte sequence */ { 0xFE, 0xFC, 5*6, 0x7FFFFFFF, 0x4000000}, /* 6 byte sequence */ { 0, 0, 0, 0, 0} /* end of table */ }; static int utftouni(unsigned *p, const char *s, size_t n) { long l; int c0, c; size_t nc; Tab *t; if(s == 0) return 0; nc = 0; if(n <= nc) return -1; c0 = *s & 0xff; l = c0; for(t = tab; t->cmask; t++) { nc++; if((c0 & t->cmask) == t->cval) { l &= t->lmask; if(l < t->lval) return -1; *p = l; return (int)nc; } if(n <= nc) return -1; s++; c = (*s ^ 0x80) & 0xFF; if(c & 0xC0) return -1; l = (l << 6) | c; } return -1; } static int unitoutf(char *s, unsigned wc) { long l; int c, nc; Tab *t; if(s == 0) return 0; l = wc; nc = 0; for(t=tab; t->cmask; t++) { nc++; if(l <= t->lmask) { c = t->shift; *s = (char)(t->cval | ( l >> c )); while(c > 0) { c -= 6; s++; *s = (char)(0x80 | (( l >> c) & 0x3F)); } return nc; } } return -1; } /*=========================================================================*/ int SLPv1AsUTF8(int encoding, char *string, int *len) /* Converts a SLPv1 encoded string to a UTF-8 character string in */ /* place. If string does not have enough space to hold the encoded string */ /* we are dead. */ /* */ /* encoding - (IN) unicode encoding of the string passed in */ /* */ /* string - (INOUT) IN - pointer to SLPv1 encoded string */ /* OUT - pointer to converted UTF-8 string. */ /* */ /* len - (INOUT) IN - length of SLPv1 encoded string (in bytes) */ /* OUT - length of UTF-8 string (in bytes) */ /* */ /* Returns - Zero on success, SLP_ERROR_PARSE_ERROR, or */ /* SLP_ERROR_INTERNAL_ERROR if out of memory. string and len */ /* invalid if return is not successful. */ /* */ /*=========================================================================*/ { int nc; unsigned uni; char utfchar[6]; /* UTF-8 chars are at most 6 bytes */ char *utfstring = string, *unistring = string; if(encoding == SLP_CHAR_ASCII || encoding == SLP_CHAR_UTF8) return 0; if(encoding != SLP_CHAR_UNICODE16 && encoding != SLP_CHAR_UNICODE32) return SLP_ERROR_INTERNAL_ERROR; while(*len) { if(encoding == SLP_CHAR_UNICODE16) { uni = AsUINT16(unistring); unistring += 2; *len -= 2; } else { uni = AsUINT32(unistring); unistring += 4; *len -= 4; } if(*len < 0) return SLP_ERROR_INTERNAL_ERROR; nc = unitoutf(utfchar, uni); /* Take care not to overwrite. */ if(nc < 0 || utfstring + nc > unistring) return SLP_ERROR_INTERNAL_ERROR; memcpy(utfstring, utfchar, nc); utfstring += nc; } *len = utfstring - string; return 0; } /*=========================================================================*/ int SLPv1ToEncoding(char *string, int *len, int encoding, const char *utfstring, int utflen) /* Converts a UTF-8 character string to a SLPv1 encoded string. */ /* When called with string set to null returns number of bytes needed */ /* in string. */ /* */ /* string - (OUT) SLPv1 encoded string. */ /* */ /* len - (INOUT) IN - bytes available in string */ /* OUT - bytes used up in string */ /* */ /* encoding - (IN) encoding of the string passed in */ /* */ /* utfstring - (IN) pointer to UTF-8 string */ /* */ /* utflen - (IN) length of UTF-8 string */ /* */ /* Returns - Zero on success, SLP_ERROR_PARSE_ERROR, or */ /* SLP_ERROR_INTERNAL_ERROR if out of memory. string and len */ /* invalid if return is not successful. */ /* */ /*=========================================================================*/ { unsigned uni; int nc, total = 0; if(encoding == SLP_CHAR_ASCII || encoding == SLP_CHAR_UTF8) { if(*len < utflen) return SLP_ERROR_INTERNAL_ERROR; *len = utflen; if(string) memcpy(string, utfstring, utflen); return 0; } if(encoding != SLP_CHAR_UNICODE16 && encoding != SLP_CHAR_UNICODE32) return SLP_ERROR_INTERNAL_ERROR; while(utflen) { nc = utftouni(&uni, utfstring, utflen); utflen -= nc; if(nc < 0 || utflen < 0) return SLP_ERROR_INTERNAL_ERROR; utfstring += nc; if(encoding == SLP_CHAR_UNICODE16) { if(string) { ToUINT16(string, uni); string += 2; } total += 2; } else { if(string) { ToUINT32(string, uni); string += 4; } total += 4; } if(total > *len) return SLP_ERROR_INTERNAL_ERROR; } *len = total; return 0; } openslp-1.2.1/common/slp_network.h0000644033442200000310000002072310202047412017064 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_network.h */ /* */ /* Abstract: Implementation for functions that are related */ /* network (and ipc) communication. */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #if(!defined SLP_NETWORK_H_INCLUDED) #define SLP_NETWORK_H_INCLUDED #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include #include #include #if(_WIN32_WINNT >= 0x0400 && _WIN32_WINNT < 0x0500) #include #endif #define ETIMEDOUT 110 #define ENOTCONN 107 #else #include #include #include #include #include #include #include #include #include #include #endif #include "slp_buffer.h" #include "slp_property.h" #include "slp_message.h" #include "slp_xid.h" /*=========================================================================*/ int SLPNetworkConnectStream(struct sockaddr_in* peeraddr, struct timeval* timeout); /* Connect a TCP stream to the specified peer */ /* */ /* peeraddr (IN) pointer to the peer to connect to */ /* */ /* timeout (IN) pointer to the maximum time to spend connecting */ /* */ /* returns: a connected socket or -1 */ /*=========================================================================*/ /*=========================================================================*/ int SLPNetworkConnectToMulticast(struct sockaddr_in* peeraddr, int ttl); /* Creates a socket and provides a peeraddr to send to */ /* */ /* peeraddr (OUT) pointer to receive the connected DA's address */ /* */ /* ttl (IN) ttl for the mcast socket */ /* */ /* Returns Valid socket or -1 if no DA connection can be made */ /*=========================================================================*/ /*=========================================================================*/ int SLPNetworkConnectToBroadcast(struct sockaddr_in* peeraddr); /* Creates a socket and provides a peeraddr to send to */ /* */ /* peeraddr (OUT) pointer to receive the connected DA's address */ /* */ /* peeraddrlen (IN/OUT) Size of the peeraddr structure */ /* */ /* Returns Valid socket or -1 if no DA connection can be made */ /*=========================================================================*/ /*=========================================================================*/ int SLPNetworkSendMessage(int sockfd, int socktype, SLPBuffer buf, struct sockaddr_in* peeraddr, struct timeval* timeout); /* Sends a message */ /* */ /* Returns - zero on success non-zero on failure */ /* */ /* errno EPIPE error during write */ /* ETIME read timed out */ /*=========================================================================*/ /*=========================================================================*/ int SLPNetworkRecvMessage(int sockfd, int socktype, SLPBuffer* buf, struct sockaddr_in* peeraddr, struct timeval* timeout); /* Receives a message */ /* */ /* Returns - zero on success, non-zero on failure */ /* */ /* errno ENOTCONN error during read */ /* ETIME read timed out */ /* ENOMEM out of memory */ /* EINVAL parse error */ /*=========================================================================*/ #endif openslp-1.2.1/common/slp_v1message.h0000644033442200000310000001521510202047412017266 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_v1message.h */ /* */ /* Abstract: Header file that defines prototypes for SLPv1 messages */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #if(!defined SLP_V1MESSAGE_H_INCLUDED) #define SLP_V1MESSAGE_H_INCLUDED #include "slp_message.h" /*=========================================================================*/ /* SLP language encodings for SLPv1 compatibility */ /*=========================================================================*/ #define SLP_CHAR_ASCII 3 #define SLP_CHAR_UTF8 106 #define SLP_CHAR_UNICODE16 1000 #define SLP_CHAR_UNICODE32 1001 /*=========================================================================*/ /* SLPv1 Flags */ /*=========================================================================*/ #define SLPv1_FLAG_OVERFLOW 0x80 #define SLPv1_FLAG_MONOLING 0x40 #define SLPv1_FLAG_URLAUTH 0x20 #define SLPv1_FLAG_ATTRAUTH 0x10 #define SLPv1_FLAG_FRESH 0x08 /*=========================================================================*/ /* Prototypes for SLPv1 functions */ /*=========================================================================*/ /*=========================================================================*/ extern int SLPv1MessageParseBuffer(struct sockaddr_in* peerinfo, SLPBuffer buffer, SLPMessage message); /* Initializes a SLPv1 message descriptor by parsing the specified buffer. */ /* */ /* peerinfo - (IN pointer to information about where buffer came from */ /* */ /* buffer - (IN) pointer the SLPBuffer to parse */ /* */ /* message - (OUT) set to describe the message from the buffer */ /* */ /* Returns - Zero on success, SLP_ERROR_PARSE_ERROR, or */ /* SLP_ERROR_INTERNAL_ERROR if out of memory. SLPMessage is */ /* invalid return is not successful. */ /* */ /* WARNING - If successful, pointers in the SLPMessage reference memory in*/ /* the parsed SLPBuffer. If SLPBufferFree() is called then the */ /* pointers in SLPMessage will be invalidated. */ /*=========================================================================*/ /*=========================================================================*/ extern int SLPv1MessageParseHeader(SLPBuffer buffer, SLPHeader* header); /* */ /* Returns - Zero on success, SLP_ERROR_VER_NOT_SUPPORTED, or */ /* SLP_ERROR_PARSE_ERROR. */ /*=========================================================================*/ #endif openslp-1.2.1/common/slp_database.h0000644033442200000310000003154310202047412017141 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_database.h */ /* */ /* Abstract: An SLP message database. The SLP message database holds */ /* actual SLP "wire" message buffers as well as structures */ /* that interpret the message buffer. The database exposes */ /* an interface suitable linked-list based implementation */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLP_DATABASE_H_INCLUDED #define SLP_DATABASE_H_INCLUDED #include "slp_message.h" #include "slp_buffer.h" #include "slp_linkedlist.h" /*=========================================================================*/ typedef struct _SLPDatabaseEntry /*=========================================================================*/ { SLPListItem listitem; SLPMessage msg; SLPBuffer buf; }SLPDatabaseEntry; /*=========================================================================*/ typedef SLPList SLPDatabase; /*=========================================================================*/ /*=========================================================================*/ typedef struct _SLPDatabaseHandle /*=========================================================================*/ { SLPDatabase* database; SLPDatabaseEntry* current; }*SLPDatabaseHandle; /*=========================================================================*/ int SLPDatabaseInit(SLPDatabase* database); /* Initialize a SLPDatabase. */ /* */ /* Parameters: database (IN) pointer to the database to initialize */ /* */ /* */ /* Returns: zero on success. Non-zero on error */ /*=========================================================================*/ /*=========================================================================*/ void SLPDatabaseDeinit(SLPDatabase* database); /* Deinitialze a SLPDatabase */ /* */ /* Parameters: database (IN) pointer to the database to de-initialize */ /* */ /* Returns: none */ /*=========================================================================*/ /*=========================================================================*/ SLPDatabaseEntry* SLPDatabaseEntryCreate(SLPMessage msg, SLPBuffer buf); /* Create a SLPDatabaseEntry. */ /* */ /* Parameters: msg (IN) The interpreting message structure for buf */ /* buf (IN) The SLP message buffer */ /* */ /* Returns: Pointer to a new SLPDatabaseEntry. NULL if out of memory */ /* */ /* Note: VERY IMPORTANT. The msg and especially the buf are owned by the */ /* returned SLPDatabaseEntry and MUST NOT be freed by the caller */ /* via SLPMessageFree() or SLPBufferFree()! Instead, the caller */ /* should use SLPDatabaseEntryDestroy() only to free memory */ /*=========================================================================*/ /*=========================================================================*/ void SLPDatabaseEntryDestroy(SLPDatabaseEntry* entry); /* Free resources associated with the specified entry */ /* */ /* Parameters: entry (IN) pointer to the entry to destroy */ /* */ /* Returns: none */ /*=========================================================================*/ /*=========================================================================*/ SLPDatabaseHandle SLPDatabaseOpen(SLPDatabase* database); /* Open a handle that is used with subsequent calls to SLPDatabaseEnum(), */ /* SLPDatabaseAdd() and SLPDatabaseRemove() */ /* */ /* Parameters (IN) pointer an initialized SLPDatabase */ /* */ /* Returns: Valid handle. NULL on error. */ /* */ /* Note: It is important to make sure that handles returned by this */ /* function are used and closed as quickly as possible. Future */ /* may use handles to ensure syncronized access to the database */ /* in threaded environments */ /*=========================================================================*/ /*=========================================================================*/ SLPDatabaseEntry* SLPDatabaseEnum(SLPDatabaseHandle dh); /* Used to enumerate through entries of a SLPDatabase */ /* */ /* Parameters: dh (IN) A handle obtained via SLPDatabaseOpen() */ /* */ /* Returns: Pointer to a SLPDatabase entry or NULL if end of enumeration */ /* has been reached. */ /*=========================================================================*/ /*=========================================================================*/ void SLPDatabaseRewind(SLPDatabaseHandle dh); /* Reset handle so SLPDatabaseEnum starts at the beginning again */ /* */ /* Parameters: eh (IN) A handle obtained via SLPDatabaseOpen() */ /* */ /* Returns: None */ /*=========================================================================*/ /*=========================================================================*/ void SLPDatabaseClose(SLPDatabaseHandle dh); /* Closes a handle obtained from SLPDatabaseOpen() */ /* */ /* Parameters: dh (IN) a handle obtained from SLPDatabaseOpenEnum() */ /* */ /* Returns: None */ /*=========================================================================*/ /*=========================================================================*/ void SLPDatabaseRemove(SLPDatabaseHandle dh, SLPDatabaseEntry* entry); /* Removes the specified entry */ /* */ /* Parameters: dh (IN) The SLPDatabaseEnumHandle used to obtain */ /* the entry in the first place */ /* entry (IN) The entry to remove */ /* */ /* Returns: None */ /* */ /* Note: During removal SLPDatabaseEntryDestroy() is called on entry. */ /* This means that you MUST NOT use entry after it is removed */ /*=========================================================================*/ /*=========================================================================*/ void SLPDatabaseAdd(SLPDatabaseHandle dh, SLPDatabaseEntry* entry); /* Add the specified entry */ /* */ /* Parameters: dh (IN) handle obtained from SLPDatabseOpen() */ /* entry (IN) the entry to add */ /* */ /* Return: None */ /* */ /* Note: DO NOT call SLPDatabaseEntryDestroy() on an entry that has been */ /* added to the database. Instead call SLPDatabaseDeinit() or */ /* SLPDatabaseRemove() to free resources associated with an added */ /* entry */ /*=========================================================================*/ /*=========================================================================*/ int SLPDatabaseCount(SLPDatabaseHandle dh); /* Returns the number of entries that are in the database */ /*=========================================================================*/ #endif openslp-1.2.1/common/slp_attr_l.l0000644033442200000310000001552610210657206016700 0ustar rganesanfloppy/******************************************************************* * Description: encode/decode attribute lists * * Originated: 03-06-2000 * Original Author: Mike Day - md@soft-hackle.net * * Copyright (C) Michael Day, 2000-2001 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *******************************************************************/ %{ #undef YYLMAX #define YYLMAX 2048 #define yymaxdepth slp_attr_maxdepth #define yyparse slp_attr_parse #define yylex slp_attr_lex #define yyerror slp_attr_error #define yylval slp_attr_lval #define yychar slp_attr_char #define yydebug slp_attr_debug #define yypact slp_attr_pact #define yyr1 slp_attr_r1 #define yyr2 slp_attr_r2 #define yydef slp_attr_def #define yychk slp_attr_chk #define yypgo slp_attr_pgo #define yyact slp_attr_act #define yyexca slp_attr_exca #define yyerrflag slp_attr_errflag #define yynerrs slp_attr_nerrs #define yyps slp_attr_ps #define yypv slp_attr_pv #define yys slp_attr_s #define yy_yys slp_attr_yys #define yystate slp_attr_state #define yytmp slp_attr_tmp #define yyv slp_attr_v #define yy_yyv slp_attr_yyv #define yyval slp_attr_val #define yylloc slp_attr_lloc #define yyreds slp_attr_reds #define yytoks slp_attr_toks #define yylhs slp_attr_yylhs #define yylen slp_attr_yylen #define yydefred slp_attr_yydefred #define yydgoto slp_attr_yydgoto #define yysindex slp_attr_yysindex #define yyrindex slp_attr_yyrindex #define yygindex slp_attr_yygindex #define yytable slp_attr_yytable #define yycheck slp_attr_yycheck #define yyname slp_attr_yyname #define yyrule slp_attr_yyrule #define YY_NO_UNPUT #include "slp_attr.h" #include "slp_attr_y.h" #include "slp_xmalloc.h" static char buf[2052]; void slp_attr_error(char *, ...); int slp_attr_wrap(void); int slp_attr_lex(void); void slp_attr_close_lexer(unsigned int handle); unsigned int slp_attr_init_lexer(char *s); %} /* {} */ digit [0-9] hexdigit [0-9a-fA-F] escaped ("\\"([a-fA-F0-9]{2})) reserved [(),\\!<=>~\x00-\x1f] res_tag [(),\\!<>~\x00-\x1f*_\r\n\t] res_val [*_\r\n\t] tag [^(),\\!<=>~\x00-\x1f] val [^(),\\!<>~\x00-\x1f*_\r\n\t] /* this lexer cycles through three states. in the initial state, it is looking strictly for attribute tags. If, in the initial state it finds a '(' it anticipates an attribute-value pair and changes to ATTRIBUTE state . in the ATTRIBUTE state is is looking for either a closing ')' or a '='. If it sees a closing ')' it changes to the initial state. if it sees an '=' it changes to the VALUE state and looks for the attribute value. After seeing the attribute value, it looks for a either a ')' or a ','. If it sees a ')' it closes the attribute and returns to the initial state. if, during the VALUE state the lexer sees a ',' it decides it is looking at a multi-valued attribute and returns a special _MULTIVAL token to the parser. The parser uses this to construct additional attribute-value pairs for each value in the multi-val statement. */ %option noyywrap %x ATTR %x VALUE %% [ \t\v\f]* { ; } "," { yylval._i = *yytext; return(yylval._i); } "(" { BEGIN ATTR; yylval._i = *yytext; return(yylval._i); } {tag}+ { if (yyleng > 0) { if(NULL != (yylval._s = xstrdup(yytext))) return(_TAG); else return(0L); } } /* anything else in the initial state is an error */ . {yyerror("error in lexer - initial state\n");} [ \t\v\f]* { ; } "=" {BEGIN VALUE; yylval._i = *yytext; return(yylval._i);} {tag}+ { if (yyleng > 0 ) { if(NULL != (yylval._s = xstrdup(yytext))) return(_TAG); else return(0L); } } /* make it legal to have just an attr tag enclosed in parens */ ")" {BEGIN INITIAL; yylval._i = *yytext; return(yylval._i); } /* anything else in the attribute state is an error */ . {yyerror("error in lexer - attribute state\n");} [ \t\v\f]* { ; } "," {yylval._i = *yytext; return(_MULTIVAL);} [-+][0-9]+ | [-+]"0"[xX]{hexdigit}+ { yylval._i = strtol(yytext, (char **) 0, 0); return _INT ;}; [0-9]+ | "0"[xX]{hexdigit}+ { yylval._i = strtoul(yytext, (char **)0, 0); return _INT; }; [tT][rR][uU][eE] {return(_TRUE);} [fF][aA][lL][sS][eE] {return(_FALSE);} {val}+ { if (yyleng > 0) { if(NULL != (yylval._s = xstrdup(yytext))) return(_STRING); else return(0L); } } {escaped}+ { if (yyleng > 0) { if(NULL != (yylval._s = xstrdup(yytext))) return(_ESCAPED); else return(0L); } } ")" {BEGIN INITIAL; yylval._i = *yytext; return(yylval._i);} /* anything else in the value state is an error */ . {yyerror("error in lexer - value state\n");} %% unsigned int slp_attr_init_lexer(char *s) { memset(&buf[0], 0x00, 2052); strncpy(&buf[0], s, 2052); return((unsigned int)yy_scan_buffer(&buf[0], strlen(s) + 2)); } void attr_close_lexer(unsigned int handle) { // assert(handle != 0); yy_delete_buffer((YY_BUFFER_STATE)handle); } void yyerror(char *s, ...) { return; } openslp-1.2.1/common/slp_message.h0000644033442200000310000005240310204452352017024 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_message.h */ /* */ /* Abstract: Header file that defines structures and constants that are */ /* specific to the SLP wire protocol messages. */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #if(!defined SLP_MESSAGE_H_INCLUDED) #define SLP_MESSAGE_H_INCLUDED #include "slp_buffer.h" #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef _WIN32 # define WIN32_LEAN_AND_MEAN # include # include # ifndef UINT32_T_DEFINED # define UINT32_T_DEFINED typedef unsigned int uint32_t; # endif #else # include # ifdef __FreeBSD__ # include /* for limits.h - INT_MAX slpd*/ # endif # include /* for htonl() routines */ # ifdef HAVE_STDINT_H # include # else # include # endif #endif typedef char CHAR; typedef unsigned char UINT8; typedef unsigned short UINT16; #ifndef _WIN32 typedef unsigned long UINT32; #endif typedef CHAR* PCHAR; typedef UINT8* PUINT8; typedef UINT16* PUINT16; typedef UINT32* PUINT32; /*=========================================================================*/ /* SLP Important constants */ /*=========================================================================*/ #define SLP_RESERVED_PORT 427 #define SLP_MCAST_ADDRESS 0xeffffffd /* 239.255.255.253 */ #define SLP_BCAST_ADDRESS 0xffffffff /* 255.255.255.255 */ #define SLPv1_DA_MCAST_ADDRESS 0xe0000123 /* 224.0.1.35 */ #define LOOPBACK_ADDRESS 0x7f000001 /* 127.0.0.1 */ #define SLP_MAX_DATAGRAM_SIZE 1400 #if(!defined SLP_LIFETIME_MAXIMUM) #define SLP_LIFETIME_MAXIMUM 0xffff #endif /*=========================================================================*/ /* SLP Function ID constants */ /*=========================================================================*/ #define SLP_FUNCT_SRVRQST 1 #define SLP_FUNCT_SRVRPLY 2 #define SLP_FUNCT_SRVREG 3 #define SLP_FUNCT_SRVDEREG 4 #define SLP_FUNCT_SRVACK 5 #define SLP_FUNCT_ATTRRQST 6 #define SLP_FUNCT_ATTRRPLY 7 #define SLP_FUNCT_DAADVERT 8 #define SLP_FUNCT_SRVTYPERQST 9 #define SLP_FUNCT_SRVTYPERPLY 10 #define SLP_FUNCT_SAADVERT 11 /*=========================================================================*/ /* SLP Protocol Error codes */ /*=========================================================================*/ #define SLP_ERROR_OK 0 #define SLP_ERROR_LANGUAGE_NOT_SUPPORTED 1 #define SLP_ERROR_PARSE_ERROR 2 #define SLP_ERROR_INVALID_REGISTRATION 3 #define SLP_ERROR_SCOPE_NOT_SUPPORTED 4 #define SLP_ERROR_CHARSET_NOT_UNDERSTOOD 5 /* valid only for SLPv1 */ #define SLP_ERROR_AUTHENTICATION_UNKNOWN 5 #define SLP_ERROR_AUTHENTICATION_ABSENT 6 #define SLP_ERROR_AUTHENTICATION_FAILED 7 #define SLP_ERROR_VER_NOT_SUPPORTED 9 #define SLP_ERROR_INTERNAL_ERROR 10 #define SLP_ERROR_DA_BUSY_NOW 11 #define SLP_ERROR_INVALID_UPDATE 13 #define SLP_ERROR_MESSAGE_NOT_SUPPORTED 14 #define SLP_ERROR_REFRESH_REJECTED 15 /*=========================================================================*/ /* SLP Flags */ /*=========================================================================*/ #define SLP_FLAG_OVERFLOW 0x8000 #define SLP_FLAG_FRESH 0x4000 #define SLP_FLAG_MCAST 0x2000 #ifndef UNICAST_NOT_SUPPORTED #define SLP_FLAG_UCAST 0x0000 #endif /*=========================================================================*/ /* SLP Constants */ /*=========================================================================*/ /* Max time to wait for a complete multicast query response */ #define CONFIG_MC_MAX 15 /* Wait interval to give up on a unicast request retransmission */ #define CONFIG_RETRY_MAX 15 /* Default wait between retransmits*/ #define CONFIG_RETRY_INTERVAL 3 #define SLP_DA_SERVICE_TYPE "service:directory-agent" #define SLP_SA_SERVICE_TYPE "service:service-agent" /*=========================================================================*/ /* SLP Registration Sources */ /*=========================================================================*/ #define SLP_REG_SOURCE_UNKNOWN 0 #define SLP_REG_SOURCE_REMOTE 1 /* from a remote host */ #define SLP_REG_SOURCE_LOCAL 2 /* from localhost or IPC */ #define SLP_REG_SOURCE_STATIC 3 /* from the slp.reg file */ /*=========================================================================*/ /* SLP Extension IDs */ /*=========================================================================*/ #define SLP_EXTENSION_ID_REG_PID 0x9799 /*=========================================================================*/ /* SLPHeader structure and associated functions */ /*=========================================================================*/ typedef struct _SLPHeader { int version; int functionid; int length; int flags; int encoding; /* language encoding, valid only for SLPv1 */ int extoffset; int xid; int langtaglen; const char* langtag; /* points into the translated message */ }SLPHeader; /*=========================================================================*/ /* SLPAuthBlock structure and associated functions */ /*=========================================================================*/ typedef struct _SLPAuthBlock { unsigned int bsd; int length; unsigned int timestamp; int spistrlen; const char* spistr; const unsigned char* authstruct; /* The following are not part of the RFC protocol. They are used by */ /* the OpenSLP implementation for convenience */ int opaquelen; char* opaque; }SLPAuthBlock; /*=========================================================================*/ /* SLPUrlEntry structure and associated functions */ /*=========================================================================*/ typedef struct _SLPUrlEntry { char reserved; /* This will always be 0 */ int lifetime; int urllen; const char* url; int authcount; SLPAuthBlock* autharray; /* The following are not part of the RFC protocol. They are used by */ /* the OpenSLP implementation for convenience */ int opaquelen; char* opaque; }SLPUrlEntry; /*=========================================================================*/ /* SLPSrvRqst structure and associated functions */ /*=========================================================================*/ typedef struct _SLPSrvRqst { int prlistlen; const char* prlist; int srvtypelen; const char* srvtype; int scopelistlen; const char* scopelist; int predicatever; int predicatelen; const char* predicate; int spistrlen; const char* spistr; }SLPSrvRqst; /*=========================================================================*/ typedef struct _SLPSrvRply /*=========================================================================*/ { int errorcode; int urlcount; SLPUrlEntry* urlarray; }SLPSrvRply; /*=========================================================================*/ typedef struct _SLPSrvReg /*=========================================================================*/ { SLPUrlEntry urlentry; int srvtypelen; const char* srvtype; int scopelistlen; const char* scopelist; int attrlistlen; const char* attrlist; int authcount; SLPAuthBlock* autharray; /* The following are used for OpenSLP specific extensions */ uint32_t pid; /* The following are not part of the RFC protocol. They are used by */ /* the OpenSLP implementation for convenience */ int source; }SLPSrvReg; /*=========================================================================*/ typedef struct _SLPSrvDeReg /*=========================================================================*/ { int scopelistlen; const char* scopelist; SLPUrlEntry urlentry; int taglistlen; const char* taglist; }SLPSrvDeReg; /*=========================================================================*/ typedef struct _SLPSrvAck /*=========================================================================*/ { int errorcode; }SLPSrvAck; /*=========================================================================*/ typedef struct _SLPDAAdvert /*=========================================================================*/ { int errorcode; unsigned int bootstamp; int urllen; const char* url; int scopelistlen; const char* scopelist; int attrlistlen; const char* attrlist; int spilistlen; const char* spilist; int authcount; SLPAuthBlock* autharray; }SLPDAAdvert; /*=========================================================================*/ typedef struct _SLPAttrRqst /*=========================================================================*/ { int prlistlen; const char* prlist; int urllen; const char* url; int scopelistlen; const char* scopelist; int taglistlen; const char* taglist; int spistrlen; const char* spistr; }SLPAttrRqst; /*=========================================================================*/ typedef struct _SLPAttrRply /*=========================================================================*/ { int errorcode; int attrlistlen; const char* attrlist; int authcount; SLPAuthBlock* autharray; }SLPAttrRply; /*=========================================================================*/ typedef struct _SLPSrvTypeRqst /*=========================================================================*/ { int prlistlen; const char* prlist; int namingauthlen; const char* namingauth; int scopelistlen; const char* scopelist; }SLPSrvTypeRqst; /*=========================================================================*/ typedef struct _SLPSrvTypeRply /*=========================================================================*/ { int errorcode; int srvtypelistlen; const char* srvtypelist; }SLPSrvTypeRply; /*=========================================================================*/ typedef struct _SLPSAAdvert /*=========================================================================*/ { int urllen; const char* url; int scopelistlen; const char* scopelist; int attrlistlen; const char* attrlist; int authcount; SLPAuthBlock* autharray; }SLPSAAdvert; /*=========================================================================*/ typedef struct _SLPMessage /*=========================================================================*/ { struct sockaddr_in peer; SLPHeader header; union _body { SLPSrvRqst srvrqst; SLPSrvRply srvrply; SLPSrvReg srvreg; SLPSrvDeReg srvdereg; SLPSrvAck srvack; SLPDAAdvert daadvert; SLPAttrRqst attrrqst; SLPAttrRply attrrply; SLPSrvTypeRqst srvtyperqst; SLPSrvTypeRply srvtyperply; SLPSAAdvert saadvert; }body; }*SLPMessage; /*=========================================================================*/ void SLPMessageFreeInternals(SLPMessage message); /*=========================================================================*/ /*=========================================================================*/ SLPMessage SLPMessageAlloc(); /* Allocates memory for a SLP message descriptor */ /* */ /* Returns - A newly allocated SLPMessage pointer of NULL on ENOMEM */ /*=========================================================================*/ /*=========================================================================*/ SLPMessage SLPMessageRealloc(SLPMessage msg); /* Reallocates memory for a SLP message descriptor */ /* */ /* Returns - A newly allocated SLPMessage pointer of NULL on ENOMEM */ /*=========================================================================*/ /*=========================================================================*/ void SLPMessageFree(SLPMessage message); /* Frees memory that might have been allocated by the SLPMessage for */ /* UrlEntryLists or AuthBlockLists. */ /* */ /* message - (IN) the SLPMessage to free */ /*=========================================================================*/ /*=========================================================================*/ int SLPMessageParseHeader(SLPBuffer buffer, SLPHeader* header); /* Fill out a header structure with what ever is in the buffer */ /* */ /* buffer (IN) the buffer to be parsed */ /* */ /* header (IN/OUT) pointer to the header structure to fill out */ /*=========================================================================*/ /*=========================================================================*/ int SLPMessageParseBuffer(struct sockaddr_in* peerinfo, SLPBuffer buffer, SLPMessage message); /* Initializes a message descriptor by parsing the specified buffer. */ /* */ /* peerinfo - (IN) pointer to the network address information that sent */ /* buffer */ /* */ /* buffer - (IN) pointer the SLPBuffer to parse */ /* */ /* message - (OUT) set to describe the message from the buffer */ /* */ /* Returns - Zero on success, SLP_ERROR_PARSE_ERROR, or */ /* SLP_ERROR_INTERNAL_ERROR if out of memory. SLPMessage is */ /* invalid return is not successful. */ /* */ /* WARNING - If successful, pointers in the SLPMessage reference memory in*/ /* the parsed SLPBuffer. If SLPBufferFree() is called then the */ /* pointers in SLPMessage will be invalidated. */ /*=========================================================================*/ /*=========================================================================*/ /* Functions used to parse buffers */ unsigned short AsUINT16(const char *charptr); unsigned int AsUINT24(const char *charptr); unsigned int AsUINT32(const char *charptr); /*=========================================================================*/ /*=========================================================================*/ /* Functions used to set buffers */ void ToUINT16(char *charptr, unsigned int val); void ToUINT24(char *charptr, unsigned int val); void ToUINT32(char *charptr, unsigned int val); /*=========================================================================*/ #ifdef i386 /*=========================================================================*/ /* Macros to check in_addr */ #define ISLOCAL(addr) ((ntohl((addr).s_addr) & 0xff000000) == 0x7f000000) #define ISMCAST(addr) ((ntohl((addr).s_addr) & 0xff000000) >= 0xef000000) /*=========================================================================*/ #else /*=========================================================================*/ /* Macros to check in_addr */ #define ISLOCAL(addr) (((addr).s_addr & 0xff000000) == 0x7f000000) #define ISMCAST(addr) (((addr).s_addr & 0xff000000) >= 0xef000000) /*=========================================================================*/ #endif #endif openslp-1.2.1/common/slp_linkedlist.h0000644033442200000310000002235610202047412017541 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP */ /* */ /* File: linkedlist.h */ /* */ /* Abstract: Functions to manipulate a simple linked list */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #if(!defined LINKEDLIST_H_INCLUDED) #define LINKEDLIST_H_INCLUDED /*=========================================================================*/ typedef struct _SLPListItem /*=========================================================================*/ { struct _SLPListItem* previous; struct _SLPListItem* next; }SLPListItem; /*=========================================================================*/ typedef struct _SLPList /*=========================================================================*/ { SLPListItem* head; SLPListItem* tail; int count; }SLPList; /*=========================================================================*/ SLPListItem* SLPListUnlink(SLPList* list, SLPListItem* item); /* Unlinks the specified item from the specified list. */ /* */ /* list (IN) pointer to the list to unlink the item from */ /* */ /* item (IN) item to be removed from the list */ /* */ /* Returns pointer to the unlinked item */ /*=========================================================================*/ /*=========================================================================*/ SLPListItem* SLPListLinkHead(SLPList* list, SLPListItem* item); /* Links the specified item to the head of the specified list. */ /* */ /* list (IN) pointer to the list to link to */ /* */ /* item (IN) item to be linkedto the list */ /* */ /* Returns pointer to the linked item */ /*=========================================================================*/ /*=========================================================================*/ SLPListItem* SLPListLinkTail(SLPList* list, SLPListItem* item); /* Links the specified item to the tail of the specified list. */ /* */ /* list (IN) pointer to the list to link to */ /* */ /* item (IN) item to be linkedto the list */ /* */ /* Returns pointer to the linked item */ /*=========================================================================*/ /********* circular list macros *********************/ /*---------------------------------------------------------------------** ** structures used with these macros MUST have the following elements: ** ** struct type-name { ** ** struct type-name *next; ** ** struct type-name *prev; ** ** BOOL isHead; ** ** } ** **---------------------------------------------------------------------*/ /* is node x the head of the list? */ /* BOOL IS_HEAD(node *x); */ #define SLP_IS_HEAD(x) ((x)->isHead ) /* where h is the head of the list */ /* BOOLSLP_IS_EMPTY(head); */ #define SLP_IS_EMPTY(h) \ ((((h)->next == (h)) && ((h)->prev == (h)) ) ? TRUE : FALSE) /* where n is the new node, insert it immediately after node x */ /* x can be the head of the list */ /* voidSLP_INSERT(new, after); */ #define SLP_INSERT(n, x) \ {(n)->prev = (x); \ (n)->next = (x)->next; \ (x)->next->prev = (n); \ (x)->next = (n); } #define SLP_INSERT_AFTERSLP_INSERT #define SLP_INSERT_BEFORE(n, x) \ {(n)->next = (x); \ (n)->prev = (x)->prev; \ (x)->prev->next = (n); \ (x)->prev = (n); } #define SLP_INSERT_WORKNODE_LAST(n, x) \ {gettimeofday(&((n)->timer)); \ (n)->next = (x); \ (n)->prev = (x)->prev; \ (x)->prev->next = (n); \ (x)->prev = (n); } #define SLP_INSERT_WORKNODE_FIRST(n, x) \ {gettimeofday(&((n)->timer)); \ (n)->prev = (x); \ (n)->next = (x)->next; \ (x)->next->prev = (n); \ (x)->next = (n); } /* delete node x - harmless if mib is empty */ /* voidSLP_DELETE_(x); */ #define SLP_UNLINK(x) \ {(x)->prev->next = (x)->next; \ (x)->next->prev = (x)->prev;} /* given the head of the list h, determine if node x is the last node */ /* BOOLSLP_IS_LAST(head, x); */ #define SLP_IS_LAST(h, x) \ (((x)->prev == (h) && (h)->prev == (x)) ? TRUE : FALSE) /* given the head of the list h, determine if node x is the first node */ /* BOOLSLP_IS_FIRST(head, x); */ #define SLP_IS_FIRST(h, x) \ (((x)->prev == (h) && (h)->next == (x)) ? TRUE : FALSE) /* given the head of the list h, determine if node x is the only node */ /* BOOLSLP_IS_ONLY(head, x); */ #define SLP_IS_ONLY(h, x) \ (((x)->next == (h) && (h)->prev == (x)) ? TRUE : FALSE) /* voidSLP_LINK_HEAD(dest, src); */ #define SLP_LINK_HEAD(d, s) \ {(d)->next = (s)->next; \ (d)->prev = (s)->prev; \ (s)->next->prev = (d); \ (s)->prev->next = (d); } #endif openslp-1.2.1/common/slp_network.c0000644033442200000310000003564110211370457017074 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_network.c */ /* */ /* Abstract: Implementation for functions that are related */ /* network (and ipc) communication. */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slp_network.h" /*=========================================================================*/ int SLPNetworkConnectStream(struct sockaddr_in* peeraddr, struct timeval* timeout) /* Connect a TCP stream to the specified peer */ /* */ /* peeraddr (IN) pointer to the peer to connect to */ /* */ /* timeout (IN) pointer to the maximum time to spend connecting */ /* */ /* returns: a connected socket or -1 */ /*=========================================================================*/ { #ifdef _WIN32 char lowat; #else int lowat; #endif int result; /* TODO: Make this connect non-blocking so that it will timeout */ result = socket(AF_INET,SOCK_STREAM,0); if(result >= 0) { if(connect(result, (struct sockaddr*)peeraddr, sizeof(struct sockaddr_in)) == 0) { /* set the receive and send buffer low water mark to 18 bytes (the length of the smallest slpv2 message) */ lowat = 18; setsockopt(result,SOL_SOCKET,SO_RCVLOWAT,&lowat,sizeof(lowat)); setsockopt(result,SOL_SOCKET,SO_SNDLOWAT,&lowat,sizeof(lowat)); return result;; } else { close(result); result = -1; } } return result; } /*=========================================================================*/ int SLPNetworkConnectToMulticast(struct sockaddr_in* peeraddr, int ttl) /* Creates a socket and provides a peeraddr to send to */ /* */ /* peeraddr (OUT) pointer to receive the connected DA's address */ /* */ /* ttl (IN) ttl for the mcast socket */ /* */ /* Returns Valid socket or -1 if no DA connection can be made */ /*=========================================================================*/ { int sockfd; #if defined(linux) int optarg; #else /* Solaris and Tru64 expect a unsigned char parameter */ unsigned char optarg; #endif #ifdef _WIN32 BOOL Reuse = TRUE; int TTLArg; struct sockaddr_in mysockaddr; memset(&mysockaddr, 0, sizeof(mysockaddr)); mysockaddr.sin_family = AF_INET; mysockaddr.sin_port = 0; #endif /* setup multicast socket */ sockfd = socket(AF_INET,SOCK_DGRAM,0); if(sockfd >= 0) { peeraddr->sin_family = AF_INET; peeraddr->sin_port = htons(SLP_RESERVED_PORT); peeraddr->sin_addr.s_addr = htonl(SLP_MCAST_ADDRESS); optarg = ttl; #ifdef _WIN32 TTLArg = ttl; if(setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (const char *)&Reuse, sizeof(Reuse)) || bind(sockfd, (struct sockaddr *)&mysockaddr, sizeof(mysockaddr)) || setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL, (char *)&TTLArg, sizeof(TTLArg))) { return -1; } #else if(setsockopt(sockfd,IPPROTO_IP,IP_MULTICAST_TTL,&optarg,sizeof(optarg))) { return -1; } #endif } return sockfd; } /*=========================================================================*/ int SLPNetworkConnectToBroadcast(struct sockaddr_in* peeraddr) /* Creates a socket and provides a peeraddr to send to */ /* */ /* peeraddr (OUT) pointer to receive the connected DA's address */ /* */ /* Returns Valid socket or -1 if no DA connection can be made */ /*=========================================================================*/ { int sockfd; #ifdef _WIN32 BOOL on = 1; #else int on = 1; #endif /* setup broadcast */ sockfd = socket(AF_INET, SOCK_DGRAM, 0); if(sockfd >= 0) { peeraddr->sin_family = AF_INET; peeraddr->sin_port = htons(SLP_RESERVED_PORT); peeraddr->sin_addr.s_addr = htonl(SLP_BCAST_ADDRESS); if(setsockopt(sockfd, SOL_SOCKET, SO_BROADCAST, (char*)&on, sizeof(on))) { return -1; } } return sockfd; } /*=========================================================================*/ int SLPNetworkSendMessage(int sockfd, int socktype, SLPBuffer buf, struct sockaddr_in* peeraddr, struct timeval* timeout) /* Sends a message */ /* */ /* Returns - zero on success non-zero on failure */ /* */ /* errno EPIPE error during write */ /* ETIME read timed out */ /*=========================================================================*/ { fd_set writefds; int xferbytes; int flags = 0; #if defined(MSG_NOSIGNAL) flags = MSG_NOSIGNAL; #endif buf->curpos = buf->start; while(buf->curpos < buf->end) { FD_ZERO(&writefds); FD_SET(sockfd, &writefds); xferbytes = select(sockfd + 1, 0, &writefds, 0, timeout); if(xferbytes > 0) { if(socktype == SOCK_DGRAM) { xferbytes = sendto(sockfd, buf->curpos, buf->end - buf->curpos, flags, (struct sockaddr *)peeraddr, sizeof(struct sockaddr_in)); } else { xferbytes = send(sockfd, buf->curpos, buf->end - buf->curpos, flags); } if(xferbytes > 0) { buf->curpos = buf->curpos + xferbytes; } else { errno = EPIPE; return -1; } } else if(xferbytes == 0) { /* timed out */ errno = ETIMEDOUT; return -1; } else { errno = EPIPE; return -1; } } return 0; } /*=========================================================================*/ int SLPNetworkRecvMessage(int sockfd, int socktype, SLPBuffer* buf, struct sockaddr_in* peeraddr, struct timeval* timeout) /* Receives a message */ /* */ /* Returns - zero on success, non-zero on failure */ /* */ /* errno ENOTCONN error during read */ /* ETIME read timed out */ /* ENOMEM out of memory */ /* EINVAL parse error */ /*=========================================================================*/ { int xferbytes, recvlen; fd_set readfds; char peek[16]; int peeraddrlen = sizeof(struct sockaddr_in); /*---------------------------------------------------------------*/ /* take a peek at the packet to get version and size information */ /*---------------------------------------------------------------*/ FD_ZERO(&readfds); FD_SET(sockfd, &readfds); xferbytes = select(sockfd + 1, &readfds, 0 , 0, timeout); if(xferbytes > 0) { if(socktype == SOCK_DGRAM) { xferbytes = recvfrom(sockfd, peek, 16, MSG_PEEK, (struct sockaddr *)peeraddr, &peeraddrlen); } else { xferbytes = recv(sockfd, peek, 16, MSG_PEEK); } if(xferbytes <= 0) { #ifdef _WIN32 if(WSAGetLastError() != WSAEMSGSIZE) { errno = ENOTCONN; return -1; } #else errno = ENOTCONN; return -1; #endif } } else if(xferbytes == 0) { errno = ETIMEDOUT; return -1; } else { errno = ENOTCONN; return -1; } /*------------------------------*/ /* Read the rest of the message */ /*------------------------------*/ /* check the version */ if(xferbytes >= 5 && *peek == 2) { /* allocate the recvmsg big enough for the whole message */ recvlen = AsUINT24(peek + 2); /* one byte is minimum */ if (recvlen <= 0) recvlen = 1; *buf = SLPBufferRealloc(*buf, recvlen); if(*buf) { while((*buf)->curpos < (*buf)->end) { FD_ZERO(&readfds); FD_SET(sockfd, &readfds); xferbytes = select(sockfd + 1, &readfds, 0 , 0, timeout); if(xferbytes > 0) { xferbytes = recv(sockfd, (*buf)->curpos, (*buf)->end - (*buf)->curpos, 0); if(xferbytes > 0) { (*buf)->curpos = (*buf)->curpos + xferbytes; } else { errno = ENOTCONN; return -1; } } else if(xferbytes == 0) { errno = ETIMEDOUT; return -1; } else { errno = ENOTCONN; return -1; } } /* end of main read while. */ } else { errno = ENOMEM; return -1; } } else { errno = EINVAL; return -1; } return 0; } openslp-1.2.1/common/slp_filter.h0000644033442200000310000000424110202047412016655 0ustar rganesanfloppy/******************************************************************* * Description: encode/decode LDAP filters * * Originated: 04-21-2001 * Original Author: Mike Day - md@soft-hackle.net * Project: * * $Header: /cvsroot/openslp/openslp/common/slp_filter.h,v 1.4 2002/09/10 04:38:25 mpeterson Exp $ * * Copyright (C) Michael Day, 2001 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *******************************************************************/ #ifndef SLP_FILTER_H_INCLUDED #define SLP_FILTER_H_INCLUDED #include "slp_attr.h" typedef enum ldap_operator_types { ldap_and = 259, /* to match token values assigned in y_filter.h */ ldap_or, ldap_not, expr_eq, expr_gt, expr_lt, expr_present, expr_approx } ldapOperatorTypes; typedef struct ldap_filter_struct_head { struct ldap_filter_struct_head *next; struct ldap_filter_struct_head *prev; int isHead; int operator; } filterHead; typedef struct ldap_filter_struct { struct ldap_filter_struct *next; struct ldap_filter_struct *prev; int isHead; int operator; int nestingLevel; int logical_value; filterHead children; SLPAttrList attrs; } SLPLDAPFilter; SLPLDAPFilter *SLPAllocFilter(int operator); void SLPFreeFilter(SLPLDAPFilter *filter); void SLPFreeFilterList(SLPLDAPFilter *head, int static_flag); void SLPFreeFilterTree(SLPLDAPFilter *root); /*prototypes */ SLPLDAPFilter *SLPDecodeLDAPFilter(const char *filter) ; #endif /*SLPDEFS_INCLUDE */ openslp-1.2.1/common/slp_crypto.h0000644033442200000310000002243110202047412016711 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_crypto.h */ /* */ /* Abstract: Primitive cryptographic functions to support DSA signature */ /* of SHA1 digests. Current implementation is uses the */ /* OpenSSL (http://www.openssl.org)) crypto library. */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLP_CRYPTO_H_INCLUDED #define SLP_CRYPTO_H_INCLUDED #include #include /*=========================================================================*/ typedef DSA SLPCryptoDSAKey; /*=========================================================================*/ /*=========================================================================*/ int SLPCryptoSHA1Digest(const unsigned char* data, int datalen, unsigned char* digest); /* Generate a SHA1 digest for the specified block data */ /* */ /* Parameters: data (IN) pointer to buffer that to be hashed */ /* datalen (IN) size of the data buffer in bytes */ /* digest (OUT) pointer to buffer of at least 20 bytes in */ /* size where the digest will be copied */ /* */ /* Returns: zero on success. non-zero on failure */ /*=========================================================================*/ /*=========================================================================*/ SLPCryptoDSAKey* SLPCryptoDSAKeyDup(SLPCryptoDSAKey* dsa); /* Duplicates the specified key */ /* */ /* Parameters: dsa (IN) the key to duplicate */ /* */ /* Returns: Pointer to the duplicated key. Caller is responsible for */ /* SLPCryptoDSAKeyDestroy()ing the returned pointer */ /*=========================================================================*/ /*=========================================================================*/ void SLPCryptoDSAKeyDestroy(SLPCryptoDSAKey* dsa); /* Destroy a key that was created by SLPCryptoDSAKeyCreate(). Care should */ /* be taken to make sure all private keys are destroyed */ /* */ /* Parameters: dsa (IN) the key to destroy */ /* */ /* Returns: None */ /*=========================================================================*/ /*=========================================================================*/ int SLPCryptoDSASignLen(SLPCryptoDSAKey* key); /* Determine the length of a signatures produced with specified key. */ /* */ /* Parameters: key (IN) the key that will be used for signing */ /* */ /* Returns: The length of signatures in bytes */ /*=========================================================================*/ /*=========================================================================*/ int SLPCryptoDSASign(SLPCryptoDSAKey* key, const unsigned char* digest, int digestlen, unsigned char* signature, int* signaturelen); /* Sign the specified digest with the specified DSA key */ /* */ /* Parameters: key (IN) Signing (private) key */ /* digest (IN) pointer to digest buffer */ /* digestlen (IN) length of the digest buffer */ /* signature (OUT) buffer that will hold the ASN.1 DER */ /* encoded signature. */ /* signaturelen (OUT) The length of the signature buffer */ /* SLPCryptoDSASignLen(key) should be */ /* called to determine how big signature */ /* should be. */ /* */ /* Returns: zero on success. non-zero on failure */ /*=========================================================================*/ /*=========================================================================*/ int SLPCryptoDSAVerify(SLPCryptoDSAKey* key, const unsigned char* digest, int digestlen, const unsigned char* signature, int signaturelen); /* Verify a DSA signature to ensure it matches the specified digest */ /* */ /* Parameters: key (IN) Verifying (public) key */ /* (IN) pointer to the digest buffer */ /* (IN) length of the digest buffer */ /* (IN) the ASN.1 DER encoded signature */ /* (IN) the length of the signature */ /* */ /* Returns: 1 if the signature is valid, 0 of it is not */ /*=========================================================================*/ #endif openslp-1.2.1/common/Makefile.in0000644033442200000310000004761310211377467016440 0ustar rganesanfloppy# Makefile.in generated by automake 1.8.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(libcommonlibslp_la_SOURCES) $(libcommonslpd_la_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_triplet = @host@ subdir = common DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in slp_attr_l.c slp_attr_y.c slp_attr_y.h \ slp_filter_l.c slp_filter_y.c slp_filter_y.h ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(mkdir_p) CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libcommonlibslp_la_LIBADD = am__libcommonlibslp_la_SOURCES_DIST = slp_compare.c slp_buffer.c \ slp_message.c slp_property.c slp_linkedlist.c slp_xid.c \ slp_network.c slp_database.c slp_xmalloc.c slp_xcast.c \ slp_iface.c slp_parse.c slp_pid.c slp_dhcp.c slp_v1message.c \ slp_utf8.c slp_auth.c slp_crypto.c slp_spi.c @ENABLE_SLPv1_TRUE@am__objects_1 = slp_v1message.lo slp_utf8.lo @ENABLE_SLPv2_SECURITY_TRUE@am__objects_2 = slp_auth.lo slp_crypto.lo \ @ENABLE_SLPv2_SECURITY_TRUE@ slp_spi.lo am_libcommonlibslp_la_OBJECTS = slp_compare.lo slp_buffer.lo \ slp_message.lo slp_property.lo slp_linkedlist.lo slp_xid.lo \ slp_network.lo slp_database.lo slp_xmalloc.lo slp_xcast.lo \ slp_iface.lo slp_parse.lo slp_pid.lo slp_dhcp.lo \ $(am__objects_1) $(am__objects_2) libcommonlibslp_la_OBJECTS = $(am_libcommonlibslp_la_OBJECTS) libcommonslpd_la_LIBADD = am__libcommonslpd_la_SOURCES_DIST = slp_compare.c slp_buffer.c \ slp_message.c slp_property.c slp_linkedlist.c slp_xid.c \ slp_database.c slp_xmalloc.c slp_parse.c slp_iface.c slp_net.c \ slp_pid.c slp_attr_y.y slp_attr_l.l slp_filter_y.y \ slp_filter_l.l slp_predicate.c slp_dhcp.c slp_v1message.c \ slp_utf8.c slp_auth.c slp_crypto.c slp_spi.c am_libcommonslpd_la_OBJECTS = slp_compare.lo slp_buffer.lo \ slp_message.lo slp_property.lo slp_linkedlist.lo slp_xid.lo \ slp_database.lo slp_xmalloc.lo slp_parse.lo slp_iface.lo \ slp_net.lo slp_pid.lo slp_attr_y.lo slp_attr_l.lo \ slp_filter_y.lo slp_filter_l.lo slp_predicate.lo slp_dhcp.lo \ $(am__objects_1) $(am__objects_2) libcommonslpd_la_OBJECTS = $(am_libcommonslpd_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/slp_attr_l.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slp_attr_y.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slp_auth.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slp_buffer.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slp_compare.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slp_crypto.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slp_database.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slp_dhcp.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slp_filter_l.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slp_filter_y.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slp_iface.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slp_linkedlist.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slp_message.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slp_net.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slp_network.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slp_parse.Plo ./$(DEPDIR)/slp_pid.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slp_predicate.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slp_property.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slp_spi.Plo ./$(DEPDIR)/slp_utf8.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slp_v1message.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slp_xcast.Plo ./$(DEPDIR)/slp_xid.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/slp_xmalloc.Plo COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) LTLEXCOMPILE = $(LIBTOOL) --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS) YLWRAP = $(top_srcdir)/ylwrap YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS) LTYACCCOMPILE = $(LIBTOOL) --mode=compile $(YACC) $(YFLAGS) \ $(AM_YFLAGS) SOURCES = $(libcommonlibslp_la_SOURCES) $(libcommonslpd_la_SOURCES) DIST_SOURCES = $(am__libcommonlibslp_la_SOURCES_DIST) \ $(am__libcommonslpd_la_SOURCES_DIST) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_ASYNC_API_FALSE = @ENABLE_ASYNC_API_FALSE@ ENABLE_ASYNC_API_TRUE = @ENABLE_ASYNC_API_TRUE@ ENABLE_PREDICATES_FALSE = @ENABLE_PREDICATES_FALSE@ ENABLE_PREDICATES_TRUE = @ENABLE_PREDICATES_TRUE@ ENABLE_SLPv1_FALSE = @ENABLE_SLPv1_FALSE@ ENABLE_SLPv1_TRUE = @ENABLE_SLPv1_TRUE@ ENABLE_SLPv2_SECURITY_FALSE = @ENABLE_SLPv2_SECURITY_FALSE@ ENABLE_SLPv2_SECURITY_TRUE = @ENABLE_SLPv2_SECURITY_TRUE@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ noinst_LTLIBRARIES = libcommonslpd.la libcommonlibslp.la EXTRA_DIST = @ENABLE_SLPv1_TRUE@slp_v1message_SRCS = slp_v1message.c slp_utf8.c @ENABLE_SLPv2_SECURITY_TRUE@slp_security_SRCS = slp_auth.c slp_crypto.c slp_spi.c libcommonlibslp_la_SOURCES = \ slp_compare.c \ slp_buffer.c \ slp_message.c \ slp_property.c \ slp_linkedlist.c \ slp_xid.c \ slp_network.c \ slp_database.c \ slp_xmalloc.c \ slp_xcast.c \ slp_iface.c \ slp_parse.c \ slp_pid.c \ slp_dhcp.c \ $(slp_v1message_SRCS) \ $(slp_security_SRCS) libcommonslpd_la_SOURCES = \ slp_compare.c \ slp_buffer.c \ slp_message.c \ slp_property.c \ slp_linkedlist.c \ slp_xid.c \ slp_database.c \ slp_xmalloc.c \ slp_parse.c \ slp_iface.c \ slp_net.c \ slp_pid.c \ slp_attr_y.y \ slp_attr_l.l \ slp_filter_y.y \ slp_filter_l.l \ slp_predicate.c \ slp_dhcp.c \ $(slp_v1message_SRCS) \ $(slp_security_SRCS) noinst_HEADERS = \ slp_buffer.h \ slp_network.h \ slp_xid.h \ slp_compare.h \ slp_linkedlist.h \ slp_database.h \ slp_message.h \ slp_v1message.h \ slp_property.h \ slp_crypto.h \ slp_auth.h \ slp_spi.h \ slp_xmalloc.h \ slp_utf8.h \ slp_xcast.h \ slp_iface.h \ slp_parse.h \ slp_net.h \ slp_pid.h \ slp_attr.h \ slp_attr_y.h \ slp_filter.h \ slp_filter_y.h \ slp_predicate.h \ slp_dhcp.h AM_YFLAGS = -d all: all-am .SUFFIXES: .SUFFIXES: .c .l .lo .o .obj .y $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu common/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" = "$$p" && dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libcommonlibslp.la: $(libcommonlibslp_la_OBJECTS) $(libcommonlibslp_la_DEPENDENCIES) $(LINK) $(libcommonlibslp_la_LDFLAGS) $(libcommonlibslp_la_OBJECTS) $(libcommonlibslp_la_LIBADD) $(LIBS) slp_attr_y.h: slp_attr_y.c @if test ! -f $@; then \ rm -f slp_attr_y.c; \ $(MAKE) slp_attr_y.c; \ else :; fi slp_filter_y.h: slp_filter_y.c @if test ! -f $@; then \ rm -f slp_filter_y.c; \ $(MAKE) slp_filter_y.c; \ else :; fi libcommonslpd.la: $(libcommonslpd_la_OBJECTS) $(libcommonslpd_la_DEPENDENCIES) $(LINK) $(libcommonslpd_la_LDFLAGS) $(libcommonslpd_la_OBJECTS) $(libcommonslpd_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_attr_l.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_attr_y.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_auth.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_buffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_compare.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_crypto.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_database.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_dhcp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_filter_l.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_filter_y.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_iface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_linkedlist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_message.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_net.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_network.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_parse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_pid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_predicate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_property.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_spi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_utf8.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_v1message.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_xcast.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_xid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slp_xmalloc.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< .l.c: $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) .y.c: $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f slp_filter_l.c -rm -f slp_attr_l.c -rm -f slp_attr_y.h -rm -f slp_filter_y.c -rm -f slp_filter_y.h -rm -f slp_attr_y.c clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: openslp-1.2.1/common/slp_filter_y.c0000644033442200000310000012054310211377550017215 0ustar rganesanfloppy/* A Bison parser, made by GNU Bison 1.875. */ /* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* Written by Richard Stallman by simplifying the original so called ``semantic'' parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Using locations. */ #define YYLSP_NEEDED 0 /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { L_PAREN = 258, R_PAREN = 259, OP_AND = 260, OP_OR = 261, OP_NOT = 262, OP_EQU = 263, OP_GT = 264, OP_LT = 265, OP_PRESENT = 266, OP_APPROX = 267, VAL_INT = 268, VAL_BOOL = 269, OPERAND = 270 }; #endif #define L_PAREN 258 #define R_PAREN 259 #define OP_AND 260 #define OP_OR 261 #define OP_NOT 262 #define OP_EQU 263 #define OP_GT 264 #define OP_LT 265 #define OP_PRESENT 266 #define OP_APPROX 267 #define VAL_INT 268 #define VAL_BOOL 269 #define OPERAND 270 /* Copy the first part of user declarations. */ #line 25 "slp_filter_y.y" #define yymaxdepth slp_filter_maxdepth #define yyparse slp_filter_parse #define yylex slp_filter_lex #define yyerror slp_filter_error #define yylval slp_filter_lval #define yychar slp_filter_char #define yydebug slp_filter_debug #define yypact slp_filter_pact #define yyr1 slp_filter_r1 #define yyr2 slp_filter_r2 #define yydef slp_filter_def #define yychk slp_filter_chk #define yypgo slp_filter_pgo #define yyact slp_filter_act #define yyexca slp_filter_exca #define yyerrflag slp_filter_errflag #define yynerrs slp_filter_nerrs #define yyps slp_filter_ps #define yypv slp_filter_pv #define yys slp_filter_s #define yy_yys slp_filter_yys #define yystate slp_filter_state #define yytmp slp_filter_tmp #define yyv slp_filter_v #define yy_yyv slp_filter_yyv #define yyval slp_filter_val #define yylloc slp_filter_lloc #define yyreds slp_filter_reds #define yytoks slp_filter_toks #define yylhs slp_filter_yylhs #define yylen slp_filter_yylen #define yydefred slp_filter_yydefred #define yydgoto slp_filter_yydgoto #define yysindex slp_filter_yysindex #define yyrindex slp_filter_yyrindex #define yygindex slp_filter_yygindex #define yytable slp_filter_yytable #define yycheck slp_filter_yycheck #define yyname slp_filter_yyname #define yyrule slp_filter_yyrule #include "slp_filter.h" #include "slp_linkedlist.h" #include #include #include #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE (!FALSE) #endif /* prototypes and globals go here */ void slp_filter_close_lexer(unsigned int handle); unsigned int slp_filter_init_lexer(const char *s); int slp_filter_parse(void); int slp_filter_parse(void); void slp_filter_error(char *, ...); int slp_filter_lex(void); /* have a place to put attributes and the filter while the parser is working */ /* on them makes it easier to recover from parser errors - all the memory we */ /* need to free is available from the list heads below. */ /* listhead for reduced filters until the parser is finished */ static filterHead reducedFilters = { &reducedFilters, &reducedFilters, TRUE } ; static int nesting_level; /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) #line 105 "slp_filter_y.y" typedef union YYSTYPE { int filter_int; char *filter_string; SLPLDAPFilter *filter_filter; } YYSTYPE; /* Line 191 of yacc.c. */ #line 189 "slp_filter_y.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif /* Copy the second part of user declarations. */ /* Line 214 of yacc.c. */ #line 201 "slp_filter_y.c" #if ! defined (yyoverflow) || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # if YYSTACK_USE_ALLOCA # define YYSTACK_ALLOC alloca # else # ifndef YYSTACK_USE_ALLOCA # if defined (alloca) || defined (_ALLOCA_H) # define YYSTACK_ALLOC alloca # else # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # else # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif # define YYSTACK_ALLOC malloc # define YYSTACK_FREE free # endif #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ #if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ || (YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { short yyss; YYSTYPE yyvs; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ register YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (0) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if defined (__STDC__) || defined (__cplusplus) typedef signed char yysigned_char; #else typedef short yysigned_char; #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 5 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 22 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 16 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 8 /* YYNRULES -- Number of rules. */ #define YYNRULES 18 /* YYNRULES -- Number of states. */ #define YYNSTATES 26 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 270 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const unsigned char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const unsigned char yyprhs[] = { 0, 0, 3, 5, 8, 13, 17, 19, 21, 23, 25, 27, 30, 34, 38, 42, 44, 46, 48 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yysigned_char yyrhs[] = { 17, 0, -1, 18, -1, 17, 18, -1, 19, 21, 17, 20, -1, 19, 22, 20, -1, 3, -1, 4, -1, 5, -1, 6, -1, 7, -1, 15, 11, -1, 15, 23, 13, -1, 15, 23, 14, -1, 15, 23, 15, -1, 8, -1, 9, -1, 10, -1, 12, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned char yyrline[] = { 0, 124, 124, 124, 126, 156, 166, 171, 176, 176, 176, 181, 197, 213, 229, 245, 245, 245, 245 }; #endif #if YYDEBUG || YYERROR_VERBOSE /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "L_PAREN", "R_PAREN", "OP_AND", "OP_OR", "OP_NOT", "OP_EQU", "OP_GT", "OP_LT", "OP_PRESENT", "OP_APPROX", "VAL_INT", "VAL_BOOL", "OPERAND", "$accept", "filter_list", "filter", "filter_open", "filter_close", "filter_op", "expression", "exp_operator", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const unsigned short yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const unsigned char yyr1[] = { 0, 16, 17, 17, 18, 18, 19, 20, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const unsigned char yyr2[] = { 0, 2, 1, 2, 4, 3, 1, 1, 1, 1, 1, 2, 3, 3, 3, 1, 1, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const unsigned char yydefact[] = { 0, 6, 0, 2, 0, 1, 3, 8, 9, 10, 0, 0, 0, 15, 16, 17, 11, 18, 0, 0, 7, 5, 12, 13, 14, 4 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yysigned_char yydefgoto[] = { -1, 2, 3, 4, 21, 11, 12, 18 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -5 static const yysigned_char yypact[] = { 9, -5, 10, -5, -4, -5, -5, -5, -5, -5, -3, 9, 0, -5, -5, -5, -5, -5, 1, 15, -5, -5, -5, -5, -5, -5 }; /* YYPGOTO[NTERM-NUM]. */ static const yysigned_char yypgoto[] = { -5, 11, -2, -5, 2, -5, -5, -5 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const unsigned char yytable[] = { 6, 7, 8, 9, 20, 13, 14, 15, 16, 17, 5, 10, 1, 1, 22, 23, 24, 6, 1, 20, 0, 25, 19 }; static const yysigned_char yycheck[] = { 2, 5, 6, 7, 4, 8, 9, 10, 11, 12, 0, 15, 3, 3, 13, 14, 15, 19, 3, 4, -1, 19, 11 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const unsigned char yystos[] = { 0, 3, 17, 18, 19, 0, 18, 5, 6, 7, 15, 21, 22, 8, 9, 10, 11, 12, 23, 17, 4, 20, 13, 14, 15, 20 }; #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ #endif #if ! defined (YYSIZE_T) && defined (size_t) # define YYSIZE_T size_t #endif #if ! defined (YYSIZE_T) # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif #endif #if ! defined (YYSIZE_T) # define YYSIZE_T unsigned int #endif #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ yyerror ("syntax error: cannot back up");\ YYERROR; \ } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Compute the default location (before the actions are run). */ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ Current.first_line = Rhs[1].first_line; \ Current.first_column = Rhs[1].first_column; \ Current.last_line = Rhs[N].last_line; \ Current.last_column = Rhs[N].last_column; #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else # define YYLEX yylex () #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) # define YYDSYMPRINT(Args) \ do { \ if (yydebug) \ yysymprint Args; \ } while (0) # define YYDSYMPRINTF(Title, Token, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yysymprint (stderr, \ Token, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (cinluded). | `------------------------------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yy_stack_print (short *bottom, short *top) #else static void yy_stack_print (bottom, top) short *bottom; short *top; #endif { YYFPRINTF (stderr, "Stack now"); for (/* Nothing. */; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yy_reduce_print (int yyrule) #else static void yy_reduce_print (yyrule) int yyrule; #endif { int yyi; unsigned int yylineno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", yyrule - 1, yylineno); /* Print the symbols being reduced, and their result. */ for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (Rule); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YYDSYMPRINT(Args) # define YYDSYMPRINTF(Title, Token, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #if YYMAXDEPTH == 0 # undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined (__GLIBC__) && defined (_STRING_H) # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T # if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) # else yystrlen (yystr) const char *yystr; # endif { register const char *yys = yystr; while (*yys++ != '\0') continue; return yys - yystr - 1; } # endif # endif # ifndef yystpcpy # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * # if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) # else yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; # endif { register char *yyd = yydest; register const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif #endif /* !YYERROR_VERBOSE */ #if YYDEBUG /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) #else static void yysymprint (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE *yyvaluep; #endif { /* Pacify ``unused variable'' warnings. */ (void) yyvaluep; if (yytype < YYNTOKENS) { YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); # ifdef YYPRINT YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # endif } else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); switch (yytype) { default: break; } YYFPRINTF (yyoutput, ")"); } #endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yydestruct (int yytype, YYSTYPE *yyvaluep) #else static void yydestruct (yytype, yyvaluep) int yytype; YYSTYPE *yyvaluep; #endif { /* Pacify ``unused variable'' warnings. */ (void) yyvaluep; switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) int yyparse (void *YYPARSE_PARAM); # else int yyparse (); # endif #else /* ! YYPARSE_PARAM */ #if defined (__STDC__) || defined (__cplusplus) int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) int yyparse (void *YYPARSE_PARAM) # else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; # endif #else /* ! YYPARSE_PARAM */ #if defined (__STDC__) || defined (__cplusplus) int yyparse (void) #else int yyparse () #endif #endif { register int yystate; register int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Lookahead token as an internal (translated) token number. */ int yytoken = 0; /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ short yyssa[YYINITDEPTH]; short *yyss = yyssa; register short *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; #define YYPOPSTACK (yyvsp--, yyssp--) YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; /* When reducing, the number of symbols on the RHS of the reduced rule. */ int yylen; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyoverflowlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyoverflowlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { short *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. */ /* Read a lookahead token if we need one and don't already have one. */ /* yyresume: */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 4: #line 127 "slp_filter_y.y" { if(NULL != (yyval.filter_filter = SLPAllocFilter(yyvsp[-2].filter_int))) { yyval.filter_filter->nestingLevel = nesting_level; if(!SLP_IS_EMPTY(&reducedFilters) ) { SLPLDAPFilter *temp = (SLPLDAPFilter *)reducedFilters.next; while(!SLP_IS_HEAD(temp)) { if(temp->nestingLevel == nesting_level + 1) { SLPLDAPFilter *nest = temp; temp = temp->next; SLP_UNLINK(nest); SLP_INSERT_BEFORE(nest, (SLPLDAPFilter *)&(yyval.filter_filter->children)) ; } else { temp = temp->next; } } SLP_INSERT_BEFORE( (filterHead *)yyval.filter_filter, &reducedFilters); } else { SLPFreeFilter(yyval.filter_filter) ; yyval.filter_filter = NULL ; } } } break; case 5: #line 157 "slp_filter_y.y" { yyval.filter_filter = yyvsp[-1].filter_filter; if(yyvsp[-1].filter_filter != NULL) { yyvsp[-1].filter_filter->nestingLevel = nesting_level; SLP_INSERT_BEFORE((filterHead *)yyvsp[-1].filter_filter, &reducedFilters) ; } } break; case 6: #line 167 "slp_filter_y.y" { nesting_level++; } break; case 7: #line 172 "slp_filter_y.y" { nesting_level--; } break; case 10: #line 177 "slp_filter_y.y" { yyval.filter_int = yylval.filter_int; } break; case 11: #line 182 "slp_filter_y.y" { /* presence test binds to single operand */ if(NULL != (yyval.filter_filter = SLPAllocFilter(expr_present))) { SLPAttrList *attr = SLPAllocAttr(yyvsp[-1].filter_string, string, "*", (int)strlen("*") + 1); if(attr != NULL) { SLP_INSERT(attr, &(yyval.filter_filter->attrs)); } else { SLPFreeFilter(yyval.filter_filter); yyval.filter_filter = NULL; } } } break; case 12: #line 198 "slp_filter_y.y" { /* must be an int or a bool */ /* remember to touch up the token values to match the enum in SLP.h */ if(NULL != (yyval.filter_filter = SLPAllocFilter(yyvsp[-1].filter_int))) { SLPAttrList *attr = SLPAllocAttr(yyvsp[-2].filter_string, integer, &(yyvsp[0].filter_int), sizeof(yyvsp[0].filter_int)); if(attr != NULL) { SLP_INSERT(attr, &(yyval.filter_filter->attrs)); } else { SLPFreeFilter(yyval.filter_filter); yyval.filter_filter = NULL ; } } } break; case 13: #line 214 "slp_filter_y.y" { /* must be an int or a bool */ /* remember to touch up the token values to match the enum in SLP.h */ if(NULL != (yyval.filter_filter = SLPAllocFilter(yyvsp[-1].filter_int))) { SLPAttrList *attr = SLPAllocAttr(yyvsp[-2].filter_string, boolean, &(yyvsp[0].filter_int), sizeof(yyvsp[0].filter_int)); if(attr != NULL) { SLP_INSERT(attr, &(yyval.filter_filter->attrs)); } else { SLPFreeFilter(yyval.filter_filter); yyval.filter_filter = NULL ; } } } break; case 14: #line 230 "slp_filter_y.y" { /* both operands are strings */ if(NULL != (yyval.filter_filter = SLPAllocFilter(yyvsp[-1].filter_int))) { SLPAttrList *attr = SLPAllocAttr(yyvsp[-2].filter_string, string, yyvsp[0].filter_string, (int)strlen(yyvsp[0].filter_string) + 1 ); if(attr != NULL) { SLP_INSERT(attr, &(yyval.filter_filter->attrs)); } else { SLPFreeFilter(yyval.filter_filter); yyval.filter_filter = NULL ; } } } break; case 18: #line 246 "slp_filter_y.y" { yyval.filter_int = yylval.filter_int; } break; } /* Line 991 of yacc.c. */ #line 1232 "slp_filter_y.c" yyvsp -= yylen; yyssp -= yylen; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if YYERROR_VERBOSE yyn = yypact[yystate]; if (YYPACT_NINF < yyn && yyn < YYLAST) { YYSIZE_T yysize = 0; int yytype = YYTRANSLATE (yychar); char *yymsg; int yyx, yycount; yycount = 0; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) yysize += yystrlen (yytname[yyx]) + 15, yycount++; yysize += yystrlen ("syntax error, unexpected ") + 1; yysize += yystrlen (yytname[yytype]); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); yyp = yystpcpy (yyp, yytname[yytype]); if (yycount < 5) { yycount = 0; for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { const char *yyq = ! yycount ? ", expecting " : " or "; yyp = yystpcpy (yyp, yyq); yyp = yystpcpy (yyp, yytname[yyx]); yycount++; } } yyerror (yymsg); YYSTACK_FREE (yymsg); } else yyerror ("syntax error; also virtual memory exhausted"); } else #endif /* YYERROR_VERBOSE */ yyerror ("syntax error"); } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ /* Return failure if at end of input. */ if (yychar == YYEOF) { /* Pop the error token. */ YYPOPSTACK; /* Pop the rest of the stack. */ while (yyss < yyssp) { YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct (yystos[*yyssp], yyvsp); YYPOPSTACK; } YYABORT; } YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); yydestruct (yytoken, &yylval); yychar = YYEMPTY; } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab2; /*----------------------------------------------------. | yyerrlab1 -- error raised explicitly by an action. | `----------------------------------------------------*/ yyerrlab1: /* Suppress GCC warning that yyerrlab1 is unused when no action invokes YYERROR. */ #if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__) \ && !defined __cplusplus __attribute__ ((__unused__)) #endif goto yyerrlab2; /*---------------------------------------------------------------. | yyerrlab2 -- pop states until the error token can be shifted. | `---------------------------------------------------------------*/ yyerrlab2: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct (yystos[yystate], yyvsp); yyvsp--; yystate = *--yyssp; YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #ifndef yyoverflow /*----------------------------------------------. | yyoverflowlab -- parser overflow comes here. | `----------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ #endif yyreturn: #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } #line 250 "slp_filter_y.y" SLPLDAPFilter *SLPAllocFilter(int operator) { SLPLDAPFilter *filter = (SLPLDAPFilter *)calloc(1, sizeof(SLPLDAPFilter)); if ( filter != NULL ) { filter->next = filter->prev = filter; if ( operator == head ) { filter->isHead = TRUE; } else { filter->children.next = filter->children.prev = &(filter->children); filter->children.isHead = 1; filter->attrs.next = filter->attrs.prev = &(filter->attrs); filter->attrs.isHead = 1; filter->operator = operator; } } return(filter); } void SLPFreeFilter(SLPLDAPFilter *filter) { if ( filter->children.next != NULL ) { while ( ! (SLP_IS_EMPTY((SLPLDAPFilter *)&(filter->children))) ) { SLPLDAPFilter *child = (SLPLDAPFilter *)filter->children.next; SLP_UNLINK(child); SLPFreeFilter(child); } } if ( filter->attrs.next != NULL ) { while ( ! (SLP_IS_EMPTY(&(filter->attrs))) ) { SLPAttrList *attrs = filter->attrs.next; SLP_UNLINK(attrs); SLPFreeAttr(attrs); } } } void SLPFreeFilterList(SLPLDAPFilter *head, int static_flag) { while ( ! (SLP_IS_EMPTY(head)) ) { SLPLDAPFilter *temp = head->next; SLP_UNLINK(temp); SLPFreeFilter(temp); } if ( static_flag == TRUE ) SLPFreeFilter(head); return; } void SLPFreeFilterTree(SLPLDAPFilter *root) { if ( !SLP_IS_EMPTY( &(root->children) ) ) { SLPFreeFilterTree((SLPLDAPFilter *)root->children.next); } if ( ! (SLP_IS_HEAD(root->next)) && (!SLP_IS_EMPTY(root->next)) ) { SLPFreeFilterTree(root->next); } if ( root->attrs.next != NULL ) { while ( ! (SLP_IS_EMPTY(&(root->attrs))) ) { SLPAttrList *attrs = root->attrs.next; SLP_UNLINK(attrs); SLPFreeAttr(attrs); } } } void SLPInitFilterList(void ) { reducedFilters.next = reducedFilters.prev = &reducedFilters; reducedFilters.isHead = TRUE; return; } void SLPCleanUpFilterList(void) { SLPFreeFilterList( (SLPLDAPFilter *)&reducedFilters, FALSE); } SLPLDAPFilter *SLPDecodeLDAPFilter(const char *filter) { SLPLDAPFilter *temp = NULL; unsigned int lexer = 0; SLPInitFilterList(); nesting_level = 1; if ( 0 != (lexer = slp_filter_init_lexer(filter)) ) { if ( slp_filter_parse() ) { SLPCleanUpFilterList(); } slp_filter_close_lexer(lexer); } if ( !SLP_IS_EMPTY(&reducedFilters) ) { if ( NULL != (temp = SLPAllocFilter(ldap_and)) ) { SLP_LINK_HEAD(&(temp->children), &reducedFilters); } } SLPCleanUpFilterList(); return(temp); } openslp-1.2.1/common/slp_property.c0000644033442200000310000003522710202050061017251 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slplib_property.c */ /* */ /* Abstract: Implementation for SLPGetProperty() and SLPSetProperty() */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include #include #include #include #ifndef _WIN32 # ifdef HAVE_CONFIG_H # include "config.h" # define SLP_VERSION VERSION # endif #endif #include "slp_property.h" #include "slp_xmalloc.h" /*=========================================================================*/ /* Global Variables */ /*=========================================================================*/ SLPList G_SLPPropertyList = {0,0,0}; /*-------------------------------------------------------------------------*/ SLPProperty* Find(const char* pcName) /* Finds the property in the property list with the specified name. */ /* */ /* pcName pointer to the property name */ /* */ /* Returns: pointer to the requested property or null if the requested */ /* property was not found. */ /*-------------------------------------------------------------------------*/ { SLPProperty* curProperty; curProperty = (SLPProperty*)G_SLPPropertyList.head; while(curProperty != 0) { if(strcmp(curProperty->propertyName,pcName) == 0) { break; } curProperty = (SLPProperty*)curProperty->listitem.next; } return curProperty; } /*=========================================================================*/ const char* SLPPropertyGet(const char* pcName) /*=========================================================================*/ { SLPProperty* existingProperty = Find(pcName); if(existingProperty) { return existingProperty->propertyValue; } return 0; } /*=========================================================================*/ int SLPPropertySet(const char *pcName, const char *pcValue) /*=========================================================================*/ { int pcNameSize; int pcValueSize; SLPProperty* newProperty; if(pcValue == 0) { /* Bail for right now */ return 0; } newProperty = Find(pcName); pcNameSize = strlen(pcName) + 1; pcValueSize = strlen(pcValue) + 1; if(newProperty == 0) { /* property does not exist in the list */ newProperty = (SLPProperty*)xmalloc(sizeof(SLPProperty) + pcNameSize + pcValueSize); if(newProperty == 0) { /* out of memory */ errno = ENOMEM; return -1; } /* set the pointers in the SLPProperty structure to point to areas of */ /* the previously allocated block of memory */ newProperty->propertyName = ((char*)newProperty) + sizeof(SLPProperty); newProperty->propertyValue = newProperty->propertyName + pcNameSize; /* copy the passed in name and value */ memcpy(newProperty->propertyName,pcName,pcNameSize); memcpy(newProperty->propertyValue,pcValue,pcValueSize); /* Link the new property into the list */ SLPListLinkHead(&G_SLPPropertyList,(SLPListItem*)newProperty); } else { SLPListUnlink(&G_SLPPropertyList,(SLPListItem*)newProperty); /* property already exists in the list */ newProperty = (SLPProperty*)xrealloc(newProperty,sizeof(SLPProperty) + pcNameSize + pcValueSize); if(newProperty == 0) { /* out of memory */ errno = ENOMEM; return -1; } /* set the pointers in the SLPProperty structure to point to areas of */ /* the previously allocated block of memory */ newProperty->propertyName = ((char*)newProperty) + sizeof(SLPProperty); newProperty->propertyValue = newProperty->propertyName + pcNameSize; /* copy the passed in name and value */ memcpy(newProperty->propertyName,pcName,pcNameSize); memcpy(newProperty->propertyValue,pcValue,pcValueSize); SLPListLinkHead(&G_SLPPropertyList,(SLPListItem*)newProperty); } return 0; } /*-------------------------------------------------------------------------*/ int SetDefaultValues() /*-------------------------------------------------------------------------*/ { int result = 0; result |= SLPPropertySet("net.slp.isBroadcastOnly","false"); result |= SLPPropertySet("net.slp.multicastTimeouts","500,750,1000,1500,2000,3000"); result |= SLPPropertySet("net.slp.multicastMaximumWait","5000"); result |= SLPPropertySet("net.slp.unicastTimeouts","500,750,1000,1500,2000,3000"); result |= SLPPropertySet("net.slp.unicastMaximumWait","5000"); result |= SLPPropertySet("net.slp.datagramTimeouts",""); result |= SLPPropertySet("net.slp.maxResults","256"); result |= SLPPropertySet("net.slp.DADiscoveryTimeouts","500,750,1000,1500,2000,3000"); result |= SLPPropertySet("net.slp.DADiscoveryMaximumWait","2000"); result |= SLPPropertySet("net.slp.DAActiveDiscoveryInterval","1"); result |= SLPPropertySet("net.slp.DAAddresses",""); result |= SLPPropertySet("net.slp.watchRegistrationPID","true"); result |= SLPPropertySet("net.slp.activeDADetection","true"); result |= SLPPropertySet("net.slp.passiveDADetection","true"); result |= SLPPropertySet("net.slp.useScopes","default"); result |= SLPPropertySet("net.slp.locale","en"); result |= SLPPropertySet("net.slp.randomWaitBound","5000"); result |= SLPPropertySet("net.slp.interfaces",""); result |= SLPPropertySet("net.slp.securityEnabled","false"); result |= SLPPropertySet("net.slp.multicastTTL","8"); result |= SLPPropertySet("net.slp.MTU","1400"); result |= SLPPropertySet("net.slp.traceMsg","false"); result |= SLPPropertySet("net.slp.traceReg","false"); result |= SLPPropertySet("net.slp.traceDrop","false"); result |= SLPPropertySet("net.slp.traceDATraffic","false"); result |= SLPPropertySet("net.slp.isDA","false"); result |= SLPPropertySet("net.slp.DAHeartBeat","10800"); result |= SLPPropertySet("net.slp.securityEnabled","false"); result |= SLPPropertySet("net.slp.checkSourceAddr","true"); result |= SLPPropertySet("net.slp.OpenSLPVersion", SLP_VERSION); return result; } /*=========================================================================*/ int SLPPropertyReadFile(const char* conffile) /* Reads and sets properties from the specified configuration file */ /* */ /* conffile (IN) the path of the config file to read. */ /* */ /* Returns - zero on success. non-zero on error. Properties will be set*/ /* to default on error. */ /*=========================================================================*/ { char* line; char* alloced; FILE* fp; char* namestart; char* nameend; char* valuestart; char* valueend; if(SetDefaultValues()) { return -1; } alloced = xmalloc(4096); if(alloced == 0) { /* out of memory */ errno = ENOMEM; return -1; } fp = fopen(conffile,"r"); if(!fp) { goto CLEANUP; } /* Set the property that keeps track of conffile */ SLPPropertySet("net.slp.OpenSLPConfigFile",conffile); while(fgets(alloced,4096,fp)) { line = alloced; /* trim whitespace */ while(*line && *line <= 0x20) { line++; } if(*line == 0) { continue; } /* skip commented lines */ if(*line == '#' || *line == ';') { continue; } /* parse out the property name*/ namestart = line; nameend = line; nameend = strchr(nameend,'='); if(nameend == 0) { continue; } valuestart = nameend + 1; /* start of value for later*/ while(*nameend <= 0x20 || *nameend == '=') { *nameend = 0; nameend --; } /* parse out the property value */ while(*valuestart && *valuestart <= 0x20) { valuestart++; } valueend = valuestart; /* Seek to the end of the value */ while(*valueend) { valueend++; } /* Remove any whitespace that might be present */ while(valueend != valuestart && *valueend <= 0x20) { *valueend = 0; valueend --; } /* set the property */ if(valuestart && *valuestart) { SLPPropertySet(namestart, valuestart); } } CLEANUP: if(fp) { fclose(fp); } if(alloced) { xfree(alloced); } return 0; } /*=========================================================================*/ int SLPPropertyAsBoolean(const char* property) /*=========================================================================*/ { if(property) { if(*property == 't' || *property == 'T' || *property == 'y' || *property == 'Y' || *property == '1') { return 1; } } return 0; } /*=========================================================================*/ int SLPPropertyAsInteger(const char* property) /*=========================================================================*/ { return atoi(property); } /*=========================================================================*/ int SLPPropertyAsIntegerVector(const char* property, int* vector, int vectorsize) /*=========================================================================*/ { int i; char* slider1; char* slider2; char* temp; char* end; memset(vector,0,sizeof(int)*vectorsize); temp = xstrdup(property); if(temp == 0) { return 0; } end = temp + strlen(property); slider1 = slider2 = temp; for(i=0;i= end) { break; } slider1 = slider2; } xfree(temp); return i; } #ifdef DEBUG /*=========================================================================*/ void SLPPropertyFreeAll() /*=========================================================================*/ { SLPProperty* property; SLPProperty* del; property = (SLPProperty*)G_SLPPropertyList.head; while(property) { del = property; property = (SLPProperty*)property->listitem.next; xfree(del); } memset(&G_SLPPropertyList,0,sizeof(G_SLPPropertyList)); } #endif openslp-1.2.1/common/slp_pid.h0000644033442200000310000001137410204452352016156 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_pid.c */ /* */ /* Abstract: Common code to obtain process identifier information */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLP_PID_H_INCLUDED #define SLP_PID_H_INCLUDED #ifdef _WIN32 # ifndef UINT32_T_DEFINED # define UINT32_T_DEFINED typedef unsigned int uint32_t; # endif #else # ifdef HAVE_CONFIG_H # include "config.h" # endif # ifdef HAVE_STDINT_H # include # else # include # endif #endif /*=========================================================================*/ uint32_t SLPPidGet(); /* Description: * Get a process 32 bit integer identifier for the current process * loopback interface * * Parameters: * * Returns: * 32 bit integer identifier for the current process *=========================================================================*/ /*=========================================================================*/ int SLPPidExists(uint32_t pid); /* Description: * (quickly) determine whether or not the process with the specified * identifier exists (is alive) * * Parameters: * pid (IN) 32 bit integer identifier for the process to check for * * Returns: * Boolean value. Zero if process does not exist, non-zero if it does *=========================================================================*/ #endif openslp-1.2.1/common/slp_net.h0000644033442200000310000001247310202047412016164 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_net.h */ /* */ /* Abstract: Network utility functions */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLP_NET_H_INCLUDED #define SLP_NET_H_INCLUDED #ifdef _WIN32 #if(_WIN32_WINNT >= 0x0400 && _WIN32_WINNT < 0x0500) #include #endif #define WIN32_LEAN_AND_MEAN #include #include #include #include #define ETIMEDOUT 110 #define ENOTCONN 107 #else #include #include #include #include #include #include #include #include #include #include #endif /*-------------------------------------------------------------------------*/ int SLPNetGetThisHostname(char** hostfdn, int numeric_only); /* * Description: * Returns a string represting this host (the FDN) or null. Caller must * free returned string * * Parameters: * hostfdn (OUT) pointer to char pointer that is set to buffer * contining this machine's FDN. Caller must free * returned string with call to xfree() * numeric_only (IN) force return of numeric address. *-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/ int SLPNetResolveHostToAddr(const char* host, struct in_addr* addr); /* * Description: * Returns a string represting this host (the FDN) or null. Caller must * free returned string * * Parameters: * host (IN) pointer to hostname to resolve * addr (OUT) pointer to in_addr that will be filled with address * * Returns: zero on success, non-zero on error; *-------------------------------------------------------------------------*/ #endif openslp-1.2.1/common/slp_linkedlist.c0000644033442200000310000001523510202047412017532 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP */ /* */ /* File: linkedlist.c */ /* */ /* Abstract: Functions to manipulate a simple linked list */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slp_linkedlist.h" /*=========================================================================*/ SLPListItem* SLPListUnlink(SLPList* list, SLPListItem* item) /* Unlinks the specified item from the specified list. */ /* */ /* list (IN) pointer to the list to unlink the item from */ /* */ /* item (IN) item to be removed from the list */ /* */ /* Returns pointer to the unlinked item */ /*=========================================================================*/ { if(item->previous) { item->previous->next = item->next; } if(item->next) { item->next->previous = item->previous; } if(item == list->head) { list->head = item->next; } if(item == list->tail) { list->tail = item->previous; } list->count = list->count - 1; return item; } /*=========================================================================*/ SLPListItem* SLPListLinkHead(SLPList* list, SLPListItem* item) /* Links the specified item to the head of the specified list. */ /* */ /* list (IN) pointer to the list to link to */ /* */ /* item (IN) item to be linkedto the list */ /* */ /* Returns pointer to the linked item */ /*=========================================================================*/ { item->previous = 0; item->next = list->head; if(list->head) { list->head->previous = item; } list->head = item; if(list->tail == 0) { list->tail = item; } list->count = list->count + 1; return item; } /*=========================================================================*/ SLPListItem* SLPListLinkTail(SLPList* list, SLPListItem* item) /* Links the specified item to the tail of the specified list. */ /* */ /* list (IN) pointer to the list to link to */ /* */ /* item (IN) item to be linkedto the list */ /* */ /* Returns pointer to the linked item */ /*=========================================================================*/ { item->previous = list->tail; item->next = 0; if(list->tail) { list->tail->next = item; } list->tail = item; if(list->head == 0) { list->head = item; } list->count = list->count + 1; return item; } openslp-1.2.1/common/slp_parse.h0000644033442200000310000001325510202047412016507 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_parse.h */ /* */ /* Abstract: Common string parsing functionality */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #ifndef SLP_PARSE_H_INCLUDED #define SLP_PARSE_H_INCLUDED typedef struct _SLPParsedSrvUrl { char* srvtype ; /* A pointer to a character string containing the service * type name, including naming authority. The service type * name includes the "service:" if the URL is of the service: * scheme. */ char* host; /* A pointer to a character string containing the host * identification information. */ int port; /* The port number, or zero if none. The port is only available * if the transport is IP. */ char* family; /* A pointer to a character string containing the network address * family identifier. Possible values are "ipx" for the IPX * family, "at" for the Appletalk family, and "" (i.e. the empty * string) for the IP address family. */ char* remainder; /* The remainder of the URL, after the host identification. */ } SLPParsedSrvUrl; /*=========================================================================*/ int SLPParseSrvUrl(int srvurllen, const char* srvurl, SLPParsedSrvUrl** parsedurl); /* * Description: * Parses a service URL into its parts * * Parameters: * srvurllen (IN) size of srvurl in bytes * srvurl (IN) pointer to service URL to parse * parsedurl (OUT) pointer to SLPParsedSrvUrl pointer that will be * set to xmalloc()ed parsed url parts. Returned * pointer must be freed by caller with call to xfree() * * Returns: zero on success, errno on failure.. *=========================================================================*/ #endif openslp-1.2.1/common/slp_attr_y.y0000644033442200000310000002272510202047427016730 0ustar rganesanfloppy/******************************************************************* * Description: encode/decode attribute lists * * Originated: 03-06-2000 * Original Author: Mike Day - md@soft-hackle.net * * Copyright (C) Michael Day, 2000-2001 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *******************************************************************/ %{ #include #include #include #include "slp_attr.h" #include "slp_linkedlist.h" /* prototypes and globals go here */ #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE (!FALSE) #endif #define yymaxdepth slp_attr_maxdepth #define yyparse slp_attr_parse #define yylex slp_attr_lex #define yyerror slp_attr_error #define yylval slp_attr_lval #define yychar slp_attr_char #define yydebug slp_attr_debug #define yypact slp_attr_pact #define yyr1 slp_attr_r1 #define yyr2 slp_attr_r2 #define yydef slp_attr_def #define yychk slp_attr_chk #define yypgo slp_attr_pgo #define yyact slp_attr_act #define yyexca slp_attr_exca #define yyerrflag slp_attr_errflag #define yynerrs slp_attr_nerrs #define yyps slp_attr_ps #define yypv slp_attr_pv #define yys slp_attr_s #define yy_yys slp_attr_yys #define yystate slp_attr_state #define yytmp slp_attr_tmp #define yyv slp_attr_v #define yy_yyv slp_attr_yyv #define yyval slp_attr_val #define yylloc slp_attr_lloc #define yyreds slp_attr_reds #define yytoks slp_attr_toks #define yylhs slp_attr_yylhs #define yylen slp_attr_yylen #define yydefred slp_attr_yydefred #define yydgoto slp_attr_yydgoto #define yysindex slp_attr_yysindex #define yyrindex slp_attr_yyrindex #define yygindex slp_attr_yygindex #define yytable slp_attr_yytable #define yycheck slp_attr_yycheck #define yyname slp_attr_yyname #define yyrule slp_attr_yyrule static int bt = TRUE; static int bf = FALSE; static SLPAttrList attrHead = {&attrHead, &attrHead, TRUE, NULL, head, {0L}}; static SLPAttrList inProcessAttr = {&inProcessAttr, &inProcessAttr, TRUE, NULL, head, {0L}}; static SLPAttrList inProcessTag = {&inProcessTag, &inProcessTag, TRUE, NULL, head, {0L}}; int slp_attr_parse(void); void slp_attr_error(char *, ...); int slp_attr_wrap(void); int slp_attr_lex(void); void slp_attr_close_lexer(unsigned int handle); unsigned int slp_attr_init_lexer(char *s); %} /* definitions for ytab.h */ %union { int _i; char *_s; SLPAttrList *_atl; } %token<_i> _TRUE _FALSE _MULTIVAL _INT %token<_s> _ESCAPED _TAG _STRING /* typecast the non-terminals */ /* %type <_i> */ %type <_atl> attr_list attr attr_val_list attr_val %% attr_list: attr { while ( !SLP_IS_HEAD(inProcessAttr.next) ) { $$ = inProcessAttr.next; SLP_UNLINK($$); SLP_INSERT_BEFORE($$, &attrHead); } /* all we really want to do here is link each attribute */ /* to the global list head. */ } | attr_list ',' attr { /* both of these non-terminals are really lists */ /* ignore the first non-terminal */ while ( !SLP_IS_HEAD(inProcessAttr.next) ) { $$ = inProcessAttr.next; SLP_UNLINK($$); SLP_INSERT_BEFORE($$, &attrHead); } }; attr: _TAG { $$ = SLPAllocAttr($1, tag, NULL, 0); if ( NULL != $$ ) { SLP_INSERT_BEFORE($$, &inProcessAttr); } } | '(' _TAG ')' { $$ = SLPAllocAttr($2, tag, NULL, 0); if (NULL != $$) { SLP_INSERT_BEFORE($$, &inProcessAttr); } } | '(' _TAG '=' attr_val_list ')' { $$ = inProcessTag.next; while (!SLP_IS_HEAD($$)) { $$->name = strdup($2); SLP_UNLINK($$); SLP_INSERT_BEFORE($$, &inProcessAttr); $$ = inProcessTag.next; } }; attr_val_list: attr_val { if(NULL != $1) { SLP_INSERT($1, &inProcessTag); } } | attr_val_list _MULTIVAL attr_val { if (NULL != $3) { SLP_INSERT_BEFORE($3, &inProcessTag); } }; attr_val: _TRUE { $$ = SLPAllocAttr(NULL, boolean, &bt, sizeof(int)); } | _FALSE { $$ = SLPAllocAttr(NULL, boolean, &bf, sizeof(int)); } | _ESCAPED { /* treat it as a string because it is already encoded */ $$ = SLPAllocAttr(NULL, string, $1, strlen($1) + 1); } | _STRING { $$ = SLPAllocAttr(NULL, string, $1, strlen($1) + 1); } | _INT { $$ = SLPAllocAttr(NULL, integer, &($1), sizeof(int)); }; %% SLPAttrList *SLPAllocAttr(char *name, SLPTypes type, void *val, int len) { SLPAttrList *attr; if ( NULL != (attr = (SLPAttrList *)calloc(1, sizeof(SLPAttrList))) ) { if ( name != NULL ) { if ( NULL == (attr->name = strdup(name)) ) { free(attr); return(NULL); } } attr->type = type; if ( type == head ) /* listhead */ return(attr); if ( val != NULL ) { switch ( type ) { case string: if ( NULL != (attr->val.stringVal = strdup((unsigned char *)val)) ) return(attr); break; case integer: attr->val.intVal = *(unsigned int *)val; break; case boolean: attr->val.boolVal = *(int *)val; break; case opaque: #if 0 if ( len > 0 ) { int encLen; opq_EncodeOpaque(val, len, (char **)&(attr->val.opaqueVal), &encLen); if ( NULL != attr->val.opaqueVal ) { /* first two bytes contain length of attribute */ SLP_SETSHORT(((char *)attr->val.opaqueVal), encLen, 0 ); } } #endif break; default: break; } } } return(attr); } SLPAttrList *SLPAllocAttrList(void) { SLPAttrList *temp; if ( NULL != (temp = SLPAllocAttr(NULL, head, NULL, 0)) ) { temp->next = temp->prev = temp; temp->isHead = TRUE; } return(temp); } /* attr MUST be unlinked from its list ! */ void SLPFreeAttr(SLPAttrList *attr) { if ( attr->name != NULL ) { free(attr->name); } if ( attr->type == string && attr->val.stringVal != NULL ) { free(attr->val.stringVal); } else if ( attr->type == opaque && attr->val.opaqueVal != NULL ) { free(attr->val.opaqueVal); } free(attr); } void SLPFreeAttrList(SLPAttrList *list, int staticFlag) { SLPAttrList *temp; while ( ! (SLP_IS_EMPTY(list)) ) { temp = list->next; SLP_UNLINK(temp); SLPFreeAttr(temp); } if ( staticFlag == TRUE ) { SLPFreeAttr(list); } return; } void SLPInitInternalAttrList(void) { attrHead.next = attrHead.prev = &attrHead; attrHead.isHead = TRUE; inProcessAttr.next = inProcessAttr.prev = &inProcessAttr; inProcessAttr.isHead = TRUE; inProcessTag.next = inProcessTag.prev = &inProcessTag; inProcessTag.isHead = TRUE; return; } SLPAttrList *_SLPDecodeAttrString(char *s) { unsigned int lexer = 0; SLPAttrList *temp = NULL; SLPInitInternalAttrList(); if ( s != NULL ) { if ( NULL != (temp = SLPAllocAttrList()) ) { if ((0 != (lexer = slp_attr_init_lexer(s))) && yyparse() ) { SLPFreeAttrList(temp,0); while ( !SLP_IS_HEAD(inProcessTag.next) ) { temp = inProcessTag.next; SLP_UNLINK(temp); SLPFreeAttr(temp); } while ( !SLP_IS_HEAD(inProcessAttr.next) ) { temp = inProcessAttr.next; SLP_UNLINK(temp); SLPFreeAttr(temp); } while ( !SLP_IS_HEAD(attrHead.next) ) { temp = attrHead.next; SLP_UNLINK(temp); SLPFreeAttr(temp); } slp_attr_close_lexer(lexer); return(NULL); } if ( !SLP_IS_EMPTY(&attrHead) ) { SLP_LINK_HEAD(temp, &attrHead); } if ( lexer != 0 ) { slp_attr_close_lexer(lexer); } } } return(temp); } openslp-1.2.1/common/slp_filter_y.h0000644033442200000310000000430710211377550017221 0ustar rganesanfloppy/* A Bison parser, made by GNU Bison 1.875. */ /* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { L_PAREN = 258, R_PAREN = 259, OP_AND = 260, OP_OR = 261, OP_NOT = 262, OP_EQU = 263, OP_GT = 264, OP_LT = 265, OP_PRESENT = 266, OP_APPROX = 267, VAL_INT = 268, VAL_BOOL = 269, OPERAND = 270 }; #endif #define L_PAREN 258 #define R_PAREN 259 #define OP_AND 260 #define OP_OR 261 #define OP_NOT 262 #define OP_EQU 263 #define OP_GT 264 #define OP_LT 265 #define OP_PRESENT 266 #define OP_APPROX 267 #define VAL_INT 268 #define VAL_BOOL 269 #define OPERAND 270 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) #line 105 "slp_filter_y.y" typedef union YYSTYPE { int filter_int; char *filter_string; SLPLDAPFilter *filter_filter; } YYSTYPE; /* Line 1249 of yacc.c. */ #line 72 "slp_filter_y.h" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif extern YYSTYPE yylval; openslp-1.2.1/common/slp_filter_y.y0000644033442200000310000002324610202047427017242 0ustar rganesanfloppy/******************************************************************* * Description: encode/decode LDAP filters * * Originated: 04-21-2001 * Original Author: Mike Day - md@soft-hackle.net * * Copyright (C) Michael Day, 2001 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *******************************************************************/ %{ #define yymaxdepth slp_filter_maxdepth #define yyparse slp_filter_parse #define yylex slp_filter_lex #define yyerror slp_filter_error #define yylval slp_filter_lval #define yychar slp_filter_char #define yydebug slp_filter_debug #define yypact slp_filter_pact #define yyr1 slp_filter_r1 #define yyr2 slp_filter_r2 #define yydef slp_filter_def #define yychk slp_filter_chk #define yypgo slp_filter_pgo #define yyact slp_filter_act #define yyexca slp_filter_exca #define yyerrflag slp_filter_errflag #define yynerrs slp_filter_nerrs #define yyps slp_filter_ps #define yypv slp_filter_pv #define yys slp_filter_s #define yy_yys slp_filter_yys #define yystate slp_filter_state #define yytmp slp_filter_tmp #define yyv slp_filter_v #define yy_yyv slp_filter_yyv #define yyval slp_filter_val #define yylloc slp_filter_lloc #define yyreds slp_filter_reds #define yytoks slp_filter_toks #define yylhs slp_filter_yylhs #define yylen slp_filter_yylen #define yydefred slp_filter_yydefred #define yydgoto slp_filter_yydgoto #define yysindex slp_filter_yysindex #define yyrindex slp_filter_yyrindex #define yygindex slp_filter_yygindex #define yytable slp_filter_yytable #define yycheck slp_filter_yycheck #define yyname slp_filter_yyname #define yyrule slp_filter_yyrule #include "slp_filter.h" #include "slp_linkedlist.h" #include #include #include #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE (!FALSE) #endif /* prototypes and globals go here */ void slp_filter_close_lexer(unsigned int handle); unsigned int slp_filter_init_lexer(const char *s); int slp_filter_parse(void); int slp_filter_parse(void); void slp_filter_error(char *, ...); int slp_filter_lex(void); /* have a place to put attributes and the filter while the parser is working */ /* on them makes it easier to recover from parser errors - all the memory we */ /* need to free is available from the list heads below. */ /* listhead for reduced filters until the parser is finished */ static filterHead reducedFilters = { &reducedFilters, &reducedFilters, TRUE } ; static int nesting_level; %} /* definitions for ytab.h */ %union { int filter_int; char *filter_string; SLPLDAPFilter *filter_filter; } %token L_PAREN R_PAREN OP_AND OP_OR OP_NOT OP_EQU OP_GT OP_LT OP_PRESENT OP_APPROX %token VAL_INT VAL_BOOL %token OPERAND /* typecast the non-terminals */ %type filter filter_list expression %type exp_operator filter_op filter_open filter_close %% /* grammar */ filter_list: filter | filter_list filter ; filter: filter_open filter_op filter_list filter_close { if(NULL != ($$ = SLPAllocFilter($2))) { $$->nestingLevel = nesting_level; if(!SLP_IS_EMPTY(&reducedFilters) ) { SLPLDAPFilter *temp = (SLPLDAPFilter *)reducedFilters.next; while(!SLP_IS_HEAD(temp)) { if(temp->nestingLevel == nesting_level + 1) { SLPLDAPFilter *nest = temp; temp = temp->next; SLP_UNLINK(nest); SLP_INSERT_BEFORE(nest, (SLPLDAPFilter *)&($$->children)) ; } else { temp = temp->next; } } SLP_INSERT_BEFORE( (filterHead *)$$, &reducedFilters); } else { SLPFreeFilter($$) ; $$ = NULL ; } } } | filter_open expression filter_close { $$ = $2; if($2 != NULL) { $2->nestingLevel = nesting_level; SLP_INSERT_BEFORE((filterHead *)$2, &reducedFilters) ; } }; filter_open: L_PAREN { nesting_level++; }; filter_close: R_PAREN { nesting_level--; }; filter_op: OP_AND | OP_OR | OP_NOT { $$ = yylval.filter_int; }; expression: OPERAND OP_PRESENT { /* presence test binds to single operand */ if(NULL != ($$ = SLPAllocFilter(expr_present))) { SLPAttrList *attr = SLPAllocAttr($1, string, "*", (int)strlen("*") + 1); if(attr != NULL) { SLP_INSERT(attr, &($$->attrs)); } else { SLPFreeFilter($$); $$ = NULL; } } } | OPERAND exp_operator VAL_INT { /* must be an int or a bool */ /* remember to touch up the token values to match the enum in SLP.h */ if(NULL != ($$ = SLPAllocFilter($2))) { SLPAttrList *attr = SLPAllocAttr($1, integer, &($3), sizeof($3)); if(attr != NULL) { SLP_INSERT(attr, &($$->attrs)); } else { SLPFreeFilter($$); $$ = NULL ; } } } | OPERAND exp_operator VAL_BOOL { /* must be an int or a bool */ /* remember to touch up the token values to match the enum in SLP.h */ if(NULL != ($$ = SLPAllocFilter($2))) { SLPAttrList *attr = SLPAllocAttr($1, boolean, &($3), sizeof($3)); if(attr != NULL) { SLP_INSERT(attr, &($$->attrs)); } else { SLPFreeFilter($$); $$ = NULL ; } } } | OPERAND exp_operator OPERAND { /* both operands are strings */ if(NULL != ($$ = SLPAllocFilter($2))) { SLPAttrList *attr = SLPAllocAttr($1, string, $3, (int)strlen($3) + 1 ); if(attr != NULL) { SLP_INSERT(attr, &($$->attrs)); } else { SLPFreeFilter($$); $$ = NULL ; } } }; exp_operator: OP_EQU | OP_GT | OP_LT | OP_APPROX { $$ = yylval.filter_int; }; %% SLPLDAPFilter *SLPAllocFilter(int operator) { SLPLDAPFilter *filter = (SLPLDAPFilter *)calloc(1, sizeof(SLPLDAPFilter)); if ( filter != NULL ) { filter->next = filter->prev = filter; if ( operator == head ) { filter->isHead = TRUE; } else { filter->children.next = filter->children.prev = &(filter->children); filter->children.isHead = 1; filter->attrs.next = filter->attrs.prev = &(filter->attrs); filter->attrs.isHead = 1; filter->operator = operator; } } return(filter); } void SLPFreeFilter(SLPLDAPFilter *filter) { if ( filter->children.next != NULL ) { while ( ! (SLP_IS_EMPTY((SLPLDAPFilter *)&(filter->children))) ) { SLPLDAPFilter *child = (SLPLDAPFilter *)filter->children.next; SLP_UNLINK(child); SLPFreeFilter(child); } } if ( filter->attrs.next != NULL ) { while ( ! (SLP_IS_EMPTY(&(filter->attrs))) ) { SLPAttrList *attrs = filter->attrs.next; SLP_UNLINK(attrs); SLPFreeAttr(attrs); } } } void SLPFreeFilterList(SLPLDAPFilter *head, int static_flag) { while ( ! (SLP_IS_EMPTY(head)) ) { SLPLDAPFilter *temp = head->next; SLP_UNLINK(temp); SLPFreeFilter(temp); } if ( static_flag == TRUE ) SLPFreeFilter(head); return; } void SLPFreeFilterTree(SLPLDAPFilter *root) { if ( !SLP_IS_EMPTY( &(root->children) ) ) { SLPFreeFilterTree((SLPLDAPFilter *)root->children.next); } if ( ! (SLP_IS_HEAD(root->next)) && (!SLP_IS_EMPTY(root->next)) ) { SLPFreeFilterTree(root->next); } if ( root->attrs.next != NULL ) { while ( ! (SLP_IS_EMPTY(&(root->attrs))) ) { SLPAttrList *attrs = root->attrs.next; SLP_UNLINK(attrs); SLPFreeAttr(attrs); } } } void SLPInitFilterList(void ) { reducedFilters.next = reducedFilters.prev = &reducedFilters; reducedFilters.isHead = TRUE; return; } void SLPCleanUpFilterList(void) { SLPFreeFilterList( (SLPLDAPFilter *)&reducedFilters, FALSE); } SLPLDAPFilter *SLPDecodeLDAPFilter(const char *filter) { SLPLDAPFilter *temp = NULL; unsigned int lexer = 0; SLPInitFilterList(); nesting_level = 1; if ( 0 != (lexer = slp_filter_init_lexer(filter)) ) { if ( slp_filter_parse() ) { SLPCleanUpFilterList(); } slp_filter_close_lexer(lexer); } if ( !SLP_IS_EMPTY(&reducedFilters) ) { if ( NULL != (temp = SLPAllocFilter(ldap_and)) ) { SLP_LINK_HEAD(&(temp->children), &reducedFilters); } } SLPCleanUpFilterList(); return(temp); } openslp-1.2.1/common/slp_net.c0000644033442200000310000001534210202047412016155 0ustar rganesanfloppy /***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_net.h */ /* */ /* Abstract: Network utility functions */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slp_net.h" #include "slp_xmalloc.h" #ifdef _WIN32 /* definition for inet_aton() since Microsoft does not have this yet */ #define inet_aton(opt,bind) ((bind)->s_addr = inet_addr(opt)) #endif /*-------------------------------------------------------------------------*/ int SLPNetGetThisHostname(char** hostfdn, int numeric_only) /* * Description: * Returns a string represting this host (the FDN) or null. Caller must * free returned string * * Parameters: * hostfdn (OUT) pointer to char pointer that is set to buffer * contining this machine's FDN. Caller must free * returned string with call to xfree() * numeric_only (IN) force return of numeric address. * * Returns: zero on success, non-zero on error; *-------------------------------------------------------------------------*/ { /* TODO find a better constant for MAX_HOSTNAME */ #define MAX_HOST_NAME 256 char host[MAX_HOST_NAME]; struct hostent* he; struct in_addr ifaddr; if ((hostfdn != NULL) && (gethostname(host, MAX_HOST_NAME) == 0)) { *hostfdn = NULL; /* Windows compatibility */ if (inet_aton(host, &ifaddr)) { if (numeric_only) { *hostfdn = xstrdup(inet_ntoa(ifaddr)); return 0; } he = gethostbyaddr((char *)&ifaddr, sizeof(ifaddr), AF_INET); } else { he = gethostbyname(host); } if(he) { /* if the hostname has a '.' then it is probably a qualified * domain name. If it is not then we better use the IP address */ if(!numeric_only && strchr(he->h_name,'.')) { *hostfdn = xstrdup(he->h_name); } else { ifaddr.s_addr = *((unsigned long*)he->h_addr); *hostfdn = xstrdup(inet_ntoa(ifaddr)); } return 0; } } return -1; } /*-------------------------------------------------------------------------*/ int SLPNetResolveHostToAddr(const char* host, struct in_addr* addr) /* * Description: * Returns a string represting this host (the FDN) or null. Caller must * free returned string * * Parameters: * host (IN) pointer to hostname to resolve * addr (OUT) pointer to in_addr that will be filled with address * * Returns: zero on success, non-zero on error; *-------------------------------------------------------------------------*/ { struct hostent* he; /* quick check for dotted quad IPv4 address */ if(inet_aton(host,addr)) { return 0; } /* Use resolver */ he = gethostbyname(host); if(he != 0) { if(he->h_addrtype == AF_INET) { memcpy(addr,he->h_addr_list[0],sizeof(struct in_addr)); return 0; } else { /* TODO: support other address types */ } } return -1; } openslp-1.2.1/common/slp_predicate.c0000644033442200000310000002013010202047412017316 0ustar rganesanfloppy#include #include #include #include "slp_predicate.h" #include "slp_linkedlist.h" #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE (!FALSE) #endif /* for those platforms without FNM_CASEFOLD */ #ifndef FNM_CASEFOLD #define FNM_CASEFOLD 0 #endif /* the usual */ #define SLP_MIN(a, b) ((a) < (b) ? (a) : (b)) #define SLP_MAX(a, b) ((a) > (b) ? (a) : (b)) #ifdef DEBUG void dumpAttrList(int level, const SLPAttrList *attrs) { int i; if (SLP_IS_EMPTY(attrs) ) { return; } for ( i = 0; i <= level; i++ ) { printf("\t"); } attrs = attrs->next; while ( !SLP_IS_HEAD(attrs) ) { switch ( attrs->type ) { case string: printf("%s = %s (string) \n", attrs->name, attrs->val.stringVal); break; case integer: printf("%s = %lu (integer) \n", attrs->name, attrs->val.intVal); break; case boolean: printf("%s = %s (boolean) \n", attrs->name, (attrs->val.boolVal ? " TRUE " : " FALSE ")); break; case opaque: case head: default: printf("%s = %s\n", attrs->name, "illegal or unknown attribute type"); break; } attrs = attrs->next; } return; } void printOperator(int op) { switch ( op ) { case ldap_or: printf(" OR "); break; case ldap_and: printf( " AND " ); break; case ldap_not: printf(" NOT "); break; case expr_eq: printf(" EQUAL "); break; case expr_gt: printf(" GREATER THAN "); break; case expr_lt: printf(" LESS THAN "); break; case expr_present: printf(" PRESENT "); break; case expr_approx: printf(" APPROX "); break; case -1: printf(" list head "); break; default: printf(" unknown operator value %i ", op); break; } return; } void dumpFilterTree( const SLPLDAPFilter *filter ) { int i; for ( i = 0; i < filter->nestingLevel; i++ ) { printf("\t"); } printOperator(filter->operator); printf("%s (level %i) \n", (filter->logical_value ? " TRUE " : " FALSE "), filter->nestingLevel ); dumpAttrList(filter->nestingLevel, &(filter->attrs)); if ( !SLP_IS_EMPTY( &(filter->children) ) ) { dumpFilterTree((SLPLDAPFilter *)filter->children.next ) ; } if ( (!SLP_IS_HEAD(filter->next)) && (!SLP_IS_EMPTY(filter->next)) ) { dumpFilterTree(filter->next); } return; } #endif /* DEBUG*/ int SLPEvaluateOperation(int compare_result, int operation) { switch ( operation ) { case expr_eq: if ( compare_result == 0 ) /* a == b */ return(TRUE); break; case expr_gt: if ( compare_result >= 0 ) /* a >= b */ return(TRUE); break; case expr_lt: /* a <= b */ if ( compare_result <= 0 ) return(TRUE); break; case expr_present: case expr_approx: default: return(TRUE); break; } return(FALSE); } /* evaluates attr values, not names */ int SLPEvaluateAttributes(const SLPAttrList *a, const SLPAttrList *b, int op) { /* first ensure they are the same type */ if ( a->type == b->type ) { switch ( a->type ) { case string: return( SLPEvaluateOperation(fnmatch(a->val.stringVal, b->val.stringVal, FNM_CASEFOLD), op) ); case integer: return( SLPEvaluateOperation( a->val.intVal - b->val.intVal, op)); case tag: /* equivalent to a presence test */ return(TRUE); case boolean: if ( (a->val.boolVal != 0) && (b->val.boolVal != 0) ) return(TRUE); if ( (a->val.boolVal == 0) && (b->val.boolVal == 0) ) return(TRUE); break; case opaque: if ( ! memcmp((((char *)(a->val.opaqueVal)) + 4), (((char *)(b->val.opaqueVal)) + 4), SLP_MIN((*((int *)a->val.opaqueVal)), (*((int *)a->val.opaqueVal)))) ); return(TRUE); break; default: break; } } return(FALSE); } /* filter is a filter tree, attrs is ptr to an attr listhead */ int SLPEvaluateFilterTree(SLPLDAPFilter *filter, const SLPAttrList *attrs) { if ( !SLP_IS_EMPTY( &(filter->children) ) ) { SLPEvaluateFilterTree((SLPLDAPFilter *)filter->children.next, attrs); } if ( ! (SLP_IS_HEAD(filter->next)) && (!SLP_IS_EMPTY(filter->next)) ) { SLPEvaluateFilterTree(filter->next, attrs); } if ( filter->operator == ldap_and || filter->operator == ldap_or || filter->operator == ldap_not ) { /* evaluate ldap logical operators by evaluating filter->children as a list of filters */ SLPLDAPFilter *child_list = (SLPLDAPFilter *)filter->children.next; /* initialize the filter's logical value to true */ if ( filter->operator == ldap_or ) { filter->logical_value = FALSE; } else { filter->logical_value = TRUE; } while ( !SLP_IS_HEAD(child_list) ) { if ( child_list->logical_value == TRUE ) { if ( filter->operator == ldap_or ) { filter->logical_value = TRUE; break; } if ( filter->operator == ldap_not ) { filter->logical_value = FALSE; break; } /* for an & operator keep going */ } else { /* child is false */ if ( filter->operator == ldap_and ) { filter->logical_value = FALSE; break; } } child_list = child_list->next; } } else { /* find the first matching attribute and set the logical value */ filter->logical_value = FALSE; if ( !SLP_IS_HEAD(filter->attrs.next) ) { attrs = attrs->next; while ( (!SLP_IS_HEAD(attrs )) && ( FNM_NOMATCH == fnmatch(filter->attrs.next->name, attrs->name, FNM_CASEFOLD)) ) { attrs = attrs->next ; } /* either we have traversed the list or found the first matching attribute */ if ( !SLP_IS_HEAD(attrs) ) { /* we found the first matching attribute, now do the comparison */ if ( filter->operator == expr_present || filter->operator == expr_approx ) { filter->logical_value = TRUE; } else { filter->logical_value = SLPEvaluateAttributes(filter->attrs.next, attrs, filter->operator ); } } } } return(filter->logical_value); } /* a is an attribute list, while b is a string representation of an ldap filter */ int SLP_predicate_match(const SLPAttrList *attrlist, const char *filter) { int ccode; SLPLDAPFilter *ftree; if ( filter == NULL || ! strlen(filter) ) { return(TRUE); /* no predicate - aways tests TRUE */ } if ( NULL != (ftree = SLPDecodeLDAPFilter(filter)) ) { ccode = SLPEvaluateFilterTree(ftree, attrlist); SLPFreeFilterTree(ftree); return(ccode); } return(FALSE); } openslp-1.2.1/common/slp_spi.c0000644033442200000310000004275510202236066016177 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slp_spi.h */ /* */ /* Abstract: Functions for fetching SPI information from the filesystem */ /* Current implementation uses OpenSSL. For details see */ /* (see http://www.openssl.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slp_spi.h" #include "slp_xmalloc.h" #include #include #include #include #define MAX_SPI_ENTRY_LEN 1024 #define PUBLIC_TOKEN "PUBLIC" #define PRIVATE_TOKEN "PRIVATE" /*-------------------------------------------------------------------------*/ void SLPSpiEntryFree(SLPSpiEntry* victim) /*-------------------------------------------------------------------------*/ { if(victim->keyfilename) xfree(victim->keyfilename); if(victim->spistr) xfree(victim->spistr); if(victim->key) SLPCryptoDSAKeyDestroy(victim->key); if(victim) xfree(victim); } /*-------------------------------------------------------------------------*/ SLPSpiEntry* SLPSpiEntryFind(SLPList* cache, int keytype, int spistrlen, const char* spistr) /* pass in null spistr to find the first Cached entry */ /*-------------------------------------------------------------------------*/ { SLPSpiEntry* entry = (SLPSpiEntry*)cache->head; while(entry) { if(spistr) { if (entry->spistrlen == spistrlen && memcmp(entry->spistr,spistr,spistrlen) == 0 && entry->keytype == keytype) { return entry; } } else { if(keytype == SLPSPI_KEY_TYPE_ANY || entry->keytype == keytype) { return entry; } } entry = (SLPSpiEntry*)entry->listitem.next; } return 0; } /*-------------------------------------------------------------------------*/ SLPCryptoDSAKey* SLPSpiReadKeyFile(const char* keyfile, int keytype) /*-------------------------------------------------------------------------*/ { FILE* fp; SLPCryptoDSAKey* result = 0; fp = fopen(keyfile,"r"); if(fp) { if(keytype == SLPSPI_KEY_TYPE_PUBLIC) { result = PEM_read_DSA_PUBKEY(fp, &result, NULL, NULL); } else if (keytype == SLPSPI_KEY_TYPE_PRIVATE) { result = PEM_read_DSAPrivateKey(fp, &result, NULL, NULL); } fclose(fp); } return result; } /*-------------------------------------------------------------------------*/ SLPSpiEntry* SLPSpiReadSpiFile(FILE* fp, int keytype) /* Caller needs to free returned memory SLPSpiEntryFree() */ /*-------------------------------------------------------------------------*/ { SLPSpiEntry* result; char tmp; char* line; char* slider1; char* slider2; /*----------------------------*/ /* Allocate memory for result */ /*----------------------------*/ line = (char*) xmalloc(MAX_SPI_ENTRY_LEN); result = (SLPSpiEntry*) xmalloc(sizeof(SLPSpiEntry)); if(result == 0 || line == 0) { return 0; } memset(result,0,sizeof(SLPSpiEntry)); /*---------------------------*/ /* Read the next valid entry */ /*---------------------------*/ while(fgets(line, MAX_SPI_ENTRY_LEN, fp)) { /*----------------------*/ /* read the first token */ /*----------------------*/ slider1 = line; /* skip leading whitespace */ while(*slider1 && *slider1 <= 0x20) slider1++; /* skip all white lines */ if(*slider1 == 0) continue; /* skip commented lines */ if(*slider1 == '#') continue; /* PUBLIC|PRIVATE */ slider2 = slider1; while(*slider2 && *slider2 > 0x20) slider2++; if(strncasecmp(PUBLIC_TOKEN,slider1,slider2-slider1) == 0) { if(keytype == SLPSPI_KEY_TYPE_PRIVATE) continue; result->keytype = SLPSPI_KEY_TYPE_PUBLIC; } else if(strncasecmp(PRIVATE_TOKEN,slider1,slider2-slider1) == 0) { if(keytype == SLPSPI_KEY_TYPE_PUBLIC) continue; result->keytype = SLPSPI_KEY_TYPE_PRIVATE; } else { /* unknown token */ continue; } /*-----------------------*/ /* read the second token */ /*-----------------------*/ slider1=slider2; /* skip leading whitespace */ while(*slider1 && *slider1 <= 0x20) slider1++; /* SPI string */ slider2 = slider1; while(*slider2 && *slider2 > 0x20) slider2++; /* SPI string is at slider1 length slider2 - slider1 */ result->spistr = (char*)xmalloc(slider2-slider1); if(result->spistr) { memcpy(result->spistr,slider1,slider2-slider1); result->spistrlen = slider2-slider1; } /*----------------------*/ /* read the third token */ /*----------------------*/ slider1=slider2; /* skip leading whitespace */ while(*slider1 && *slider1 <= 0x20) slider1++; /* SPI string */ slider2 = slider1; while(*slider2 && *slider2 > 0x20) slider2++; /* key file path is at slider1 length slider2 - slider1 */ tmp = *slider2; *slider2 = 0; result->keyfilename = xstrdup(slider1); result->key = 0; /* read it later */ *slider2 = tmp; /*-----------------*/ /* See what we got */ /*-----------------*/ if(result && result->spistr && result->keyfilename) { goto SUCCESS; } if(result->keyfilename) xfree(result->keyfilename); if(result->spistr) xfree(result->spistr); } if (result) { xfree(result); result = 0; } SUCCESS: if (line) xfree(line); return result; } /*=========================================================================*/ SLPSpiHandle SLPSpiOpen(const char* spifile, int cacheprivate) /* Initializes SLP SPI data storage. */ /* */ /* Parameters: spifile (IN) path of slp.spi file */ /* cacheprivate (IN) should private keys be cached in handle */ /* */ /* Returns: valid pointer. NULL on failure */ /*=========================================================================*/ { FILE* fp; SLPSpiHandle result = 0; SLPSpiEntry* spientry; fp = fopen(spifile,"r"); if(fp) { result = xmalloc(sizeof(struct _SLPSpiHandle)); if(result == 0) return 0; memset(result, 0, sizeof(struct _SLPSpiHandle)); result->spifile = xstrdup(spifile); result->cacheprivate = cacheprivate; while(1) { spientry = SLPSpiReadSpiFile(fp, SLPSPI_KEY_TYPE_ANY); if(spientry == 0) break; if(spientry->keytype == SLPSPI_KEY_TYPE_PRIVATE && cacheprivate == 0) { /* destroy the key cause we're not suppose to cache it */ SLPCryptoDSAKeyDestroy(spientry->key); } SLPListLinkHead(&(result->cache),(SLPListItem*)spientry); } fclose(fp); } return result; } /*=========================================================================*/ void SLPSpiClose(SLPSpiHandle hspi) /* Release SLP SPI data storage associated with the specified SLPSpiHandle */ /* */ /* Parameters: hspi (IN) SLPSpiHandle to deinitialize */ /*=========================================================================*/ { if(hspi) { if(hspi->spifile) xfree(hspi->spifile); while(hspi->cache.count) { SLPSpiEntryFree((SLPSpiEntry*)SLPListUnlink(&(hspi->cache),hspi->cache.head)); } xfree(hspi); } } /*=========================================================================*/ char* SLPSpiGetDefaultSPI(SLPSpiHandle hspi, int keytype, int* spistrlen, char** spistr) /* Gets a reference to the default SPI string for the specified keytype */ /* */ /* Parameters: hspi (IN) handle obtained from call to SLPSpiOpen() */ /* keytype (IN) type of key */ /* spistrlen (OUT) length or the returned spistr */ /* spistr (OUT) pointer to spistr. MUST be freed by */ /* caller!! */ /* */ /* Returns: Pointer to the default SPI string. Pointer may *not* be NULL */ /* terminated */ /*=========================================================================*/ { SLPSpiEntry* entry; *spistr = 0; *spistrlen = 0; if(hspi) { entry = SLPSpiEntryFind(&(hspi->cache),keytype,0,0); if(entry) { *spistr = xmalloc(entry->spistrlen); if(*spistr) { memcpy(*spistr, entry->spistr, entry->spistrlen); *spistrlen = entry->spistrlen; } } } return *spistr; } /*=========================================================================*/ SLPCryptoDSAKey* SLPSpiGetDSAKey(SLPSpiHandle hspi, int keytype, int spistrlen, const char* spistr, SLPCryptoDSAKey **key) /* Fetches a copy of the private key file used to sign SLP messages. */ /* */ /* Parameters: hspi (IN) handle obtained from call to SLPSpiOpen() */ /* keytype (IN) the type of key desired */ /* spistrlen (IN) the length of the spistr */ /* spistr (IN) spistr associated with the key */ /* key (OUT) the private key. Caller should use */ /* SLPCryptoDSAKeyDestroy() to free key memory */ /* */ /* Returns: A valid pointer. NULL on failure. Caller should use */ /* SLPCryptoDSAKeyDestroy() to free key memory */ /*=========================================================================*/ { SLPSpiEntry* tmp = 0; /* For safety NULL out the key from the beginning */ *key = 0; if(hspi) { tmp = SLPSpiEntryFind(&(hspi->cache), keytype, spistrlen, spistr); if(tmp) { if(tmp->key == 0) { if(keytype == SLPSPI_KEY_TYPE_PRIVATE && hspi->cacheprivate == 0) { *key = SLPSpiReadKeyFile(tmp->keyfilename,SLPSPI_KEY_TYPE_PRIVATE); return *key; } tmp->key = SLPSpiReadKeyFile(tmp->keyfilename,keytype); if (tmp->key == 0) return 0; } *key = SLPCryptoDSAKeyDup(tmp->key); } } return *key; } /*=========================================================================*/ int SLPSpiCanVerify(SLPSpiHandle hspi, int spistrlen, const char* spistr) /* Determine if we understand the specified SPI. No SPI is always */ /* returns true */ /* */ /* Parameters: hspi (IN) handle obtained from call to SLPSpiOpen() */ /* spistrlen (IN) the length of the spistr */ /* spistr (IN) the SPI string */ /* */ /* Returns Non-zero if we verify specified the SPI */ /*=========================================================================*/ { if (hspi == 0) { return 0; } if(spistrlen == 0 || spistr == NULL) { return 1; } return (SLPSpiEntryFind(&(hspi->cache), SLPSPI_KEY_TYPE_PUBLIC, spistrlen, spistr) != 0); } /*=========================================================================*/ int SLPSpiCanSign(SLPSpiHandle hspi, int spistrlen, const char* spistr) /* Determine if we understand the specified SPI. No SPI is always */ /* return true */ /* */ /* Parameters: hspi (IN) handle obtained from call to SLPSpiOpen() */ /* spistrlen (IN) the length of the spistr */ /* spistr (IN) the SPI string */ /* */ /* Returns Non-zero if we sign using the specified SPI */ /*=========================================================================*/ { return (SLPSpiEntryFind(&(hspi->cache), SLPSPI_KEY_TYPE_PRIVATE, spistrlen, spistr) != 0); } openslp-1.2.1/common/slp_buffer.c0000644033442200000310000002036510202047412016641 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_buffer.c */ /* */ /* Abstract: Header file that defines structures and constants that are */ /* are used to control memory allocation in OpenSLP */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slp_buffer.h" #include "slp_xmalloc.h" /*=========================================================================*/ void* memdup(const void* src, int srclen) /* Generic memdup analogous to strdup() */ /*=========================================================================*/ { char* result; result = (unsigned char*)xmalloc(srclen); if(result) { memcpy(result,src,srclen); } return result; } /*=========================================================================*/ SLPBuffer SLPBufferAlloc(size_t size) /* Must be called to initially allocate a SLPBuffer */ /* */ /* size - (IN) number of bytes to reallocate */ /* */ /* returns - newly allocated SLPBuffer or NULL on ENOMEM. An extra byte */ /* is allocated to null terminating strings. This extra byte */ /* is not counted in the buffer size */ /*=========================================================================*/ { SLPBuffer result; /* allocate an extra byte for null terminating strings */ result = (SLPBuffer)xmalloc(sizeof(struct _SLPBuffer) + size + 1); if(result) { result->allocated = size; result->start = (unsigned char*)(result + 1); result->curpos = result->start; result->end = result->start + size; #if(defined DEBUG) memset(result->start,0x4d,size + 1); #endif } return result; } /*=========================================================================*/ SLPBuffer SLPBufferRealloc(SLPBuffer buf, size_t size) /* Must be called to initially allocate a SLPBuffer */ /* */ /* size - (IN) number of bytes to allocate */ /* */ /* returns - newly (re)allocated SLPBuffer or NULL on ENOMEM. An extra */ /* byte is allocated to null terminating strings. This extra */ /* byte is not counted in the buffer size */ /*=========================================================================*/ { SLPBuffer result; if(buf) { if(buf->allocated >= size) { result = buf; } else { /* allocate an extra byte for null terminating strings */ result = (SLPBuffer)xrealloc(buf, sizeof(struct _SLPBuffer) + size + 1); result->allocated = size; } if(result) { result->start = (unsigned char*)(result + 1); result->curpos = result->start; result->end = result->start + size; #if(defined DEBUG) memset(result->start,0x4d,size + 1); #endif } } else { result = SLPBufferAlloc(size); } return result; } /*=========================================================================*/ SLPBuffer SLPBufferDup(SLPBuffer buf) /* Returns a duplicate buffer. Duplicate buffer must be freed by a call */ /* to SLPBufferFree() */ /* */ /* size - (IN) number of bytes to allocate */ /* */ /* returns - a newly allocated SLPBuffer or NULL on ENOMEM */ /*=========================================================================*/ { SLPBuffer dup; dup = SLPBufferAlloc(buf->end - buf->start); if(dup) { memcpy(dup->start,buf->start,buf->end - buf->start); } return dup; } /*=========================================================================*/ void SLPBufferFree(SLPBuffer buf) /* Free a previously allocated SLPBuffer */ /* */ /* msg - (IN) the SLPBuffer to free */ /* */ /* returns - none */ /*=========================================================================*/ { if(buf) { xfree(buf); } } openslp-1.2.1/common/slp_auth.c0000644033442200000310000011272110202047412016327 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp_auth.c */ /* */ /* Abstract: Common for OpenSLP's SLPv2 authentication implementation */ /* Currently only bsd 0x0002 (DSA-SHA1) is supported */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include #include "slp_xmalloc.h" #include "slp_auth.h" #include "slp_crypto.h" /*-------------------------------------------------------------------------*/ int SLPAuthDigestString(int spistrlen, const char* spistr, int stringlen, const char* string, unsigned long timestamp, unsigned char* digest) /*-------------------------------------------------------------------------*/ { int result; int tmpbufsize; unsigned char* tmpbuf; unsigned char* curpos; /* assume success */ result = 0; /*-------------------------------------------------------*/ /* Allocate temporary buffer for contiguous data */ /*-------------------------------------------------------*/ /* +8 makes room for: stringlen (2 bytes) */ /* autharray[i].spistrlen (2 bytes) */ /* timestamp 4 bytes */ tmpbufsize = stringlen + spistrlen + 8; tmpbuf = xmalloc(tmpbufsize); if(tmpbuf == 0) { return SLP_ERROR_INTERNAL_ERROR; } /*-----------------------------------*/ /* Copy data into continguous buffer */ /*-----------------------------------*/ curpos = tmpbuf; ToUINT16(curpos,spistrlen); curpos = curpos + 2; memcpy(curpos, spistr, spistrlen); curpos = curpos + spistrlen; ToUINT16(curpos,stringlen); curpos = curpos + 2; memcpy(curpos, string, stringlen); curpos = curpos + stringlen; ToUINT32(curpos, timestamp); /*---------------------*/ /* Generate the digest */ /*---------------------*/ if(SLPCryptoSHA1Digest(tmpbuf, tmpbufsize, digest)) { result = SLP_ERROR_INTERNAL_ERROR; } /*------------------------------*/ /* Cleanup the temporary buffer */ /*------------------------------*/ xfree(tmpbuf); return result; } /*-------------------------------------------------------------------------*/ int SLPAuthDigestDAAdvert(unsigned short spistrlen, const char* spistr, unsigned long timestamp, unsigned long bootstamp, unsigned short urllen, const char* url, unsigned short attrlistlen, const char* attrlist, unsigned short scopelistlen, const char* scopelist, unsigned short daspistrlen, const char* daspistr, unsigned char* digest) /*-------------------------------------------------------------------------*/ { int result; int tmpbufsize; unsigned char* tmpbuf; unsigned char* curpos; /* assume success */ result = 0; /*-------------------------------------------------------*/ /* Allocate temporary buffer for contiguous data */ /*-------------------------------------------------------*/ /* +18 makes room for: spistrlen (2 bytes) */ /* bootstamp (4 bytes) */ /* urllen (2 bytes) */ /* scopelistlen(2 bytes) */ /* attrlistlen (2 bytes) */ /* daspistrlen (2 bytes) */ /* timestamp (4 bytes) */ tmpbufsize = spistrlen + urllen + scopelistlen + attrlistlen + daspistrlen + 18; tmpbuf = xmalloc(tmpbufsize); if(tmpbuf == 0) { return SLP_ERROR_INTERNAL_ERROR; } /*-----------------------------------*/ /* Copy data into continguous buffer */ /*-----------------------------------*/ curpos = tmpbuf; ToUINT16(curpos,spistrlen); curpos += 2; memcpy(curpos, spistr, spistrlen); curpos += spistrlen; ToUINT32(curpos,bootstamp); curpos += 4; ToUINT16(curpos,urllen); curpos += 2; memcpy(curpos, url, urllen); curpos += urllen; ToUINT16(curpos,scopelistlen); curpos += 2; memcpy(curpos, scopelist, scopelistlen); curpos += scopelistlen; ToUINT16(curpos,attrlistlen); curpos += 2; memcpy(curpos, attrlist, attrlistlen); curpos += attrlistlen; ToUINT16(curpos,daspistrlen); curpos += 2; memcpy(curpos, daspistr, daspistrlen); curpos += daspistrlen; ToUINT32(curpos,timestamp); /*---------------------*/ /* Generate the digest */ /*---------------------*/ if(SLPCryptoSHA1Digest(tmpbuf, tmpbufsize, digest)) { result = SLP_ERROR_INTERNAL_ERROR; } /*------------------------------*/ /* Cleanup the temporary buffer */ /*------------------------------*/ xfree(tmpbuf); return result; } /*-------------------------------------------------------------------------*/ int SLPAuthSignDigest(int spistrlen, const char* spistr, SLPCryptoDSAKey* key, unsigned char* digest, int* authblocklen, unsigned char** authblock) /*-------------------------------------------------------------------------*/ { int signaturelen; int result; unsigned char* curpos; /*----------------------------------------------*/ /* Allocate memory for the authentication block */ /*----------------------------------------------*/ /* +10 makes room for: */ /* - the bsd (2 bytes) */ /* - the the authblock length (2 bytes) */ /* - the spi string length (2 bytes) */ /* - the timestamp (4 bytes) */ signaturelen = SLPCryptoDSASignLen(key); *authblocklen = spistrlen + signaturelen + 10; *authblock = (unsigned char*)xmalloc(*authblocklen); if(*authblock == 0) { result = SLP_ERROR_INTERNAL_ERROR; goto ERROR; } /*---------------------------------------------------------*/ /* Fill in the Authblock with everything but the signature */ /*---------------------------------------------------------*/ curpos = *authblock; ToUINT16(curpos,0x0002); /* the BSD for DSA-SHA1 */ curpos += 2; ToUINT16(curpos,*authblocklen); curpos += 2; ToUINT32(curpos,0xffffffff); /* very long expiration (for now) */ curpos += 4; ToUINT16(curpos, spistrlen); curpos += 2; memcpy(curpos, spistr, spistrlen); curpos += spistrlen; /*---------------------------------------------*/ /* Sign the digest and put it in the authblock */ /*---------------------------------------------*/ if( SLPCryptoDSASign(key, digest, SLPAUTH_SHA1_DIGEST_SIZE, curpos, &signaturelen)) { result = SLP_ERROR_INTERNAL_ERROR; goto ERROR; } /*---------*/ /* Success */ /*---------*/ return 0; ERROR: /*-------------------------------*/ /* Clean up and return errorcode */ /*-------------------------------*/ if(authblock) xfree(*authblock); *authblock = 0; *authblocklen = 0; return result; } /*-------------------------------------------------------------------------*/ int SLPVerifyDigest(SLPSpiHandle hspi, int emptyisfail, SLPCryptoDSAKey* key, unsigned char* digest, int authcount, const SLPAuthBlock* autharray) /*-------------------------------------------------------------------------*/ { int i; int signaturelen; int result; unsigned long timestamp; /*-----------------------------------*/ /* Should we fail on emtpy authblock */ /*-----------------------------------*/ if(emptyisfail) { result = SLP_ERROR_AUTHENTICATION_FAILED; } else { result = SLP_ERROR_OK; } /*-----------------*/ /* Get a timestamp */ /*-----------------*/ timestamp = time(NULL); /*------------------------------------------------------*/ /* Iterate and check all authentication blocks */ /*------------------------------------------------------*/ /* If any one of the authblocks can be verified then we */ /* accept it */ for(i=0;iurllen, urlentry->url, urlentry->authcount, urlentry->autharray); } /*=========================================================================*/ int SLPAuthVerifyDAAdvert(SLPSpiHandle hspi, int emptyisfail, const SLPDAAdvert* daadvert) /* Verify authenticity of the specified DAAdvert */ /* */ /* Parameters: hspi (IN) open SPI handle */ /* (IN) if non-zero, messages without authblocks */ /* will fail */ /* spistrlen (IN) length of the spi string */ /* sprstr (IN) the spi string */ /* daadvert (IN) the DAAdvert to verify */ /* */ /* Returns: 0 on success or SLP_ERROR_xxx code on failure */ /*=========================================================================*/ { int i; int signaturelen; int result; unsigned long timestamp; const SLPAuthBlock* autharray; int authcount; SLPCryptoDSAKey* key = 0; unsigned char digest[SLPAUTH_SHA1_DIGEST_SIZE]; /*-----------------------------------*/ /* Should we fail on emtpy authblock */ /*-----------------------------------*/ if(emptyisfail) { result = SLP_ERROR_AUTHENTICATION_FAILED; } else { result = SLP_ERROR_OK; } /*-----------------*/ /* Get a timestamp */ /*-----------------*/ timestamp = time(NULL); /*------------------------------------------------------*/ /* Iterate and check all authentication blocks */ /*------------------------------------------------------*/ /* If any one of the authblocks can be verified then we */ /* accept it */ authcount = daadvert->authcount; autharray = daadvert->autharray; for(i=0;ibootstamp, daadvert->urllen, daadvert->url, daadvert->attrlistlen, daadvert->attrlist, daadvert->scopelistlen, daadvert->scopelist, daadvert->spilistlen, daadvert->spilist, digest); if(result == 0) { /*------------------------------------------------------------*/ /* Calculate the size of the DSA signature from the authblock */ /*------------------------------------------------------------*/ /* we have to calculate the signature length since */ /* autharray[i].length is (stupidly) the length of the entire */ /* authblock */ signaturelen = autharray[i].length - (autharray[i].spistrlen + 10); /*----------------------*/ /* Verify the signature */ /*----------------------*/ if(SLPCryptoDSAVerify(key, digest, sizeof(digest), autharray[i].authstruct, signaturelen)) { break; } result = SLP_ERROR_AUTHENTICATION_FAILED; } } } if(key) SLPCryptoDSAKeyDestroy(key); return result; } /*=========================================================================*/ int SLPAuthVerifySAAdvert(SLPSpiHandle hspi, int emptyisfail, const SLPSAAdvert* saadvert) /* Verify authenticity of the specified SAAdvert */ /* */ /* Parameters: hspi (IN) open SPI handle */ /* emptyisfail (IN) if non-zero, messages without authblocks */ /* will fail */ /* spistrlen (IN) length of the spi string */ /* sprstr (IN) the spi string */ /* saadvert (IN) the SAADVERT to verify */ /* */ /* Returns: 0 on success or SLP_ERROR_xxx code on failure */ /*=========================================================================*/ { return 0; } /*=========================================================================*/ int SLPAuthSignString(SLPSpiHandle hspi, int spistrlen, const char* spistr, unsigned short stringlen, const char* string, int* authblocklen, unsigned char** authblock) /* Generate an authblock signature for an attribute list */ /* */ /* Parameters: hspi (IN) open SPI handle */ /* spistrlen (IN) length of the SPI string */ /* spistr (IN) SPI to sign with */ /* attrlistlen (IN) the length of the URL to sign */ /* attrlist (IN) the url to sign */ /* authblocklen (OUT) the length of the authblock signature */ /* authblock (OUT) buffer containing authblock signature */ /* must be freed by the caller */ /* */ /* Returns: 0 on success or SLP_ERROR_xxx code on failure */ /*=========================================================================*/ { int result; SLPCryptoDSAKey* key; unsigned char digest[20]; int defaultspistrlen = 0; char* defaultspistr = 0; /* NULL out the authblock and spistr just to be safe */ key = 0; *authblock = 0; *authblocklen = 0; spistr = 0; spistrlen = 0; /*--------------------------------*/ /* Get a private key for the SPI */ /*--------------------------------*/ if(spistr) { key = SLPSpiGetDSAKey(hspi, SLPSPI_KEY_TYPE_PRIVATE, spistrlen, spistr, &key); } else { if(SLPSpiGetDefaultSPI(hspi, SLPSPI_KEY_TYPE_PRIVATE, &defaultspistrlen, &defaultspistr)) { spistr = defaultspistr; spistrlen = defaultspistrlen; key = SLPSpiGetDSAKey(hspi, SLPSPI_KEY_TYPE_PRIVATE, spistrlen, spistr, &key); } } if(key == 0) { result = SLP_ERROR_AUTHENTICATION_UNKNOWN; goto ERROR; } /*--------------------------*/ /* Generate the SHA1 digest */ /*--------------------------*/ result = SLPAuthDigestString(spistrlen, spistr, stringlen, string, 0xffffffff, /* very long expiration (for now) */ digest); /*---------------------------------------------*/ /* Sign the digest and put it in the authblock */ /*---------------------------------------------*/ if(result == 0) { result = SLPAuthSignDigest(spistrlen, spistr, key, digest, authblocklen, authblock); } ERROR: /*---------*/ /* Cleanup */ /*---------*/ if(defaultspistr) xfree(defaultspistr); if(key) SLPCryptoDSAKeyDestroy(key); return result; } /*=========================================================================*/ int SLPAuthSignUrl(SLPSpiHandle hspi, int spistrlen, const char* spistr, unsigned short urllen, const char* url, int* authblocklen, unsigned char** authblock) /* Generate an authblock signature for a Url */ /* */ /* Parameters: hspi (IN) open SPI handle */ /* spistrlen (IN) length of the SPI string */ /* spistr (IN) SPI to sign with */ /* urllen (IN) the length of the URL to sign */ /* url (IN) the url to sign */ /* authblocklen (OUT) the length of the authblock signature */ /* authblock (OUT) buffer containing authblock signature */ /* must be freed by the caller */ /* */ /* Returns: 0 on success or SLP_ERROR_xxx code on failure */ /*=========================================================================*/ { return SLPAuthSignString(hspi, spistrlen, spistr, urllen, url, authblocklen, authblock); } /*=========================================================================*/ int SLPAuthSignDAAdvert(SLPSpiHandle hspi, unsigned short spistrlen, const char* spistr, unsigned long bootstamp, unsigned short urllen, const char* url, unsigned short attrlistlen, const char* attrlist, unsigned short scopelistlen, const char* scopelist, unsigned short daspistrlen, const char* daspistr, int* authblocklen, unsigned char** authblock) /* Generate an authblock signature for a DAADVERT */ /* */ /* Parameters: hspi (IN) open SPI handle */ /* spistrlen (IN) length of the spi string */ /* sprstr (IN) the spi string */ /* bootstamp (IN) the statless DA boot timestamp */ /* urllen (IN) the length of the URL to sign */ /* url (IN) the url to sign */ /* attrlistlen (IN) the length of the URL to sign */ /* attrlist (IN) the url to sign */ /* scopelistlen (IN) the length of the DA's scope list */ /* scopelist (IN) the DA's scope list */ /* daspistrlen (IN) the length of the list of DA's SPIs */ /* daspistr (IN) the list of the DA's SPI's */ /* authblocklen (OUT) the length of the authblock signature */ /* authblock (OUT) buffer containing authblock signature must */ /* be freed by the caller */ /* */ /* Returns: 0 on success or SLP_ERROR_xxx code on failure */ /*=========================================================================*/ { int result; SLPCryptoDSAKey* key; unsigned char digest[20]; int defaultspistrlen = 0; char* defaultspistr = 0; /* NULL out the authblock and spistr just to be safe */ key = 0; *authblock = 0; *authblocklen = 0; spistr = 0; spistrlen = 0; /*--------------------------------*/ /* Get a private key for the SPI */ /*--------------------------------*/ if(spistr) { key = SLPSpiGetDSAKey(hspi, SLPSPI_KEY_TYPE_PRIVATE, spistrlen, spistr, &key); } else { if(SLPSpiGetDefaultSPI(hspi, SLPSPI_KEY_TYPE_PRIVATE, &defaultspistrlen, &defaultspistr)) { spistr = defaultspistr; spistrlen = defaultspistrlen; key = SLPSpiGetDSAKey(hspi, SLPSPI_KEY_TYPE_PRIVATE, spistrlen, spistr, &key); } } if(key == 0) { result = SLP_ERROR_AUTHENTICATION_UNKNOWN; goto ERROR; } /*--------------------------*/ /* Generate the SHA1 digest */ /*--------------------------*/ result = SLPAuthDigestDAAdvert(spistrlen, spistr, 0xffffffff, bootstamp, urllen, url, attrlistlen, attrlist, scopelistlen, scopelist, daspistrlen, daspistr, digest); /*---------------------------------------------*/ /* Sign the digest and put it in the authblock */ /*---------------------------------------------*/ if(result == 0) { result = SLPAuthSignDigest(spistrlen, spistr, key, digest, authblocklen, authblock); } ERROR: /*---------*/ /* Cleanup */ /*---------*/ if(defaultspistr) xfree(defaultspistr); if(key) SLPCryptoDSAKeyDestroy(key); return result; } /*=========================================================================*/ int SLPAuthSignSAAdvert(unsigned short spistrlen, const char* spistr, unsigned short urllen, const char* url, unsigned short attrlistlen, const char* attrlist, unsigned short scopelistlen, const char* scopelist, int* authblocklen, unsigned char** authblock) /* Generate an authblock signature for a SAADVERT */ /* */ /* Parameters: spistrlen (IN) length of the spi string */ /* sprstr (IN) the spi string */ /* urllen (IN) the length of the URL to sign */ /* url (IN) the url to sign */ /* attrlistlen (IN) the length of the URL to sign */ /* attrlist (IN) the url to sign */ /* scopelistlen (IN) the length of the DA's scope list */ /* scopelist (IN) the DA's scope list */ /* authblocklen (OUT) the length of the authblock signature */ /* authblock (OUT) buffer containing authblock signature */ /* */ /* Returns: 0 on success or SLP_ERROR_xxx code on failure */ /*=========================================================================*/ { *authblocklen = 0; *authblock = 0; return 0; } openslp-1.2.1/libslp/0000755033442200000310000000000010211377553014351 5ustar rganesanfloppyopenslp-1.2.1/libslp/slp.h0000644033442200000310000017115510207404661015326 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slp.h */ /* */ /* Abstract: Main header file for the SLP API exactly as described by */ /* rfc2614. This is the only file that needs to be included */ /* in order make all SLP API declarations. */ /* */ /* Author(s) Matt Peterson */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #if(!defined SLP_H_INCLUDED) #define SLP_H_INCLUDED #if(defined __cplusplus) extern "C" { #endif #if defined(_WIN32) && defined(_MSC_VER) /* MSVC auto-exports, BCB uses .def file */ # define SLPCALLBACK # ifdef LIBSLP_EXPORTS # define SLPEXP __declspec(dllexport) # elif defined(LIBSLP_STATIC) # define SLPEXP # else # define SLPEXP __declspec(dllimport) # endif # define SLPAPI #else # define SLPCALLBACK # define SLPEXP # define SLPAPI #endif /*==========================================================================*/ /* lifetime values, in seconds, that are frequently used. */ /*==========================================================================*/ #define SLP_LIFETIME_DEFAULT 10800 /* 3 hours */ #define SLP_LIFETIME_MAXIMUM 65535 /* 18 hours */ /*==========================================================================*/ /* SLPError */ /* --------- */ /* The SLPError type represents error codes that are returned from API */ /* functions. */ typedef int SLPError; #define SLP_LAST_CALL 1 /* passed to callback functions when the API */ /* library has no more data for them and therefore no further calls */ /* will be made to the callback on the currently outstanding operation. */ /* The callback can use this to signal the main body of the client code */ /* that no more data will be forthcoming on the operation, so that the */ /* main body of the client code can break out of data collection loops. */ /* On * the last call of a callback during both a synchronous and */ /* asynchronous call, the error code parameter has value SLP_LAST_CALL, */ /* and the other parameters are all NULL. If no results are returned by */ /* an API operation, then only one call is made, with the error */ /* parameter set to SLP_LAST_CALL. */ #define SLP_OK 0 /* indicates that the no error occurred during the operation. */ #define SLP_LANGUAGE_NOT_SUPPORTED -1 /* No DA or SA has service advertisement or attribute information */ /* in the language requested, but at least one DA or SA indicated, */ /* via the LANGUAGE_NOT_SUPPORTED error code, that it might have */ /* information for that service in another language */ #define SLP_PARSE_ERROR -2 /* The SLP message was rejected by a remote SLP agent. The API */ /* returns this error only when no information was retrieved, and */ /* at least one SA or DA indicated a protocol error. The data */ /* supplied through the API may be malformed or a may have been */ /* damaged in transit. */ #define SLP_INVALID_REGISTRATION -3 /* The API may return this error if an attempt to register a */ /* service was rejected by all DAs because of a malformed URL or */ /* attributes. SLP does not return the error if at least one DA */ /* accepted the registration. */ #define SLP_SCOPE_NOT_SUPPORTED -4 /* The API returns this error if the SA has been configured with */ /* net.slp.useScopes value-list of scopes and the SA request did */ /* not specify one or more of these allowable scopes, and no */ /* others. It may be returned by a DA or SA if the scope included */ /* in a request is not supported by the DA or SA. */ #define SLP_AUTHENTICATION_ABSENT -6 /* if the SLP framework supports authentication, this error arises */ /* when the UA or SA failed to send an authenticator for requests */ /* or registrations in a protected scope. */ #define SLP_AUTHENTICATION_FAILED -7 /* If the SLP framework supports authentication, this error arises */ /* when a authentication on an SLP message failed */ #define SLP_INVALID_UPDATE -13 /* An update for a non-existing registration was issued, or the */ /* update includes a service type or scope different than that in */ /* the initial registration, etc. */ #define SLP_REFRESH_REJECTED -15 /* The SA attempted to refresh a registration more frequently */ /* than the minimum refresh interval. The SA should call the */ /* appropriate API function to obtain the minimum refresh interval */ /* to use. */ #define SLP_NOT_IMPLEMENTED -17 /* If an unimplemented feature is used, this error is returned. */ #define SLP_BUFFER_OVERFLOW -18 /* An outgoing request overflowed the maximum network MTU size. */ /* The request should be reduced in size or broken into pieces and */ /* tried again. */ #define SLP_NETWORK_TIMED_OUT -19 /* When no reply can be obtained in the time specified by the */ /* configured timeout interval for a unicast request, this error */ /* is returned. */ #define SLP_NETWORK_INIT_FAILED -20 /* If the network cannot initialize properly, this error is */ /* returned. Will also be returned if an SA or DA agent (slpd) */ /* can not be contacted. See SLPRegReport() callback. */ #define SLP_MEMORY_ALLOC_FAILED -21 /* Out of memory error */ #define SLP_PARAMETER_BAD -22 /* If a parameter passed into an interface is bad, this error is */ /* returned. */ #define SLP_NETWORK_ERROR -23 /* The failure of networking during normal operations causes this */ /* error to be returned. */ #define SLP_INTERNAL_SYSTEM_ERROR -24 /* A basic failure of the API causes this error to be returned. */ /* This occurs when a system call or library fails. The operation */ /* could not recover. */ #define SLP_HANDLE_IN_USE -25 /* In the C API, callback functions are not permitted to */ /* recursively call into the API on the same SLPHandle, either */ /* directly or indirectly. If an attempt is made to do so, this */ /* error is returned from the called API function. */ #define SLP_TYPE_ERROR -26 #ifndef UNICAST_NOT_SUPPORTED /* The SLP UA needs to send a unicast query to a SA because this SA has */ /* sent a packet > MTU size */ # define SLP_RETRY_UNICAST -27 #endif /* If the API supports type checking of registrations against */ /* service type templates, this error can arise if the attributes */ /* in a registration do not match the service type template for */ /* the service. */ /*==========================================================================*/ /* SLPBoolean */ /*------------ */ /* The SLPBoolean enum is used as a boolean flag. */ typedef enum { SLP_FALSE = 0, SLP_TRUE = 1 } SLPBoolean; /*==========================================================================*/ /* SLPSrvURL */ /*----------- */ /* The SLPSrvURL structure is filled in by the SLPParseSrvURL() function */ /* with information parsed from a character buffer containing a service */ /* URL. The fields correspond to different parts of the URL. Note that */ /* the structure is in conformance with the standard Berkeley sockets */ /* struct servent, with the exception that the pointer to an array of */ /* characters for aliases (s_aliases field) is replaced by the pointer */ /* to host name (s_pcHost field). */ typedef struct srvurl { char *s_pcSrvType; /* A pointer to a character string containing the service */ /* type name, including naming authority. The service type */ /* name includes the "service:" if the URL is of the service: */ /* scheme. */ char *s_pcHost; /* A pointer to a character string containing the host */ /* identification information. */ int s_iPort; /* The port number, or zero if none. The port is only available */ /* if the transport is IP. */ char *s_pcNetFamily; /* A pointer to a character string containing the network address */ /* family identifier. Possible values are "ipx" for the IPX */ /* family, "at" for the Appletalk family, and "" (i.e. the empty */ /* string) for the IP address family. */ char *s_pcSrvPart; /* The remainder of the URL, after the host identification. */ } SLPSrvURL; /*=========================================================================*/ #if(!defined SLPHANDLE_INTERNAL) /*=========================================================================*/ typedef void* SLPHandle; /* */ /* The SLPHandle type is returned by SLPOpen() and is a parameter to all */ /* SLP functions. It serves as a handle for all resources allocated on */ /* behalf of the process by the SLP library. The type is opaque, since */ /* the exact nature differs depending on the implementation. */ /*=========================================================================*/ #endif /*=========================================================================*/ typedef void SLPCALLBACK SLPRegReport(SLPHandle hSLP, SLPError errCode, void *pvCookie); /* */ /* The SLPRegReport callback type is the type of the callback function */ /* to the SLPReg(), SLPDereg(), and SLPDelAttrs() functions. */ /* */ /* hSLP The SLPHandle used to initiate the operation. */ /* */ /* errCode An error code indicating if an error occurred during the */ /* operation. */ /* */ /* pvCookie Memory passed down from the client code that called the */ /* original API function, starting the operation. May be NULL. */ /*=========================================================================*/ /*=========================================================================*/ typedef SLPBoolean SLPCALLBACK SLPSrvTypeCallback(SLPHandle hSLP, const char* pcSrvTypes, SLPError errCode, void *pvCookie); /* */ /* The SLPSrvTypeCallback type is the type of the callback function */ /* parameter to SLPFindSrvTypes() function. If the hSLP handle */ /* parameter was opened asynchronously, the results returned through the */ /* callback MAY be uncollated. If the hSLP handle parameter was opened */ /* synchronously, then the returned results must be collated and */ /* duplicates eliminated. */ /* */ /* hSLP The SLPHandle used to initiate the operation. */ /* */ /* pcSrvTypes A character buffer containing a comma separated, null */ /* terminated list of service types. */ /* */ /* errCode An error code indicating if an error occurred during the */ /* operation. The callback should check this error code befor*/ /* processing the parameters. If the error code is other than*/ /* SLP_OK, then the API library may choose to terminate the */ /* outstanding operation. */ /* */ /* pvCookie Memory passed down from the client code that called the */ /* original API function, starting the operation. May be NULL*/ /* */ /* Returns The client code should return SLP_TRUE if more data is */ /* desired, otherwise return SLP_FALSE */ /*=========================================================================*/ /*=========================================================================*/ typedef SLPBoolean SLPCALLBACK SLPSrvURLCallback(SLPHandle hSLP, const char* pcSrvURL, unsigned short sLifetime, SLPError errCode, void *pvCookie); /* */ /* The SLPSrvURLCallback type is the type of the callback function */ /* parameter to SLPFindSrvs() function. If the hSLP handle parameter */ /* was opened asynchronously, the results returned through the callback */ /* MAY be uncollated. If the hSLP handle parameter was opened */ /* synchronously, then the returned results must be collated and */ /* duplicates eliminated. */ /* */ /* hSLP The SLPHandle used to initiate the operation. */ /* */ /* pcSrvURL A character buffer containing the returned service URL. */ /* May be NULL if errCode not SLP_OK. */ /* */ /* sLifetime An unsigned short giving the life time of the service */ /* advertisement, in seconds. The value must be an unsigned */ /* integer less than or equal to SLP_LIFETIME_MAXIMUM. */ /* */ /* errCode An error code indicating if an error occurred during the */ /* operation. The callback should check this error code */ /* before processing the parameters. If the error code is */ /* other than SLP_OK, then the API library may choose to */ /* terminate the outstanding operation. SLP_LAST_CALL is */ /* returned when no more services are available and the */ /* callback will not be called again.. */ /* */ /* pvCookie Memory passed down from the client code that called the */ /* original API function, starting the operation. */ /* May be NULL. */ /* */ /* Returns The client code should return SLP_TRUE if more data is */ /* desired, otherwise return SLP_FALSE */ /*=========================================================================*/ /*=========================================================================*/ typedef SLPBoolean SLPCALLBACK SLPAttrCallback(SLPHandle hSLP, const char* pcAttrList, SLPError errCode, void *pvCookie); /* */ /* The SLPAttrCallback type is the type of the callback function */ /* parameter to SLPFindAttrs() function. */ /* */ /* The behavior of the callback differs depending on whether the */ /* attribute request was by URL or by service type. If the */ /* SLPFindAttrs() operation was originally called with a URL, the */ /* callback is called once regardless of whether the handle was opened */ /* asynchronously or synchronously. The pcAttrList parameter contains */ /* the requested attributes as a comma separated list (or is empty if no */ /* attributes matched the original tag list). */ /* */ /* If the SLPFindAttrs() operation was originally called with a service */ /* type, the value of pcAttrList and calling behavior depend on whether */ /* the handle was opened asynchronously or synchronously. If the handle */ /* was opened asynchronously, the callback is called every time the API */ /* library has results from a remote agent. The pcAttrList parameter */ /* MAY be uncollated between calls. It contains a comma separated list */ /* with the results from the agent that immediately returned results. */ /* If the handle was opened synchronously, the results must be collated */ /* from all returning agents and the callback is called once, with the */ /* pcAttrList parameter set to the collated result. */ /* */ /* hSLP The SLPHandle used to initiate the operation. */ /* */ /* pcAttrList A character buffer containing a comma separated, null */ /* terminated list of attribute id/value assignments, in SLP */ /* wire format; i.e. "(attr-id=attr-value-list)". */ /* */ /* errCode An error code indicating if an error occurred during the */ /* operation. The callback should check this error code */ /* before processing the parameters. If the error code is */ /* other than SLP_OK, then the API library may choose to */ /* terminate the outstanding operation. */ /* */ /* pvCookie Memory passed down from the client code that called the */ /* original API function, starting the operation. */ /* May be NULL. */ /* */ /* Returns The client code should return SLP_TRUE if more data is */ /* desired,otherwise return SLP_FALSE */ /*=========================================================================*/ /*=========================================================================*/ SLPEXP SLPError SLPAPI SLPOpen(const char *pcLang, SLPBoolean isAsync, SLPHandle *phSLP); /* */ /* Returns a SLPHandle handle in the phSLP parameter for the language */ /* locale passed in as the pcLang parameter. The client indicates if */ /* operations on the handle are to be synchronous or asynchronous */ /* through the isAsync parameter. The handle encapsulates the language */ /* locale for SLP requests issued through the handle, and any other */ /* resources required by the implementation. However, SLP properties */ /* are not encapsulated by the handle; they are global. The return */ /* value of the function is an SLPError code indicating the status of */ /* the operation. Upon failure, the phSLP parameter is NULL. */ /* */ /* An SLPHandle can only be used for one SLP API operation at a time. */ /* If the original operation was started asynchronously, any attempt to */ /* start an additional operation on the handle while the original */ /* operation is pending results in the return of an SLP_HANDLE_IN_USE */ /* error from the API function. The SLPClose() API function terminates */ /* any outstanding calls on the handle. If an implementation is unable */ /* to support a asynchronous( resp. synchronous) operation, due to */ /* memory constraints or lack of threading support, the */ /* SLP_NOT_IMPLEMENTED flag may be returned when the isAsync flag is */ /* SLP_TRUE (resp. SLP_FALSE). */ /* */ /* pcLang A pointer to an array of characters containing the RFC 1766 */ /* Language Tag RFC 1766 for the natural language locale of */ /* requests and registrations issued on the handle. Pass in NULL */ /* or the empty string, "" to use the default locale */ /* */ /* isAsync An SLPBoolean indicating whether the SLPHandle should be opened*/ /* for asynchronous operation or not. */ /* */ /* phSLP A pointer to an SLPHandle, in which the open SLPHandle is */ /* returned. If an error occurs, the value upon return is NULL. */ /* */ /* Returns SLPError code */ /*=========================================================================*/ /*=========================================================================*/ SLPEXP void SLPAPI SLPClose(SLPHandle hSLP); /* */ /* Frees all resources associated with the handle. If the handle was */ /* invalid, the function returns silently. Any outstanding synchronous */ /* or asynchronous operations are cancelled so their callback functions */ /* will not be called any further. */ /* */ /* SLPHandle A SLPHandle handle returned from a call to SLPOpen(). */ /*=========================================================================*/ #ifndef MI_NOT_SUPPORTED /*=========================================================================*/ SLPEXP SLPError SLPAssociateIFList( SLPHandle hSLP, const char* McastIFList); /* */ /* Associates a list of interfaces McastIFList on which multicast needs to */ /* be done with a particular SLPHandle hSLP. McastIFList is a comma */ /* separated list of host interface IP addresses. */ /* */ /* hSLP The SLPHandle with which the interface list is to */ /* be associated with. */ /* */ /* McastIFList A comma separated list of host interface IP */ /* addresses on which multicast needs to be done. */ /* */ /* Returns SLPError code */ /*=========================================================================*/ #endif /* MI_NOT_SUPPORTED */ #ifndef UNICAST_NOT_SUPPORTED /*=========================================================================*/ SLPEXP SLPError SLPAssociateIP( SLPHandle hSLP, const char* unicast_ip); /* */ /* Associates an IP address unicast_ip with a particular SLPHandle hSLP. */ /* unicast_ip is the IP address of the SA/DA from which service is */ /* requested. */ /* */ /* hSLP The SLPHandle with which the unicast_ip address is */ /* to be associated with. */ /* */ /* unicast_ip IP address of the SA/DA from which service is */ /* requested. */ /* */ /* Returns SLPError code */ /*=========================================================================*/ #endif #define SLP_REG_FLAG_FRESH (1) #define SLP_REG_FLAG_WATCH_PID (1 << 1) /*=========================================================================*/ SLPEXP SLPError SLPAPI SLPReg(SLPHandle hSLP, const char *pcSrvURL, const unsigned short usLifetime, const char *pcSrvType, const char *pcAttrs, SLPBoolean fresh, SLPRegReport callback, void *pvCookie); /* */ /* Registers the URL in pcSrvURL having the lifetime usLifetime with the */ /* attribute list in pcAttrs. The pcAttrs list is a comma separated */ /* list of attribute assignments in the wire format (including escaping */ /* of reserved characters). The usLifetime parameter must be nonzero */ /* and less than or equal to SLP_LIFETIME_MAXIMUM. If the fresh flag is */ /* SLP_TRUE, then the registration is new (the SLP protocol FRESH flag */ /* is set) and the registration replaces any existing registrations. */ /* The pcSrvType parameter is a service type name and can be included */ /* for service URLs that are not in the service: scheme. If the URL is */ /* in the service: scheme, the pcSrvType parameter is ignored. If the */ /* fresh flag is SLP_FALSE, then an existing registration is updated. */ /* Registrations and updates take place in the language locale of the */ /* hSLP handle. */ /* */ /* hSLP The language specific SLPHandle on which to register the */ /* advertisement. */ /* */ /* pcSrvURL The URL to register. May not be the empty string. May not */ /* be NULL. Must conform to SLP Service URL syntax. */ /* SLP_INVALID_REGISTRATION will be returned if it does not. */ /* */ /* usLifetime An unsigned short giving the life time of the service */ /* advertisement, in seconds. The value must be an unsigned */ /* integer less than or equal to SLP_LIFETIME_MAXIMUM and */ /* greater than zero. If SLP_LIFETIME_MAXIMUM is used, the */ /* registration will remain for the life of the calling */ /* process. Also, OpenSLP, will not allow registrations to */ /* be made with SLP_LIFETIME_MAXIMUM unless */ /* SLP_REG_FLAG_WATCH_PID is also used */ /* */ /* pcSrvType This parameter is ALWAYS ignored since the SLP Service URL */ /* syntax required for the pcSrvURL encapsulates the service */ /* type. */ /* */ /* pcAttrs A comma separated list of attribute assignment expressions */ /* for the attributes of the advertisement. Use empty string,*/ /* "" for no attributes. */ /* */ /* fresh Use of non-fresh registrations is deprecated. SLP_TRUE */ /* must be passed in for this parameter or SLP_BAD_PARAMETER */ /* will be returned */ /* */ /* callback A SLPRegReport callback to report the operation completion */ /* status. */ /* */ /* pvCookie Memory passed to the callback code from the client. May be*/ /* NULL. */ /* */ /* Returns: If an error occurs in starting the operation, one of the */ /* SLPError codes is returned. */ /*=========================================================================*/ /*=========================================================================*/ SLPEXP SLPError SLPAPI SLPDereg(SLPHandle hSLP, const char *pcSrvURL, SLPRegReport callback, void *pvCookie); /* */ /* Deregisters the advertisement for URL pcURL in all scopes where the */ /* service is registered and all language locales. The deregistration */ /* is not just confined to the locale of the SLPHandle, it is in all */ /* locales. The API library is required to perform the operation in all */ /* scopes obtained through configuration. */ /* */ /* hSLP The language specific SLPHandle to use for deregistering. */ /* */ /* pcSrvURL The SLP Service URL to deregister. May not be the empty */ /* string. May not be NULL. Must conform to SLP Service URL */ /* syntax or SLP_INVALID_REGISTRATION will be returned. */ /* */ /* callback A callback to report the operation completion status. */ /* */ /* pvCookie Memory passed to the callback code from the client. May be*/ /* NULL. */ /* */ /* Returns: If an error occurs in starting the operation, one of the */ /* SLPError codes is returned. */ /*=========================================================================*/ /*=========================================================================*/ SLPEXP SLPError SLPAPI SLPDelAttrs(SLPHandle hSLP, const char *pcSrvURL, const char *pcAttrs, SLPRegReport callback, void *pvCookie); /* */ /* Delete the selected attributes in the locale of the SLPHandle. The */ /* API library is required to perform the operation in all scopes */ /* obtained through configuration. */ /* */ /* hSLP The language specific SLPHandle to use for deleting */ /* attributes. */ /* */ /* pcSrvURL The SLP Service URL of the advertisement from which the */ /* attributes should be deleted. May not be the empty string. */ /* */ /* pcAttrs A comma separated list of attribute ids for the attributes */ /* to deregister. May not be the empty string. */ /* */ /* callback A callback to report the operation completion status. */ /* */ /* pvCookie Memory passed to the callback code from the client. May be*/ /* NULL. */ /* */ /* Returns If an error occurs in starting the operation, one of the */ /* SLPError codes is returned. */ /*=========================================================================*/ /*=========================================================================*/ SLPEXP SLPError SLPAPI SLPFindSrvTypes(SLPHandle hSLP, const char *pcNamingAuthority, const char *pcScopeList, SLPSrvTypeCallback callback, void *pvCookie); /* */ /* The SLPFindSrvType() function issues an SLP service type request for */ /* service types in the scopes indicated by the pcScopeList. The */ /* results are returned through the callback parameter. The service */ /* types are independent of language locale, but only for services */ /* registered in one of scopes and for the indicated naming authority. */ /* */ /* If the naming authority is "*", then results are returned for all */ /* naming authorities. If the naming authority is the empty string, */ /* i.e. "", then the default naming authority, "IANA", is used. "IANA" */ /* is not a valid naming authority name, and it is a PARAMETER_BAD error */ /* to include it explicitly. */ /* */ /* The service type names are returned with the naming authority intact. */ /* If the naming authority is the default (i.e. empty string) then it */ /* is omitted, as is the separating ".". Service type names from URLs */ /* of the service: scheme are returned with the "service:" prefix */ /* intact. See RFC 2609 for more information on the syntax of service */ /* type names. */ /* */ /* hSLP The SLPHandle on which to search for types. */ /* */ /* pcNamingAuthority The naming authority to search. Use "*" for all */ /* naming authorities and the empty string, "", for */ /* the default naming authority. */ /* */ /* pcScopeList A pointer to a string containing comma separated */ /* list of scope names to search for service types. */ /* May not be the empty string, "". */ /* */ /* callback A callback function through which the results of */ /* the operation are reported. */ /* */ /* pvCookie Memory passed to the callback code from the client.*/ /* May be NULL. */ /* */ /* Returns If an error occurs in starting the operation, one */ /* of the SLPError codes is returned. */ /*=========================================================================*/ /*=========================================================================*/ SLPEXP SLPError SLPAPI SLPFindSrvs(SLPHandle hSLP, const char *pcServiceType, const char *pcScopeList, const char *pcSearchFilter, SLPSrvURLCallback callback, void *pvCookie); /* */ /* Issue the query for services on the language specific SLPHandle and */ /* return the results through the callback. The parameters determine */ /* the results */ /* */ /* hSLP The language specific SLPHandle on which to search for */ /* services. */ /* */ /* pcServiceType The Service Type String, including authority string if */ /* any, for the request, such as can be discovered using */ /* SLPSrvTypes(). This could be, for example */ /* "service:printer:lpr" or "service:nfs". May not be */ /* the empty string or NULL. */ /* */ /* */ /* pcScopeList A pointer to a char containing comma separated list of */ /* scope names. Pass in the NULL or the empty string "" */ /* to find services in all the scopes the local host is */ /* configured query. */ /* */ /* pcSearchFilter A query formulated of attribute pattern matching */ /* expressions in the form of a LDAPv3 Search Filter. */ /* If this filter is NULL or empty, i.e. "", all */ /* services of the requested type in the specified scopes */ /* are returned. */ /* */ /* callback A callback function through which the results of the */ /* operation are reported. May not be NULL */ /* */ /* pvCookie Memory passed to the callback code from the client. */ /* May be NULL. */ /* */ /* Returns: If an error occurs in starting the operation, one of */ /* the SLPError codes is returned. */ /* */ /*=========================================================================*/ /*=========================================================================*/ SLPEXP SLPError SLPAPI SLPFindAttrs(SLPHandle hSLP, const char *pcURLOrServiceType, const char *pcScopeList, const char *pcAttrIds, SLPAttrCallback callback, void *pvCookie); /* */ /* This function returns service attributes matching the attribute ids */ /* for the indicated service URL or service type. If pcURLOrServiceType */ /* is a service URL, the attribute information returned is for that */ /* particular advertisement in the language locale of the SLPHandle. */ /* */ /* If pcURLOrServiceType is a service type name (including naming */ /* authority if any), then the attributes for all advertisements of that */ /* service type are returned regardless of the language of registration. */ /* Results are returned through the callback. */ /* */ /* The result is filtered with an SLP attribute request filter string */ /* parameter, the syntax of which is described in RFC 2608. If the filter */ /* string is the empty string, i.e. "", all attributes are returned. */ /* */ /* hSLP The language specific SLPHandle on which to search */ /* for attributes. */ /* */ /* pcURLOrServiceType The service URL or service type. See RFC 2608 for */ /* URL and service type syntax. May not be the empty */ /* string. */ /* */ /* pcScopeList A pointer to a char containing a comma separated */ /* list of scope names. Pass in NULL or the empty */ /* string "" to find services in all the scopes the */ /* local host is configured query. */ /* */ /* pcAttrIds A comma separated list of attribute ids to return. */ /* Use NULL or the empty string, "", to indicate all */ /* values. Wildcards are not currently supported */ /* */ /* callback A callback function through which the results of */ /* the operation are reported. */ /* */ /* pvCookie Memory passed to the callback code from the client.*/ /* May be NULL. */ /* */ /* Returns: If an error occurs in starting the operation, one */ /* of the SLPError codes is returned. */ /*=========================================================================*/ /*=========================================================================*/ SLPEXP unsigned short SLPAPI SLPGetRefreshInterval(); /* */ /* Returns the maximum across all DAs of the min-refresh-interval */ /* attribute. This value satisfies the advertised refresh interval */ /* bounds for all DAs, and, if used by the SA, assures that no refresh */ /* registration will be rejected. If no DA advertises a min-refresh- */ /* interval attribute, a value of 0 is returned. */ /* */ /* Returns: If no error, the maximum refresh interval value allowed by all */ /* DAs (a positive integer). If no DA advertises a */ /* min-refresh-interval attribute, returns 0. If an error occurs,*/ /* returns an SLP error code. */ /*=========================================================================*/ /*=========================================================================*/ SLPEXP SLPError SLPAPI SLPFindScopes(SLPHandle hSLP, char** ppcScopeList); /* */ /* Sets ppcScopeList parameter to a pointer to a comma separated list */ /* including all available scope values. The list of scopes comes from */ /* a variety of sources: the configuration file's net.slp.useScopes */ /* property, unicast to DAs on the net.slp.DAAddresses property, DHCP, */ /* or through the DA discovery process. If there is any order to the */ /* scopes, preferred scopes are listed before less desirable scopes. */ /* There is always at least one name in the list, the default scope, */ /* "DEFAULT". */ /* */ /* hSLP The SLPHandle on which to search for scopes. */ /* */ /* ppcScopeList A pointer to char pointer into which the buffer pointer is */ /* placed upon return. The buffer is null terminated. The */ /* memory should be freed by calling SLPFree(). */ /* */ /* Returns: If no error occurs, returns SLP_OK, otherwise, the a */ /* ppropriate error code. */ /*=========================================================================*/ /*=========================================================================*/ SLPEXP SLPError SLPAPI SLPParseSrvURL(const char *pcSrvURL, SLPSrvURL** ppSrvURL); /* */ /* Parses the URL passed in as the argument into a service URL structure */ /* and returns it in the ppSrvURL pointer. If a parse error occurs, */ /* returns SLP_PARSE_ERROR. The structure returned in ppSrvURL should be */ /* freed with SLPFreeURL(). If the URL has no service part, the */ /* s_pcSrvPart string is the empty string, "", i.e. not NULL. If */ /* pcSrvURL is not a service: URL, then the s_pcSrvType field in the */ /* returned data structure is the URL's scheme, which might not be the */ /* same as the service type under which the URL was registered. If the */ /* transport is IP, the s_pcTransport field is the empty string. If the */ /* transport is not IP or there is no port number, the s_iPort field is */ /* zero. */ /* */ /* pcSrvURL A pointer to a character buffer containing the null terminated */ /* URL string to parse. */ /* */ /* ppSrvURL A pointer to a pointer for the SLPSrvURL structure to receive */ /* the parsed URL. The memory should be freed by a call to */ /* SLPFree() when no longer needed. */ /* */ /* Returns: If no error occurs, the return value is SLP_OK. Otherwise, the */ /* appropriate error code is returned. */ /*=========================================================================*/ /*=========================================================================*/ SLPEXP SLPError SLPAPI SLPEscape(const char* pcInbuf, char** ppcOutBuf, SLPBoolean isTag); /* */ /* Process the input string in pcInbuf and escape any SLP reserved */ /* characters. If the isTag parameter is SLPTrue, then look for bad tag */ /* characters and signal an error if any are found by returning the */ /* SLP_PARSE_ERROR code. The results are put into a buffer allocated by */ /* the API library and returned in the ppcOutBuf parameter. This buffer */ /* should be deallocated using SLPFree() when the memory is no longer */ /* needed. */ /* */ /* pcInbuf Pointer to he input buffer to process for escape */ /* characters. */ /* */ /* ppcOutBuf Pointer to a pointer for the output buffer with the SLP */ /* reserved characters escaped. Must be freed using */ /* SLPFree()when the memory is no longer needed. */ /* */ /* isTag When true, the input buffer is checked for bad tag */ /* characters. */ /* */ /* Returns: Return SLP_PARSE_ERROR if any characters are bad tag */ /* characters and the isTag flag is true, otherwise SLP_OK, */ /* or the appropriate error code if another error occurs. */ /*=========================================================================*/ /*=========================================================================*/ SLPEXP SLPError SLPAPI SLPUnescape(const char* pcInbuf, char** ppcOutBuf, SLPBoolean isTag); /* */ /* Process the input string in pcInbuf and unescape any SLP reserved */ /* characters. If the isTag parameter is SLPTrue, then look for bad tag */ /* characters and signal an error if any are found with the */ /* SLP_PARSE_ERROR code. No transformation is performed if the input */ /* string is an opaque. The results are put into a buffer allocated by */ /* the API library and returned in the ppcOutBuf parameter. This buffer */ /* should be deallocated using SLPFree() when the memory is no longer */ /* needed. */ /* */ /* pcInbuf Pointer to he input buffer to process for escape */ /* characters. */ /* */ /* ppcOutBuf Pointer to a pointer for the output buffer with the SLP */ /* reserved characters escaped. Must be freed using */ /* SLPFree() when the memory is no longer needed. */ /* */ /* isTag When true, the input buffer is checked for bad tag */ /* characters. */ /* */ /* Returns: Return SLP_PARSE_ERROR if any characters are bad tag */ /* characters and the isTag flag is true, otherwise SLP_OK, */ /* or the appropriate error code if another error occurs. */ /*=========================================================================*/ /*=========================================================================*/ SLPEXP void SLPAPI SLPFree(void* pvMem); /* */ /* Frees memory returned from SLPParseSrvURL(), SLPFindScopes(), */ /* SLPEscape(), and SLPUnescape(). */ /* */ /* pvMem A pointer to the storage allocated by the SLPParseSrvURL(), */ /* SLPEscape(), SLPUnescape(), or SLPFindScopes() function. */ /* Ignored if NULL. */ /*=========================================================================*/ /*=========================================================================*/ SLPEXP const char* SLPAPI SLPGetProperty(const char* pcName); /* */ /* Returns the value of the corresponding SLP property name. The returned */ /* string is owned by the library and MUST NOT be freed. */ /* */ /* pcName Null terminated string with the property name, from */ /* Section 2.1 of RFC 2614. */ /* */ /* Returns: If no error, returns a pointer to a character buffer containing*/ /* the property value. If the property was not set, returns the */ /* default value. If an error occurs, returns NULL. The returned */ /* string MUST NOT be freed. */ /*=========================================================================*/ /*=========================================================================*/ SLPEXP void SLPAPI SLPSetProperty(const char *pcName, const char *pcValue); /* */ /* Sets the value of the SLP property to the new value. The pcValue */ /* parameter should be the property value as a string. */ /* */ /* pcName Null terminated string with the property name, from Section */ /* 2.1. of RFC 2614. */ /* */ /* pcValue Null terminated string with the property value, in UTF-8 */ /* character encoding. */ /*=========================================================================*/ /*=========================================================================*/ SLPEXP SLPError SLPAPI SLPParseAttrs(const char* pcAttrList, const char *pcAttrId, char** ppcAttrVal); /* */ /* Used to get individual attribute values from an attribute string that */ /* is passed to the SLPAttrCallback */ /* */ /* pcAttrList (IN) A character buffer containing a comma separated, null */ /* terminated list of attribute id/value assignments, in */ /* SLP wire format; i.e. "(attr-id=attr-value-list)" */ /* */ /* pcAttrId (IN) The string indicating which attribute value to return. */ /* MUST not be null. MUST not be the empty string (""). */ /* */ /* ppcAttrVal (OUT) A pointer to a pointer to the buffer to receive */ /* attribute value. The memory should be freed by a call */ /* to SLPFree() when no longer needed. */ /* */ /* Returns: Returns SLP_PARSE_ERROR if an attribute of the specified id */ /* was not found otherwise SLP_OK */ /*=========================================================================*/ #if(defined __cplusplus) } #endif #endif /* (!defined SLP_H_INCLUDED) */ openslp-1.2.1/libslp/Makefile.am0000644033442200000310000000140510207740666016411 0ustar rganesanfloppy# # Makefile.am # Automake File # The linked in library libcommonlibslp, which is from ../common # containing exacts functions which are required. # EXTRA_DIST = lib_LTLIBRARIES = libslp.la include_HEADERS = slp.h INCLUDES = -I$(top_srcdir)/common libslp_la_SOURCES = libslp_dereg.c \ libslp_findscopes.c \ libslp_reg.c \ libslp_findsrvs.c \ libslp_parse.c \ libslp_property.c \ libslp_handle.c \ libslp_thread.c \ libslp_network.c \ libslp_findattrs.c \ libslp_delattrs.c \ libslp_findsrvtypes.c \ libslp_knownda.c \ libslp.h #if you're building on Irix, exchange commented and uncommented lines #libslp_la_LIBADD = -L../common/libcommonlibslp libslp_la_LIBADD = ../common/libcommonlibslp.la libslp_la_LDFLAGS = -version-info 1:1:0 openslp-1.2.1/libslp/libslp_parse.c0000644033442200000310000004675310211370457017207 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slplib_parse.c */ /* */ /* Abstract: Implementation for SLPParseSrvUrl(), SLPEscape(), */ /* SLPUnescape() and SLPFree() calls. */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slp.h" #include "libslp.h" #ifdef _WIN32 /* on Win32 strncasecmp is named strnicmp, but behaves the same */ #define strncasecmp(String1, String2, Num) strnicmp(String1, String2, Num) #endif /*=========================================================================*/ void SLPAPI SLPFree(void* pvMem) /* */ /* Frees memory returned from SLPParseSrvURL(), SLPFindScopes(), */ /* SLPEscape(), and SLPUnescape(). */ /* */ /* pvMem A pointer to the storage allocated by the SLPParseSrvURL(), */ /* SLPEscape(), SLPUnescape(), or SLPFindScopes() function. */ /* Ignored if NULL. */ /*=========================================================================*/ { if(pvMem) { xfree(pvMem); } } /*=========================================================================*/ SLPError SLPAPI SLPParseSrvURL(const char *pcSrvURL, SLPSrvURL** ppSrvURL) /* */ /* Parses the URL passed in as the argument into a service URL structure */ /* and returns it in the ppSrvURL pointer. If a parse error occurs, */ /* returns SLP_PARSE_ERROR. The input buffer pcSrvURL is destructively */ /* modified during the parse and used to fill in the fields of the */ /* return structure. The structure returned in ppSrvURL should be freed */ /* with SLPFreeURL(). If the URL has no service part, the s_pcSrvPart */ /* string is the empty string, "", i.e. not NULL. If pcSrvURL is not a */ /* service: URL, then the s_pcSrvType field in the returned data */ /* structure is the URL's scheme, which might not be the same as the */ /* service type under which the URL was registered. If the transport is */ /* IP, the s_pcTransport field is the empty string. If the transport is */ /* not IP or there is no port number, the s_iPort field is zero. */ /* */ /* pcSrvURL A pointer to a character buffer containing the null terminated */ /* URL string to parse. */ /* */ /* ppSrvURL A pointer to a pointer for the SLPSrvURL structure to receive */ /* the parsed URL. The memory should be freed by a call to */ /* SLPFree() when no longer needed. */ /* */ /* Returns: If no error occurs, the return value is SLP_OK. Otherwise, the */ /* appropriate error code is returned. */ /*=========================================================================*/ { int result = SLPParseSrvUrl(strlen(pcSrvURL), pcSrvURL, (SLPParsedSrvUrl**) ppSrvURL); switch(result) { case ENOMEM: return SLP_MEMORY_ALLOC_FAILED; case EINVAL: return SLP_PARSE_ERROR; } return SLP_OK; } #define ATTRIBUTE_RESERVE_STRING "(),\\!<=>~" #define ATTRIBUTE_BAD_TAG "\r\n\t_" #define ESCAPE_CHARACTER '\\' #define ESCAPE_CHARACTER_STRING "\\" /*=========================================================================*/ SLPError SLPAPI SLPEscape(const char* pcInbuf, char** ppcOutBuf, SLPBoolean isTag) /* */ /* Process the input string in pcInbuf and escape any SLP reserved */ /* characters. If the isTag parameter is SLPTrue, then look for bad tag */ /* characters and signal an error if any are found by returning the */ /* SLP_PARSE_ERROR code. The results are put into a buffer allocated by */ /* the API library and returned in the ppcOutBuf parameter. This buffer */ /* should be deallocated using SLPFree() when the memory is no longer */ /* needed. */ /* */ /* pcInbuf Pointer to he input buffer to process for escape */ /* characters. */ /* */ /* ppcOutBuf Pointer to a pointer for the output buffer with the SLP */ /* reserved characters escaped. Must be freed using */ /* SLPFree()when the memory is no longer needed. */ /* */ /* isTag When true, the input buffer is checked for bad tag */ /* characters. */ /* */ /* Returns: Return SLP_PARSE_ERROR if any characters are bad tag */ /* characters and the isTag flag is true, otherwise SLP_OK, */ /* or the appropriate error code if another error occurs. */ /*=========================================================================*/ { char *current_inbuf, *current_outBuf; int amount_of_escape_characters; char hex_digit; /* Ensure that the parameters are good. */ if((pcInbuf == NULL) || ((isTag != SLP_TRUE) && (isTag != SLP_FALSE))) return(SLP_PARAMETER_BAD); /* * Loop thru the string, counting the number of reserved characters * and checking for bad tags when required. This is also used to * calculate the size of the new string to create. * ASSUME: that pcInbuf is a NULL terminated string. */ current_inbuf = (char *) pcInbuf; amount_of_escape_characters = 0; while(*current_inbuf != '\0') { /* Ensure that there are no bad tags when it is a tag. */ if((isTag) && strchr(ATTRIBUTE_BAD_TAG, *current_inbuf)) return(SLP_PARSE_ERROR); if((strchr(ATTRIBUTE_RESERVE_STRING, *current_inbuf)) || ((*current_inbuf >= 0x00) && (*current_inbuf <= 0x1F)) || (*current_inbuf == 0x7F) ) amount_of_escape_characters++; current_inbuf++; } /* End While. */ /* Allocate the string. */ *ppcOutBuf = (char *) xmalloc( sizeof(char) * (strlen(pcInbuf) + (amount_of_escape_characters * 2) + 1)); if(ppcOutBuf == NULL) return(SLP_MEMORY_ALLOC_FAILED); /* * Go over it, again. Replace each of the escape characters with their * \hex equivalent. */ current_inbuf = (char *) pcInbuf; current_outBuf = *ppcOutBuf; while(*current_inbuf != '\0') { /* Check to see if it is an escape character. */ if((strchr(ATTRIBUTE_RESERVE_STRING, *current_inbuf)) || ((*current_inbuf >= 0x00) && (*current_inbuf <= 0x1F)) || (*current_inbuf == 0x7F) ) { /* Insert the escape character. */ *current_outBuf = ESCAPE_CHARACTER; current_outBuf++; /* Do the first digit. */ hex_digit = (*current_inbuf & 0xF0)/0x0F; if((hex_digit >= 0) && (hex_digit <= 9)) *current_outBuf = hex_digit + '0'; else *current_outBuf = hex_digit + 'A' - 0x0A; current_outBuf++; /* Do the last digit. */ hex_digit = *current_inbuf & 0x0F; if((hex_digit >= 0) && (hex_digit <= 9)) *current_outBuf = hex_digit + '0'; else *current_outBuf = hex_digit + 'A' - 0x0A; } else { *current_outBuf = *current_inbuf; } /* End If, Else. */ current_outBuf += sizeof(char); current_inbuf += sizeof(char); } /* End While. */ /* Make sure that the string is properly terminated. */ *current_outBuf = '\0'; return(SLP_OK); } /*=========================================================================*/ SLPError SLPAPI SLPUnescape(const char* pcInbuf, char** ppcOutBuf, SLPBoolean isTag) /* */ /* Process the input string in pcInbuf and unescape any SLP reserved */ /* characters. If the isTag parameter is SLPTrue, then look for bad tag */ /* characters and signal an error if any are found with the */ /* SLP_PARSE_ERROR code. No transformation is performed if the input */ /* string is an opaque. The results are put into a buffer allocated by */ /* the API library and returned in the ppcOutBuf parameter. This buffer */ /* should be deallocated using SLPFree() when the memory is no longer */ /* needed. */ /* */ /* pcInbuf Pointer to he input buffer to process for escape */ /* characters. */ /* */ /* ppcOutBuf Pointer to a pointer for the output buffer with the SLP */ /* reserved characters escaped. Must be freed using */ /* SLPFree() when the memory is no longer needed. */ /* */ /* isTag When true, the input buffer is checked for bad tag */ /* characters. */ /* */ /* Returns: Return SLP_PARSE_ERROR if any characters are bad tag */ /* characters and the isTag flag is true, otherwise SLP_OK, */ /* or the appropriate error code if another error occurs. */ /*=========================================================================*/ { int output_buffer_size; char *current_Inbuf, *current_OutBuf; char escaped_digit[2]; /* Ensure that the parameters are good. */ if((pcInbuf == NULL) || ((isTag != SLP_TRUE) && (isTag != SLP_FALSE))) return(SLP_PARAMETER_BAD); /* * Loop thru the string, counting the number of escape characters * and checking for bad tags when required. This is also used to * calculate the size of the new string to create. * ASSUME: that pcInbuf is a NULL terminated string. */ current_Inbuf = (char *) pcInbuf; output_buffer_size = strlen(pcInbuf); while(*current_Inbuf != '\0') { /* Ensure that there are no bad tags when it is a tag. */ if((isTag) && strchr(ATTRIBUTE_BAD_TAG, *current_Inbuf)) return(SLP_PARSE_ERROR); if(strchr(ESCAPE_CHARACTER_STRING, *current_Inbuf)) output_buffer_size-=2; current_Inbuf++; } /* End While. */ /* Allocate the string. */ *ppcOutBuf = (char *) xmalloc((sizeof(char) * output_buffer_size) + 1); if(ppcOutBuf == NULL) return(SLP_MEMORY_ALLOC_FAILED); current_Inbuf = (char *) pcInbuf; current_OutBuf = *ppcOutBuf; while(*current_Inbuf != '\0') { /* Check to see if it is an escape character. */ if(strchr(ESCAPE_CHARACTER_STRING, *current_Inbuf)) { /* Insert the real character based on the escaped character. */ escaped_digit[0] = *(current_Inbuf + sizeof(char)); escaped_digit[1] = *(current_Inbuf + (sizeof(char) * 2)); if((escaped_digit[0] >= 'A') && (escaped_digit[0] <= 'F')) escaped_digit[0] = escaped_digit[0] - 'A' + 0x0A; else if((escaped_digit[0] >= '0') && (escaped_digit[0] <= '9')) escaped_digit[0] = escaped_digit[0] - '0'; else return(SLP_PARSE_ERROR); if((escaped_digit[1] >= 'A') && (escaped_digit[1] <= 'F')) escaped_digit[1] = escaped_digit[1] - 'A' + 0x0A; else if((escaped_digit[1] >= '0') && (escaped_digit[1] <= '9')) escaped_digit[1] = escaped_digit[1] - '0'; else return(SLP_PARSE_ERROR); *current_OutBuf = escaped_digit[1] + (escaped_digit[0] * 0x10); current_Inbuf = (char *) current_Inbuf + (sizeof(char) * 2); } else { *current_OutBuf = *current_Inbuf; } /* End If, Else. */ /* Move to the next character. */ current_OutBuf++; current_Inbuf++; } /* End While. */ /* Make sure we terminate the string properly. */ *current_OutBuf = '\0'; return(SLP_OK); } /*=========================================================================*/ SLPError SLPAPI SLPParseAttrs(const char* pcAttrList, const char *pcAttrId, char** ppcAttrVal) /* */ /* Used to get individual attribute values from an attribute string that */ /* is passed to the SLPAttrCallback */ /* */ /* pcAttrList (IN) A character buffer containing a comma separated, null */ /* terminated list of attribute id/value assignments, in */ /* SLP wire format; i.e. "(attr-id=attr-value-list)" */ /* */ /* pcAttrId (IN) The string indicating which attribute value to return. */ /* MUST not be null. MUST not be the empty string (""). */ /* */ /* ppcAttrVal (IN) A pointer to a pointer to the buffer to receive */ /* attribute value. The memory should be freed by a call */ /* to SLPFree() when no longer needed. */ /* */ /* Returns: Returns SLP_PARSE_ERROR if an attribute of the specified id */ /* was not found otherwise SLP_OK */ /*=========================================================================*/ { const char* slider1; const char* slider2; int attridlen; /* Check for bad parameters */ if(pcAttrList == 0 || pcAttrId == 0 || ppcAttrVal == 0) { return SLP_PARAMETER_BAD; } attridlen = strlen(pcAttrId); slider1 = pcAttrList; while(1) { while(*slider1 != '(') { if(*slider1 == 0) { return SLP_PARSE_ERROR; } slider1++; } slider1++; slider2=slider1; while(*slider2 && *slider2 != '=' && *slider2 !=')') slider2++; if(attridlen == slider2-slider1 && strncasecmp(slider1, pcAttrId, slider2 - slider1) == 0) { /* found the attribute id */ slider1 = slider2; if(*slider1 == '=') slider1++; while(*slider2 && *slider2 !=')') slider2++; *ppcAttrVal = (char*)xmalloc((slider2 - slider1) + 1); if(*ppcAttrVal == 0) { return SLP_MEMORY_ALLOC_FAILED; } memcpy(*ppcAttrVal,slider1,slider2-slider1); (*ppcAttrVal)[slider2-slider1] = 0; return SLP_OK; } } /* attrid does not exist */ return SLP_PARSE_ERROR; } openslp-1.2.1/libslp/libslp_findscopes.c0000644033442200000310000001556110202047457020224 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slplib_findattrs.c */ /* */ /* Abstract: Implementation for SLPFindScopes() call. */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slp.h" #include "libslp.h" /*=========================================================================*/ SLPError SLPAPI SLPFindScopes(SLPHandle hSLP, char** ppcScopeList) /* */ /* Sets ppcScopeList parameter to a pointer to a comma separated list */ /* including all available scope values. The list of scopes comes from */ /* a variety of sources: the configuration file's net.slp.useScopes */ /* property, unicast to DAs on the net.slp.DAAddresses property, DHCP, */ /* or through the DA discovery process. If there is any order to the */ /* scopes, preferred scopes are listed before less desirable scopes. */ /* There is always at least one name in the list, the default scope, */ /* "DEFAULT". */ /* */ /* hSLP The SLPHandle on which to search for scopes. */ /* */ /* ppcScopeList A pointer to char pointer into which the buffer pointer is */ /* placed upon return. The buffer is null terminated. The */ /* memory should be freed by calling SLPFree(). */ /* */ /* Returns: If no error occurs, returns SLP_OK, otherwise, the a */ /* ppropriate error code. */ /*=========================================================================*/ { int scopelistlen; /*------------------------------*/ /* check for invalid parameters */ /*------------------------------*/ if(hSLP == 0 || *(unsigned int*)hSLP != SLP_HANDLE_SIG || ppcScopeList == 0) { return SLP_PARAMETER_BAD; } /* start with nothing */ *ppcScopeList = 0; #ifndef MI_NOT_SUPPORTED if(KnownDAGetScopes(&scopelistlen,ppcScopeList, hSLP)) #else if(KnownDAGetScopes(&scopelistlen,ppcScopeList)) #endif /* MI_NOT_SUPPORTED */ { return SLP_MEMORY_ALLOC_FAILED; } return SLP_OK; } /*=========================================================================*/ unsigned short SLPAPI SLPGetRefreshInterval() /* */ /* Returns the maximum across all DAs of the min-refresh-interval */ /* attribute. This value satisfies the advertised refresh interval */ /* bounds for all DAs, and, if used by the SA, assures that no refresh */ /* registration will be rejected. If no DA advertises a min-refresh- */ /* interval attribute, a value of 0 is returned. */ /* */ /* Returns: If no error, the maximum refresh interval value allowed by all */ /* DAs (a positive integer). If no DA advertises a */ /* min-refresh-interval attribute, returns 0. If an error occurs,*/ /* returns an SLP error code. */ /*=========================================================================*/ { return 0; } openslp-1.2.1/libslp/libslp_findsrvs.c0000644033442200000310000006074610202047457017732 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slplib_findsrvs.c */ /* */ /* Abstract: Implementation for SLPFindSrvs() call. */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slp.h" #include "libslp.h" /*-------------------------------------------------------------------------*/ SLPBoolean ColateSLPSrvURLCallback(SLPHandle hSLP, const char* pcSrvURL, unsigned short sLifetime, SLPError errCode, void *pvCookie) /*-------------------------------------------------------------------------*/ { SLPSrvUrlColatedItem* collateditem; PSLPHandleInfo handle; handle = (PSLPHandleInfo) hSLP; handle->callbackcount ++; #ifdef ENABLE_ASYNC_API /* Do not colate for async calls */ if(handle->isAsync) { return handle->params.findsrvs.callback(hSLP, pcSrvURL, sLifetime, errCode, pvCookie); } #endif if(errCode == SLP_LAST_CALL || handle->callbackcount > SLPPropertyAsInteger(SLPGetProperty("net.slp.maxResults"))) { /* We are done so call the caller's callback for each */ /* service URL colated item and clean up the colation list */ handle->params.findsrvs.callback((SLPHandle)handle, NULL, 0, SLP_LAST_CALL, handle->params.findsrvs.cookie); goto CLEANUP; } else if(errCode != SLP_OK) { return SLP_TRUE; } /* Add the service URL to the colation list */ collateditem = (SLPSrvUrlColatedItem*) handle->collatedsrvurls.head; while(collateditem) { if(strcmp(collateditem->srvurl,pcSrvURL) == 0) { break; } collateditem = (SLPSrvUrlColatedItem*)collateditem->listitem.next; } /* create a new item if none was found */ if(collateditem == NULL) { collateditem = (SLPSrvUrlColatedItem*) xmalloc(sizeof(SLPSrvUrlColatedItem) + \ strlen(pcSrvURL) + 1); if(collateditem) { memset(collateditem,0,sizeof(SLPSrvUrlColatedItem)); collateditem->srvurl = (char*)(collateditem + 1); strcpy(collateditem->srvurl,pcSrvURL); collateditem->lifetime = sLifetime; /* Add the new item to the collated list */ SLPListLinkTail(&(handle->collatedsrvurls), (SLPListItem*)collateditem); /* Call the caller's callback */ if(handle->params.findsrvs.callback((SLPHandle)handle, pcSrvURL, sLifetime, SLP_OK, handle->params.findsrvs.cookie) == SLP_FALSE) { goto CLEANUP; } } } return SLP_TRUE; CLEANUP: /* free the collation list */ while(handle->collatedsrvurls.count) { collateditem = (SLPSrvUrlColatedItem*)SLPListUnlink(&(handle->collatedsrvurls), handle->collatedsrvurls.head); xfree(collateditem); } handle->callbackcount = 0; return SLP_FALSE; } /*-------------------------------------------------------------------------*/ SLPBoolean ProcessSrvRplyCallback(SLPError errorcode, struct sockaddr_in* peerinfo, SLPBuffer replybuf, void* cookie) /*-------------------------------------------------------------------------*/ { int i; SLPUrlEntry* urlentry; SLPMessage replymsg; PSLPHandleInfo handle = (PSLPHandleInfo) cookie; SLPBoolean result = SLP_TRUE; #ifdef ENABLE_SLPv2_SECURITY int securityenabled; securityenabled = SLPPropertyAsBoolean(SLPGetProperty("net.slp.securityEnabled")); #endif /*-------------------------------------------*/ /* Check the errorcode and bail if it is set */ /*-------------------------------------------*/ if(errorcode != SLP_OK) { return ColateSLPSrvURLCallback((SLPHandle)handle, 0, 0, errorcode, handle->params.findsrvs.cookie); } /*--------------------*/ /* Parse the replybuf */ /*--------------------*/ replymsg = SLPMessageAlloc(); if(replymsg) { if(SLPMessageParseBuffer(peerinfo,replybuf,replymsg) == 0) { if(replymsg->header.functionid == SLP_FUNCT_SRVRPLY && replymsg->body.srvrply.errorcode == 0) { urlentry = replymsg->body.srvrply.urlarray; for(i=0;ibody.srvrply.urlcount;i++) { #ifdef ENABLE_SLPv2_SECURITY /*-------------------------------*/ /* Validate the authblocks */ /*-------------------------------*/ if(securityenabled && SLPAuthVerifyUrl(handle->hspi, 1, &(urlentry[i]))) { /* authentication failed skip this URLEntry */ continue; } #endif /*--------------------------------*/ /* Send the URL to the API caller */ /*--------------------------------*/ /* TRICKY: null terminate the url by setting the authcount to 0 */ ((char*)(urlentry[i].url))[urlentry[i].urllen] = 0; result = ColateSLPSrvURLCallback((SLPHandle)handle, urlentry[i].url, (unsigned short)urlentry[i].lifetime, SLP_OK, handle->params.findsrvs.cookie); if(result == SLP_FALSE) { break; } } } else if(replymsg->header.functionid == SLP_FUNCT_DAADVERT && replymsg->body.daadvert.errorcode == 0) { #ifdef ENABLE_SLPv2_SECURITY if(securityenabled && SLPAuthVerifyDAAdvert(handle->hspi, 1, &(replymsg->body.daadvert))) { /* Verification failed. Ignore message */ SLPMessageFree(replymsg); return SLP_TRUE; } #endif ((char*)(replymsg->body.daadvert.url))[replymsg->body.daadvert.urllen] = 0; result = ColateSLPSrvURLCallback((SLPHandle)handle, replymsg->body.daadvert.url, SLP_LIFETIME_MAXIMUM, SLP_OK, handle->params.findsrvs.cookie); } else if(replymsg->header.functionid == SLP_FUNCT_SAADVERT) { #ifdef ENABLE_SLPv2_SECURITY if(securityenabled && SLPAuthVerifySAAdvert(handle->hspi, 1, &(replymsg->body.saadvert))) { /* Verification failed. Ignore message */ SLPMessageFree(replymsg); return SLP_TRUE; } #endif ((char*)(replymsg->body.saadvert.url))[replymsg->body.saadvert.urllen] = 0; result = ColateSLPSrvURLCallback((SLPHandle)handle, replymsg->body.saadvert.url, SLP_LIFETIME_MAXIMUM, SLP_OK, handle->params.findsrvs.cookie); } } SLPMessageFree(replymsg); } return result; } /*-------------------------------------------------------------------------*/ SLPError ProcessSrvRqst(PSLPHandleInfo handle) /*-------------------------------------------------------------------------*/ { struct sockaddr_in peeraddr; int sock = -1; int bufsize = 0; char* buf = 0; char* curpos = 0; SLPError result = 0; #ifdef ENABLE_SLPv2_SECURITY int spistrlen = 0; char* spistr = 0; #endif /*------------------------------------------*/ /* Is this a special attempt to locate DAs? */ /*------------------------------------------*/ if(strncasecmp(handle->params.findsrvs.srvtype, SLP_DA_SERVICE_TYPE, handle->params.findsrvs.srvtypelen) == 0) { KnownDAProcessSrvRqst(handle); goto FINISHED; } #ifdef ENABLE_SLPv2_SECURITY if(SLPPropertyAsBoolean(SLPGetProperty("net.slp.securityEnabled"))) { SLPSpiGetDefaultSPI(handle->hspi, SLPSPI_KEY_TYPE_PUBLIC, &spistrlen, &spistr); } #endif /*-------------------------------------------------------------------*/ /* determine the size of the fixed portion of the SRVRQST */ /*-------------------------------------------------------------------*/ bufsize = handle->params.findsrvs.srvtypelen + 2; /* 2 bytes for len field */ bufsize += handle->params.findsrvs.scopelistlen + 2; /* 2 bytes for len field */ bufsize += handle->params.findsrvs.predicatelen + 2; /* 2 bytes for len field */ bufsize += 2; /* 2 bytes for spistr len*/ #ifdef ENABLE_SLPv2_SECURITY bufsize += spistrlen; #endif buf = curpos = (char*)xmalloc(bufsize); if(buf == 0) { result = SLP_MEMORY_ALLOC_FAILED; goto FINISHED; } /*------------------------------------------------------------*/ /* Build a buffer containing the fixed portion of the SRVRQST */ /*------------------------------------------------------------*/ /* service type */ ToUINT16(curpos,handle->params.findsrvs.srvtypelen); curpos = curpos + 2; memcpy(curpos, handle->params.findsrvs.srvtype, handle->params.findsrvs.srvtypelen); curpos = curpos + handle->params.findsrvs.srvtypelen; /* scope list */ ToUINT16(curpos,handle->params.findsrvs.scopelistlen); curpos = curpos + 2; memcpy(curpos, handle->params.findsrvs.scopelist, handle->params.findsrvs.scopelistlen); curpos = curpos + handle->params.findsrvs.scopelistlen; /* predicate */ ToUINT16(curpos,handle->params.findsrvs.predicatelen); curpos = curpos + 2; memcpy(curpos, handle->params.findsrvs.predicate, handle->params.findsrvs.predicatelen); curpos = curpos + handle->params.findsrvs.predicatelen; #ifdef ENABLE_SLPv2_SECURITY ToUINT16(curpos,spistrlen); curpos = curpos + 2; memcpy(curpos,spistr,spistrlen); curpos = curpos + spistrlen; #else ToUINT16(curpos,0); #endif /*--------------------------*/ /* Call the RqstRply engine */ /*--------------------------*/ do { #ifndef UNICAST_NOT_SUPPORTED if ( handle->dounicast == 1 ) { void *cookie = (PSLPHandleInfo) handle; result = NetworkUcastRqstRply(handle, buf, SLP_FUNCT_SRVRQST, bufsize, ProcessSrvRplyCallback, cookie); break; } else #endif if(strncasecmp(handle->params.findsrvs.srvtype, SLP_SA_SERVICE_TYPE, handle->params.findsrvs.srvtypelen)) { sock = NetworkConnectToDA(handle, handle->params.findsrvs.scopelist, handle->params.findsrvs.scopelistlen, &peeraddr); } if(sock == -1) { /* use multicast as a last resort */ #ifndef MI_NOT_SUPPORTED result = NetworkMcastRqstRply(handle, buf, SLP_FUNCT_SRVRQST, bufsize, ProcessSrvRplyCallback, NULL); #else result = NetworkMcastRqstRply(handle->langtag, buf, SLP_FUNCT_SRVRQST, bufsize, ProcessSrvRplyCallback, handle); #endif /* MI_NOT_SUPPORTED */ break; } result = NetworkRqstRply(sock, &peeraddr, handle->langtag, 0, buf, SLP_FUNCT_SRVRQST, bufsize, ProcessSrvRplyCallback, handle); if(result) { NetworkDisconnectDA(handle); } }while(result == SLP_NETWORK_ERROR); FINISHED: if(buf) xfree(buf); #ifdef ENABLE_SLPv2_SECURITY if(spistr) xfree(spistr); #endif return result; } #ifdef ENABLE_ASYNC_API /*-------------------------------------------------------------------------*/ SLPError AsyncProcessSrvRqst(PSLPHandleInfo handle) /*-------------------------------------------------------------------------*/ { SLPError result = ProcessSrvRqst(handle); xfree((void*)handle->params.findsrvs.srvtype); xfree((void*)handle->params.findsrvs.scopelist); xfree((void*)handle->params.findsrvs.predicate); handle->inUse = SLP_FALSE; return result; } #endif /*=========================================================================*/ SLPError SLPAPI SLPFindSrvs(SLPHandle hSLP, const char *pcServiceType, const char *pcScopeList, const char *pcSearchFilter, SLPSrvURLCallback callback, void *pvCookie) /* */ /* Issue the query for services on the language specific SLPHandle and */ /* return the results through the callback. The parameters determine */ /* the results */ /* */ /* hSLP The language specific SLPHandle on which to search for */ /* services. */ /* */ /* pcServiceType The Service Type String, including authority string if */ /* any, for the request, such as can be discovered using */ /* SLPSrvTypes(). This could be, for example */ /* "service:printer:lpr" or "service:nfs". May not be */ /* the empty string or NULL. */ /* */ /* */ /* pcScopeList A pointer to a char containing comma separated list of */ /* scope names. Pass in the NULL or the empty string "" */ /* to find services in all the scopes the local host is */ /* configured query. */ /* */ /* pcSearchFilter A query formulated of attribute pattern matching */ /* expressions in the form of a LDAPv3 Search Filter. */ /* If this filter is NULL or empty, i.e. "", all */ /* services of the requested type in the specified scopes */ /* are returned. */ /* */ /* callback A callback function through which the results of the */ /* operation are reported. May not be NULL */ /* */ /* pvCookie Memory passed to the callback code from the client. */ /* May be NULL. */ /* */ /* Returns: If an error occurs in starting the operation, one of */ /* the SLPError codes is returned. */ /* */ /*=========================================================================*/ { PSLPHandleInfo handle; SLPError result; /*------------------------------*/ /* check for invalid parameters */ /*------------------------------*/ if(hSLP == 0 || *(unsigned int*)hSLP != SLP_HANDLE_SIG || pcServiceType == 0 || *pcServiceType == 0 || /* srvtype can't be empty string */ callback == 0) { return SLP_PARAMETER_BAD; } /*-----------------------------------------*/ /* cast the SLPHandle into a SLPHandleInfo */ /*-----------------------------------------*/ handle = (PSLPHandleInfo)hSLP; /*-----------------------------------------*/ /* Check to see if the handle is in use */ /*-----------------------------------------*/ if(handle->inUse == SLP_TRUE) { return SLP_HANDLE_IN_USE; } handle->inUse = SLP_TRUE; /*-------------------------------------------*/ /* Set the handle up to reference parameters */ /*-------------------------------------------*/ handle->params.findsrvs.srvtypelen = strlen(pcServiceType); handle->params.findsrvs.srvtype = pcServiceType; if(pcScopeList && *pcScopeList) { handle->params.findsrvs.scopelistlen = strlen(pcScopeList); handle->params.findsrvs.scopelist = pcScopeList; } else { handle->params.findsrvs.scopelist = SLPGetProperty("net.slp.useScopes"); handle->params.findsrvs.scopelistlen = strlen(handle->params.findsrvs.scopelist); } if(pcSearchFilter) { handle->params.findsrvs.predicatelen = strlen(pcSearchFilter); handle->params.findsrvs.predicate = pcSearchFilter; } else { handle->params.findsrvs.predicatelen = 0; handle->params.findsrvs.predicate = (char*)&handle->params.findsrvs.predicatelen; } handle->params.findsrvs.callback = callback; handle->params.findsrvs.cookie = pvCookie; /*----------------------------------------------*/ /* Check to see if we should be async or sync */ /*----------------------------------------------*/ #ifdef ENABLE_ASYNC_API if(handle->isAsync) { /* COPY all the referenced parameters */ handle->params.findsrvs.srvtype = xstrdup(handle->params.findsrvs.srvtype); handle->params.findsrvs.scopelist = xstrdup(handle->params.findsrvs.scopelist); handle->params.findsrvs.predicate = xstrdup(handle->params.findsrvs.predicate); /* make sure strdups did not fail */ if(handle->params.findsrvs.srvtype && handle->params.findsrvs.scopelist && handle->params.findsrvs.predicate) { result = ThreadCreate((ThreadStartProc)AsyncProcessSrvRqst,handle); } else { result = SLP_MEMORY_ALLOC_FAILED; } if(result) { if(handle->params.findsrvs.srvtype) xfree((void*)handle->params.findsrvs.srvtype); if(handle->params.findsrvs.scopelist) xfree((void*)handle->params.findsrvs.scopelist); if(handle->params.findsrvs.predicate) xfree((void*)handle->params.findsrvs.predicate); handle->inUse = SLP_FALSE; } } else #endif /* ifdef ENABLE_ASYNC_API */ { /* Leave all parameters REFERENCED */ result = ProcessSrvRqst(handle); handle->inUse = SLP_FALSE; } return result; } openslp-1.2.1/libslp/libslp.h0000644033442200000310000006416010202047457016013 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: libslp.h */ /* */ /* Abstract: Make all declarations that are used *internally by libslp */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #if(!defined LIBSLP_H_INCLUDED) #define LIBSLP_H_INCLUDED #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include #include #include #include #include #include #else #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif #include "slp_buffer.h" #include "slp_message.h" #include "slp_property.h" #include "slp_xid.h" #include "slp_network.h" #include "slp_database.h" #include "slp_compare.h" #include "slp_xmalloc.h" #include "slp_parse.h" #include "slp_iface.h" #include "slp_xcast.h" #include "slp_pid.h" #ifdef ENABLE_SLPv2_SECURITY #include "slp_auth.h" #include "slp_spi.h" #endif #define MINIMUM_DISCOVERY_INTERVAL 300 /* 5 minutes */ #define MAX_RETRANSMITS 5 /* we'll only re-xmit 5 times! */ #define SLP_FUNCT_DASRVRQST 0x7f /* fake id used internally */ #if(!defined LIBSLP_CONFFILE) #ifdef _WIN32 #define LIBSLP_CONFFILE "%WINDIR%\\slp.conf" #define LIBSLP_SPIFILE "%WINDIR%\\slp.spi" #else #define LIBSLP_CONFFILE "/etc/slp.conf" #define LIBSLP_SPIFILE "/etc/slp.spi" #endif #endif #if (!defined MAX_PATH) #define MAX_PATH 256 #endif /*=========================================================================*/ typedef enum _SLPCallType /*=========================================================================*/ { SLPREG = 0, SLPDEREG, SLPFINDSRVS, SLPFINDSRVTYPES, SLPFINDATTRS, SLPDELATTRS }SLPCallType; /*=========================================================================*/ typedef struct _SLPSrvUrlColatedItem /* Used to colate Service URLS */ /*=========================================================================*/ { SLPListItem listitem; char* srvurl; unsigned short lifetime; }SLPSrvUrlColatedItem; /*=========================================================================*/ typedef struct _SLPRegParams /* Used to pass parameters to functions that deals with handle based SLP */ /* API calls */ /*=========================================================================*/ { int lifetime; int fresh; int urllen; const char* url; int srvtypelen; const char* srvtype; int scopelistlen; const char* scopelist; int attrlistlen; const char* attrlist; SLPRegReport* callback; void* cookie; }SLPRegParams,*PSLPRegParams; /*=========================================================================*/ typedef struct _SLPDeRegParams /* Used to pass parameters to functions that deals with handle based SLP */ /* API calls */ /*=========================================================================*/ { int scopelistlen; const char* scopelist; int urllen; const char* url; SLPRegReport* callback; void* cookie; }SLPDeRegParams,*PSLPDeRegParams; /*=========================================================================*/ typedef struct _SLPFindSrvTypesParams /* Used to pass parameters to functions that deals with handle based SLP */ /* API calls */ /*=========================================================================*/ { int namingauthlen; const char* namingauth; int scopelistlen; const char* scopelist; SLPSrvTypeCallback* callback; void* cookie; }SLPFindSrvTypesParams,*PSLPFindSrvTypesParams; /*=========================================================================*/ typedef struct _SLPFindSrvsParams /* Used to pass parameters to functions that deals with handle based SLP */ /* API calls */ /*=========================================================================*/ { int srvtypelen; const char* srvtype; int scopelistlen; const char* scopelist; int predicatelen; const char* predicate; SLPSrvURLCallback* callback; void* cookie; }SLPFindSrvsParams,*PSLPFindSrvsParams; /*=========================================================================*/ typedef struct _SLPFindAttrsParams /* Used to pass parameters to functions that deals with handle based SLP */ /* API calls */ /*=========================================================================*/ { int urllen; const char* url; int scopelistlen; const char* scopelist; int taglistlen; const char* taglist; SLPAttrCallback* callback; void* cookie; }SLPFindAttrsParams,*PSLPFindAttrsParams; /*=========================================================================*/ typedef union _SLPHandleCallParams /* Used to pass parameters to functions that deals with handle based SLP */ /* API calls */ /*=========================================================================*/ { SLPRegParams reg; SLPDeRegParams dereg; SLPFindSrvTypesParams findsrvtypes; SLPFindSrvsParams findsrvs; SLPFindAttrsParams findattrs; }SLPHandleCallParams, *PSLPHandleCallParams; #define SLP_HANDLE_SIG 0xbeeffeed /*=========================================================================*/ typedef struct _SLPHandleInfo /* The SLPHandle that is used internally in slplib is actually a pointer to*/ /* a structSLPHandleInfo */ /*=========================================================================*/ { unsigned int sig; SLPBoolean inUse; SLPBoolean isAsync; int dasock; struct sockaddr_in daaddr; char* dascope; int dascopelen; int sasock; struct sockaddr_in saaddr; char* sascope; int sascopelen; #ifndef MI_NOT_SUPPORTED const char *McastIFList; #endif /* MI_NOT_SUPPORTED */ #ifndef UNICAST_NOT_SUPPORTED int dounicast; int unicastsock; struct sockaddr_in unicastaddr; char* unicastscope; int unicastscopelen; #endif int langtaglen; char* langtag; int callbackcount; SLPList collatedsrvurls; char* collatedsrvtypes; #ifdef ENABLE_SLPv2_SECURITY SLPSpiHandle hspi; #endif SLPHandleCallParams params; }SLPHandleInfo, *PSLPHandleInfo; #ifdef ENABLE_ASYNC_API /*=========================================================================*/ typedef void* (*ThreadStartProc)(void *); /*=========================================================================*/ /*=========================================================================*/ SLPError ThreadCreate(ThreadStartProc startproc, void *arg); /* Creates a thread */ /* */ /* startproc (IN) Address of the thread start procedure. */ /* */ /* arg (IN) An argument for the thread start procedure. */ /* */ /* Returns SLPError code */ /*=========================================================================*/ #endif /*=========================================================================*/ int NetworkConnectToMulticast(struct sockaddr_in* peeraddr); /*=========================================================================*/ /*=========================================================================*/ int NetworkConnectToSlpd(struct sockaddr_in* peeraddr); /* Connects to slpd and provides a peeraddr to send to */ /* */ /* peeraddr (OUT) pointer to receive the connected DA's address */ /* */ /* Returns Connected socket or -1 if no DA connection can be made */ /*=========================================================================*/ /*=========================================================================*/ void NetworkDisconnectDA(PSLPHandleInfo handle); /* Called after DA fails to respond */ /* */ /* handle (IN) a handle previously passed to NetworkConnectToDA() */ /*=========================================================================*/ /*=========================================================================*/ void NetworkDisconnectSA(PSLPHandleInfo handle); /* Called after SA fails to respond */ /* */ /* handle (IN) a handle previously passed to NetworkConnectToSA() */ /*=========================================================================*/ /*=========================================================================*/ int NetworkConnectToDA(PSLPHandleInfo handle, const char* scopelist, int scopelistlen, struct sockaddr_in* peeraddr); /* Connects to slpd and provides a peeraddr to send to */ /* */ /* handle (IN) SLPHandle info (caches connection reuse info) */ /* */ /* scopelist (IN) Scope that must be supported by DA. Pass in NULL */ /* for any scope */ /* */ /* scopelistlen (IN) Length of the scope list in bytes. Ignored if */ /* scopelist is NULL */ /* */ /* peeraddr (OUT) pointer to receive the connected DA's address */ /* */ /* Returns Connected socket or -1 if no DA connection can be made */ /*=========================================================================*/ /*=========================================================================*/ int NetworkConnectToSA(PSLPHandleInfo handle, const char* scopelist, int scopelistlen, struct sockaddr_in* peeraddr); /* Connects to slpd and provides a peeraddr to send to */ /* */ /* handle (IN) SLPHandle info (caches connection info) */ /* */ /* scopelist (IN) Scope that must be supported by SA. Pass in NULL */ /* for any scope */ /* */ /* scopelistlen (IN) Length of the scope list in bytes. Ignored if */ /* scopelist is NULL */ /* */ /* peeraddr (OUT) pointer to receive the connected SA's address */ /* */ /* Returns Connected socket or -1 if no SA connection can be made */ /*=========================================================================*/ /*=========================================================================*/ typedef SLPBoolean NetworkRplyCallback(SLPError errorcode, struct sockaddr_in* peerinfo, SLPBuffer replybuf, void* cookie); /* Function called by NetworkRqstRply to notify caller of the replies */ /* received. Callback returns 0 when no more replies are desired */ /* */ /* errorcode (IN) errorcode that may have occured during the */ /* Request process. May be set by the callback */ /* to indicate an error in processing the replybuf */ /* If errorcode is set then replybuf is probably not */ /* valid */ /* */ /* peerinfo (IN) the peer that sent replybuf */ /* */ /* replybuf (IN) Buffer containing the reply */ /* */ /* */ /* cookie (IN) Pointer to opaque data from the caller of */ /* NetworkRqstRply() */ /* */ /* Returns: Callback should return SLP_TRUE if it wants to be */ /* called again, or SLP_FALSE if it is finished */ /*=========================================================================*/ /*=========================================================================*/ SLPError NetworkRqstRply(int sock, struct sockaddr_in* peeraddr, const char* langtag, int extoffset, char* buf, char buftype, int bufsize, NetworkRplyCallback callback, void * cookie); /* Transmits and receives SLP messages via multicast convergence algorithm */ /* */ /* Returns - SLP_OK on success */ /*=========================================================================*/ /*=========================================================================*/ #ifndef MI_NOT_SUPPORTED SLPError NetworkMcastRqstRply(PSLPHandleInfo handle, #else SLPError NetworkMcastRqstRply(const char* langtag, #endif /* MI_NOT_SUPPORTED */ char* buf, char buftype, int bufsize, NetworkRplyCallback callback, void * cookie); /* Description: */ /* */ /* Broadcasts/multicasts SLP messages via multicast convergence algorithm */ /* */ /* langtag (IN) Language tag to use in SLP message header */ /* */ /* buf (IN) pointer to the portion of the SLP message to send. The */ /* portion to that should be pointed to is everything after */ /* the pr-list. NetworkXcastRqstRply() automatically */ /* generates the header and the prlist. */ /* */ /* buftype (IN) the function-id to use in the SLPMessage header */ /* */ /* bufsize (IN) the size of the buffer pointed to by buf */ /* */ /* callback (IN) the callback to use for reporting results */ /* */ /* cookie (IN) the cookie to pass to the callback */ /* */ /* Returns - SLP_OK on success. SLP_ERROR on failure */ /*=========================================================================*/ #ifndef UNICAST_NOT_SUPPORTED /*=========================================================================*/ SLPError NetworkUcastRqstRply(PSLPHandleInfo handle, char* buf, char buftype, int bufsize, NetworkRplyCallback callback, void * cookie); /* Description: */ /* */ /* Unicasts SLP messages */ /* */ /* handle (IN) pointer to the SLP handle */ /* */ /* buf (IN) pointer to the portion of the SLP message to send. */ /* */ /* buftype (IN) the function-id to use in the SLPMessage header */ /* */ /* bufsize (IN) the size of the buffer pointed to by buf */ /* */ /* callback (IN) the callback to use for reporting results */ /* */ /* cookie (IN) the cookie to pass to the callback */ /* */ /* Returns - SLP_OK on success. SLP_ERROR on failure */ /*=========================================================================*/ #endif /*=========================================================================*/ int KnownDAConnect(PSLPHandleInfo handle, int scopelistlen, const char* scopelist, struct sockaddr_in* peeraddr); /* handle (IN) SLPHandle info (caches connection info) */ /* */ /* Get a connected socket to a DA that supports the specified scope */ /* */ /* scopelistlen (IN) stringlen of the scopelist */ /* */ /* scopelist (IN) DA must support this scope */ /* */ /* peeraddr (OUT) the peer that was connected to */ /* */ /* */ /* returns: valid socket file descriptor or -1 if no DA is found */ /*=========================================================================*/ /*=========================================================================*/ void KnownDABadDA(struct in_addr* daaddr); /* Mark a KnownDA as a Bad DA. */ /* */ /* peeraddr (IN) address of the bad DA */ /* */ /* Returns: zero on success. */ /*=========================================================================*/ /*=========================================================================*/ int KnownDAGetScopes(int* scopelistlen, #ifndef MI_NOT_SUPPORTED char** scopelist, PSLPHandleInfo handle); #else char** scopelist); #endif /* MI_NOT_SUPPORTED */ /* Gets a list of scopes from the known DA list */ /* */ /* scopelistlen (OUT) stringlen of the scopelist */ /* */ /* scopelist (OUT) NULL terminated list of scopes */ /* */ /* returns: zero on success, non-zero on failure */ /*=========================================================================*/ /*=========================================================================*/ void KnownDAProcessSrvRqst(PSLPHandleInfo handle); /* Process a SrvRqst for service:directory-agent */ /* */ /* handle (IN) the handle used to make the SrvRqst */ /* */ /* returns: none */ /*=========================================================================*/ #ifdef DEBUG /*=========================================================================*/ void KnownDAFreeAll(); /* Frees all (cached) resources associated with known DAs */ /* */ /* returns: none */ /*=========================================================================*/ #endif #endif /*LIBSLP_H_INCLUDED*/ openslp-1.2.1/libslp/libslp_property.c0000644033442200000310000001505410202047457017750 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slplib_property.c */ /* */ /* Abstract: Implementation for SLPGetProperty() and SLPSetProperty() */ /* calls. */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slp.h" #include "libslp.h" /*=========================================================================*/ //int G_PropertyInit = 0; /*=========================================================================*/ /*=========================================================================*/ const char* SLPAPI SLPGetProperty(const char* pcName) /* */ /* Returns the value of the corresponding SLP property name. The returned */ /* string is owned by the library and MUST NOT be freed. */ /* */ /* pcName Null terminated string with the property name, from */ /* Section 2.1 of RFC 2614. */ /* */ /* Returns: If no error, returns a pointer to a character buffer containing*/ /* the property value. If the property was not set, returns the */ /* default value. If an error occurs, returns NULL. The returned */ /* string MUST NOT be freed. */ /*=========================================================================*/ { char conffile[MAX_PATH]; const char* result; memset(conffile,0,MAX_PATH); #ifdef _WIN32 ExpandEnvironmentStrings(LIBSLP_CONFFILE,conffile,MAX_PATH); #else strncpy(conffile,LIBSLP_CONFFILE,MAX_PATH-1); #endif if(G_SLPPropertyList.head == NULL) { if(SLPPropertyReadFile(conffile) != 0) { return 0; } } result = SLPPropertyGet(pcName); return result; } /*=========================================================================*/ void SLPAPI SLPSetProperty(const char *pcName, const char *pcValue) /* */ /* Sets the value of the SLP property to the new value. The pcValue */ /* parameter should be the property value as a string. */ /* */ /* pcName Null terminated string with the property name, from Section */ /* 2.1. of RFC 2614. */ /* */ /* pcValue Null terminated string with the property value, in UTF-8 */ /* character encoding. */ /*=========================================================================*/ { /* Following commented out for threading reasons if(G_PropertyInit.head == NULL) { if(SLPPropertyReadFile(LIBSLP_CONFFILE) == 0) { G_PropertyInit = 1; } } SLPPropertySet(pcName,pcValue); */ } openslp-1.2.1/libslp/libslp_findsrvtypes.c0000644033442200000310000004604410202047457020627 0ustar rganesanfloppy/***************************************************************************/ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slplib_findsrvtypes.c */ /* */ /* Abstract: Implementation for SLPFindSrvType() call. */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slp.h" #include "libslp.h" /*----------------------------------------------------------------------------*/ SLPBoolean ColateSrvTypeCallback(SLPHandle hSLP, const char* pcSrvTypes, SLPError errCode, void *pvCookie) /*----------------------------------------------------------------------------*/ { PSLPHandleInfo handle; SLPBoolean result; int srvtypeslen; char* srvtypes; handle = (PSLPHandleInfo) hSLP; handle->callbackcount ++; #ifdef ENABLE_ASYNC_API /* Do not colate for async calls */ if(handle->isAsync) { return handle->params.findsrvtypes.callback(hSLP, pcSrvTypes, errCode, pvCookie); } #endif if(errCode == SLP_LAST_CALL || handle->callbackcount > SLPPropertyAsInteger(SLPGetProperty("net.slp.maxResults"))) { /* We're done. Send back the colated srvtype string */ result = SLP_TRUE; if(handle->collatedsrvtypes) { result = handle->params.findsrvtypes.callback((SLPHandle)handle, handle->collatedsrvtypes, SLP_OK, handle->params.findsrvtypes.cookie); if(result == SLP_TRUE) { handle->params.findsrvtypes.callback((SLPHandle)handle, NULL, SLP_LAST_CALL, handle->params.findsrvtypes.cookie); } } /* Free the colatedsrvtype string */ if(handle->collatedsrvtypes) { xfree(handle->collatedsrvtypes); handle->collatedsrvtypes = NULL; } handle->callbackcount = 0; return SLP_FALSE; } else if(errCode != SLP_OK) { return SLP_TRUE; } /* Add the service types to the colation */ srvtypeslen = strlen(pcSrvTypes) + 1; /* +1 - terminator */ if(handle->collatedsrvtypes) { srvtypeslen += strlen(handle->collatedsrvtypes) + 1; /* +1 - comma */ } srvtypes = xmalloc(srvtypeslen); if(srvtypes) { if(handle->collatedsrvtypes) { if(SLPUnionStringList(strlen(handle->collatedsrvtypes), handle->collatedsrvtypes, strlen(pcSrvTypes), pcSrvTypes, &srvtypeslen, srvtypes) != srvtypeslen) { xfree(handle->collatedsrvtypes); handle->collatedsrvtypes = srvtypes; } else { #ifndef COLLATION_CHANGES xfree(handle->collatedsrvtypes); handle->collatedsrvtypes = srvtypes; handle->collatedsrvtypes[srvtypeslen] = '\0'; #else xfree(srvtypes); #endif /* COLLATION_CHANGES */ } } else { strcpy(srvtypes,pcSrvTypes); handle->collatedsrvtypes = srvtypes; } } return SLP_TRUE; } /*----------------------------------------------------------------------------*/ SLPBoolean ProcessSrvTypeRplyCallback(SLPError errorcode, struct sockaddr_in* peerinfo, SLPBuffer replybuf, void* cookie) /*----------------------------------------------------------------------------*/ { SLPMessage replymsg; SLPSrvTypeRply* srvtyperply; PSLPHandleInfo handle = (PSLPHandleInfo) cookie; SLPBoolean result = SLP_TRUE; /*-------------------------------------------*/ /* Check the errorcode and bail if it is set */ /*-------------------------------------------*/ if(errorcode) { return ColateSrvTypeCallback((SLPHandle)handle, 0, errorcode, handle->params.findsrvtypes.cookie); } /*--------------------*/ /* Parse the replybuf */ /*--------------------*/ replymsg = SLPMessageAlloc(); if(replymsg) { if(SLPMessageParseBuffer(peerinfo,replybuf,replymsg) == 0 && replymsg->header.functionid == SLP_FUNCT_SRVTYPERPLY && replymsg->body.srvtyperply.errorcode == 0) { srvtyperply = &(replymsg->body.srvtyperply); if(srvtyperply->srvtypelistlen) { /*------------------------------------------*/ /* Send the service type list to the caller */ /*------------------------------------------*/ /* TRICKY: null terminate the srvtypelist by setting the last byte 0 */ ((char*)(srvtyperply->srvtypelist))[srvtyperply->srvtypelistlen] = 0; /* Call the callback function */ result = ColateSrvTypeCallback((SLPHandle)handle, srvtyperply->srvtypelist, srvtyperply->errorcode * - 1, handle->params.findsrvtypes.cookie); } } SLPMessageFree(replymsg); } return result; } /*-------------------------------------------------------------------------*/ SLPError ProcessSrvTypeRqst(PSLPHandleInfo handle) /*-------------------------------------------------------------------------*/ { int sock; struct sockaddr_in peeraddr; int bufsize = 0; char* buf = 0; char* curpos = 0; SLPError result = 0; /*-------------------------------------------------------------------*/ /* determine the size of the fixed portion of the SRVTYPERQST */ /*-------------------------------------------------------------------*/ bufsize = handle->params.findsrvtypes.namingauthlen + 2; /* 2 bytes for len field */ bufsize += handle->params.findsrvtypes.scopelistlen + 2; /* 2 bytes for len field */ /* TODO: make sure that we don't exceed the MTU */ buf = curpos = (char*)xmalloc(bufsize); if(buf == 0) { result = SLP_MEMORY_ALLOC_FAILED; goto FINISHED; } /*----------------------------------------------------------------*/ /* Build a buffer containing the fixed portion of the SRVTYPERQST */ /*----------------------------------------------------------------*/ /* naming authority */ if(strcmp(handle->params.findsrvtypes.namingauth, "*") == 0) { ToUINT16(curpos,0xffff); /* 0xffff indicates all service types */ curpos += 2; bufsize--; /* '*' is not put on the wire */ } else { ToUINT16(curpos,handle->params.findsrvtypes.namingauthlen); curpos += 2; memcpy(curpos, handle->params.findsrvtypes.namingauth, handle->params.findsrvtypes.namingauthlen); curpos += handle->params.findsrvtypes.namingauthlen; } /* scope list */ ToUINT16(curpos,handle->params.findsrvtypes.scopelistlen); curpos = curpos + 2; memcpy(curpos, handle->params.findsrvtypes.scopelist, handle->params.findsrvtypes.scopelistlen); curpos = curpos + handle->params.findsrvtypes.scopelistlen; /*--------------------------*/ /* Call the RqstRply engine */ /*--------------------------*/ do { #ifndef UNICAST_NOT_SUPPORTED if ( handle->dounicast == 1 ) { void *cookie = (PSLPHandleInfo) handle; result = NetworkUcastRqstRply(handle, buf, SLP_FUNCT_SRVTYPERQST, bufsize, ProcessSrvTypeRplyCallback, cookie); break; } else #endif sock = NetworkConnectToDA(handle, handle->params.findsrvtypes.scopelist, handle->params.findsrvtypes.scopelistlen, &peeraddr); if(sock == -1) { /* use multicast as a last resort */ #ifndef MI_NOT_SUPPORTED result = NetworkMcastRqstRply(handle, buf, SLP_FUNCT_SRVTYPERQST, bufsize, ProcessSrvTypeRplyCallback, NULL); #else result = NetworkMcastRqstRply(handle->langtag, buf, SLP_FUNCT_SRVTYPERQST, bufsize, ProcessSrvTypeRplyCallback, handle); #endif /* MI_NOT_SUPPORTED */ break; } result = NetworkRqstRply(sock, &peeraddr, handle->langtag, 0, buf, SLP_FUNCT_SRVTYPERQST, bufsize, ProcessSrvTypeRplyCallback, handle); if(result) { NetworkDisconnectDA(handle); } }while(result == SLP_NETWORK_ERROR); FINISHED: if(buf) xfree(buf); return result; } #ifdef ENABLE_ASYNC_API /*-------------------------------------------------------------------------*/ SLPError AsyncProcessSrvTypeRqst(PSLPHandleInfo handle) /*-------------------------------------------------------------------------*/ { SLPError result = ProcessSrvTypeRqst(handle); xfree((void*)handle->params.findsrvtypes.namingauth); xfree((void*)handle->params.findsrvtypes.scopelist); handle->inUse = SLP_FALSE; return result; } #endif /*=========================================================================*/ SLPError SLPAPI SLPFindSrvTypes(SLPHandle hSLP, const char *pcNamingAuthority, const char *pcScopeList, SLPSrvTypeCallback callback, void *pvCookie) /* */ /* Issue the query for service types on the language specific SLPHandle */ /* and return the results through the callback. The parameters determine */ /* the results */ /* */ /* hSLP The language specific SLPHandle on which to search */ /* for service types. */ /* */ /* pcNamingAuthority The Naming Authority string for which service types */ /* for which service types are returned */ /* */ /* pcScopeList A pointer to a char containing comma separated list of */ /* scope names. Pass in the NULL or the empty string "" */ /* to find services in all the scopes the local host is */ /* configured query. */ /* */ /* callback A callback function through which the results of the */ /* operation are reported. May not be NULL */ /* */ /* pvCookie Memory passed to the callback code from the client. */ /* May be NULL. */ /* */ /* Returns: If an error occurs in starting the operation, one of */ /* the SLPError codes is returned. */ /* */ /*=========================================================================*/ { PSLPHandleInfo handle; SLPError result; /*------------------------------*/ /* check for invalid parameters */ /*------------------------------*/ if(hSLP == 0 || *(unsigned int*)hSLP != SLP_HANDLE_SIG || !pcNamingAuthority || strcmp(pcNamingAuthority, "IANA") == 0 || callback == 0) { return SLP_PARAMETER_BAD; } /*-----------------------------------------*/ /* cast the SLPHandle into a SLPHandleInfo */ /*-----------------------------------------*/ handle = (PSLPHandleInfo)hSLP; /*-----------------------------------------*/ /* Check to see if the handle is in use */ /*-----------------------------------------*/ if(handle->inUse == SLP_TRUE) { return SLP_HANDLE_IN_USE; } handle->inUse = SLP_TRUE; /*-------------------------------------------*/ /* Set the handle up to reference parameters */ /*-------------------------------------------*/ handle->params.findsrvtypes.namingauthlen = strlen(pcNamingAuthority); handle->params.findsrvtypes.namingauth = pcNamingAuthority; if(pcScopeList && *pcScopeList) { handle->params.findsrvtypes.scopelist = pcScopeList; } else { handle->params.findsrvtypes.scopelist = SLPGetProperty("net.slp.useScopes"); } handle->params.findsrvtypes.scopelistlen = strlen(handle->params.findsrvtypes.scopelist); handle->params.findsrvtypes.callback = callback; handle->params.findsrvtypes.cookie = pvCookie; /*----------------------------------------------*/ /* Check to see if we should be async or sync */ /*----------------------------------------------*/ #ifdef ENABLE_ASYNC_API if(handle->isAsync) { /* COPY all the referenced parameters */ handle->params.findsrvtypes.namingauth = xstrdup(handle->params.findsrvtypes.namingauth); handle->params.findsrvtypes.scopelist = xstrdup(handle->params.findsrvtypes.scopelist); /* make sure strdups did not fail */ if(handle->params.findsrvtypes.namingauth && handle->params.findsrvtypes.scopelist) { result = ThreadCreate((ThreadStartProc)AsyncProcessSrvTypeRqst,handle); } else { result = SLP_MEMORY_ALLOC_FAILED; } if(result) { if(handle->params.findsrvtypes.namingauth) xfree((void*)handle->params.findsrvtypes.namingauth); if(handle->params.findsrvtypes.scopelist) xfree((void*)handle->params.findsrvtypes.scopelist); handle->inUse = SLP_FALSE; } } else #endif /*ifdef ENABLE_ASYNC_API*/ { /* Leave all parameters REFERENCED */ result = ProcessSrvTypeRqst(handle); handle->inUse = SLP_FALSE; } return result; } openslp-1.2.1/libslp/libslp_thread.c0000644033442200000310000001100610202047457017324 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slplib_reg.c */ /* */ /* Abstract: Implementation for functions register and deregister */ /* services -- SLPReg() call. */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slp.h" #include "libslp.h" #ifdef ENABLE_ASYNC_API /*=========================================================================*/ SLPError ThreadCreate(ThreadStartProc startproc, void *arg) /* Creates a thread */ /* */ /* startproc (IN) Address of the thread start procedure. */ /* */ /* arg (IN) An argument for the thread start procedure. */ /* */ /* Returns SLPError code */ /*=========================================================================*/ { return SLP_NOT_IMPLEMENTED; } #endif openslp-1.2.1/libslp/libslp_findattrs.c0000644033442200000310000004576610202047457020077 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slplib_findattrs.c */ /* */ /* Abstract: Implementation for SLPFindAttrs() call. */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slp.h" #include "libslp.h" /* TODO: do we need to add anything for collation here? */ /*-------------------------------------------------------------------------*/ SLPBoolean ProcessAttrRplyCallback(SLPError errorcode, struct sockaddr_in* peerinfo, SLPBuffer replybuf, void* cookie) /*-------------------------------------------------------------------------*/ { SLPMessage replymsg; SLPAttrRply* attrrply; PSLPHandleInfo handle = (PSLPHandleInfo) cookie; SLPBoolean result = SLP_TRUE; #ifdef ENABLE_SLPv2_SECURITY int securityenabled; securityenabled = SLPPropertyAsBoolean(SLPGetProperty("net.slp.securityEnabled")); #endif /*-------------------------------------------*/ /* Check the errorcode and bail if it is set */ /*-------------------------------------------*/ if(errorcode) { handle->params.findattrs.callback((SLPHandle)handle, 0, errorcode, handle->params.findattrs.cookie); return SLP_FALSE; } /*--------------------*/ /* Parse the replybuf */ /*--------------------*/ replymsg = SLPMessageAlloc(); if(replymsg) { if(SLPMessageParseBuffer(peerinfo,replybuf,replymsg) == 0 && replymsg->header.functionid == SLP_FUNCT_ATTRRPLY && replymsg->body.attrrply.errorcode == 0) { attrrply = &(replymsg->body.attrrply); if(attrrply->attrlistlen) { #ifdef ENABLE_SLPv2_SECURITY /*-------------------------------*/ /* Validate the authblocks */ /*-------------------------------*/ if(SLPPropertyAsBoolean(SLPGetProperty("net.slp.securityEnabled")) && SLPAuthVerifyString(handle->hspi, 1, attrrply->attrlistlen, attrrply->attrlist, attrrply->authcount, attrrply->autharray)) { /* Could not verify the attr auth block */ SLPMessageFree(replymsg); return result; } #endif /*---------------------------------------*/ /* Send the attribute list to the caller */ /*---------------------------------------*/ /* TRICKY: null terminate the attrlist by setting the authcount to 0 */ ((char*)(attrrply->attrlist))[attrrply->attrlistlen] = 0; /* Call the callback function */ result = handle->params.findattrs.callback((SLPHandle)handle, attrrply->attrlist, attrrply->errorcode * -1, handle->params.findattrs.cookie); } } SLPMessageFree(replymsg); } return result; } /*-------------------------------------------------------------------------*/ SLPError ProcessAttrRqst(PSLPHandleInfo handle) /*-------------------------------------------------------------------------*/ { int sock; struct sockaddr_in peeraddr; int bufsize = 0; char* buf = 0; char* curpos = 0; SLPError result = 0; #ifdef ENABLE_SLPv2_SECURITY int spistrlen = 0; char* spistr = 0; if(SLPPropertyAsBoolean(SLPGetProperty("net.slp.securityEnabled"))) { SLPSpiGetDefaultSPI(handle->hspi, SLPSPI_KEY_TYPE_PUBLIC, &spistrlen, &spistr); } #endif /*-------------------------------------------------------------------*/ /* determine the size of the fixed portion of the ATTRRQST */ /*-------------------------------------------------------------------*/ bufsize = handle->params.findattrs.urllen + 2; /* 2 bytes for len field */ bufsize += handle->params.findattrs.scopelistlen + 2; /* 2 bytes for len field */ bufsize += handle->params.findattrs.taglistlen + 2; /* 2 bytes for len field */ bufsize += 2; /* 2 bytes for spistr len*/ #ifdef ENABLE_SLPv2_SECURITY bufsize += spistrlen; #endif buf = curpos = (char*)xmalloc(bufsize); if(buf == 0) { result = SLP_MEMORY_ALLOC_FAILED; goto FINISHED; } /*------------------------------------------------------------*/ /* Build a buffer containing the fixed portion of the ATTRRQST*/ /*------------------------------------------------------------*/ /* url */ ToUINT16(curpos,handle->params.findattrs.urllen); curpos = curpos + 2; memcpy(curpos, handle->params.findattrs.url, handle->params.findattrs.urllen); curpos = curpos + handle->params.findattrs.urllen; /* scope list */ ToUINT16(curpos,handle->params.findattrs.scopelistlen); curpos = curpos + 2; memcpy(curpos, handle->params.findattrs.scopelist, handle->params.findattrs.scopelistlen); curpos = curpos + handle->params.findattrs.scopelistlen; /* taglist */ ToUINT16(curpos,handle->params.findattrs.taglistlen); curpos = curpos + 2; memcpy(curpos, handle->params.findattrs.taglist, handle->params.findattrs.taglistlen); curpos = curpos + handle->params.findattrs.taglistlen; #ifdef ENABLE_SLPv2_SECURITY ToUINT16(curpos,spistrlen); curpos = curpos + 2; memcpy(curpos,spistr,spistrlen); curpos = curpos + spistrlen; #else ToUINT16(curpos,0); #endif /*--------------------------*/ /* Call the RqstRply engine */ /*--------------------------*/ do { #ifndef UNICAST_NOT_SUPPORTED if ( handle->dounicast == 1 ) { void *cookie = (PSLPHandleInfo) handle; result = NetworkUcastRqstRply(handle, buf, SLP_FUNCT_ATTRRQST, bufsize, ProcessAttrRplyCallback, cookie); break; } else #endif sock = NetworkConnectToDA(handle, handle->params.findattrs.scopelist, handle->params.findattrs.scopelistlen, &peeraddr); if(sock == -1) { /* use multicast as a last resort */ #ifndef MI_NOT_SUPPORTED result = NetworkMcastRqstRply(handle, buf, SLP_FUNCT_ATTRRQST, bufsize, ProcessAttrRplyCallback, NULL); #else result = NetworkMcastRqstRply(handle->langtag, buf, SLP_FUNCT_ATTRRQST, bufsize, ProcessAttrRplyCallback, handle); #endif /* MI_NOT_SUPPORTED */ break; } result = NetworkRqstRply(sock, &peeraddr, handle->langtag, 0, buf, SLP_FUNCT_ATTRRQST, bufsize, ProcessAttrRplyCallback, handle); if(result) { NetworkDisconnectDA(handle); } }while(result == SLP_NETWORK_ERROR); FINISHED: if(buf) xfree(buf); #ifdef ENABLE_SLPv2_SECURITY if(spistr) xfree(spistr); #endif return result; } #ifdef ENABLE_ASYNC_API /*-------------------------------------------------------------------------*/ SLPError AsyncProcessAttrRqst(PSLPHandleInfo handle) /*-------------------------------------------------------------------------*/ { SLPError result = ProcessAttrRqst(handle); xfree((void*)handle->params.findattrs.url); xfree((void*)handle->params.findattrs.scopelist); xfree((void*)handle->params.findattrs.taglist); handle->inUse = SLP_FALSE; return result; } #endif /*=========================================================================*/ SLPError SLPAPI SLPFindAttrs(SLPHandle hSLP, const char *pcURLOrServiceType, const char *pcScopeList, const char *pcAttrIds, SLPAttrCallback callback, void *pvCookie) /* */ /* This function returns service attributes matching the attribute ids */ /* for the indicated service URL or service type. If pcURLOrServiceType */ /* is a service URL, the attribute information returned is for that */ /* particular advertisement in the language locale of the SLPHandle. */ /* */ /* If pcURLOrServiceType is a service type name (including naming */ /* authority if any), then the attributes for all advertisements of that */ /* service type are returned regardless of the language of registration. */ /* Results are returned through the callback. */ /* */ /* The result is filtered with an SLP attribute request filter string */ /* parameter, the syntax of which is described in RFC 2608. If the filter */ /* string is the empty string, i.e. "", all attributes are returned. */ /* */ /* hSLP The language specific SLPHandle on which to search */ /* for attributes. */ /* */ /* pcURLOrServiceType The service URL or service type. See RFC 2608 for */ /* URL and service type syntax. May not be the empty */ /* string. */ /* */ /* pcScopeList A pointer to a char containing a comma separated */ /* list of scope names. Pass in NULL or the empty */ /* string "" to find services in all the scopes the */ /* local host is configured query. */ /* */ /* pcAttrIds A comma separated list of attribute ids to return. */ /* Use NULL or the empty string, "", to indicate all */ /* values. Wildcards are not currently supported */ /* */ /* callback A callback function through which the results of */ /* the operation are reported. */ /* */ /* pvCookie Memory passed to the callback code from the client.*/ /* May be NULL. */ /* */ /* Returns: If an error occurs in starting the operation, one */ /* of the SLPError codes is returned. */ /*=========================================================================*/ { PSLPHandleInfo handle; SLPError result; /*------------------------------*/ /* check for invalid parameters */ /*------------------------------*/ if(hSLP == 0 || *(unsigned int*)hSLP != SLP_HANDLE_SIG || pcURLOrServiceType == 0 || *pcURLOrServiceType == 0 || callback == 0) { return SLP_PARAMETER_BAD; } /*-----------------------------------------*/ /* cast the SLPHandle into a SLPHandleInfo */ /*-----------------------------------------*/ handle = (PSLPHandleInfo)hSLP; /*-----------------------------------------*/ /* Check to see if the handle is in use */ /*-----------------------------------------*/ if(handle->inUse == SLP_TRUE) { return SLP_HANDLE_IN_USE; } handle->inUse = SLP_TRUE; /*-------------------------------------------*/ /* Set the handle up to reference parameters */ /*-------------------------------------------*/ handle->params.findattrs.urllen = strlen(pcURLOrServiceType); handle->params.findattrs.url = pcURLOrServiceType; if(pcScopeList && *pcScopeList) { handle->params.findattrs.scopelistlen = strlen(pcScopeList); handle->params.findattrs.scopelist = pcScopeList; } else { handle->params.findattrs.scopelist = SLPGetProperty("net.slp.useScopes"); handle->params.findattrs.scopelistlen = strlen(handle->params.findattrs.scopelist); } if(pcAttrIds && *pcAttrIds) { handle->params.findattrs.taglistlen = strlen(pcAttrIds); handle->params.findattrs.taglist = pcAttrIds; } else { handle->params.findattrs.taglistlen = 0; handle->params.findattrs.taglist = (char*)&handle->params.findattrs.taglistlen; } handle->params.findattrs.callback = callback; handle->params.findattrs.cookie = pvCookie; /*----------------------------------------------*/ /* Check to see if we should be async or sync */ /*----------------------------------------------*/ #ifdef ENABLE_ASYNC_API if(handle->isAsync) { /* COPY all the referenced parameters */ handle->params.findattrs.url = xstrdup(handle->params.findattrs.url); handle->params.findattrs.scopelist = xstrdup(handle->params.findattrs.scopelist); handle->params.findattrs.taglist = xstrdup(handle->params.findattrs.taglist); /* make sure strdups did not fail */ if(handle->params.findattrs.url && handle->params.findattrs.scopelist && handle->params.findattrs.taglist) { result = ThreadCreate((ThreadStartProc)AsyncProcessAttrRqst,handle); } else { result = SLP_MEMORY_ALLOC_FAILED; } if(result) { if(handle->params.findattrs.url) xfree((void*)handle->params.findattrs.url); if(handle->params.findattrs.scopelist) xfree((void*)handle->params.findattrs.scopelist); if(handle->params.findattrs.taglist) xfree((void*)handle->params.findattrs.taglist); handle->inUse = SLP_FALSE; } } else #endif /* ifdef ENABLE_ASYNC_API */ { /* Leave all parameters REFERENCED */ result = ProcessAttrRqst(handle); handle->inUse = SLP_FALSE; } return result; } openslp-1.2.1/libslp/libslp_network.c0000644033442200000310000014031510207404661017553 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: libslp_network.c */ /* */ /* Abstract: Implementation for functions that are related to INTERNAL */ /* library network (and ipc) communication. */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slp.h" #include "libslp.h" /*=========================================================================*/ int NetworkConnectToSlpd(struct sockaddr_in* peeraddr) /* Connects to slpd and provides a peeraddr to send to */ /* */ /* peeraddr (OUT) pointer to receive the connected DA's address */ /* */ /* Returns Connected socket or -1 if no DA connection can be made */ /*=========================================================================*/ { #ifdef _WIN32 /* on WIN32 setsockopt takes a const char * argument */ char lowat; #else int lowat; #endif int result; result = socket(AF_INET,SOCK_STREAM,0); if(result >= 0) { peeraddr->sin_family = AF_INET; peeraddr->sin_port = htons(SLP_RESERVED_PORT); peeraddr->sin_addr.s_addr = htonl(LOOPBACK_ADDRESS); /* TODO: the following connect() could block for a long time. */ if(connect(result, (struct sockaddr*)peeraddr, sizeof(struct sockaddr_in)) == 0) { /* set the receive and send buffer low water mark to 18 bytes (the length of the smallest slpv2 message) */ lowat = 18; setsockopt(result,SOL_SOCKET,SO_RCVLOWAT,&lowat,sizeof(lowat)); setsockopt(result,SOL_SOCKET,SO_SNDLOWAT,&lowat,sizeof(lowat)); } else { /* Could not connect to the slpd through the loopback */ close(result); result = -1; } } return result; } /*=========================================================================*/ void NetworkDisconnectDA(PSLPHandleInfo handle) /* Called after DA fails to respond */ /* */ /* handle (IN) a handle previously passed to NetworkConnectToDA() */ /*=========================================================================*/ { if(handle->dasock) { #ifdef _WIN32 closesocket(handle->dasock); #else close(handle->dasock); #endif handle->dasock = -1; } /* Mark this DA as bad */ KnownDABadDA(&(handle->daaddr.sin_addr)); } /*=========================================================================*/ void NetworkDisconnectSA(PSLPHandleInfo handle) /* Called after SA fails to respond */ /* */ /* handle (IN) a handle previously passed to NetworkConnectToSA() */ /*=========================================================================*/ { if(handle->sasock) { #ifdef _WIN32 closesocket(handle->sasock); #else close(handle->sasock); #endif handle->sasock = -1; } } /*=========================================================================*/ int NetworkConnectToDA(PSLPHandleInfo handle, const char* scopelist, int scopelistlen, struct sockaddr_in* peeraddr) /* Connects to slpd and provides a peeraddr to send to */ /* */ /* handle (IN) SLPHandle info (caches connection info */ /* */ /* scopelist (IN) Scope that must be supported by DA. Pass in NULL */ /* for any scope */ /* */ /* scopelistlen (IN) Length of the scope list in bytes. Ignored if */ /* scopelist is NULL */ /* */ /* peeraddr (OUT) pointer to receive the connected DA's address */ /* */ /* Returns Connected socket or -1 if no DA connection can be made */ /*=========================================================================*/ { /*-----------------------------------------------------------------*/ /* attempt to use a cached socket if scope is supported otherwise */ /* discover a DA that supports the scope */ /*-----------------------------------------------------------------*/ if(handle->dasock >= 0 && handle->dascope && SLPCompareString(handle->dascopelen, handle->dascope, scopelistlen, scopelist) == 0) { memcpy(peeraddr,&(handle->daaddr),sizeof(struct sockaddr_in)); } else { /* close handle cause it can't support the scope */ if(handle->dasock >= 0) { #ifdef _WIN32 closesocket(handle->dasock); #else close(handle->dasock); #endif } /* Attempt to connect to DA that does support the scope */ handle->dasock = KnownDAConnect(handle, scopelistlen, scopelist, &(handle->daaddr)); if(handle->dasock >= 0) { if(handle->dascope) xfree(handle->dascope); handle->dascope = memdup(scopelist,scopelistlen); handle->dascopelen = scopelistlen; memcpy(peeraddr,&(handle->daaddr),sizeof(struct sockaddr_in)); } } return handle->dasock; } /*=========================================================================*/ int NetworkConnectToSA(PSLPHandleInfo handle, const char* scopelist, int scopelistlen, struct sockaddr_in* peeraddr) /* Connects to slpd and provides a peeraddr to send to */ /* */ /* handle (IN) SLPHandle info (caches connection info) */ /* */ /* scopelist (IN) Scope that must be supported by SA. Pass in NULL */ /* for any scope */ /* */ /* scopelistlen (IN) Length of the scope list in bytes. Ignored if */ /* scopelist is NULL */ /* */ /* peeraddr (OUT) pointer to receive the connected SA's address */ /* */ /* Returns Connected socket or -1 if no SA connection can be made */ { /*-----------------------------------------------------------------*/ /* attempt to use a cached socket if scope is supported otherwise */ /* look to connect to local slpd or a DA that supports the scope */ /*-----------------------------------------------------------------*/ if(handle->sasock >= 0 && handle->sascope && SLPCompareString(handle->sascopelen, handle->sascope, scopelistlen, scopelist) == 0) { memcpy(peeraddr,&(handle->saaddr),sizeof(struct sockaddr_in)); } else { /* close handle cause it can't support the scope */ if(handle->sasock >= 0) { #ifdef _WIN32 closesocket(handle->sasock); #else close(handle->sasock); #endif } /*-----------------------------------------*/ /* Attempt to connect to slpd via loopback */ /*-----------------------------------------*/ handle->sasock = NetworkConnectToSlpd(&(handle->saaddr)); /*----------------------------------------------------------*/ /* if we connected to something, cache scope and addr info */ /*----------------------------------------------------------*/ if(handle->sasock >= 0) { if(handle->sascope) xfree(handle->sascope); handle->sascope = memdup(scopelist,scopelistlen); handle->sascopelen = scopelistlen; memcpy(peeraddr,&(handle->saaddr),sizeof(struct sockaddr_in)); } } return handle->sasock; } /*=========================================================================*/ SLPError NetworkRqstRply(int sock, struct sockaddr_in* destaddr, const char* langtag, int extoffset, char* buf, char buftype, int bufsize, NetworkRplyCallback callback, void * cookie) /* Transmits and receives SLP messages via multicast convergence algorithm */ /* */ /* Returns - SLP_OK on success */ /*=========================================================================*/ { struct timeval timeout; struct sockaddr_in peeraddr; SLPBuffer sendbuf = 0; SLPBuffer recvbuf = 0; SLPError result = 0; int looprecv = 0; int langtaglen = 0; int prlistlen = 0; char* prlist = 0; int xid = 0; int mtu = 0; int size = 0; int xmitcount = 0; int rplycount = 0; int maxwait = 0; int totaltimeout = 0; #ifdef _WIN32 /* on WIN32 setsockopt takes a const char * argument */ char socktype = 0; #else int socktype = 0; #endif int timeouts[MAX_RETRANSMITS]; unsigned short flags; /*----------------------------------------------------*/ /* Save off a few things we don't want to recalculate */ /*----------------------------------------------------*/ langtaglen = strlen(langtag); xid = SLPXidGenerate(); mtu = SLPPropertyAsInteger(SLPGetProperty("net.slp.MTU")); sendbuf = SLPBufferAlloc(mtu); if(sendbuf == 0) { result = SLP_MEMORY_ALLOC_FAILED; goto CLEANUP; } /* Figure unicast/multicast,TCP/UDP, wait and time out stuff */ if(ISMCAST(destaddr->sin_addr)) { /* Multicast or broadcast */ maxwait = SLPPropertyAsInteger(SLPGetProperty("net.slp.multicastMaximumWait")); SLPPropertyAsIntegerVector(SLPGetProperty("net.slp.multicastTimeouts"), timeouts, MAX_RETRANSMITS ); xmitcount = 0; looprecv = 1; socktype = SOCK_DGRAM; } else { maxwait = SLPPropertyAsInteger(SLPGetProperty("net.slp.unicastMaximumWait")); SLPPropertyAsIntegerVector(SLPGetProperty("net.slp.unicastTimeouts"), timeouts, MAX_RETRANSMITS ); size = sizeof(socktype); getsockopt(sock,SOL_SOCKET,SO_TYPE,&socktype,&size); if(socktype == SOCK_DGRAM) { xmitcount = 0; looprecv = 1; } else { xmitcount = MAX_RETRANSMITS; looprecv = 0; } } /* Special case for fake SLP_FUNCT_DASRVRQST */ if(buftype == SLP_FUNCT_DASRVRQST) { /* do something special for SRVRQST that will be discovering DAs */ maxwait = SLPPropertyAsInteger(SLPGetProperty("net.slp.DADiscoveryMaximumWait")); SLPPropertyAsIntegerVector(SLPGetProperty("net.slp.DADiscoveryTimeouts"), timeouts, MAX_RETRANSMITS ); /* SLP_FUNCT_DASRVRQST is a fake function. We really want to */ /* send a SRVRQST */ buftype = SLP_FUNCT_SRVRQST; looprecv = 1; } /*---------------------------------------------------------------------*/ /* Allocate memory for the prlist for appropriate messages. */ /* Notice that the prlist is as large as the MTU -- thus assuring that */ /* there will not be any buffer overwrites regardless of how many */ /* previous responders there are. This is because the retransmit */ /* code terminates if ever MTU is exceeded for any datagram message. */ /*---------------------------------------------------------------------*/ if(buftype == SLP_FUNCT_SRVRQST || buftype == SLP_FUNCT_ATTRRQST || buftype == SLP_FUNCT_SRVTYPERQST) { prlist = (char*)xmalloc(mtu); if(prlist == 0) { result = SLP_MEMORY_ALLOC_FAILED; goto CLEANUP; } *prlist = 0; prlistlen = 0; } /*--------------------------*/ /* Main retransmission loop */ /*--------------------------*/ while(xmitcount <= MAX_RETRANSMITS) { xmitcount++; /*--------------------*/ /* setup recv timeout */ /*--------------------*/ if(socktype == SOCK_DGRAM) { totaltimeout += timeouts[xmitcount]; if(totaltimeout >= maxwait || timeouts[xmitcount] == 0) { /* we are all done */ break; } timeout.tv_sec = timeouts[xmitcount] / 1000; timeout.tv_usec = (timeouts[xmitcount] % 1000) * 1000; } else { timeout.tv_sec = maxwait / 1000; timeout.tv_usec = (maxwait % 1000) * 1000; } /*------------------------------------------------------------------*/ /* re-allocate buffer and make sure that the send buffer does not */ /* exceed MTU for datagram transmission */ /*------------------------------------------------------------------*/ size = 14 + langtaglen + bufsize; if(buftype == SLP_FUNCT_SRVRQST || buftype == SLP_FUNCT_ATTRRQST || buftype == SLP_FUNCT_SRVTYPERQST) { /* add in room for the prlist */ size += 2 + prlistlen; } if(size > mtu && socktype == SOCK_DGRAM) { if(xmitcount == 0) { result = SLP_BUFFER_OVERFLOW; } goto FINISHED; } if((sendbuf = SLPBufferRealloc(sendbuf,size)) == 0) { result = SLP_MEMORY_ALLOC_FAILED; goto CLEANUP; } /*-----------------------------------*/ /* Add the header to the send buffer */ /*-----------------------------------*/ /*version*/ *(sendbuf->start) = 2; /*function id*/ *(sendbuf->start + 1) = buftype; /*length*/ ToUINT24(sendbuf->start + 2, size); /*flags*/ flags = (ISMCAST(destaddr->sin_addr) ? SLP_FLAG_MCAST : 0); if (buftype == SLP_FUNCT_SRVREG) { flags |= SLP_FLAG_FRESH; } ToUINT16(sendbuf->start + 5, flags); /*ext offset*/ /* TRICKY: the extoffset passed into us was the offset not * including the header. We need to fix up the offset so * that it is from the beginning of the SLP message */ if(extoffset != 0) { ToUINT24(sendbuf->start + 7,extoffset + langtaglen + 14); } else { ToUINT24(sendbuf->start + 7, 0); } /*xid*/ ToUINT16(sendbuf->start + 10,xid); /*lang tag len*/ ToUINT16(sendbuf->start + 12,langtaglen); /*lang tag*/ memcpy(sendbuf->start + 14, langtag, langtaglen); sendbuf->curpos = sendbuf->start + langtaglen + 14 ; /*-----------------------------------*/ /* Add the prlist to the send buffer */ /*-----------------------------------*/ if(prlist) { ToUINT16(sendbuf->curpos,prlistlen); sendbuf->curpos = sendbuf->curpos + 2; memcpy(sendbuf->curpos, prlist, prlistlen); sendbuf->curpos = sendbuf->curpos + prlistlen; } /*-----------------------------*/ /* Add the rest of the message */ /*-----------------------------*/ memcpy(sendbuf->curpos, buf, bufsize); /*----------------------*/ /* send the send buffer */ /*----------------------*/ result = SLPNetworkSendMessage(sock, socktype, sendbuf, destaddr, &timeout); if(result != 0) { /* we could not send the message for some reason */ /* we're done */ if(errno == ETIMEDOUT) { result = SLP_NETWORK_TIMED_OUT; } else { result = SLP_NETWORK_ERROR; } goto FINISHED; } /*----------------*/ /* Main recv loop */ /*----------------*/ do { if(SLPNetworkRecvMessage(sock, socktype, &recvbuf, &peeraddr, &timeout) != 0) { /* An error occured while receiving the message */ /* probably a just time out error. break for re-send. */ if(errno == ETIMEDOUT) { result = SLP_NETWORK_TIMED_OUT; } else { result = SLP_NETWORK_ERROR; } break; } else { /* Sneek in and check the XID */ if(AsUINT16(recvbuf->start+10) == xid) { rplycount += 1; /* Call the callback with the result and recvbuf */ if(callback(result,&peeraddr,recvbuf,cookie) == SLP_FALSE) { /* Caller does not want any more info */ /* We are done! */ goto CLEANUP; } /* add the peer to the previous responder list */ /* Note that prlist will be NULL if message type is not */ /* SLP_FUNCT_SRVRQST, SLP_FUNCT_ATTRRQST, or */ /* SLP_FUNCT_SRVTYPERQST) */ if(prlist && socktype == SOCK_DGRAM) { /* calculate the peeraddr string and length */ char* peeraddrstr = NULL; int peeraddrstrlen = 0; peeraddrstr = inet_ntoa(peeraddr.sin_addr); if(peeraddrstr) { peeraddrstrlen = strlen(peeraddrstr); /* Append to the prlist if we won't overflow */ if((prlistlen + peeraddrstrlen + 1) < mtu ) { /* append comma if necessary */ if(prlistlen != 0) { strcat(prlist,","); prlistlen ++; } /* append address string */ strcat(prlist,peeraddrstr); prlistlen += peeraddrstrlen; } } } } } }while(looprecv); } FINISHED: /*-----------------------------------------------*/ /* Notify the last time callback that we're done */ /*-----------------------------------------------*/ if(rplycount) { result = SLP_LAST_CALL; } if(result == SLP_NETWORK_TIMED_OUT && ISMCAST(destaddr->sin_addr)) { result = SLP_LAST_CALL; } callback(result, &peeraddr, recvbuf, cookie); if(result == SLP_LAST_CALL) { result = 0; } /*----------------*/ /* Free resources */ /*----------------*/ CLEANUP: if(prlist) xfree(prlist); SLPBufferFree(sendbuf); SLPBufferFree(recvbuf); return result; } /*=========================================================================*/ #ifndef MI_NOT_SUPPORTED SLPError NetworkMcastRqstRply(PSLPHandleInfo handle, #else SLPError NetworkMcastRqstRply(const char* langtag, #endif /* MI_NOT_SUPPORTED */ char* buf, char buftype, int bufsize, NetworkRplyCallback callback, void * cookie) /* Description: */ /* */ /* Broadcasts/multicasts SLP messages via multicast convergence algorithm */ /* */ /* langtag (IN) Language tag to use in SLP message header */ /* */ /* buf (IN) pointer to the portion of the SLP message to send. The */ /* portion to that should be pointed to is everything after */ /* the pr-list. NetworkXcastRqstRply() automatically */ /* generates the header and the prlist. */ /* */ /* buftype (IN) the function-id to use in the SLPMessage header */ /* */ /* bufsize (IN) the size of the buffer pointed to by buf */ /* */ /* callback (IN) the callback to use for reporting results */ /* */ /* cookie (IN) the cookie to pass to the callback */ /* */ /* Returns - SLP_OK on success. SLP_ERROR on failure */ /*=========================================================================*/ { struct timeval timeout; struct sockaddr_in peeraddr; SLPBuffer sendbuf = 0; SLPBuffer recvbuf = 0; SLPError result = 0; int langtaglen = 0; int prlistlen = 0; char* prlist = 0; int xid = 0; int mtu = 0; int size = 0; int xmitcount = 0; int rplycount = 0; int maxwait = 0; int totaltimeout = 0; int usebroadcast = 0; int timeouts[MAX_RETRANSMITS]; SLPIfaceInfo ifaceinfo; SLPXcastSockets xcastsocks; #ifdef DEBUG /* This function only supports multicast or broadcast of the following * messages */ if(buftype != SLP_FUNCT_SRVRQST && buftype != SLP_FUNCT_ATTRRQST && buftype != SLP_FUNCT_SRVTYPERQST && buftype != SLP_FUNCT_DASRVRQST) { return SLP_PARAMETER_BAD; } #endif /*----------------------------------------------------*/ /* Save off a few things we don't want to recalculate */ /*----------------------------------------------------*/ #ifndef MI_NOT_SUPPORTED langtaglen = strlen(handle->langtag); #else langtaglen = strlen(langtag); #endif /* MI_NOT_SUPPORTED */ xid = SLPXidGenerate(); mtu = SLPPropertyAsInteger(SLPGetProperty("net.slp.MTU")); sendbuf = SLPBufferAlloc(mtu); if(sendbuf == 0) { result = SLP_MEMORY_ALLOC_FAILED; goto FINISHED; } #ifndef MI_NOT_SUPPORTED if(handle->McastIFList != NULL) { #ifdef DEBUG fprintf(stderr, "McastIFList = %s\n", handle->McastIFList); #endif SLPIfaceGetInfo(handle->McastIFList, &ifaceinfo); } else #endif /* MI_NOT_SUPPORTED */ if(SLPIfaceGetInfo(SLPGetProperty("net.slp.interfaces"),&ifaceinfo)) { result = SLP_NETWORK_ERROR; goto FINISHED; } usebroadcast = SLPPropertyAsBoolean(SLPGetProperty("net.slp.useBroadcast")); /*-----------------------------------*/ /* Multicast/broadcast wait timeouts */ /*-----------------------------------*/ maxwait = SLPPropertyAsInteger(SLPGetProperty("net.slp.multicastMaximumWait")); SLPPropertyAsIntegerVector(SLPGetProperty("net.slp.multicastTimeouts"), timeouts, MAX_RETRANSMITS ); /* Special case for fake SLP_FUNCT_DASRVRQST */ if(buftype == SLP_FUNCT_DASRVRQST) { /* do something special for SRVRQST that will be discovering DAs */ maxwait = SLPPropertyAsInteger(SLPGetProperty("net.slp.DADiscoveryMaximumWait")); SLPPropertyAsIntegerVector(SLPGetProperty("net.slp.DADiscoveryTimeouts"), timeouts, MAX_RETRANSMITS ); /* SLP_FUNCT_DASRVRQST is a fake function. We really want to */ /* send a SRVRQST */ buftype = SLP_FUNCT_SRVRQST; } /*---------------------------------------------------------------------*/ /* Allocate memory for the prlist for appropriate messages. */ /* Notice that the prlist is as large as the MTU -- thus assuring that */ /* there will not be any buffer overwrites regardless of how many */ /* previous responders there are. This is because the retransmit */ /* code terminates if ever MTU is exceeded for any datagram message. */ /*---------------------------------------------------------------------*/ prlist = (char*)xmalloc(mtu); if(prlist == 0) { result = SLP_MEMORY_ALLOC_FAILED; goto FINISHED; } *prlist = 0; prlistlen = 0; /*--------------------------*/ /* Main retransmission loop */ /*--------------------------*/ xmitcount = 0; while(xmitcount <= MAX_RETRANSMITS) { xmitcount++; totaltimeout += timeouts[xmitcount]; if(totaltimeout >= maxwait || timeouts[xmitcount] == 0) { /* we are all done */ break; } timeout.tv_sec = timeouts[xmitcount] / 1000; timeout.tv_usec = (timeouts[xmitcount] % 1000) * 1000; /*------------------------------------------------------------------*/ /* re-allocate buffer and make sure that the send buffer does not */ /* exceed MTU for datagram transmission */ /*------------------------------------------------------------------*/ size = 14 + langtaglen + bufsize; if(buftype == SLP_FUNCT_SRVRQST || buftype == SLP_FUNCT_ATTRRQST || buftype == SLP_FUNCT_SRVTYPERQST) { /* add in room for the prlist */ size += 2 + prlistlen; } if(size > mtu) { if(xmitcount == 0) { result = SLP_BUFFER_OVERFLOW; } goto FINISHED; } if((sendbuf = SLPBufferRealloc(sendbuf,size)) == 0) { result = SLP_MEMORY_ALLOC_FAILED; goto FINISHED; } /*-----------------------------------*/ /* Add the header to the send buffer */ /*-----------------------------------*/ /*version*/ *(sendbuf->start) = 2; /*function id*/ *(sendbuf->start + 1) = buftype; /*length*/ ToUINT24(sendbuf->start + 2, size); /*flags*/ ToUINT16(sendbuf->start + 5, SLP_FLAG_MCAST); /*ext offset*/ ToUINT24(sendbuf->start + 7,0); /*xid*/ ToUINT16(sendbuf->start + 10,xid); /*lang tag len*/ ToUINT16(sendbuf->start + 12,langtaglen); /*lang tag*/ #ifndef MI_NOT_SUPPORTED memcpy(sendbuf->start + 14, handle->langtag, langtaglen); #else memcpy(sendbuf->start + 14, langtag, langtaglen); #endif /* MI_NOT_SUPPORTED */ sendbuf->curpos = sendbuf->start + langtaglen + 14 ; /*-----------------------------------*/ /* Add the prlist to the send buffer */ /*-----------------------------------*/ if(prlist) { ToUINT16(sendbuf->curpos,prlistlen); sendbuf->curpos = sendbuf->curpos + 2; memcpy(sendbuf->curpos, prlist, prlistlen); sendbuf->curpos = sendbuf->curpos + prlistlen; } /*-----------------------------*/ /* Add the rest of the message */ /*-----------------------------*/ memcpy(sendbuf->curpos, buf, bufsize); /*----------------------*/ /* send the send buffer */ /*----------------------*/ if(usebroadcast) { result = SLPBroadcastSend(&ifaceinfo,sendbuf,&xcastsocks); } else { result = SLPMulticastSend(&ifaceinfo,sendbuf,&xcastsocks); } if(result != 0) { /* we could not send the message for some reason */ result = SLP_NETWORK_ERROR; goto FINISHED; } /*----------------*/ /* Main recv loop */ /*----------------*/ while(1) { #ifndef UNICAST_NOT_SUPPORTED int retval = 0; if((retval = SLPXcastRecvMessage(&xcastsocks, &recvbuf, &peeraddr, &timeout)) != 0) #else if(SLPXcastRecvMessage(&xcastsocks, &recvbuf, &peeraddr, &timeout) != 0) #endif { /* An error occured while receiving the message */ /* probably a just time out error. break for re-send. */ if(errno == ETIMEDOUT) { result = SLP_NETWORK_TIMED_OUT; } else { result = SLP_NETWORK_ERROR; } #ifndef UNICAST_NOT_SUPPORTED /* retval = SLP_RETRY_UNICAST signifies that we received a * multicast packet of size > MTU and hence we are now sending * a unicast request to this IP-address */ if ( retval == SLP_RETRY_UNICAST ) { int tcpsockfd, retval1, retval2, unicastwait = 0; unicastwait = SLPPropertyAsInteger(SLPGetProperty("net.slp.unicastMaximumWait")); timeout.tv_sec = unicastwait / 1000; timeout.tv_usec = (unicastwait % 1000) * 1000; tcpsockfd = SLPNetworkConnectStream(&peeraddr, &timeout); if ( tcpsockfd >= 0 ) { ToUINT16(sendbuf->start + 5, SLP_FLAG_UCAST); xid = SLPXidGenerate(); ToUINT16(sendbuf->start + 10,xid); retval1 = SLPNetworkSendMessage(tcpsockfd, SOCK_STREAM, sendbuf, &peeraddr, &timeout); if ( retval1 != 0 ) { /* we could not send the message for some reason */ /* we close the TCP connection and break */ if(errno == ETIMEDOUT) { result = SLP_NETWORK_TIMED_OUT; } else { result = SLP_NETWORK_ERROR; } #ifdef _WIN32 closesocket(tcpsockfd); #else close(tcpsockfd); #endif break; } retval2 = SLPNetworkRecvMessage(tcpsockfd, SOCK_STREAM, &recvbuf, &peeraddr, &timeout); if ( retval2 != 0 ) { /* An error occured while receiving the message */ /* probably a just time out error. break for re-send. */ if(errno == ETIMEDOUT) { result = SLP_NETWORK_TIMED_OUT; } else { result = SLP_NETWORK_ERROR; } #ifdef _WIN32 closesocket(tcpsockfd); #else close(tcpsockfd); #endif break; } #ifdef _WIN32 closesocket(tcpsockfd); #else close(tcpsockfd); #endif result = SLP_OK; goto SNEEK; } else { /* Unsuccessful in opening a TCP connection */ /* just break and retry everything */ break; } } else { #endif break; #ifndef UNICAST_NOT_SUPPORTED } #endif } #ifndef UNICAST_NOT_SUPPORTED SNEEK: #endif /* Sneek in and check the XID */ if(AsUINT16(recvbuf->start+10) == xid) { rplycount += 1; /* Call the callback with the result and recvbuf */ #ifndef MI_NOT_SUPPORTED if (cookie == NULL) { cookie = (PSLPHandleInfo)handle; } #endif /* MI_NOT_SUPPORTED */ if(callback(result,&peeraddr,recvbuf,cookie) == SLP_FALSE) { /* Caller does not want any more info */ /* We are done! */ goto CLEANUP; } if (prlistlen + 14 < mtu) { /* add the peer to the previous responder list */ if(prlistlen != 0) { strcat(prlist,","); } strcat(prlist,inet_ntoa(peeraddr.sin_addr)); prlistlen = strlen(prlist); } } } SLPXcastSocketsClose(&xcastsocks); } FINISHED: /*---------------------------------------------------------------------*/ /* Notify the callback with SLP_LAST_CALL so that they know we're done */ /*---------------------------------------------------------------------*/ if(rplycount || result == SLP_NETWORK_TIMED_OUT) { result = SLP_LAST_CALL; } #ifndef MI_NOT_SUPPORTED if (cookie == NULL) { cookie = (PSLPHandleInfo)handle; } #endif /* MI_NOT_SUPPORTED */ callback(result, NULL,NULL,cookie); if(result == SLP_LAST_CALL) { result = SLP_OK; } CLEANUP: /*----------------*/ /* Free resources */ /*----------------*/ if(prlist) xfree(prlist); SLPBufferFree(sendbuf); SLPBufferFree(recvbuf); SLPXcastSocketsClose(&xcastsocks); return result; } #ifndef UNICAST_NOT_SUPPORTED /*=========================================================================*/ SLPError NetworkUcastRqstRply(PSLPHandleInfo handle, char* buf, char buftype, int bufsize, NetworkRplyCallback callback, void * cookie) /* Description: */ /* */ /* Unicasts SLP messages */ /* */ /* handle (IN) pointer to the SLP handle */ /* */ /* buf (IN) pointer to the portion of the SLP message to send. */ /* */ /* buftype (IN) the function-id to use in the SLPMessage header */ /* */ /* bufsize (IN) the size of the buffer pointed to by buf */ /* */ /* callback (IN) the callback to use for reporting results */ /* */ /* cookie (IN) the cookie to pass to the callback */ /* */ /* Returns - SLP_OK on success. SLP_ERROR on failure */ /*=========================================================================*/ { struct timeval timeout; struct sockaddr_in peeraddr; SLPBuffer sendbuf = 0; SLPBuffer recvbuf = 0; SLPError result = 0; int langtaglen = 0; int prlistlen = 0; char* prlist = 0; int xid = 0; int mtu = 0; int size = 0; int rplycount = 0; int maxwait = 0; int timeouts[MAX_RETRANSMITS]; int retval1, retval2; #ifdef DEBUG /* This function only supports unicast of the following messages */ if(buftype != SLP_FUNCT_SRVRQST && buftype != SLP_FUNCT_ATTRRQST && buftype != SLP_FUNCT_SRVTYPERQST && buftype != SLP_FUNCT_DASRVRQST) { return SLP_PARAMETER_BAD; } #endif /*----------------------------------------------------*/ /* Save off a few things we don't want to recalculate */ /*----------------------------------------------------*/ langtaglen = strlen(handle->langtag); xid = SLPXidGenerate(); mtu = SLPPropertyAsInteger(SLPGetProperty("net.slp.MTU")); sendbuf = SLPBufferAlloc(mtu); if(sendbuf == 0) { result = SLP_MEMORY_ALLOC_FAILED; goto FINISHED; } /*-----------------------------------*/ /* Unicast wait timeouts */ /*-----------------------------------*/ maxwait = SLPPropertyAsInteger(SLPGetProperty("net.slp.unicastMaximumWait")); SLPPropertyAsIntegerVector(SLPGetProperty("net.slp.unicastTimeouts"), timeouts, MAX_RETRANSMITS ); /* Special case for fake SLP_FUNCT_DASRVRQST */ if(buftype == SLP_FUNCT_DASRVRQST) { /* do something special for SRVRQST that will be discovering DAs */ maxwait = SLPPropertyAsInteger(SLPGetProperty("net.slp.DADiscoveryMaximumWait")); SLPPropertyAsIntegerVector(SLPGetProperty("net.slp.DADiscoveryTimeouts"), timeouts, MAX_RETRANSMITS ); /* SLP_FUNCT_DASRVRQST is a fake function. We really want to */ /* send a SRVRQST */ buftype = SLP_FUNCT_SRVRQST; } /*---------------------------------------------------------------------*/ /* Allocate memory for the prlist for appropriate messages. */ /* Notice that the prlist is as large as the MTU -- thus assuring that */ /* there will not be any buffer overwrites regardless of how many */ /* previous responders there are. This is because the retransmit */ /* code terminates if ever MTU is exceeded for any datagram message. */ /*---------------------------------------------------------------------*/ prlist = (char*)xmalloc(mtu); if(prlist == 0) { result = SLP_MEMORY_ALLOC_FAILED; goto FINISHED; } *prlist = 0; prlistlen = 0; /*--------------------------*/ /* Main unicast segment */ /*--------------------------*/ { timeout.tv_sec = timeouts[0] / 1000; timeout.tv_usec = (timeouts[0] % 1000) * 1000; size = 14 + langtaglen + bufsize; if(buftype == SLP_FUNCT_SRVRQST || buftype == SLP_FUNCT_ATTRRQST || buftype == SLP_FUNCT_SRVTYPERQST) { /* add in room for the prlist */ size += 2 + prlistlen; } if((sendbuf = SLPBufferRealloc(sendbuf,size)) == 0) { result = SLP_MEMORY_ALLOC_FAILED; goto FINISHED; } /*-----------------------------------*/ /* Add the header to the send buffer */ /*-----------------------------------*/ /*version*/ *(sendbuf->start) = 2; /*function id*/ *(sendbuf->start + 1) = buftype; /*length*/ ToUINT24(sendbuf->start + 2, size); /*flags*/ ToUINT16(sendbuf->start + 5, SLP_FLAG_UCAST); /*this is a unicast */ /*ext offset*/ ToUINT24(sendbuf->start + 7,0); /*xid*/ ToUINT16(sendbuf->start + 10,xid); /*lang tag len*/ ToUINT16(sendbuf->start + 12,langtaglen); /*lang tag*/ memcpy(sendbuf->start + 14, handle->langtag, langtaglen); sendbuf->curpos = sendbuf->start + langtaglen + 14 ; /*-----------------------------------*/ /* Add the prlist to the send buffer */ /*-----------------------------------*/ if(prlist) { ToUINT16(sendbuf->curpos,prlistlen); sendbuf->curpos = sendbuf->curpos + 2; memcpy(sendbuf->curpos, prlist, prlistlen); sendbuf->curpos = sendbuf->curpos + prlistlen; } /*-----------------------------*/ /* Add the rest of the message */ /*-----------------------------*/ memcpy(sendbuf->curpos, buf, bufsize); /*----------------------*/ /* send the send buffer */ /*----------------------*/ handle->unicastsock = SLPNetworkConnectStream(&(handle->unicastaddr), &timeout); if ( handle->unicastsock >= 0 ) { retval1 = SLPNetworkSendMessage(handle->unicastsock, SOCK_STREAM, sendbuf, &(handle->unicastaddr), &timeout); if ( retval1 != 0 ) { /* we could not send the message for some reason */ /* we close the TCP connection and break */ if(errno == ETIMEDOUT) { result = SLP_NETWORK_TIMED_OUT; }else { result = SLP_NETWORK_ERROR; } #ifdef _WIN32 closesocket(handle->unicastsock); #else close(handle->unicastsock); #endif goto FINISHED; } retval2 = SLPNetworkRecvMessage(handle->unicastsock, SOCK_STREAM, &recvbuf, &(handle->unicastaddr), &timeout); if ( retval2 != 0 ) { /* An error occured while receiving the message */ /* probably just a time out error. */ /* we close the TCP connection and break */ if(errno == ETIMEDOUT) { result = SLP_NETWORK_TIMED_OUT; } else { result = SLP_NETWORK_ERROR; } #ifdef _WIN32 closesocket(handle->unicastsock); #else close(handle->unicastsock); #endif goto FINISHED; } #ifdef _WIN32 closesocket(handle->unicastsock); #else close(handle->unicastsock); #endif result = SLP_OK; } else { result = SLP_NETWORK_TIMED_OUT; /* Unsuccessful in opening a TCP connection */ /* just break */ goto FINISHED; } /* Sneek in and check the XID */ if(AsUINT16(recvbuf->start+10) == xid) { rplycount += 1; /* Call the callback with the result and recvbuf */ if(callback(result,&peeraddr,recvbuf,cookie) == SLP_FALSE) { /* Caller does not want any more info */ /* We are done! */ goto CLEANUP; } /* add the peer to the previous responder list */ if(prlistlen != 0) { strcat(prlist,","); } strcat(prlist,inet_ntoa(peeraddr.sin_addr)); prlistlen = strlen(prlist); } } FINISHED: /*---------------------------------------------------------------------*/ /* Notify the callback with SLP_LAST_CALL so that they know we're done */ /*---------------------------------------------------------------------*/ if(rplycount || result == SLP_NETWORK_TIMED_OUT) { result = SLP_LAST_CALL; } callback(result, NULL,NULL,cookie); if(result == SLP_LAST_CALL) { result = SLP_OK; } CLEANUP: /*----------------*/ /* Free resources */ /*----------------*/ if(prlist) xfree(prlist); SLPBufferFree(sendbuf); SLPBufferFree(recvbuf); return result; } #endif openslp-1.2.1/libslp/libslp_reg.c0000644033442200000310000004060710202047457016643 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slplib_reg.c */ /* */ /* Abstract: Implementation for functions register and deregister */ /* services -- SLPReg() call. */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slp.h" #include "libslp.h" /*-------------------------------------------------------------------------*/ SLPBoolean CallbackSrvReg(SLPError errorcode, struct sockaddr_in* peerinfo, SLPBuffer replybuf, void* cookie) /*-------------------------------------------------------------------------*/ { SLPMessage replymsg; PSLPHandleInfo handle = (PSLPHandleInfo) cookie; /*-------------------------------------------*/ /* Check the errorcode and bail if it is set */ /*-------------------------------------------*/ if(errorcode == 0) { /*--------------------*/ /* Parse the replybuf */ /*--------------------*/ replymsg = SLPMessageAlloc(); if(replymsg) { errorcode = SLPMessageParseBuffer(peerinfo,replybuf,replymsg); if(errorcode == 0) { if(replymsg->header.functionid == SLP_FUNCT_SRVACK) { errorcode = replymsg->body.srvack.errorcode * - 1; } } SLPMessageFree(replymsg); } else { errorcode = SLP_MEMORY_ALLOC_FAILED; } } /*----------------------------*/ /* Call the callback function */ /*----------------------------*/ handle->params.reg.callback((SLPHandle)handle, errorcode, handle->params.reg.cookie); return SLP_FALSE; } /*-------------------------------------------------------------------------*/ SLPError ProcessSrvReg(PSLPHandleInfo handle) /*-------------------------------------------------------------------------*/ { int sock; struct sockaddr_in peeraddr; int bufsize = 0; char* buf = 0; char* curpos = 0; SLPError result = 0; int extoffset = 0; #ifdef ENABLE_SLPv2_SECURITY int urlauthlen = 0; unsigned char* urlauth = 0; int attrauthlen = 0; unsigned char* attrauth = 0; if(SLPPropertyAsBoolean(SLPGetProperty("net.slp.securityEnabled"))) { result = SLPAuthSignUrl(handle->hspi, 0, 0, handle->params.reg.urllen, handle->params.reg.url, &urlauthlen, &urlauth); if(result == 0) { result = SLPAuthSignString(handle->hspi, 0, 0, handle->params.reg.attrlistlen, handle->params.reg.attrlist, &attrauthlen, &attrauth); } bufsize += urlauthlen; bufsize += attrauthlen; } #endif /*-------------------------------------------------------------------*/ /* determine the size of the fixed portion of the SRVREG */ /*-------------------------------------------------------------------*/ bufsize += handle->params.reg.urllen + 6; /* 1 byte for reserved */ /* 2 bytes for lifetime */ /* 2 bytes for urllen */ /* 1 byte for authcount */ bufsize += handle->params.reg.srvtypelen + 2; /* 2 bytes for len field */ bufsize += handle->params.reg.scopelistlen + 2; /* 2 bytes for len field */ bufsize += handle->params.reg.attrlistlen + 2; /* 2 bytes for len field */ bufsize += 1; /* 1 byte for authcount */ if(SLPPropertyAsBoolean(SLPGetProperty("net.slp.watchRegistrationPID"))) { bufsize += 9; /* 2 bytes for extid */ /* 3 bytes for nextoffset */ /* 4 bytes for pid */ } buf = curpos = (char*)xmalloc(bufsize); if(buf == 0) { result = SLP_MEMORY_ALLOC_FAILED; goto FINISHED; } /*------------------------------------------------------------*/ /* Build a buffer containing the fixed portion of the SRVREG */ /*------------------------------------------------------------*/ /* url-entry reserved */ *curpos= 0; curpos = curpos + 1; /* url-entry lifetime */ ToUINT16(curpos,handle->params.reg.lifetime); curpos = curpos + 2; /* url-entry urllen */ ToUINT16(curpos,handle->params.reg.urllen); curpos = curpos + 2; /* url-entry url */ memcpy(curpos, handle->params.reg.url, handle->params.reg.urllen); curpos = curpos + handle->params.reg.urllen; /* url-entry authblock */ #ifdef ENABLE_SLPv2_SECURITY if(urlauth) { /* authcount */ *curpos = 1; curpos = curpos + 1; /* authblock */ memcpy(curpos,urlauth,urlauthlen); curpos = curpos + urlauthlen; } else #endif { /* authcount */ *curpos = 0; curpos = curpos + 1; } /* service type */ ToUINT16(curpos,handle->params.reg.srvtypelen); curpos = curpos + 2; memcpy(curpos, handle->params.reg.srvtype, handle->params.reg.srvtypelen); curpos = curpos + handle->params.reg.srvtypelen; /* scope list */ ToUINT16(curpos,handle->params.reg.scopelistlen); curpos = curpos + 2; memcpy(curpos, handle->params.reg.scopelist, handle->params.reg.scopelistlen); curpos = curpos + handle->params.reg.scopelistlen; /* attr list */ ToUINT16(curpos,handle->params.reg.attrlistlen); curpos = curpos + 2; memcpy(curpos, handle->params.reg.attrlist, handle->params.reg.attrlistlen); curpos = curpos + handle->params.reg.attrlistlen; /* attribute auth block */ #ifdef ENABLE_SLPv2_SECURITY if(attrauth) { /* authcount */ *curpos = 1; curpos = curpos + 1; /* authblock */ memcpy(curpos,attrauth,attrauthlen); curpos = curpos + attrauthlen; } else #endif { /* authcount */ *curpos = 0; curpos = curpos + 1; } /* Put in the SLP_EXTENSION_ID_REG_PID */ if(SLPPropertyAsBoolean(SLPGetProperty("net.slp.watchRegistrationPID"))) { extoffset = curpos - buf; ToUINT16(curpos,SLP_EXTENSION_ID_REG_PID); curpos += 2; ToUINT24(curpos,0); curpos += 3; ToUINT32(curpos,SLPPidGet()); curpos += 4; } /*--------------------------*/ /* Call the RqstRply engine */ /*--------------------------*/ sock = NetworkConnectToSA(handle, handle->params.reg.scopelist, handle->params.reg.scopelistlen, &peeraddr); if(sock >= 0) { result = NetworkRqstRply(sock, &peeraddr, handle->langtag, extoffset, buf, SLP_FUNCT_SRVREG, bufsize, CallbackSrvReg, handle); if (result) { NetworkDisconnectSA(handle); } } else { result = SLP_NETWORK_INIT_FAILED; } FINISHED: if(buf) xfree(buf); #ifdef ENABLE_SLPv2_SECURITY if(urlauth) xfree(urlauth); if(attrauth) xfree(attrauth); #endif return result; } #ifdef ENABLE_ASYNC_API /*-------------------------------------------------------------------------*/ SLPError AsyncProcessSrvReg(PSLPHandleInfo handle) /*-------------------------------------------------------------------------*/ { SLPError result = ProcessSrvReg(handle); xfree((void*)handle->params.reg.url); xfree((void*)handle->params.reg.srvtype); xfree((void*)handle->params.reg.scopelist); xfree((void*)handle->params.reg.attrlist); handle->inUse = SLP_FALSE; return result; } #endif /*=========================================================================*/ SLPError SLPAPI SLPReg(SLPHandle hSLP, const char *srvUrl, const unsigned short lifetime, const char *srvType, const char *attrList, SLPBoolean fresh, SLPRegReport callback, void *cookie) /* */ /* See slplib.h for detailed documentation */ /*=========================================================================*/ { PSLPHandleInfo handle = 0; SLPError result = SLP_OK; SLPSrvURL* parsedurl = 0; /*------------------------------*/ /* check for invalid parameters */ /*------------------------------*/ if(hSLP == 0 || *(unsigned int*)hSLP != SLP_HANDLE_SIG || srvUrl == 0 || *srvUrl == 0 || /* srvUrl can't be empty string */ lifetime == 0 || /* lifetime can not be zero */ attrList == 0 || callback == 0) { return SLP_PARAMETER_BAD; } /*---------------------------------------------*/ /* We don't handle non-fresh registrations */ /*---------------------------------------------*/ if(fresh == SLP_FALSE) { return SLP_NOT_IMPLEMENTED; } /*-----------------------------------------*/ /* cast the SLPHandle into a SLPHandleInfo */ /*-----------------------------------------*/ handle = (PSLPHandleInfo)hSLP; /*-----------------------------------------*/ /* Check to see if the handle is in use */ /*-----------------------------------------*/ if(handle->inUse == SLP_TRUE) { return SLP_HANDLE_IN_USE; } handle->inUse = SLP_TRUE; /*------------------*/ /* Parse the srvurl */ /*------------------*/ result = SLPParseSrvURL(srvUrl,&parsedurl); if(result) { if(result == SLP_PARSE_ERROR) { result = SLP_INVALID_REGISTRATION; } if(parsedurl) SLPFree(parsedurl); handle->inUse = SLP_FALSE; return result; } /*-------------------------------------------*/ /* Set the handle up to reference parameters */ /*-------------------------------------------*/ handle->params.reg.fresh = fresh; handle->params.reg.lifetime = lifetime; handle->params.reg.urllen = strlen(srvUrl); handle->params.reg.url = srvUrl; handle->params.reg.srvtype = parsedurl->s_pcSrvType; handle->params.reg.srvtypelen = strlen(handle->params.reg.srvtype); handle->params.reg.scopelist = SLPGetProperty("net.slp.useScopes"); if(handle->params.reg.scopelist) { handle->params.reg.scopelistlen = strlen(handle->params.reg.scopelist); } handle->params.reg.attrlistlen = strlen(attrList); handle->params.reg.attrlist = attrList; handle->params.reg.callback = callback; handle->params.reg.cookie = cookie; #ifdef ENABLE_ASYNC_API /*----------------------------------------------*/ /* Check to see if we should be async or sync */ /*----------------------------------------------*/ if(handle->isAsync) { /* Copy all of the referenced parameters before making thread */ handle->params.reg.url = xstrdup(handle->params.reg.url); handle->params.reg.srvtype = xstrdup(handle->params.reg.url); handle->params.reg.scopelist = xstrdup(handle->params.reg.scopelist); handle->params.reg.attrlist = xstrdup(handle->params.reg.attrlist); /* make sure that the strdups did not fail */ if(handle->params.reg.url && handle->params.reg.srvtype && handle->params.reg.scopelist && handle->params.reg.attrlist) { result = ThreadCreate((ThreadStartProc)AsyncProcessSrvReg,handle); } else { result = SLP_MEMORY_ALLOC_FAILED; } if(result) { if(handle->params.reg.url) xfree((void*)handle->params.reg.url); if(handle->params.reg.srvtype) xfree((void*)handle->params.reg.srvtype); if(handle->params.reg.scopelist) xfree((void*)handle->params.reg.scopelist); if(handle->params.reg.attrlist) xfree((void*)handle->params.reg.attrlist); handle->inUse = SLP_FALSE; } } else #endif //ffdef ENABLE_ASYNC_API { result = ProcessSrvReg(handle); handle->inUse = SLP_FALSE; } if(parsedurl) SLPFree(parsedurl); return result; } openslp-1.2.1/libslp/libslp_handle.c0000644033442200000310000003673510207404660017326 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: slplib_handle.h */ /* */ /* Abstract: Implementation for SLPOpen() and SLPClose() functions */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slp.h" #include "libslp.h" /*=========================================================================*/ int G_OpenSLPHandleCount = 0; /* Global variable that keeps track of the number of handles that are open */ /*=========================================================================*/ /*=========================================================================*/ SLPError SLPAPI SLPOpen(const char *pcLang, SLPBoolean isAsync, SLPHandle *phSLP) /* */ /* Returns a SLPHandle handle in the phSLP parameter for the language */ /* locale passed in as the pcLang parameter. The client indicates if */ /* operations on the handle are to be synchronous or asynchronous */ /* through the isAsync parameter. The handle encapsulates the language */ /* locale for SLP requests issued through the handle, and any other */ /* resources required by the implementation. However, SLP properties */ /* are not encapsulated by the handle; they are global. The return */ /* value of the function is an SLPError code indicating the status of */ /* the operation. Upon failure, the phSLP parameter is NULL. */ /* */ /* An SLPHandle can only be used for one SLP API operation at a time. */ /* If the original operation was started asynchronously, any attempt to */ /* start an additional operation on the handle while the original */ /* operation is pending results in the return of an SLP_HANDLE_IN_USE */ /* error from the API function. The SLPClose() API function terminates */ /* any outstanding calls on the handle. If an implementation is unable */ /* to support a asynchronous( resp. synchronous) operation, due to */ /* memory constraints or lack of threading support, the */ /* SLP_NOT_IMPLEMENTED flag may be returned when the isAsync flag is */ /* SLP_TRUE (resp. SLP_FALSE). */ /* */ /* pcLang A pointer to an array of characters containing the RFC 1766 */ /* Language Tag RFC 1766 for the natural language locale of */ /* requests and registrations issued on the handle. Pass in NULL */ /* or the empty string, "" to use the default locale */ /* */ /* isAsync An SLPBoolean indicating whether the SLPHandle should be opened*/ /* for asynchronous operation or not. */ /* */ /* phSLP A pointer to an SLPHandle, in which the open SLPHandle is */ /* returned. If an error occurs, the value upon return is NULL. */ /* */ /* Returns SLPError code */ /*=========================================================================*/ { SLPError result = SLP_OK; PSLPHandleInfo handle = 0; /*------------------------------*/ /* check for invalid parameters */ /*------------------------------*/ if(phSLP == 0) { result = SLP_PARAMETER_BAD; goto FINISHED; } /* assign out param to zero in just for paranoia */ *phSLP = 0; #ifndef ENABLE_ASYNC_API if(isAsync == SLP_TRUE) { result = SLP_NOT_IMPLEMENTED; goto FINISHED; } /*-------------------------------------------------------*/ /* TODO: remove the #else when we implement async calls */ /*-------------------------------------------------------*/ #else if(isAsync == SLP_TRUE) { result = SLP_NOT_IMPLEMENTED; goto FINISHED; } #endif /*------------------------------------*/ /* allocate a SLPHandleInfo structure */ /*------------------------------------*/ handle = (PSLPHandleInfo)xmalloc(sizeof(SLPHandleInfo)); if(handle == 0) { result = SLP_PARAMETER_BAD; goto FINISHED; } memset(handle,0,sizeof(SLPHandleInfo)); /*-------------------------------*/ /* Set the language tag */ /*-------------------------------*/ if(pcLang && *pcLang) { handle->langtaglen = strlen(pcLang); handle->langtag = (char*)xmalloc(handle->langtaglen + 1); if(handle->langtag == 0) { xfree(handle); result = SLP_PARAMETER_BAD; goto FINISHED; } memcpy(handle->langtag,pcLang,handle->langtaglen + 1); } else { handle->langtaglen = strlen(SLPGetProperty("net.slp.locale")); handle->langtag = (char*)xmalloc(handle->langtaglen + 1); if(handle->langtag == 0) { xfree(handle); result = SLP_PARAMETER_BAD; goto FINISHED; } memcpy(handle->langtag,SLPGetProperty("net.slp.locale"),handle->langtaglen + 1); } /*---------------------------------------------------------*/ /* Seed the XID generator if this is the first open handle */ /*---------------------------------------------------------*/ if(G_OpenSLPHandleCount == 0) { #ifdef _WIN32 WSADATA wsaData; WORD wVersionRequested = MAKEWORD(1,1); if(0 != WSAStartup(wVersionRequested, &wsaData)) { result = SLP_NETWORK_INIT_FAILED; goto FINISHED; } #endif #ifdef DEBUG xmalloc_init("/tmp/libslp_xmalloc.log",0); #endif SLPXidSeed(); } #ifdef ENABLE_SLPv2_SECURITY handle->hspi = SLPSpiOpen(LIBSLP_SPIFILE,0); #endif handle->sig = SLP_HANDLE_SIG; handle->inUse = SLP_FALSE; handle->isAsync = isAsync; handle->dasock = -1; handle->sasock = -1; #ifndef UNICAST_NOT_SUPPORTED handle->unicastsock = -1; #endif G_OpenSLPHandleCount ++; *phSLP = (SLPHandle)handle; FINISHED: if(result) { *phSLP = 0; } return result; } /*=========================================================================*/ void SLPAPI SLPClose(SLPHandle hSLP) /* */ /* Frees all resources associated with the handle. If the handle was */ /* invalid, the function returns silently. Any outstanding synchronous */ /* or asynchronous operations are cancelled so their callback functions */ /* will not be called any further. */ /* */ /* SLPHandle A SLPHandle handle returned from a call to SLPOpen(). */ /*=========================================================================*/ { PSLPHandleInfo handle; /*------------------------------*/ /* check for invalid parameters */ /*------------------------------*/ if(hSLP == 0 || *(unsigned int*)hSLP != SLP_HANDLE_SIG) { return; } handle = (PSLPHandleInfo)hSLP; if(handle->isAsync) { /* TODO: stop the usage of this handle (kill threads, etc) */ } if(handle->langtag) { xfree(handle->langtag); } if(handle->dasock >=0) { #ifdef _WIN32 closesocket(handle->dasock); #else close(handle->dasock); #endif } if(handle->dascope) { xfree(handle->dascope); } if(handle->sasock >=0) { #ifdef _WIN32 closesocket(handle->sasock); #else close(handle->sasock); #endif } if(handle->sascope) { xfree(handle->sascope); } #ifdef ENABLE_SLPv2_SECURITY if(handle->hspi) SLPSpiClose(handle->hspi); #endif handle->sig = 0; /* If they use the handle again, it won't be valid */ xfree(hSLP); G_OpenSLPHandleCount --; #if DEBUG /* Free additional resources if this is the last handle open */ if(G_OpenSLPHandleCount <= 0) { G_OpenSLPHandleCount = 0; SLPPropertyFreeAll(); KnownDAFreeAll(); xmalloc_deinit(); } #endif } #ifndef MI_NOT_SUPPORTED /*=========================================================================*/ SLPError SLPAssociateIFList( SLPHandle hSLP, const char* McastIFList) /* */ /* Associates a list of interfaces McastIFList on which multicast needs to */ /* be done with a particular SLPHandle hSLP. McastIFList is a comma */ /* separated list of host interface IP addresses. */ /* */ /* hSLP The SLPHandle with which the interface list is to */ /* be associated with. */ /* */ /* McastIFList A comma separated list of host interface IP */ /* addresses on which multicast needs to be done. */ /* */ /* Returns SLPError code */ /*=========================================================================*/ { PSLPHandleInfo handle; /*------------------------------*/ /* check for invalid parameters */ /*------------------------------*/ if(hSLP == 0 || *(unsigned int*)hSLP != SLP_HANDLE_SIG || McastIFList == 0 || *McastIFList == 0) /* interface list can't be empty string */ { return SLP_PARAMETER_BAD; } handle = (PSLPHandleInfo)hSLP; #ifdef DEBUG fprintf(stderr, "SLPAssociateIFList(): McastIFList = %s\n", McastIFList); #endif handle->McastIFList = McastIFList; return SLP_OK; } #endif /* MI_NOT_SUPPORTED */ #ifndef UNICAST_NOT_SUPPORTED /*=========================================================================*/ SLPError SLPAssociateIP( SLPHandle hSLP, const char* unicast_ip) /* */ /* Associates an IP address unicast_ip with a particular SLPHandle hSLP. */ /* unicast_ip is the IP address of the SA/DA from which service is */ /* requested. */ /* */ /* hSLP The SLPHandle with which the unicast_ip address is */ /* to be associated with. */ /* */ /* unicast_ip IP address of the SA/DA from which service is */ /* requested. */ /* */ /* Returns SLPError code */ /*=========================================================================*/ { PSLPHandleInfo handle; /*------------------------------*/ /* check for invalid parameters */ /*------------------------------*/ if(hSLP == 0 || *(unsigned int*)hSLP != SLP_HANDLE_SIG || unicast_ip == 0 || *unicast_ip == 0) /* unicast address not specified */ { return SLP_PARAMETER_BAD; } handle = (PSLPHandleInfo)hSLP; #ifdef DEBUG fprintf(stderr, "SLPAssociateIP(): unicast_ip = %s\n", unicast_ip); #endif handle->dounicast = 1; handle->unicastaddr.sin_family = AF_INET; if (inet_aton(unicast_ip, ((struct in_addr *)(&handle->unicastaddr.sin_addr))) == 0 ) { return SLP_PARAMETER_BAD; } handle->unicastaddr.sin_port = htons(SLP_RESERVED_PORT); return SLP_OK; } #endif openslp-1.2.1/libslp/Makefile.in0000644033442200000310000004307610211377467016434 0ustar rganesanfloppy# Makefile.in generated by automake 1.8.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # # Makefile.am # Automake File # The linked in library libcommonlibslp, which is from ../common # containing exacts functions which are required. # SOURCES = $(libslp_la_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_triplet = @host@ subdir = libslp DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(mkdir_p) CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libslp_la_DEPENDENCIES = ../common/libcommonlibslp.la am_libslp_la_OBJECTS = libslp_dereg.lo libslp_findscopes.lo \ libslp_reg.lo libslp_findsrvs.lo libslp_parse.lo \ libslp_property.lo libslp_handle.lo libslp_thread.lo \ libslp_network.lo libslp_findattrs.lo libslp_delattrs.lo \ libslp_findsrvtypes.lo libslp_knownda.lo libslp_la_OBJECTS = $(am_libslp_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/libslp_delattrs.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/libslp_dereg.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/libslp_findattrs.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/libslp_findscopes.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/libslp_findsrvs.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/libslp_findsrvtypes.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/libslp_handle.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/libslp_knownda.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/libslp_network.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/libslp_parse.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/libslp_property.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/libslp_reg.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/libslp_thread.Plo COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libslp_la_SOURCES) DIST_SOURCES = $(libslp_la_SOURCES) includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_ASYNC_API_FALSE = @ENABLE_ASYNC_API_FALSE@ ENABLE_ASYNC_API_TRUE = @ENABLE_ASYNC_API_TRUE@ ENABLE_PREDICATES_FALSE = @ENABLE_PREDICATES_FALSE@ ENABLE_PREDICATES_TRUE = @ENABLE_PREDICATES_TRUE@ ENABLE_SLPv1_FALSE = @ENABLE_SLPv1_FALSE@ ENABLE_SLPv1_TRUE = @ENABLE_SLPv1_TRUE@ ENABLE_SLPv2_SECURITY_FALSE = @ENABLE_SLPv2_SECURITY_FALSE@ ENABLE_SLPv2_SECURITY_TRUE = @ENABLE_SLPv2_SECURITY_TRUE@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ EXTRA_DIST = lib_LTLIBRARIES = libslp.la include_HEADERS = slp.h INCLUDES = -I$(top_srcdir)/common libslp_la_SOURCES = libslp_dereg.c \ libslp_findscopes.c \ libslp_reg.c \ libslp_findsrvs.c \ libslp_parse.c \ libslp_property.c \ libslp_handle.c \ libslp_thread.c \ libslp_network.c \ libslp_findattrs.c \ libslp_delattrs.c \ libslp_findsrvtypes.c \ libslp_knownda.c \ libslp.h #if you're building on Irix, exchange commented and uncommented lines #libslp_la_LIBADD = -L../common/libcommonlibslp libslp_la_LIBADD = ../common/libcommonlibslp.la libslp_la_LDFLAGS = -version-info 1:1:0 all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libslp/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu libslp/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" = "$$p" && dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libslp.la: $(libslp_la_OBJECTS) $(libslp_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libslp_la_LDFLAGS) $(libslp_la_OBJECTS) $(libslp_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libslp_delattrs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libslp_dereg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libslp_findattrs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libslp_findscopes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libslp_findsrvs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libslp_findsrvtypes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libslp_handle.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libslp_knownda.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libslp_network.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libslp_parse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libslp_property.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libslp_reg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libslp_thread.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-includeHEADERS install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-includeHEADERS install-info \ install-info-am install-libLTLIBRARIES install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-includeHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: openslp-1.2.1/libslp/libslp_delattrs.c0000644033442200000310000001001510202047457017676 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slplib_delattrs.c */ /* */ /* Abstract: Implementation for SLPDelAttrs() call. */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slp.h" #include "libslp.h" /*=========================================================================*/ SLPError SLPAPI SLPDelAttrs(SLPHandle hSLP, const char *pcURL, const char *pcAttrs, SLPRegReport callback, void *pvCookie) /*========================================================================*/ { return SLP_NOT_IMPLEMENTED; } openslp-1.2.1/libslp/libslp_knownda.c0000644033442200000310000010455110202047457017526 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol */ /* */ /* File: libslp_knownda.c */ /* */ /* Abstract: Internal implementation for generating unique XIDs. */ /* Provides functions that are supposed to generate 16-bit */ /* values that won't be generated for a long time in this */ /* process and hopefully won't be generated by other process */ /* for a long time. */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slp.h" #include "libslp.h" #include "slp_dhcp.h" #ifndef _WIN32 #define closesocket close #endif #include /*=========================================================================*/ SLPDatabase G_KnownDACache ={0,0,0}; /* The cache DAAdvert messages from known DAs. */ /*=========================================================================*/ /*=========================================================================*/ int G_KnownDAScopesLen = 0; char* G_KnownDAScopes = 0; /* Cached known scope list */ /*=========================================================================*/ /*=========================================================================*/ time_t G_KnownDALastCacheRefresh = 0; /* The time of the last Multicast for known DAs */ /*=========================================================================*/ /*-------------------------------------------------------------------------*/ SLPBoolean KnownDAListFind(int scopelistlen, const char* scopelist, int spistrlen, const char* spistr, struct in_addr* daaddr) /* Returns: non-zero on success, zero if DA can not be found */ /*-------------------------------------------------------------------------*/ { SLPDatabaseHandle dh; SLPDatabaseEntry* entry; int result = SLP_FALSE; dh = SLPDatabaseOpen(&G_KnownDACache); if(dh) { /*----------------------------------------*/ /* Check to see if there a matching entry */ /*----------------------------------------*/ while(1) { entry = SLPDatabaseEnum(dh); if(entry == NULL) break; /* Check scopes */ if(SLPSubsetStringList(entry->msg->body.daadvert.scopelistlen, entry->msg->body.daadvert.scopelist, scopelistlen, scopelist)) { #ifdef ENABLE_SLPv2_SECURITY if(SLPCompareString(entry->msg->body.daadvert.spilistlen, entry->msg->body.daadvert.spilist, spistrlen, spistr) == 0) #endif { memcpy(daaddr, &(entry->msg->peer.sin_addr), sizeof(struct in_addr)); result = SLP_TRUE; } } } SLPDatabaseClose(dh); } return result; } /*-------------------------------------------------------------------------*/ int KnownDAAdd(SLPMessage msg, SLPBuffer buf) /* Add an entry to the KnownDA cache */ /* */ /* Returns: zero on success, non-zero on error */ /*-------------------------------------------------------------------------*/ { SLPDatabaseHandle dh; SLPDatabaseEntry* entry; SLPDAAdvert* entrydaadvert; SLPDAAdvert* daadvert; int result; result = 0; dh = SLPDatabaseOpen(&G_KnownDACache); if(dh) { /* daadvert is the DAAdvert message being added */ daadvert = &(msg->body.daadvert); /*-----------------------------------------------------*/ /* Check to see if there is already an identical entry */ /*-----------------------------------------------------*/ while(1) { entry = SLPDatabaseEnum(dh); if(entry == NULL) break; /* entrydaadvert is the DAAdvert message from the database */ entrydaadvert = &(entry->msg->body.daadvert); /* Assume DAs are identical if their URLs match */ if(SLPCompareString(entrydaadvert->urllen, entrydaadvert->url, daadvert->urllen, daadvert->url) == 0) { SLPDatabaseRemove(dh,entry); break; } } /* Create and link in a new entry */ entry = SLPDatabaseEntryCreate(msg,buf); if(entry) { SLPDatabaseAdd(dh, entry); } else { result = SLP_MEMORY_ALLOC_FAILED; } SLPDatabaseClose(dh); } return result; } /*-------------------------------------------------------------------------*/ SLPBoolean KnownDADiscoveryCallback(SLPError errorcode, struct sockaddr_in* peerinfo, SLPBuffer rplybuf, void* cookie) /*-------------------------------------------------------------------------*/ { SLPMessage replymsg; SLPBuffer dupbuf; struct hostent* he; SLPSrvURL* srvurl; int* count; SLPBoolean result = SLP_TRUE; count = (int*)cookie; if(errorcode == 0) { dupbuf = SLPBufferDup(rplybuf); if(dupbuf) { replymsg = SLPMessageAlloc(); if(replymsg) { if(SLPMessageParseBuffer(peerinfo,dupbuf,replymsg) == 0 && replymsg->header.functionid == SLP_FUNCT_DAADVERT) { if(replymsg->body.daadvert.errorcode == 0) { /* TRICKY: NULL terminate the DA url */ ((char*)(replymsg->body.daadvert.url))[replymsg->body.daadvert.urllen] = 0; if(SLPParseSrvURL(replymsg->body.daadvert.url, &srvurl) == 0) { replymsg->peer.sin_addr.s_addr = 0; if(inet_aton(srvurl->s_pcHost, &(replymsg->peer.sin_addr)) == 0) { he = gethostbyname(srvurl->s_pcHost); if(he) { /* Reset the peer to the one in the URL */ replymsg->peer.sin_addr.s_addr = *((unsigned int*)(he->h_addr_list[0])); } } SLPFree(srvurl); if(replymsg->peer.sin_addr.s_addr) { (*count) += 1; KnownDAAdd(replymsg,dupbuf); if(replymsg->header.flags & SLP_FLAG_MCAST) { return SLP_FALSE; } return SLP_TRUE; } } } else if(replymsg->body.daadvert.errorcode == SLP_ERROR_INTERNAL_ERROR) { /* SLP_ERROR_INTERNAL_ERROR is a "end of stream" */ /* marker for looppack IPC */ result = SLP_FALSE; } } SLPMessageFree(replymsg); } SLPBufferFree(dupbuf); } } return result; } /*-------------------------------------------------------------------------*/ int KnownDADiscoveryRqstRply(int sock, struct sockaddr_in* peeraddr, int scopelistlen, #ifndef MI_NOT_SUPPORTED const char* scopelist, PSLPHandleInfo handle) #else const char* scopelist) #endif /* MI_NOT_SUPPORTED */ /* Returns: number of *new* DAEntries found */ /*-------------------------------------------------------------------------*/ { char* buf; char* curpos; int bufsize; int result = 0; /*-------------------------------------------------------------------*/ /* determine the size of the fixed portion of the SRVRQST */ /*-------------------------------------------------------------------*/ bufsize = 31; /* 2 bytes for the srvtype length */ /* 23 bytes for "service:directory-agent" srvtype */ /* 2 bytes for scopelistlen */ /* 2 bytes for predicatelen */ /* 2 bytes for sprstrlen */ bufsize += scopelistlen; /* TODO: make sure that we don't exceed the MTU */ buf = curpos = (char*)xmalloc(bufsize); if(buf == 0) { return 0; } memset(buf,0,bufsize); /*------------------------------------------------------------*/ /* Build a buffer containing the fixed portion of the SRVRQST */ /*------------------------------------------------------------*/ /* service type */ ToUINT16(curpos,23); curpos = curpos + 2; /* 23 is the length of SLP_DA_SERVICE_TYPE */ memcpy(curpos,SLP_DA_SERVICE_TYPE,23); curpos += 23; /* scope list */ ToUINT16(curpos,scopelistlen); curpos = curpos + 2; memcpy(curpos,scopelist,scopelistlen); /* predicate zero length */ /* spi list zero length */ if(sock == -1) { #ifndef MI_NOT_SUPPORTED NetworkMcastRqstRply(handle, #else NetworkMcastRqstRply("en", #endif /* MI_NOT_SUPPORTED */ buf, SLP_FUNCT_DASRVRQST, bufsize, KnownDADiscoveryCallback, &result); } else { NetworkRqstRply(sock, peeraddr, "en", 0, buf, SLP_FUNCT_DASRVRQST, bufsize, KnownDADiscoveryCallback, &result); } xfree(buf); return result; } /*-------------------------------------------------------------------------*/ #ifndef MI_NOT_SUPPORTED int KnownDADiscoverFromMulticast(int scopelistlen, const char* scopelist, PSLPHandleInfo handle) #else int KnownDADiscoverFromMulticast(int scopelistlen, const char* scopelist) #endif /* MI_NOT_SUPPORTED */ /* Locates DAs via multicast convergence */ /* */ /* Returns: number of *new* DAs found */ /*-------------------------------------------------------------------------*/ { int result = 0; if(SLPPropertyAsBoolean(SLPGetProperty("net.slp.activeDADetection")) && SLPPropertyAsInteger(SLPGetProperty("net.slp.DADiscoveryMaximumWait"))) { result = KnownDADiscoveryRqstRply(-1, NULL, scopelistlen, #ifndef MI_NOT_SUPPORTED scopelist, handle); #else scopelist); #endif /* MI_NOT_SUPPORTED */ } return result; } /*-------------------------------------------------------------------------*/ #ifndef MI_NOT_SUPPORTED int KnownDADiscoverFromDHCP(PSLPHandleInfo handle) #else int KnownDADiscoverFromDHCP() #endif /* MI_NOT_SUPPORTED */ /* Locates DAs via DHCP */ /* */ /* Returns: number of *new* DAs found via DHCP. */ /*-------------------------------------------------------------------------*/ { int count = 0; int scopelistlen; DHCPContext ctx; unsigned char *alp; struct timeval timeout; struct sockaddr_in peeraddr; unsigned char dhcpOpts[] = {TAG_SLP_SCOPE, TAG_SLP_DA}; *ctx.scopelist = 0; ctx.addrlistlen = 0; DHCPGetOptionInfo(dhcpOpts, sizeof(dhcpOpts), DHCPParseSLPTags, &ctx); if(!*ctx.scopelist) { const char *slp = SLPGetProperty("net.slp.useScopes"); if(slp) strcpy(ctx.scopelist, slp); } scopelistlen = strlen(ctx.scopelist); memset(&peeraddr,0,sizeof(peeraddr)); peeraddr.sin_family = AF_INET; peeraddr.sin_port = htons(SLP_RESERVED_PORT); timeout.tv_sec = SLPPropertyAsInteger(SLPGetProperty("net.slp.DADiscoveryMaximumWait")); timeout.tv_usec = (timeout.tv_sec % 1000) * 1000; timeout.tv_sec = timeout.tv_sec / 1000; alp = ctx.addrlist; while(ctx.addrlistlen >= 4) { memcpy(&peeraddr.sin_addr.s_addr, alp, 4); if(peeraddr.sin_addr.s_addr) { int sockfd; if((sockfd = SLPNetworkConnectStream(&peeraddr, &timeout)) >= 0) { count = KnownDADiscoveryRqstRply(sockfd, &peeraddr, scopelistlen, #ifndef MI_NOT_SUPPORTED ctx.scopelist, handle); #else ctx.scopelist); #endif /* MI_NOT_SUPPORTED */ closesocket(sockfd); if(scopelistlen && count) break; /* stop after the first set found */ } } ctx.addrlistlen -= 4; alp += 4; } return count; } /*-------------------------------------------------------------------------*/ int KnownDADiscoverFromProperties(int scopelistlen, #ifndef MI_NOT_SUPPORTED const char* scopelist, PSLPHandleInfo handle) #else const char* scopelist) #endif /* MI_NOT_SUPPORTED */ /* Locates DAs from the property list of DA hostnames */ /* */ /* Returns: number of *new* DAs found */ /*-------------------------------------------------------------------------*/ { char* temp; char* tempend; char* slider1; char* slider2; int sockfd; struct hostent* he; struct sockaddr_in peeraddr; struct timeval timeout; int result = 0; memset(&peeraddr,0,sizeof(peeraddr)); peeraddr.sin_family = AF_INET; peeraddr.sin_port = htons(SLP_RESERVED_PORT); slider1 = slider2 = temp = xstrdup(SLPGetProperty("net.slp.DAAddresses")); if(temp) { tempend = temp + strlen(temp); while(slider1 != tempend) { timeout.tv_sec = SLPPropertyAsInteger(SLPGetProperty("net.slp.DADiscoveryMaximumWait")); timeout.tv_usec = (timeout.tv_sec % 1000) * 1000; timeout.tv_sec = timeout.tv_sec / 1000; while(*slider2 && *slider2 != ',') slider2++; *slider2 = 0; peeraddr.sin_addr.s_addr = 0; if(inet_aton(slider1, &(peeraddr.sin_addr)) == 0) { he = gethostbyname(slider1); if(he) { peeraddr.sin_addr.s_addr = *((unsigned int*)(he->h_addr_list[0])); } } if (peeraddr.sin_addr.s_addr) { sockfd = SLPNetworkConnectStream(&peeraddr,&timeout); if(sockfd >= 0) { result = KnownDADiscoveryRqstRply(sockfd, &peeraddr, scopelistlen, #ifndef MI_NOT_SUPPORTED scopelist, handle); #else scopelist); #endif closesocket(sockfd); if(scopelistlen && result) { /* return if we found at least one DA */ break; } } } slider1 = slider2; slider2++; } xfree(temp); } return result; } /*-------------------------------------------------------------------------*/ #ifndef MI_NOT_SUPPORTED int KnownDADiscoverFromIPC(PSLPHandleInfo handle) #else int KnownDADiscoverFromIPC() #endif /* Ask Slpd if it knows about a DA */ /* */ /* Returns: number of *new* DAs found */ /*-------------------------------------------------------------------------*/ { struct sockaddr_in peeraddr; int sockfd; int result = 0; sockfd = NetworkConnectToSlpd(&peeraddr); if(sockfd >= 0) { #ifndef MI_NOT_SUPPORTED result = KnownDADiscoveryRqstRply(sockfd, &peeraddr, 0, "", handle); #else result = KnownDADiscoveryRqstRply(sockfd, &peeraddr, 0, ""); #endif closesocket(sockfd); } return result; } /*-------------------------------------------------------------------------*/ SLPBoolean KnownDAFromCache(int scopelistlen, const char* scopelist, int spistrlen, const char* spistr, #ifndef MI_NOT_SUPPORTED struct in_addr* daaddr, PSLPHandleInfo handle) #else struct in_addr* daaddr) #endif /* MI_NOT_SUPPORTED */ /* Ask Slpd if it knows about a DA */ /* */ /* Returns: non-zero on success, zero if DA can not be found */ /*-------------------------------------------------------------------------*/ { time_t curtime; if(KnownDAListFind(scopelistlen, scopelist, spistrlen, spistr, daaddr) == SLP_FALSE) { curtime = time(&curtime); if(G_KnownDALastCacheRefresh == 0 || curtime - G_KnownDALastCacheRefresh > MINIMUM_DISCOVERY_INTERVAL) { G_KnownDALastCacheRefresh = curtime; /* discover DAs */ #ifndef MI_NOT_SUPPORTED if(KnownDADiscoverFromIPC(handle) == 0) if(KnownDADiscoverFromProperties(scopelistlen, scopelist, handle) == 0) if(KnownDADiscoverFromDHCP(handle) == 0) KnownDADiscoverFromMulticast(scopelistlen, scopelist, handle); #else if(KnownDADiscoverFromIPC() == 0) if(KnownDADiscoverFromProperties(scopelistlen, scopelist) == 0) if(KnownDADiscoverFromDHCP() == 0) KnownDADiscoverFromMulticast(scopelistlen, scopelist); #endif } return KnownDAListFind(scopelistlen, scopelist, spistrlen, spistr, daaddr); } return SLP_TRUE; } /*=========================================================================*/ int KnownDAConnect(PSLPHandleInfo handle, int scopelistlen, const char* scopelist, struct sockaddr_in* peeraddr) /* Get a connected socket to a DA that supports the specified scope */ /* */ /* scopelistlen (IN) stringlen of the scopelist */ /* */ /* scopelist (IN) DA must support this scope */ /* */ /* peeraddr (OUT) the peer that was connected to */ /* */ /* */ /* returns: valid socket file descriptor or -1 if no DA is found */ /*=========================================================================*/ { struct timeval timeout; int sock = -1; int spistrlen = 0; char* spistr = 0; #ifdef ENABLE_SLPv2_SECURITY if(SLPPropertyAsBoolean(SLPGetProperty("net.slp.securityEnabled"))) { SLPSpiGetDefaultSPI(handle->hspi, SLPSPI_KEY_TYPE_PUBLIC, &spistrlen, &spistr); } #endif /* Set up connect timeout */ timeout.tv_sec = SLPPropertyAsInteger(SLPGetProperty("net.slp.DADiscoveryMaximumWait")); timeout.tv_usec = (timeout.tv_sec % 1000) * 1000; timeout.tv_sec = timeout.tv_sec / 1000; while(1) { memset(peeraddr,0,sizeof(peeraddr)); if(KnownDAFromCache(scopelistlen, scopelist, spistrlen, spistr, #ifndef MI_NOT_SUPPORTED &(peeraddr->sin_addr), handle) == 0) #else &(peeraddr->sin_addr)) == 0) #endif /* MI_NOT_SUPPORTED */ { break; } peeraddr->sin_family = PF_INET; peeraddr->sin_port = htons(SLP_RESERVED_PORT); sock = SLPNetworkConnectStream(peeraddr,&timeout); if(sock >= 0) { break; } KnownDABadDA(&(peeraddr->sin_addr)); } #ifdef ENABLE_SLPv2_SECURITY if(spistr) xfree(spistr); #endif return sock; } /*=========================================================================*/ void KnownDABadDA(struct in_addr* daaddr) /* Mark a KnownDA as a Bad DA. */ /* */ /* daaddr (IN) address of the bad DA */ /* */ /* Returns: none */ /*=========================================================================*/ { SLPDatabaseHandle dh; SLPDatabaseEntry* entry; dh = SLPDatabaseOpen(&G_KnownDACache); if(dh) { /*-----------------------------------*/ /* Check to find the requested entry */ /*-----------------------------------*/ while(1) { entry = SLPDatabaseEnum(dh); if(entry == NULL) break; /* Assume DAs are identical if their in_addrs match */ if(memcmp(daaddr,&(entry->msg->peer.sin_addr),sizeof(struct in_addr)) == 0) { SLPDatabaseRemove(dh,entry); break; } } SLPDatabaseClose(dh); } } /*=========================================================================*/ int KnownDAGetScopes(int* scopelistlen, #ifndef MI_NOT_SUPPORTED char** scopelist, PSLPHandleInfo handle) #else char** scopelist) #endif /* Gets a list of scopes from the known DA list */ /* */ /* scopelistlen (OUT) stringlen of the scopelist */ /* */ /* scopelist (OUT) NULL terminated list of scopes */ /* */ /* returns: zero on success, non-zero on failure */ /*=========================================================================*/ { int newlen; SLPDatabaseHandle dh; SLPDatabaseEntry* entry; /* discover all DAs */ #ifndef MI_NOT_SUPPORTED if(KnownDADiscoverFromIPC(handle) == 0) #else if(KnownDADiscoverFromIPC() == 0) #endif { #ifndef MI_NOT_SUPPORTED KnownDADiscoverFromDHCP(handle); KnownDADiscoverFromProperties(0,"", handle); KnownDADiscoverFromMulticast(0,"", handle); #else KnownDADiscoverFromDHCP(); KnownDADiscoverFromProperties(0,""); KnownDADiscoverFromMulticast(0,""); #endif } /* enumerate through all the knownda entries and generate a */ /* scopelist */ dh = SLPDatabaseOpen(&G_KnownDACache); if(dh) { /*-----------------------------------*/ /* Check to find the requested entry */ /*-----------------------------------*/ while(1) { entry = SLPDatabaseEnum(dh); if(entry == NULL) break; newlen = G_KnownDAScopesLen; while(SLPUnionStringList(G_KnownDAScopesLen, G_KnownDAScopes, entry->msg->body.daadvert.scopelistlen, entry->msg->body.daadvert.scopelist, &newlen, G_KnownDAScopes) < 0) { G_KnownDAScopes = xrealloc(G_KnownDAScopes,newlen); if(G_KnownDAScopes == 0) { G_KnownDAScopesLen = 0; break; } } G_KnownDAScopesLen = newlen; } SLPDatabaseClose(dh); } /* Explicitly add in the useScopes property */ newlen = G_KnownDAScopesLen; while(SLPUnionStringList(G_KnownDAScopesLen, G_KnownDAScopes, strlen(SLPPropertyGet("net.slp.useScopes")), SLPPropertyGet("net.slp.useScopes"), &newlen, G_KnownDAScopes) < 0) { G_KnownDAScopes = xrealloc(G_KnownDAScopes,newlen); if(G_KnownDAScopes == 0) { G_KnownDAScopesLen = 0; break; } } G_KnownDAScopesLen = newlen; if(G_KnownDAScopesLen) { *scopelist = xmalloc(G_KnownDAScopesLen + 1); if(*scopelist == 0) { return -1; } memcpy(*scopelist,G_KnownDAScopes, G_KnownDAScopesLen); (*scopelist)[G_KnownDAScopesLen] = 0; *scopelistlen = G_KnownDAScopesLen; } else { *scopelist = xstrdup(""); if(*scopelist == 0) { return -1; } *scopelistlen = 0; } return 0; } /*=========================================================================*/ void KnownDAProcessSrvRqst(PSLPHandleInfo handle) /* Process a SrvRqst for service:directory-agent */ /* */ /* handle (IN) the handle used to make the SrvRqst */ /* */ /* returns: none */ /*=========================================================================*/ { SLPDatabaseHandle dh; SLPDatabaseEntry* entry; SLPBoolean cb_result; char tmp; /* discover all DAs */ #ifndef MI_NOT_SUPPORTED if(KnownDADiscoverFromIPC(handle) == 0) #else if(KnownDADiscoverFromIPC() == 0) #endif { #ifndef MI_NOT_SUPPORTED KnownDADiscoverFromDHCP(handle); KnownDADiscoverFromProperties(0,"", handle); KnownDADiscoverFromMulticast(0,"", handle); #else KnownDADiscoverFromDHCP(); KnownDADiscoverFromProperties(0,""); KnownDADiscoverFromMulticast(0,""); #endif } /* Enumerate through knownDA database */ dh = SLPDatabaseOpen(&G_KnownDACache); if(dh) { /* Check to see if there a matching entry */ while(1) { entry = SLPDatabaseEnum(dh); /* is there anything left? */ if(entry == NULL) break; /* TRICKY temporary null termination of DA url */ tmp = entry->msg->body.daadvert.url[entry->msg->body.daadvert.urllen]; ((char*)(entry->msg->body.daadvert.url))[entry->msg->body.daadvert.urllen] = 0; /* Call the SrvURLCallback */ cb_result = handle->params.findsrvs.callback((SLPHandle)handle, entry->msg->body.daadvert.url, SLP_LIFETIME_MAXIMUM, SLP_OK, handle->params.findsrvs.cookie); /* TRICKY: undo temporary null termination of DA url */ ((char*)(entry->msg->body.daadvert.url))[entry->msg->body.daadvert.urllen] = tmp; /* does the caller want more? */ if(cb_result == SLP_FALSE) { break; } } SLPDatabaseClose(dh); } /* Make SLP_LAST_CALL */ handle->params.findsrvs.callback((SLPHandle)handle, NULL, 0, SLP_LAST_CALL, handle->params.findsrvs.cookie); } #ifdef DEBUG /*=========================================================================*/ void KnownDAFreeAll() /* Frees all (cached) resources associated with known DAs */ /* */ /* returns: none */ /*=========================================================================*/ { SLPDatabaseHandle dh; SLPDatabaseEntry* entry; dh = SLPDatabaseOpen(&G_KnownDACache); if(dh) { while(1) { entry = SLPDatabaseEnum(dh); if(entry == NULL) break; SLPDatabaseRemove(dh,entry); } SLPDatabaseClose(dh); } if(G_KnownDAScopes) xfree(G_KnownDAScopes); G_KnownDAScopesLen = 0; G_KnownDALastCacheRefresh = 0; } #endif openslp-1.2.1/libslp/libslp_dereg.c0000644033442200000310000003227010204452732017147 0ustar rganesanfloppy/***************************************************************************/ /* */ /* Project: OpenSLP - OpenSource implementation of Service Location */ /* Protocol Version 2 */ /* */ /* File: slplib_dereg.c */ /* */ /* Abstract: Implementation for SLPDeReg() call. */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Please submit patches to http://www.openslp.org */ /* */ /*-------------------------------------------------------------------------*/ /* */ /* Copyright (C) 2000 Caldera Systems, Inc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Caldera Systems nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA */ /* SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /***************************************************************************/ #include "slp.h" #include "libslp.h" /*-------------------------------------------------------------------------*/ SLPBoolean CallbackSrvDeReg(SLPError errorcode, struct sockaddr_in* peerinfo, SLPBuffer replybuf, void* cookie) /*-------------------------------------------------------------------------*/ { SLPMessage replymsg; PSLPHandleInfo handle = (PSLPHandleInfo) cookie; /*-------------------------------------------*/ /* Check the errorcode and bail if it is set */ /*-------------------------------------------*/ if(errorcode == 0) { /*--------------------*/ /* Parse the replybuf */ /*--------------------*/ replymsg = SLPMessageAlloc(); if(replymsg) { errorcode = SLPMessageParseBuffer(peerinfo,replybuf,replymsg); if(errorcode == 0) { if(replymsg->header.functionid == SLP_FUNCT_SRVACK) { errorcode = replymsg->body.srvack.errorcode * - 1; } } SLPMessageFree(replymsg); } else { errorcode = SLP_MEMORY_ALLOC_FAILED; } } /*----------------------------*/ /* Call the callback function */ /*----------------------------*/ handle->params.dereg.callback((SLPHandle)handle, errorcode, handle->params.dereg.cookie); return SLP_FALSE; } /*-------------------------------------------------------------------------*/ SLPError ProcessSrvDeReg(PSLPHandleInfo handle) /*-------------------------------------------------------------------------*/ { int sock; struct sockaddr_in peeraddr; int bufsize = 0; char* buf = 0; char* curpos = 0; SLPError result = 0; #ifdef ENABLE_SLPv2_SECURITY int urlauthlen = 0; unsigned char* urlauth = 0; if(SLPPropertyAsBoolean(SLPGetProperty("net.slp.securityEnabled"))) { result = SLPAuthSignUrl(handle->hspi, 0, 0, handle->params.dereg.urllen, handle->params.dereg.url, &urlauthlen, &urlauth); bufsize += urlauthlen; } #endif /*-------------------------------------------------------------------*/ /* determine the size of the fixed portion of the SRVDEREG */ /*-------------------------------------------------------------------*/ bufsize += handle->params.dereg.scopelistlen + 2; /* 2 bytes for len field*/ bufsize += handle->params.dereg.urllen + 6; /* 1 byte for reserved */ /* 2 bytes for lifetime */ /* 2 bytes for urllen */ /* 1 byte for authcount */ bufsize += 2; /* 2 bytes for taglistlen*/ /*--------------------------------------------*/ /* Allocate a buffer for the SRVDEREG message */ /*--------------------------------------------*/ buf = curpos = (char*)xmalloc(bufsize); if(buf == 0) { result = SLP_MEMORY_ALLOC_FAILED; goto FINISHED; } /*------------------------------------------------------------*/ /* Build a buffer containing the fixed portion of the SRVDEREG*/ /*------------------------------------------------------------*/ /* scope list */ ToUINT16(curpos,handle->params.dereg.scopelistlen); curpos = curpos + 2; memcpy(curpos, handle->params.dereg.scopelist, handle->params.dereg.scopelistlen); curpos = curpos + handle->params.dereg.scopelistlen; /* url-entry reserved */ *curpos = 0; curpos = curpos + 1; /* url-entry lifetime */ ToUINT16(curpos, 0); curpos = curpos + 2; /* url-entry urllen */ ToUINT16(curpos,handle->params.dereg.urllen); curpos = curpos + 2; /* url-entry url */ memcpy(curpos, handle->params.dereg.url, handle->params.dereg.urllen); curpos = curpos + handle->params.dereg.urllen; /* url-entry authcount */ #ifdef ENABLE_SLPv2_SECURITY if(urlauth) { /* authcount */ *(curpos) = 1; curpos = curpos + 1; /* authblock */ memcpy(curpos,urlauth,urlauthlen); curpos = curpos + urlauthlen; } else #endif { /* authcount */ *(curpos) = 0; curpos = curpos + 1; } /* tag list */ /* TODO: No tag list for now put in taglist stuff */ ToUINT16(curpos,0); /*--------------------------*/ /* Call the RqstRply engine */ /*--------------------------*/ sock = NetworkConnectToSA(handle, handle->params.dereg.scopelist, handle->params.dereg.scopelistlen, &peeraddr); if(sock >= 0) { result = NetworkRqstRply(sock, &peeraddr, handle->langtag, 0, buf, SLP_FUNCT_SRVDEREG, bufsize, CallbackSrvDeReg, handle); if (result) { NetworkDisconnectSA(handle); } } else { result = SLP_NETWORK_INIT_FAILED; goto FINISHED; } FINISHED: if(buf) xfree(buf); #ifdef ENABLE_SLPv2_SECURITY if(urlauth) xfree(urlauth); #endif return result; } #ifdef ENABLE_ASYNC_API /*-------------------------------------------------------------------------*/ SLPError AsyncProcessSrvDeReg(PSLPHandleInfo handle) /*-------------------------------------------------------------------------*/ { SLPError result = ProcessSrvDeReg(handle); xfree((void*)handle->params.dereg.scopelist); xfree((void*)handle->params.dereg.url); handle->inUse = SLP_FALSE; return result; } #endif /*=========================================================================*/ SLPError SLPAPI SLPDereg(SLPHandle hSLP, const char *srvUrl, SLPRegReport callback, void *cookie) /* */ /* See slplib.h for detailed documentation */ /*=========================================================================*/ { PSLPHandleInfo handle = 0; SLPError result = SLP_OK; SLPSrvURL* parsedurl = 0; /*------------------------------*/ /* check for invalid parameters */ /*------------------------------*/ if(hSLP == 0 || *(unsigned int*)hSLP != SLP_HANDLE_SIG || srvUrl == 0 || *srvUrl == 0 || /* url can't be empty string */ callback == 0) { return SLP_PARAMETER_BAD; } /*-----------------------------------------*/ /* cast the SLPHandle into a SLPHandleInfo */ /*-----------------------------------------*/ handle = (PSLPHandleInfo)hSLP; /*-----------------------------------------*/ /* Check to see if the handle is in use */ /*-----------------------------------------*/ if(handle->inUse == SLP_TRUE) { return SLP_HANDLE_IN_USE; } handle->inUse = SLP_TRUE; /*------------------*/ /* Parse the srvurl */ /*------------------*/ result = SLPParseSrvURL(srvUrl,&parsedurl); if(result) { if(result == SLP_PARSE_ERROR) { result = SLP_INVALID_REGISTRATION; } if(parsedurl) SLPFree(parsedurl); handle->inUse = SLP_FALSE; return result; } /*-------------------------------------------*/ /* Set the handle up to reference parameters */ /*-------------------------------------------*/ handle->params.dereg.scopelist = SLPGetProperty("net.slp.useScopes"); if(handle->params.dereg.scopelist) { handle->params.dereg.scopelistlen = strlen(handle->params.dereg.scopelist); } handle->params.dereg.urllen = strlen(srvUrl); handle->params.dereg.url = srvUrl; handle->params.dereg.callback = callback; handle->params.dereg.cookie = cookie; /*----------------------------------------------*/ /* Check to see if we should be async or sync */ /*----------------------------------------------*/ #ifdef ENABLE_ASYNC_API if(handle->isAsync) { /* COPY all the parameters */ handle->params.dereg.scopelist = xstrdup(handle->params.dereg.scopelist); handle->params.dereg.url = xstrdup(handle->params.dereg.url); /* make sure the strdups did not fail */ if(handle->params.dereg.scopelist && handle->params.dereg.url) { result = ThreadCreate((ThreadStartProc)AsyncProcessSrvDeReg,handle); } else { result = SLP_MEMORY_ALLOC_FAILED; } if(result) { if(handle->params.dereg.scopelist) xfree((void*)handle->params.dereg.scopelist); if(handle->params.dereg.url) xfree((void*)handle->params.dereg.url); handle->inUse = SLP_FALSE; } } else #endif /* ifdef ENABLE_ASYNC_API */ { /* REFERENCE all the parameters */ result = ProcessSrvDeReg(handle); handle->inUse = SLP_FALSE; } if(parsedurl) SLPFree(parsedurl); return result; }