Added --with-vmps to configure options, so that you can build
authoraland <aland>
Tue, 12 Jun 2007 09:16:24 +0000 (09:16 +0000)
committeraland <aland>
Tue, 12 Jun 2007 09:16:24 +0000 (09:16 +0000)
without VMPS support.  It's enabled by default...

configure
configure.in
src/include/autoconf.h.in
src/lib/vqp.c
src/main/listen.c
src/main/radiusd.c
src/main/vmps.c

index e8bdf32..f66aa8c 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 1.241 .
+# From configure.in Revision: 1.243 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.60.
 #
@@ -1470,6 +1470,7 @@ Optional Packages:
   --with-ascend-binary    Include support for Ascend binary filter attributes (default=yes)
   --with-threads          Use threads, if available.  (default=yes)
   --with-snmp             Compile in SNMP support. (default=yes)
+  --with-vmps             Compile in VMPS support. (default=yes)
   --with-static-modules=QUOTED-MODULE-LIST
  --with-modules=QUOTED-MODULE-LIST
   --with-experimental-modules      Use experimental and unstable modules. (default=no)
@@ -5895,7 +5896,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 5898 "configure"' > conftest.$ac_ext
+  echo '#line 5899 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -7781,11 +7782,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$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 echo "\"\$as_me:7785: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:7788: \$? = $ac_status" >&5
+   echo "$as_me:7789: \$? = $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 other than the usual output.
@@ -8049,11 +8050,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8052: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8053: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:8056: \$? = $ac_status" >&5
+   echo "$as_me:8057: \$? = $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 other than the usual output.
@@ -8153,11 +8154,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8156: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8157: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:8160: \$? = $ac_status" >&5
+   echo "$as_me:8161: \$? = $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
@@ -10605,7 +10606,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 10608 "configure"
+#line 10609 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10705,7 +10706,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 10708 "configure"
+#line 10709 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -13077,11 +13078,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13080: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13081: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13084: \$? = $ac_status" >&5
+   echo "$as_me:13085: \$? = $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 other than the usual output.
@@ -13181,11 +13182,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13184: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13185: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13188: \$? = $ac_status" >&5
+   echo "$as_me:13189: \$? = $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
@@ -14751,11 +14752,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14754: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14755: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:14758: \$? = $ac_status" >&5
+   echo "$as_me:14759: \$? = $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 other than the usual output.
@@ -14855,11 +14856,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14858: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14859: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:14862: \$? = $ac_status" >&5
+   echo "$as_me:14863: \$? = $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
@@ -17089,11 +17090,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:17092: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:17093: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:17096: \$? = $ac_status" >&5
+   echo "$as_me:17097: \$? = $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 other than the usual output.
@@ -17357,11 +17358,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:17360: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:17361: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:17364: \$? = $ac_status" >&5
+   echo "$as_me:17365: \$? = $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 other than the usual output.
@@ -17461,11 +17462,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:17464: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:17465: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:17468: \$? = $ac_status" >&5
+   echo "$as_me:17469: \$? = $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
@@ -20389,6 +20390,28 @@ if test "${with_snmp+set}" = set; then
 fi
 
 
+WITH_VMPS=yes
+
+# Check whether --with-vmps was given.
+if test "${with_vmps+set}" = set; then
+  withval=$with_vmps;  case "$withval" in
+    yes)
+        ;;
+    *)
+       WITH_VMPS=no
+  esac
+
+fi
+
+if test "x$WITH_VMPS" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define WITH_VMPS
+_ACEOF
+
+fi
+
+
 STATIC_MODULES=
 
 # Check whether --with-static_modules was given.
@@ -22822,7 +22845,7 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#if HAVE_SYS_SOCKET_H
+#ifdef HAVE_SYS_SOCKET_H
 # include <sys/socket.h>
 # endif
 
@@ -26215,15 +26238,107 @@ gethostbyaddrrstyle=""
 { echo "$as_me:$LINENO: checking gethostbyaddr_r() syntax" >&5
 echo $ECHO_N "checking gethostbyaddr_r() syntax... $ECHO_C" >&6; }
 case "$host" in
