convert snmp FLAVOR to use net-snmp.

Maintainer timeout.  I do not see how this worked in the first place
without smux support.
This commit is contained in:
danh 2004-10-13 01:58:14 +00:00
parent f8aa183c80
commit 8b348582f0
7 changed files with 191 additions and 17 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.26 2004/01/02 06:36:32 david Exp $
# $OpenBSD: Makefile,v 1.27 2004/10/13 01:58:14 danh Exp $
# KAME Id: Makefile,v 1.5 1999/09/13 16:27:41 itojun Exp
# Originally by: peter.galbavy@knowledge.com
@ -39,7 +39,7 @@ FLAVORS= snmp
FLAVOR?=
.if ${FLAVOR:L:Msnmp}
LIB_DEPENDS= snmp.42::net/ucd-snmp
LIB_DEPENDS= netsnmp.6.2::net/net-snmp
CONFIGURE_ARGS+= --enable-snmp
.else
CONFIGURE_ARGS+= --disable-snmp

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-bgpd_bgp_snmp_c,v 1.1 2004/10/13 01:58:14 danh Exp $
--- bgpd/bgp_snmp.c.orig Wed Jun 19 04:05:38 2002
+++ bgpd/bgp_snmp.c Fri Oct 8 13:28:11 2004
@@ -21,9 +21,8 @@ Software Foundation, Inc., 59 Temple Pla
#include <zebra.h>
#ifdef HAVE_SNMP
-#include <asn1.h>
-#include <snmp.h>
-#include <snmp_impl.h>
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
#include "if.h"
#include "log.h"

View File

