AC_SUBST(SNMP_LIBS)
AC_SUBST(SNMP_INCLUDE)
-AC_MSG_CHECKING([for asn1.h])
+AC_MSG_CHECKING([for asn1.h,snmp.h,snmp_impl.h])
dnl #
-dnl # First, see if we can build it WITHOUT using any special includes
+dnl # First, see if we can build it WITHOUT using any special includes and in ucd-snmp
dnl #
AC_TRY_COMPILE([
#ifdef HAVE_SYS_TYPES_H
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <asn1.h>],
+#include <ucd-snmp/asn1.h>
+#include <ucd-snmp/snmp.h>
+#include <ucd-snmp/snmp_impl.h>],
[ int a = 1;],
- SNMP_INCLUDE="",
+ SNMP_INCLUDE="";ucdsnmp=yes,
SNMP_INCLUDE=)
dnl #
-dnl # If not, look for it in a number of directories.
+dnl # If not, look for it in a number of directories and in ucd-snmp.
dnl #
if test "x$SNMP_INCLUDE" = "x"; then
old_CFLAGS="$CFLAGS"
- for try in /usr/include/ucd-snmp /usr/local/include/ucd-snmp $snmp_include_dir; do
+ for try in /usr/include /usr/local/include $snmp_include_dir; do
CFLAGS="$old_CFLAGS -I$try"
AC_TRY_COMPILE([
#ifdef HAVE_SYS_TYPES_H
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <asn1.h>],
+#include <ucd-snmp/asn1.h>
+#include <ucd-snmp/snmp.h>
+#include <ucd-snmp/snmp_impl.h>],
[ int a = 1;],
- SNMP_INCLUDE="-I$try",
+ SNMP_INCLUDE="-I$try";ucdsnmp=yes,
SNMP_INCLUDE=)
if test "x$SNMP_INCLUDE" != "x"; then
break;
fi
if test "x$SNMP_INCLUDE" = "x"; then
- AC_MSG_RESULT(no)
-else
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_ASN1_H)
-
+ old_CFLAGS="$CFLAGS"
+ for try in /usr/include/ucd-snmp /usr/local/include/ucd-snmp $snmp_include_dir; do
+ CFLAGS="$old_CFLAGS -I$try"
dnl #
-dnl # Check for the rest of the SNMP headers.
+dnl # First, see if we can build it WITHOUT using any special includes and without ucd-snmp
dnl #
- old_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $SNMP_INCLUDE"
-
- AC_MSG_CHECKING(for snmp.h)
- AC_TRY_COMPILE([
+AC_TRY_COMPILE([
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_ASN1_H
#include <asn1.h>
-#endif
-#include <snmp.h>],
- [ int a = 1;],
- [AC_DEFINE(HAVE_SNMP_H) ac_cv_header_snmp_h=yes])
- if test "x$ac_cv_header_snmp_h" = "xyes"; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
+#include <snmp.h>
+#include <snmp_impl.h>],
+ [ int a = 1;],
+ SNMP_INCLUDE="",
+ SNMP_INCLUDE=)
+ if test "x$SNMP_INCLUDE" != "x"; then
+ break;
fi
+ done
+ CFLAGS="$old_CFLAGS"
+fi
- AC_MSG_CHECKING(for snmp_impl.h)
+dnl #
+dnl # If not, look for it in a number of directories and without ucd-snmp
+dnl #
+if test "x$SNMP_INCLUDE" = "x"; then
+ old_CFLAGS="$CFLAGS"
+ for try in /usr/include/ucd-snmp /usr/local/include/ucd-snmp $snmp_include_dir; do
+ CFLAGS="$old_CFLAGS -I$try"
AC_TRY_COMPILE([
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_ASN1_H
#include <asn1.h>
-#endif
-#ifdef HAVE_SNMP_H
#include <snmp.h>
-#endif
#include <snmp_impl.h>],
[ int a = 1;],
- [AC_DEFINE(HAVE_SNMP_IMPL_H) ac_cv_header_snmp_impl_h=yes])
- if test "x$ac_cv_header_snmp_h" = "xyes"; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
+ SNMP_INCLUDE="-I$try",
+ SNMP_INCLUDE=)
+ if test "x$SNMP_INCLUDE" != "x"; then
+ break;
fi
+ done
+ CFLAGS="$old_CFLAGS"
+fi
+if test "x$SNMP_INCLUDE" = "x"; then
+ AC_MSG_RESULT(no)
+else
+ if test "x$ucdsnmp" = "xyes"; then
+ AC_MSG_RESULT((ucd-snmp)yes)
+ AC_DEFINE(HAVE_UCD_SNMP_ASN1_SNMP_SNMPIMPL_H)
+ else
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_ASN1_SNMP_SNMPIMPL_H)
+ fi
dnl #
dnl # Now do the same thing, looking for the SNMP library directory
dnl #
-# From configure.in Revision: 1.165
+# From configure.in Revision: 1.166
RADIUSD_MAJOR_VERSION=0
RADIUSD_MINOR_VERSION=8-pre
RADIUSD_VERSION="${RADIUSD_MAJOR_VERSION}.${RADIUSD_MINOR_VERSION}"
-echo $ac_n "checking for asn1.h""... $ac_c" 1>&6
-echo "configure:7688: checking for asn1.h" >&5
+echo $ac_n "checking for asn1.h,snmp.h,snmp_impl.h""... $ac_c" 1>&6
+echo "configure:7688: checking for asn1.h,snmp.h,snmp_impl.h" >&5
cat > conftest.$ac_ext <<EOF
#line 7691 "configure"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <asn1.h>
+#include <ucd-snmp/asn1.h>
+#include <ucd-snmp/snmp.h>
+#include <ucd-snmp/snmp_impl.h>
int main() {
int a = 1;
; return 0; }
EOF
-if { (eval echo configure:7714: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7716: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
- SNMP_INCLUDE=""
+ SNMP_INCLUDE="";ucdsnmp=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
if test "x$SNMP_INCLUDE" = "x"; then
old_CFLAGS="$CFLAGS"
- for try in /usr/include/ucd-snmp /usr/local/include/ucd-snmp $snmp_include_dir; do
+ for try in /usr/include /usr/local/include $snmp_include_dir; do
CFLAGS="$old_CFLAGS -I$try"
cat > conftest.$ac_ext <<EOF
-#line 7730 "configure"
+#line 7732 "configure"
#include "confdefs.h"
#ifdef HAVE_SYS_TYPES_H
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <asn1.h>
+#include <ucd-snmp/asn1.h>
+#include <ucd-snmp/snmp.h>
+#include <ucd-snmp/snmp_impl.h>
int main() {
int a = 1;
; return 0; }
EOF
-if { (eval echo configure:7753: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7757: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
- SNMP_INCLUDE="-I$try"
+ SNMP_INCLUDE="-I$try";ucdsnmp=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
if test "x$SNMP_INCLUDE" = "x"; then
- echo "$ac_t""no" 1>&6
-else
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_ASN1_H 1
-EOF
-
-
old_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $SNMP_INCLUDE"
-
- echo $ac_n "checking for snmp.h""... $ac_c" 1>&6
-echo "configure:7783: checking for snmp.h" >&5
- cat > conftest.$ac_ext <<EOF
-#line 7785 "configure"
+ for try in /usr/include/ucd-snmp /usr/local/include/ucd-snmp $snmp_include_dir; do
+ CFLAGS="$old_CFLAGS -I$try"
+cat > conftest.$ac_ext <<EOF
+#line 7779 "configure"
#include "confdefs.h"
#ifdef HAVE_SYS_TYPES_H
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_ASN1_H
#include <asn1.h>
-#endif
#include <snmp.h>
+#include <snmp_impl.h>
int main() {
int a = 1;
; return 0; }
EOF
-if { (eval echo configure:7811: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7804: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
- cat >> confdefs.h <<\EOF
-#define HAVE_SNMP_H 1
-EOF
- ac_cv_header_snmp_h=yes
+ SNMP_INCLUDE=""
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ SNMP_INCLUDE=
fi
rm -f conftest*
- if test "x$ac_cv_header_snmp_h" = "xyes"; then
- echo "$ac_t""yes" 1>&6
- else
- echo "$ac_t""no" 1>&6
+ if test "x$SNMP_INCLUDE" != "x"; then
+ break;
fi
+ done
+ CFLAGS="$old_CFLAGS"
+fi
- echo $ac_n "checking for snmp_impl.h""... $ac_c" 1>&6
-echo "configure:7829: checking for snmp_impl.h" >&5
+if test "x$SNMP_INCLUDE" = "x"; then
+ old_CFLAGS="$CFLAGS"
+ for try in /usr/include/ucd-snmp /usr/local/include/ucd-snmp $snmp_include_dir; do
+ CFLAGS="$old_CFLAGS -I$try"
cat > conftest.$ac_ext <<EOF
-#line 7831 "configure"
+#line 7826 "configure"
#include "confdefs.h"
#ifdef HAVE_SYS_TYPES_H
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_ASN1_H
#include <asn1.h>
-#endif
-#ifdef HAVE_SNMP_H
#include <snmp.h>
-#endif
#include <snmp_impl.h>
int main() {
int a = 1;
; return 0; }
EOF
-if { (eval echo configure:7860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7851: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
- cat >> confdefs.h <<\EOF
-#define HAVE_SNMP_IMPL_H 1
-EOF
- ac_cv_header_snmp_impl_h=yes
+ SNMP_INCLUDE="-I$try"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ SNMP_INCLUDE=
fi
rm -f conftest*
- if test "x$ac_cv_header_snmp_h" = "xyes"; then
- echo "$ac_t""yes" 1>&6
- else
- echo "$ac_t""no" 1>&6
+ if test "x$SNMP_INCLUDE" != "x"; then
+ break;
fi
+ done
+ CFLAGS="$old_CFLAGS"
+fi
+
+if test "x$SNMP_INCLUDE" = "x"; then
+ echo "$ac_t""no" 1>&6
+else
+ if test "x$ucdsnmp" = "xyes"; then
+ echo "$ac_t""(ucd-snmp)yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_UCD_SNMP_ASN1_SNMP_SNMPIMPL_H 1
+EOF
+ else
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_ASN1_SNMP_SNMPIMPL_H 1
+EOF
+
+ fi
echo $ac_n "checking for snmp_build_var_op in -lsnmp""... $ac_c" 1>&6
-echo "configure:7878: checking for snmp_build_var_op in -lsnmp" >&5
+echo "configure:7885: checking for snmp_build_var_op in -lsnmp" >&5
old_LIBS="$LIBS"
LIBS="$old_LIBS -lsnmp"
cat > conftest.$ac_ext <<EOF
-#line 7883 "configure"
+#line 7890 "configure"
#include "confdefs.h"
extern char snmp_build_var_op();
int main() {
snmp_build_var_op()
; return 0; }
EOF
-if { (eval echo configure:7890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
SNMP_LIBS="-lsnmp"
else
for try in /usr/lib /usr/local/lib /usr/local/snmp/lib $snmp_lib_dir; do
LIBS="$old_LIBS -L$try -lsnmp"
cat > conftest.$ac_ext <<EOF
-#line 7905 "configure"
+#line 7912 "configure"
#include "confdefs.h"
extern char snmp_build_var_op();
int main() {
snmp_build_var_op()
; return 0; }
EOF
-if { (eval echo configure:7912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
SNMP_LIBS="-L$try -lsnmp"
else
fi
LIBS="$old_LIBS -L$try -lsnmp -lcrypto"
cat > conftest.$ac_ext <<EOF
-#line 7927 "configure"
+#line 7934 "configure"
#include "confdefs.h"
extern char snmp_build_var_op();
int main() {
snmp_build_var_op()
; return 0; }
EOF
-if { (eval echo configure:7934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
SNMP_LIBS="-L$try -lsnmp -lcrypto"
else
gethostbyaddrrstyle=""
echo $ac_n "checking gethostbyaddr_r() syntax""... $ac_c" 1>&6
-echo "configure:7972: checking gethostbyaddr_r() syntax" >&5
+echo "configure:7979: checking gethostbyaddr_r() syntax" >&5
cat > conftest.$ac_ext <<EOF
-#line 7974 "configure"
+#line 7981 "configure"
#include "confdefs.h"
#include <netdb.h>
int main() {
gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL)
; return 0; }
EOF
-if { (eval echo configure:7981: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7988: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 7996 "configure"
+#line 8003 "configure"
#include "confdefs.h"
#include <netdb.h>
int main() {
gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL, NULL)
; return 0; }
EOF
-if { (eval echo configure:8003: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8010: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 8019 "configure"
+#line 8026 "configure"
#include "confdefs.h"
#include <netdb.h>
int main() {
gethostbyaddr(NULL, 0, 0)
; return 0; }
EOF
-if { (eval echo configure:8026: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8033: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
* Version: $Id$
*/
-#if HAVE_ASN1_H
+#if HAVE_ASN1_SNMP_SNMPIMPL_H
#include <asn1.h>
-#elif HAVE_UCD_SNMP_ASN1_H
-#include <ucd-snmp/asn1.h>
-#endif
-
-#if HAVE_SNMP_H
#include <snmp.h>
-#elif HAVE_UCD_SNMP_SNMP_H
-#include <ucd-snmp/snmp.h>
-#endif
-
-#if HAVE_SNMP_IMPL_H
#include <snmp_impl.h>
-#elif HAVE_UCD_SNMP_SNMP_IMPL_H
+#elif HAVE_UCD_SNMP_ASN1_SNMP_SNMPIMPL_H
+#include <ucd-snmp/asn1.h>
+#include <ucd-snmp/snmp.h>
#include <ucd-snmp/snmp_impl.h>
#endif
int smux_max_failures;
} rad_snmp_t;
+/*
+ * Taken from RFC 2619 and RFC 2621
+ */
+typedef struct rad_snmp_client_entry_t {
+ int index;
+ /* IP address */
+ /* Client ID (string ) */
+ int access_requests;
+ int dup_access_requests;
+ int access_accepts;
+ int access_rejects;
+ int access_challenges;
+ int auth_malformed_requests;
+ int auth_bad_authenticators;
+ int auth_packets_dropped;
+ int auth_unknown_types;
+ int acct_packets_dropped;
+ int acct_requests;
+ int acct_dup_requests;
+ int acct_responses;
+ int acct_bad_authenticators;
+ int acct_malformed_requests;
+ int acct_no_records;
+ int acct_unknown_types;
+} rad_snmp_client_entry_t;
+
extern rad_snmp_t rad_snmp;
#endif /* _RADIUS_SNMP_H */