-*-freebsd45.*|*-freebsd6.01)
+*-freebsd*)
+       { echo "$as_me:$LINENO: checking whether gethostbyaddr_r is declared" >&5
+echo $ECHO_N "checking whether gethostbyaddr_r is declared... $ECHO_C" >&6; }
+if test "${ac_cv_have_decl_gethostbyaddr_r+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+
+int
+main ()
+{
+#ifndef gethostbyaddr_r
+  char *p = (char *) gethostbyaddr_r;
+  return !p;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_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'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_have_decl_gethostbyaddr_r=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl_gethostbyaddr_r=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_gethostbyaddr_r" >&5
+echo "${ECHO_T}$ac_cv_have_decl_gethostbyaddr_r" >&6; }
+if test $ac_cv_have_decl_gethostbyaddr_r = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETHOSTBYADDR_R 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETHOSTBYADDR_R 0
+_ACEOF
+
+
 
 cat >>confdefs.h <<\_ACEOF
 #define GETHOSTBYADDRRSTYLE BSDSTYLE
 _ACEOF
 
-       gethostbyaddrrstyle=BSD
-       { echo "$as_me:$LINENO: WARNING: FreeBSD overridden to BSD-style" >&5
+               gethostbyaddrrstyle=BSD
+               { echo "$as_me:$LINENO: WARNING: FreeBSD overridden to BSD-style" >&5
 echo "$as_me: WARNING: FreeBSD overridden to BSD-style" >&2;}
+
+fi
+
+
        ;;
 esac
 if test "x$gethostbyaddrrstyle" = "x"; then
index de1c7ae..4754a7f 100644 (file)
@@ -236,6 +236,22 @@ AC_ARG_WITH(snmp,
   esac ]
 )
 
+dnl extra argument: --with-vmps
+WITH_VMPS=yes
+AC_ARG_WITH(vmps,
+[  --with-vmps             Compile in VMPS support. (default=yes)],
+[ case "$withval" in
+    yes)
+        ;;
+    *)
+       WITH_VMPS=no
+  esac ]
+)
+if test "x$WITH_VMPS" = "xyes"; then
+       AC_DEFINE(WITH_VMPS, [], [define if you want VMPS support])
+fi
+
+
 dnl #
 dnl #  Allow the user to specify a list of modules to be linked
 dnl #  statically to the server.
index 5386e59..c40dfda 100644 (file)
 /* Define to 1 if you have the `ctime_r' function. */
 #undef HAVE_CTIME_R
 
+/* Define to 1 if you have the declaration of `gethostbyaddr_r', and to 0 if
+   you don't. */
+#undef HAVE_DECL_GETHOSTBYADDR_R
+
 /* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
    */
 #undef HAVE_DIRENT_H
 /* define if you want udpfromto */
 #undef WITH_UDPFROMTO
 
+/* define if you want VMPS support */
+#undef WITH_VMPS
+
 /* Define to 1 if your processor stores words with the most significant byte
    first (like Motorola and SPARC, unlike Intel and VAX). */
 #undef WORDS_BIGENDIAN
index 3493b14..7601eb9 100644 (file)
@@ -26,6 +26,8 @@ RCSID("$Id$");
 #include       <freeradius-devel/libradius.h>
 #include       <freeradius-devel/vqp.h>
 
+#ifdef WITH_VMPS
+
 /*
  *  http://www.openbsd.org/cgi-bin/cvsweb/src/usr.sbin/tcpdump/print-vqp.c
  *
@@ -450,6 +452,12 @@ RADIUS_PACKET *vqp_recv(int sockfd)
        memcpy(&id, packet->data + 4, 4);
        packet->id = ntohl(id);
 
+       /*
+        *      FIXME: Create a fake "request authenticator", to
+        *      avoid duplicates?  Or is the VQP sequence number
+        *      adequate for this purpose?
+        */
+
        return packet;
 }
 