@ -1,6 +1,108 @@
$OpenBSD: patch-configure,v 1.5 2002/07/10 20:14:46 mickey Exp $
$OpenBSD: patch-configure,v 1.6 2004/10/13 01:58:14 danh Exp $
--- configure.orig Fri Jun 21 17:04:21 2002
+++ configure Wed Jul 10 13:11:33 2002
+++ configure Fri Oct 8 13:18:08 2004
@@ -6142,13 +6142,13 @@ if test "${enable_snmp}" = "yes";then
old_libs="${LIBS}"
LIBS="-L/usr/local/lib"
unset ac_cv_lib_snmp_asn_parse_int
- echo "$as_me:$LINENO: checking for asn_parse_int in -lsnmp" >&5
-echo $ECHO_N "checking for asn_parse_int in -lsnmp... $ECHO_C" >&6
+ echo "$as_me:$LINENO: checking for asn_parse_int in -lnetsnmp" >&5
+echo $ECHO_N "checking for asn_parse_int in -lnetsnmp... $ECHO_C" >&6
if test "${ac_cv_lib_snmp_asn_parse_int+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsnmp $LIBS"
+LIBS="-lnetsnmp -lm $LIBS"
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
@@ -6257,13 +6257,13 @@ if test $ac_cv_lib_crypto_main = yes; th
fi
if test "${NEED_CRYPTO}" = ""; then
- echo "$as_me:$LINENO: checking for asn_parse_int in -lsnmp" >&5
-echo $ECHO_N "checking for asn_parse_int in -lsnmp... $ECHO_C" >&6
+ echo "$as_me:$LINENO: checking for asn_parse_int in -lnetsnmp" >&5
+echo $ECHO_N "checking for asn_parse_int in -lnetsnmp... $ECHO_C" >&6
if test "${ac_cv_lib_snmp_asn_parse_int+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsnmp $LIBS"
+LIBS="-lnetsnmp -lm $LIBS"
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
@@ -6317,13 +6317,13 @@ if test $ac_cv_lib_snmp_asn_parse_int =
fi
else
- echo "$as_me:$LINENO: checking for asn_parse_int in -lsnmp" >&5
-echo $ECHO_N "checking for asn_parse_int in -lsnmp... $ECHO_C" >&6
+ echo "$as_me:$LINENO: checking for asn_parse_int in -lnetsnmp" >&5
+echo $ECHO_N "checking for asn_parse_int in -lnetsnmp... $ECHO_C" >&6
if test "${ac_cv_lib_snmp_asn_parse_int+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsnmp "-lcrypto" $LIBS"
+LIBS="-lnetsnmp -lcrypto -lm $LIBS"
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
@@ -6383,13 +6383,13 @@ fi
if test "${HAVE_SNMP}" = ""; then
old_libs="${LIBS}"
LIBS="-L/usr/local/lib"
- echo "$as_me:$LINENO: checking for asn_parse_int in -lsnmp" >&5
-echo $ECHO_N "checking for asn_parse_int in -lsnmp... $ECHO_C" >&6
+ echo "$as_me:$LINENO: checking for asn_parse_int in -lnetsnmp" >&5
+echo $ECHO_N "checking for asn_parse_int in -lnetsnmp... $ECHO_C" >&6
if test "${ac_cv_lib_snmp_asn_parse_int+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsnmp $LIBS"
+LIBS="-lnetsnmp -lm $LIBS"
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
@@ -6445,26 +6445,26 @@ fi
LIBS="${old_libs}"
fi
if test "${HAVE_SNMP}" = "yes"; then
- for ac_snmp in /usr/include/ucd-snmp/asn1.h /usr/local/include/ucd-snmp/asn1.h /dev/null
+ for ac_snmp in /usr/include/net-snmp/library/asn1.h /usr/local/include/net-snmp/library/asn1.h /dev/null
do
test -f "${ac_snmp}" && break
done
case ${ac_snmp} in
- /usr/include/ucd-snmp/*)
+ /usr/include/net-snmp/*)
cat >>confdefs.h <<\_ACEOF
#define HAVE_SNMP 1
_ACEOF
- CFLAGS="${CFLAGS} -I/usr/include/ucd-snmp"
- LIBS="${LIBS} -lsnmp"
+ CFLAGS="${CFLAGS} -I/usr/include/net-snmp"
+ LIBS="${LIBS} -lnetsnmp -lm"
;;
- /usr/local/include/ucd-snmp/*)
+ /usr/local/include/net-snmp/*)
cat >>confdefs.h <<\_ACEOF
#define HAVE_SNMP 1
_ACEOF
- CFLAGS="${CFLAGS} -I/usr/local/include/ucd-snmp"
- LIBS="${LIBS} -L/usr/local/lib -lsnmp"
+ CFLAGS="${CFLAGS} -I/usr/local/include"
+ LIBS="${LIBS} -L/usr/local/lib -lnetsnmp -lm"
;;
esac
if test "${NEED_CRYPTO}" = "yes"; then
@@ -7004,7 +7004,7 @@ fi
echo "$as_me:$LINENO: result: $ac_cv_htonl_works" >&5
echo "${ECHO_T}$ac_cv_htonl_works" >&6

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-lib_smux_c,v 1.1 2004/10/13 01:58:14 danh Exp $
--- lib/smux.c.orig Mon Oct 29 08:07:26 2001
+++ lib/smux.c Fri Oct 8 13:28:50 2004
@@ -23,9 +23,8 @@
#ifdef HAVE_SNMP
-#include <asn1.h>
-#include <snmp.h>
-#include <snmp_impl.h>
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
#include "smux.h"
#include "log.h"

View File

@ -1,7 +1,19 @@
$OpenBSD: patch-ospfd_ospf_snmp_c,v 1.1 2002/07/17 21:57:23 mickey Exp $
$OpenBSD: patch-ospfd_ospf_snmp_c,v 1.2 2004/10/13 01:58:14 danh Exp $
--- ospfd/ospf_snmp.c.orig Sat Jul 6 03:36:57 2002
+++ ospfd/ospf_snmp.c Wed Jul 17 17:50:35 2002
@@ -1115,6 +1115,9 @@ ospfAreaRangeLookup (struct variable *v,
+++ ospfd/ospf_snmp.c Fri Oct 8 13:28:56 2004
@@ -24,9 +24,8 @@
#include <zebra.h>
#ifdef HAVE_SNMP
-#include <asn1.h>
-#include <snmp.h>
-#include <snmp_impl.h>
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
#include "if.h"
#include "log.h"
@@ -1115,6 +1114,9 @@ ospfAreaRangeLookup (struct variable *v,
int len;
struct ospf_area *area;
struct ospf_area_range *range;
@ -11,7 +23,7 @@ $OpenBSD: patch-ospfd_ospf_snmp_c,v 1.1 2002/07/17 21:57:23 mickey Exp $
if (exact)
{
@@ -1136,8 +1139,9 @@ ospfAreaRangeLookup (struct variable *v,
@@ -1136,8 +1138,9 @@ ospfAreaRangeLookup (struct variable *v,
/* Lookup area range. */
oid2in_addr (offset, IN_ADDR_SIZE, range_net);
@ -22,7 +34,7 @@ $OpenBSD: patch-ospfd_ospf_snmp_c,v 1.1 2002/07/17 21:57:23 mickey Exp $
}
else
{
@@ -1201,7 +1205,6 @@ ospfAreaRangeEntry (struct variable *v,
@@ -1201,7 +1204,6 @@ ospfAreaRangeEntry (struct variable *v,
{
struct ospf_area_range *range;
struct in_addr area_id;
@ -30,7 +42,7 @@ $OpenBSD: patch-ospfd_ospf_snmp_c,v 1.1 2002/07/17 21:57:23 mickey Exp $
struct in_addr range_net;
struct in_addr mask;
@@ -1217,7 +1220,7 @@ ospfAreaRangeEntry (struct variable *v,
@@ -1217,7 +1219,7 @@ ospfAreaRangeEntry (struct variable *v,
return NULL;
/* Convert prefixlen to network mask format. */
@ -39,7 +51,7 @@ $OpenBSD: patch-ospfd_ospf_snmp_c,v 1.1 2002/07/17 21:57:23 mickey Exp $
/* Return the current value of the variable */
switch (v->magic)
@@ -1268,7 +1271,7 @@ ospfHostLookup (struct variable *v, oid
@@ -1268,7 +1270,7 @@ ospfHostLookup (struct variable *v, oid
oid2in_addr (name + v->namelen, IN_ADDR_SIZE, addr);
@ -48,7 +60,7 @@ $OpenBSD: patch-ospfd_ospf_snmp_c,v 1.1 2002/07/17 21:57:23 mickey Exp $
return nbr_nbma;
}
@@ -1653,7 +1656,7 @@ ospfIfEntry (struct variable *v, oid *na
@@ -1653,7 +1655,7 @@ ospfIfEntry (struct variable *v, oid *na
return SNMP_INTEGER (OSPF_POLL_INTERVAL_DEFAULT);
break;
case OSPFIFSTATE: /* 12 */
@ -57,7 +69,7 @@ $OpenBSD: patch-ospfd_ospf_snmp_c,v 1.1 2002/07/17 21:57:23 mickey Exp $
break;
case OSPFIFDESIGNATEDROUTER: /* 13 */
return SNMP_IPADDRESS (DR (oi));
@@ -1662,7 +1665,7 @@ ospfIfEntry (struct variable *v, oid *na
@@ -1662,7 +1664,7 @@ ospfIfEntry (struct variable *v, oid *na
return SNMP_IPADDRESS (BDR (oi));
break;
case OSPFIFEVENTS: /* 15 */
@ -66,7 +78,7 @@ $OpenBSD: patch-ospfd_ospf_snmp_c,v 1.1 2002/07/17 21:57:23 mickey Exp $
break;
case OSPFIFAUTHKEY: /* 16 */
*var_len = 0;
@@ -1993,10 +1996,10 @@ ospfVirtIfEntry (struct variable *v, oid
@@ -1993,10 +1995,10 @@ ospfVirtIfEntry (struct variable *v, oid
return SNMP_INTEGER (OSPF_IF_PARAM (oi, v_wait));
break;
case OSPFVIRTIFSTATE:
@ -79,7 +91,7 @@ $OpenBSD: patch-ospfd_ospf_snmp_c,v 1.1 2002/07/17 21:57:23 mickey Exp $
break;
case OSPFVIRTIFAUTHKEY:
*var_len = 0;
@@ -2031,7 +2034,7 @@ ospf_snmp_nbr_lookup (struct in_addr *nb
@@ -2031,7 +2033,7 @@ ospf_snmp_nbr_lookup (struct in_addr *nb
for (rn = route_top (oi->nbrs); rn; rn = route_next (rn))
if ((nbr = rn->info) != NULL
&& nbr != oi->nbr_self
@ -88,7 +100,7 @@ $OpenBSD: patch-ospfd_ospf_snmp_c,v 1.1 2002/07/17 21:57:23 mickey Exp $
&& nbr->src.s_addr != 0)
{
if (IPV4_ADDR_SAME (&nbr->src, nbr_addr))
@@ -2059,7 +2062,7 @@ ospf_snmp_nbr_lookup_next (struct in_add
@@ -2059,7 +2061,7 @@ ospf_snmp_nbr_lookup_next (struct in_add
for (rn = route_top (oi->nbrs); rn; rn = route_next (rn))
if ((nbr = rn->info) != NULL
&& nbr != oi->nbr_self
@ -97,7 +109,7 @@ $OpenBSD: patch-ospfd_ospf_snmp_c,v 1.1 2002/07/17 21:57:23 mickey Exp $
&& nbr->src.s_addr != 0)
{
if (first)
@@ -2173,7 +2176,7 @@ ospfNbrEntry (struct variable *v, oid *n
@@ -2173,7 +2175,7 @@ ospfNbrEntry (struct variable *v, oid *n
return SNMP_INTEGER (nbr->priority);
break;
case OSPFNBRSTATE:

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-ripd_rip_snmp_c,v 1.1 2004/10/13 01:58:14 danh Exp $
--- ripd/rip_snmp.c.orig Wed Aug 29 02:14:47 2001
+++ ripd/rip_snmp.c Fri Oct 8 13:29:02 2004
@@ -22,9 +22,8 @@
#include <zebra.h>
#ifdef HAVE_SNMP
-#include <asn1.h>
-#include <snmp.h>
-#include <snmp_impl.h>
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
#include "if.h"
#include "log.h"

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-zebra_zebra_snmp_c,v 1.1 2004/10/13 01:58:14 danh Exp $
--- zebra/zebra_snmp.c.orig Sun Aug 26 03:55:03 2001
+++ zebra/zebra_snmp.c Fri Oct 8 13:29:05 2004
@@ -22,9 +22,8 @@
#include <zebra.h>
#ifdef HAVE_SNMP
-#include <asn1.h>
-#include <snmp.h>
-#include <snmp_impl.h>
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
#include "if.h"
#include "log.h"