@@ -740,3 +748,4 @@ int vqp_encode(RADIUS_PACKET *packet, RADIUS_PACKET *original)
 
        return 0;
 }
+#endif
index 4eaac72..e668538 100644 (file)
@@ -1355,6 +1355,7 @@ static int radius_snmp_print(rad_listen_t *this, char *buffer, size_t bufsize)
 
 #endif
 
+#ifdef WITH_VMPS
 /*
  *     Check if an incoming request is "ok"
  *
@@ -1431,6 +1432,7 @@ static int vqp_socket_decode(rad_listen_t *listener, REQUEST *request)
 {
        return vqp_decode(request->packet);
 }
+#endif /* WITH_VMPS */
 
 
 static const rad_listen_master_t master_listen[RAD_LISTEN_MAX] = {
@@ -1456,10 +1458,14 @@ static const rad_listen_master_t master_listen[RAD_LISTEN_MAX] = {
          detail_recv, detail_send,
          detail_print, detail_encode, detail_decode },
 
+#ifdef WITH_VMPS
        /* vlan query protocol */
        { common_socket_parse, NULL,
          vqp_socket_recv, vqp_socket_send,
          socket_print, vqp_socket_encode, vqp_socket_decode },
+#else
+       { NULL, NULL, NULL, NULL, NULL, NULL, NULL},
+#endif
 
        { NULL, NULL, NULL, NULL, NULL, NULL, NULL}     /* RAD_LISTEN_SNMP */
 };
@@ -1669,7 +1675,9 @@ static const LRAD_NAME_NUMBER listen_compare[] = {
        { "auth",       RAD_LISTEN_AUTH },
        { "acct",       RAD_LISTEN_ACCT },
        { "detail",     RAD_LISTEN_DETAIL },
+#ifdef WITH_VMPS
        { "vmps",       RAD_LISTEN_VQP },
+#endif
        { NULL, 0 },
 };
 
@@ -1729,12 +1737,14 @@ int listen_init(const char *filename, rad_listen_t **head)
                radlog(L_INFO, "WARNING: The directive 'bind_adress' is deprecated, and will be removed in future versions of FreeRADIUS. Please edit the configuration files to use the directive 'listen'.");
 
        bind_it:
-               if (strcmp(progname, "vmpsd") != 0) {
-                       this = listen_alloc(RAD_LISTEN_AUTH);
-               } else {
+#ifdef WITH_VMPS
+               if (strcmp(progname, "vmpsd") == 0) {
                        this = listen_alloc(RAD_LISTEN_VQP);
                        if (!auth_port) auth_port = 1589;
-               }
+               } else
+#endif
+                       this = listen_alloc(RAD_LISTEN_AUTH);
+
                sock = this->data;
 
                sock->ipaddr = server_ipaddr;
@@ -1750,10 +1760,12 @@ int listen_init(const char *filename, rad_listen_t **head)
                *last = this;
                last = &(this->next);
 
+#ifdef WITH_VMPS
                /*
                 *      No acct for vmpsd
                 */
                if (strcmp(progname, "vmpsd") == 0) goto do_proxy;
+#endif
 
                /*
                 *      Open Accounting Socket.
index 5f19e98..5159a1b 100644 (file)
@@ -444,9 +444,11 @@ int main(int argc, char *argv[])
                        DEBUG("Listening on SNMP %s", buffer);
                        break;
 
+#ifdef WITH_VMPS
                case RAD_LISTEN_VQP:
                        DEBUG("Listening on vmps %s", buffer);
                        break;
+#endif
 
                default:
                        break;
index decde6f..b4a854c 100644 (file)
@@ -28,6 +28,7 @@ RCSID("$Id$")
 #include <freeradius-devel/modules.h>
 #include <freeradius-devel/rad_assert.h>
 
+#ifdef WITH_VMPS
 int vmps_process(REQUEST *request)
 {
        DEBUG2("Doing VMPS");
@@ -36,3 +37,4 @@ int vmps_process(REQUEST *request)
 
        request->reply->code = PW_AUTHENTICATION_ACK;
 }
+#endif