summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2004-01-23 16:22:49 +0000
committerharti <harti@FreeBSD.org>2004-01-23 16:22:49 +0000
commit9576ee9b99d65d320aece9a1f0a2e5b06a483ef1 (patch)
tree65a1aa99775b9ea5784447cd9891cbd7d34bf1f2 /usr.sbin
parent37783c5ffd462fc7902b9ce212d81a6146e8c77b (diff)
downloadFreeBSD-src-9576ee9b99d65d320aece9a1f0a2e5b06a483ef1.zip
FreeBSD-src-9576ee9b99d65d320aece9a1f0a2e5b06a483ef1.tar.gz
Create the OID and tree files while building the modules and the daemon
instead of creating them by hand and storing them in the CVS tree. Add gensnmptree to the bootstrap tools (it is used to generated these files). This simplifies the update procedure. Submitted by: ru
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bsnmpd/bsnmpd/Makefile31
-rw-r--r--usr.sbin/bsnmpd/bsnmpd/genfiles21
-rw-r--r--usr.sbin/bsnmpd/bsnmpd/oid.h35
-rw-r--r--usr.sbin/bsnmpd/bsnmpd/tree.c56
-rw-r--r--usr.sbin/bsnmpd/bsnmpd/tree.h61
-rw-r--r--usr.sbin/bsnmpd/modules/Makefile.inc12
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_mibII/Makefile2
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_netgraph/Makefile1
8 files changed, 32 insertions, 187 deletions
diff --git a/usr.sbin/bsnmpd/bsnmpd/Makefile b/usr.sbin/bsnmpd/bsnmpd/Makefile
index e9520b9..4bcc005 100644
--- a/usr.sbin/bsnmpd/bsnmpd/Makefile
+++ b/usr.sbin/bsnmpd/bsnmpd/Makefile
@@ -3,29 +3,36 @@
# Author: Harti Brandt <harti@freebsd.org>
CONTRIB=${.CURDIR}/../../../contrib/bsnmp
-.PATH: ${CONTRIB}/snmpd
+.PATH: ${CONTRIB}/snmpd
PROG= bsnmpd
-SRCS= oid.h tree.h tree.c main.c action.c config.c export.c trap.c \
- trans_udp.c trans_lsock.c
+SRCS= main.c action.c config.c export.c trap.c trans_udp.c trans_lsock.c
+SRCS+= oid.h tree.c tree.h
+XSYM= snmpMIB begemotSnmpdModuleTable begemotSnmpd begemotTrapSinkTable \
+ sysUpTime snmpTrapOID coldStart authenticationFailure \
+ begemotSnmpdTransUdp begemotSnmpdTransLsock begemotSnmpdLocalPortTable
+CLEANFILES= oid.h tree.c tree.h
MAN= bsnmpd.1 snmpmod.3
-WARNS= 6
+WARNS?= 6
-FILESGROUPS += MIBS DEFS
+FILESGROUPS= MIBS DEFS
MIBS= FOKUS-MIB.txt BEGEMOT-MIB.txt BEGEMOT-SNMPD.txt
MIBSDIR= ${SHAREDIR}/bsnmp/mibs
DEFS= tree.def
DEFSDIR= ${SHAREDIR}/bsnmp/defs
-INCSDIR= ${INCLUDEDIR}/bsnmp
-# snmpdmod is installed in lib/libbsnmp/modules
-# INCS= snmpmod.h
-CFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/../lib -I${.OBJDIR} \
- -I${CONTRIB}/lib -I${CONTRIB}/snmpd
-DPADD+= ${LIBISC} ${LIBBSNMP}
+CFLAGS+= -I${CONTRIB}/lib -I${CONTRIB}/snmpd -I.
+DPADD= ${LIBISC} ${LIBBSNMP}
LDADD= -lisc -lbsnmp
-LDFLAGS+= -export-dynamic
+LDFLAGS= -export-dynamic
+
+oid.h: tree.def
+ gensnmptree -e ${XSYM} < ${.ALLSRC} > ${.TARGET}
+
+.ORDER: tree.c tree.h
+tree.c tree.h: tree.def
+ gensnmptree -l < ${.ALLSRC}
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsnmpd/bsnmpd/genfiles b/usr.sbin/bsnmpd/bsnmpd/genfiles
deleted file mode 100644
index 1c5507a..0000000
--- a/usr.sbin/bsnmpd/bsnmpd/genfiles
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-# $FreeBSD$
-
-XSYM="snmpMIB begemotSnmpdModuleTable begemotSnmpd begemotTrapSinkTable \
- sysUpTime snmpTrapOID coldStart authenticationFailure \
- begemotSnmpdTransUdp begemotSnmpdTransLsock begemotSnmpdLocalPortTable"
-SRC=../../../contrib/bsnmp/snmpd
-
-gensnmptree -l <${SRC}/tree.def
-gensnmptree <${SRC}/tree.def -e ${XSYM} >oid.h
-
-for i in tree.h tree.c oid.h ; do
- ex $i <<'EOF'
-0a
-/* $XFreeBSD$ */
-/* generated file, don't edit - use ./genfiles */
-.
-1s/X//
-wq
-EOF
-done
diff --git a/usr.sbin/bsnmpd/bsnmpd/oid.h b/usr.sbin/bsnmpd/bsnmpd/oid.h
deleted file mode 100644
index c3e8f6b..0000000
--- a/usr.sbin/bsnmpd/bsnmpd/oid.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* $FreeBSD$ */
-/* generated file, don't edit - use ./genfiles */
-#define OID_snmpMIB 1
-#define OIDLEN_snmpMIB 7
-#define OIDX_snmpMIB { 7, { 1, 3, 6, 1, 6, 3, 1, } }
-#define OID_begemotSnmpdModuleTable 6
-#define OIDLEN_begemotSnmpdModuleTable 11
-#define OIDX_begemotSnmpdModuleTable { 11, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 6, } }
-#define OID_begemotSnmpd 1
-#define OIDLEN_begemotSnmpd 9
-#define OIDX_begemotSnmpd { 9, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, } }
-#define OID_begemotTrapSinkTable 2
-#define OIDLEN_begemotTrapSinkTable 11
-#define OIDX_begemotTrapSinkTable { 11, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 2, } }
-#define OID_sysUpTime 3
-#define OIDLEN_sysUpTime 8
-#define OIDX_sysUpTime { 8, { 1, 3, 6, 1, 2, 1, 1, 3, } }
-#define OID_snmpTrapOID 1
-#define OIDLEN_snmpTrapOID 10
-#define OIDX_snmpTrapOID { 10, { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, } }
-#define OID_coldStart 1
-#define OIDLEN_coldStart 10
-#define OIDX_coldStart { 10, { 1, 3, 6, 1, 6, 3, 1, 1, 5, 1, } }
-#define OID_authenticationFailure 5
-#define OIDLEN_authenticationFailure 10
-#define OIDX_authenticationFailure { 10, { 1, 3, 6, 1, 6, 3, 1, 1, 5, 5, } }
-#define OID_begemotSnmpdTransUdp 2
-#define OIDLEN_begemotSnmpdTransUdp 12
-#define OIDX_begemotSnmpdTransUdp { 12, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 10, 2, } }
-#define OID_begemotSnmpdTransLsock 3
-#define OIDLEN_begemotSnmpdTransLsock 12
-#define OIDX_begemotSnmpdTransLsock { 12, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 10, 3, } }
-#define OID_begemotSnmpdLocalPortTable 9
-#define OIDLEN_begemotSnmpdLocalPortTable 11
-#define OIDX_begemotSnmpdLocalPortTable { 11, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 9, } }
diff --git a/usr.sbin/bsnmpd/bsnmpd/tree.c b/usr.sbin/bsnmpd/bsnmpd/tree.c
deleted file mode 100644
index f03c058..0000000
--- a/usr.sbin/bsnmpd/bsnmpd/tree.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* $FreeBSD$ */
-/* generated file, don't edit - use ./genfiles */
-#include <sys/types.h>
-#include <stdio.h>
-#include "asn1.h"
-#include "snmp.h"
-#include "snmpagent.h"
-#include "tree.h"
-
-const struct snmp_node ctree[] = {
- {{ 8, { 1, 3, 6, 1, 2, 1, 1, 1, }}, "sysDescr", SNMP_NODE_LEAF, SNMP_SYNTAX_OCTETSTRING, op_system_group, 0, 0, NULL },
- {{ 8, { 1, 3, 6, 1, 2, 1, 1, 2, }}, "sysObjectId", SNMP_NODE_LEAF, SNMP_SYNTAX_OID, op_system_group, 0, 0, NULL },
- {{ 8, { 1, 3, 6, 1, 2, 1, 1, 3, }}, "sysUpTime", SNMP_NODE_LEAF, SNMP_SYNTAX_TIMETICKS, op_system_group, 0, 0, NULL },
- {{ 8, { 1, 3, 6, 1, 2, 1, 1, 4, }}, "sysContact", SNMP_NODE_LEAF, SNMP_SYNTAX_OCTETSTRING, op_system_group, 0|SNMP_NODE_CANSET, 0, NULL },
- {{ 8, { 1, 3, 6, 1, 2, 1, 1, 5, }}, "sysName", SNMP_NODE_LEAF, SNMP_SYNTAX_OCTETSTRING, op_system_group, 0|SNMP_NODE_CANSET, 0, NULL },
- {{ 8, { 1, 3, 6, 1, 2, 1, 1, 6, }}, "sysLocation", SNMP_NODE_LEAF, SNMP_SYNTAX_OCTETSTRING, op_system_group, 0|SNMP_NODE_CANSET, 0, NULL },
- {{ 8, { 1, 3, 6, 1, 2, 1, 1, 7, }}, "sysServices", SNMP_NODE_LEAF, SNMP_SYNTAX_INTEGER, op_system_group, 0, 0, NULL },
- {{ 8, { 1, 3, 6, 1, 2, 1, 1, 8, }}, "sysORLastChange", SNMP_NODE_LEAF, SNMP_SYNTAX_TIMETICKS, op_system_group, 0, 0, NULL },
- {{ 10, { 1, 3, 6, 1, 2, 1, 1, 9, 1, 2, }}, "sysORID", SNMP_NODE_COLUMN, SNMP_SYNTAX_OID, op_or_table, 0, 0x11, NULL },
- {{ 10, { 1, 3, 6, 1, 2, 1, 1, 9, 1, 3, }}, "sysORDescr", SNMP_NODE_COLUMN, SNMP_SYNTAX_OCTETSTRING, op_or_table, 0, 0x11, NULL },
- {{ 10, { 1, 3, 6, 1, 2, 1, 1, 9, 1, 4, }}, "sysORUpTime", SNMP_NODE_COLUMN, SNMP_SYNTAX_TIMETICKS, op_or_table, 0, 0x11, NULL },
- {{ 8, { 1, 3, 6, 1, 2, 1, 11, 1, }}, "snmpInPkts", SNMP_NODE_LEAF, SNMP_SYNTAX_COUNTER, op_snmp, 0, 0, NULL },
- {{ 8, { 1, 3, 6, 1, 2, 1, 11, 3, }}, "snmpInBadVersions", SNMP_NODE_LEAF, SNMP_SYNTAX_COUNTER, op_snmp, 0, 0, NULL },
- {{ 8, { 1, 3, 6, 1, 2, 1, 11, 4, }}, "snmpInBadCommunityNames", SNMP_NODE_LEAF, SNMP_SYNTAX_COUNTER, op_snmp, 0, 0, NULL },
- {{ 8, { 1, 3, 6, 1, 2, 1, 11, 5, }}, "snmpInBadCommunityUses", SNMP_NODE_LEAF, SNMP_SYNTAX_COUNTER, op_snmp, 0, 0, NULL },
- {{ 8, { 1, 3, 6, 1, 2, 1, 11, 6, }}, "snmpInASNParseErrs", SNMP_NODE_LEAF, SNMP_SYNTAX_COUNTER, op_snmp, 0, 0, NULL },
- {{ 8, { 1, 3, 6, 1, 2, 1, 11, 30, }}, "snmpEnableAuthenTraps", SNMP_NODE_LEAF, SNMP_SYNTAX_INTEGER, op_snmp, 0|SNMP_NODE_CANSET, 0, NULL },
- {{ 8, { 1, 3, 6, 1, 2, 1, 11, 31, }}, "snmpSilentDrops", SNMP_NODE_LEAF, SNMP_SYNTAX_COUNTER, op_snmp, 0, 0, NULL },
- {{ 8, { 1, 3, 6, 1, 2, 1, 11, 32, }}, "snmpProxyDrops", SNMP_NODE_LEAF, SNMP_SYNTAX_COUNTER, op_snmp, 0, 0, NULL },
- {{ 12, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 1, 1, }}, "begemotSnmpdTransmitBuffer", SNMP_NODE_LEAF, SNMP_SYNTAX_INTEGER, op_snmpd_config, 0|SNMP_NODE_CANSET, 0, NULL },
- {{ 12, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 1, 2, }}, "begemotSnmpdReceiveBuffer", SNMP_NODE_LEAF, SNMP_SYNTAX_INTEGER, op_snmpd_config, 0|SNMP_NODE_CANSET, 0, NULL },
- {{ 12, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 1, 3, }}, "begemotSnmpdCommunityDisable", SNMP_NODE_LEAF, SNMP_SYNTAX_INTEGER, op_snmpd_config, 0|SNMP_NODE_CANSET, 0, NULL },
- {{ 12, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 1, 4, }}, "begemotSnmpdTrap1Addr", SNMP_NODE_LEAF, SNMP_SYNTAX_IPADDRESS, op_snmpd_config, 0|SNMP_NODE_CANSET, 0, NULL },
- {{ 12, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 1, 5, }}, "begemotSnmpdVersionEnable", SNMP_NODE_LEAF, SNMP_SYNTAX_GAUGE, op_snmpd_config, 0|SNMP_NODE_CANSET, 0, NULL },
- {{ 13, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 2, 1, 3, }}, "begemotTrapSinkStatus", SNMP_NODE_COLUMN, SNMP_SYNTAX_INTEGER, op_trapsink, 0|SNMP_NODE_CANSET, 0x142, NULL },
- {{ 13, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 2, 1, 4, }}, "begemotTrapSinkComm", SNMP_NODE_COLUMN, SNMP_SYNTAX_OCTETSTRING, op_trapsink, 0|SNMP_NODE_CANSET, 0x142, NULL },
- {{ 13, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 2, 1, 5, }}, "begemotTrapSinkVersion", SNMP_NODE_COLUMN, SNMP_SYNTAX_INTEGER, op_trapsink, 0|SNMP_NODE_CANSET, 0x142, NULL },
- {{ 13, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 4, 1, 3, }}, "begemotSnmpdPortStatus", SNMP_NODE_COLUMN, SNMP_SYNTAX_INTEGER, op_snmp_port, 0|SNMP_NODE_CANSET, 0x142, NULL },
- {{ 13, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 5, 1, 3, }}, "begemotSnmpdCommunityString", SNMP_NODE_COLUMN, SNMP_SYNTAX_OCTETSTRING, op_community, 0|SNMP_NODE_CANSET, 0x622, NULL },
- {{ 13, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 5, 1, 4, }}, "begemotSnmpdCommunityDescr", SNMP_NODE_COLUMN, SNMP_SYNTAX_OCTETSTRING, op_community, 0, 0x622, NULL },
- {{ 13, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 6, 1, 2, }}, "begemotSnmpdModulePath", SNMP_NODE_COLUMN, SNMP_SYNTAX_OCTETSTRING, op_modules, 0|SNMP_NODE_CANSET, 0x21, NULL },
- {{ 13, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 6, 1, 3, }}, "begemotSnmpdModuleComment", SNMP_NODE_COLUMN, SNMP_SYNTAX_OCTETSTRING, op_modules, 0, 0x21, NULL },
- {{ 12, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 7, 1, }}, "begemotSnmpdStatsNoRxBufs", SNMP_NODE_LEAF, SNMP_SYNTAX_COUNTER, op_snmpd_stats, 0, 0, NULL },
- {{ 12, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 7, 2, }}, "begemotSnmpdStatsNoTxBufs", SNMP_NODE_LEAF, SNMP_SYNTAX_COUNTER, op_snmpd_stats, 0, 0, NULL },
- {{ 12, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 7, 3, }}, "begemotSnmpdStatsInTooLongPkts", SNMP_NODE_LEAF, SNMP_SYNTAX_COUNTER, op_snmpd_stats, 0, 0, NULL },
- {{ 12, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 7, 4, }}, "begemotSnmpdStatsInBadPduTypes", SNMP_NODE_LEAF, SNMP_SYNTAX_COUNTER, op_snmpd_stats, 0, 0, NULL },
- {{ 12, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 8, 1, }}, "begemotSnmpdDebugDumpPdus", SNMP_NODE_LEAF, SNMP_SYNTAX_INTEGER, op_debug, 0|SNMP_NODE_CANSET, 0, NULL },
- {{ 12, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 8, 2, }}, "begemotSnmpdDebugSnmpTrace", SNMP_NODE_LEAF, SNMP_SYNTAX_GAUGE, op_debug, 0|SNMP_NODE_CANSET, 0, NULL },
- {{ 12, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 8, 3, }}, "begemotSnmpdDebugSyslogPri", SNMP_NODE_LEAF, SNMP_SYNTAX_INTEGER, op_debug, 0|SNMP_NODE_CANSET, 0, NULL },
- {{ 13, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 9, 1, 2, }}, "begemotSnmpdLocalPortStatus", SNMP_NODE_COLUMN, SNMP_SYNTAX_INTEGER, op_lsock_port, 0|SNMP_NODE_CANSET, 0x21, NULL },
- {{ 13, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 9, 1, 3, }}, "begemotSnmpdLocalPortType", SNMP_NODE_COLUMN, SNMP_SYNTAX_INTEGER, op_lsock_port, 0|SNMP_NODE_CANSET, 0x21, NULL },
- {{ 14, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 10, 1, 1, 2, }}, "begemotSnmpdTransportStatus", SNMP_NODE_COLUMN, SNMP_SYNTAX_INTEGER, op_transport_table, 0, 0x21, NULL },
- {{ 14, { 1, 3, 6, 1, 4, 1, 12325, 1, 1, 1, 10, 1, 1, 3, }}, "begemotSnmpdTransportOid", SNMP_NODE_COLUMN, SNMP_SYNTAX_OID, op_transport_table, 0, 0x21, NULL },
- {{ 10, { 1, 3, 6, 1, 6, 3, 1, 1, 6, 1, }}, "snmpSetSerialNo", SNMP_NODE_LEAF, SNMP_SYNTAX_INTEGER, op_snmp_set, 0|SNMP_NODE_CANSET, 0, NULL },
-};
-
diff --git a/usr.sbin/bsnmpd/bsnmpd/tree.h b/usr.sbin/bsnmpd/bsnmpd/tree.h
deleted file mode 100644
index 3b2f29a..0000000
--- a/usr.sbin/bsnmpd/bsnmpd/tree.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* $FreeBSD$ */
-/* generated file, don't edit - use ./genfiles */
-int op_system_group(struct snmp_context *, struct snmp_value *, u_int, u_int, enum snmp_op);
-# define LEAF_sysDescr 1
-# define LEAF_sysObjectId 2
-# define LEAF_sysUpTime 3
-# define LEAF_sysContact 4
-# define LEAF_sysName 5
-# define LEAF_sysLocation 6
-# define LEAF_sysServices 7
-# define LEAF_sysORLastChange 8
-int op_or_table(struct snmp_context *, struct snmp_value *, u_int, u_int, enum snmp_op);
-# define LEAF_sysORID 2
-# define LEAF_sysORDescr 3
-# define LEAF_sysORUpTime 4
-int op_snmp(struct snmp_context *, struct snmp_value *, u_int, u_int, enum snmp_op);
-# define LEAF_snmpInPkts 1
-# define LEAF_snmpInBadVersions 3
-# define LEAF_snmpInBadCommunityNames 4
-# define LEAF_snmpInBadCommunityUses 5
-# define LEAF_snmpInASNParseErrs 6
-# define LEAF_snmpEnableAuthenTraps 30
-# define LEAF_snmpSilentDrops 31
-# define LEAF_snmpProxyDrops 32
-int op_snmpd_config(struct snmp_context *, struct snmp_value *, u_int, u_int, enum snmp_op);
-# define LEAF_begemotSnmpdTransmitBuffer 1
-# define LEAF_begemotSnmpdReceiveBuffer 2
-# define LEAF_begemotSnmpdCommunityDisable 3
-# define LEAF_begemotSnmpdTrap1Addr 4
-# define LEAF_begemotSnmpdVersionEnable 5
-int op_trapsink(struct snmp_context *, struct snmp_value *, u_int, u_int, enum snmp_op);
-# define LEAF_begemotTrapSinkStatus 3
-# define LEAF_begemotTrapSinkComm 4
-# define LEAF_begemotTrapSinkVersion 5
-int op_snmp_port(struct snmp_context *, struct snmp_value *, u_int, u_int, enum snmp_op);
-# define LEAF_begemotSnmpdPortStatus 3
-int op_community(struct snmp_context *, struct snmp_value *, u_int, u_int, enum snmp_op);
-# define LEAF_begemotSnmpdCommunityString 3
-# define LEAF_begemotSnmpdCommunityDescr 4
-int op_modules(struct snmp_context *, struct snmp_value *, u_int, u_int, enum snmp_op);
-# define LEAF_begemotSnmpdModulePath 2
-# define LEAF_begemotSnmpdModuleComment 3
-int op_snmpd_stats(struct snmp_context *, struct snmp_value *, u_int, u_int, enum snmp_op);
-# define LEAF_begemotSnmpdStatsNoRxBufs 1
-# define LEAF_begemotSnmpdStatsNoTxBufs 2
-# define LEAF_begemotSnmpdStatsInTooLongPkts 3
-# define LEAF_begemotSnmpdStatsInBadPduTypes 4
-int op_debug(struct snmp_context *, struct snmp_value *, u_int, u_int, enum snmp_op);
-# define LEAF_begemotSnmpdDebugDumpPdus 1
-# define LEAF_begemotSnmpdDebugSnmpTrace 2
-# define LEAF_begemotSnmpdDebugSyslogPri 3
-int op_lsock_port(struct snmp_context *, struct snmp_value *, u_int, u_int, enum snmp_op);
-# define LEAF_begemotSnmpdLocalPortStatus 2
-# define LEAF_begemotSnmpdLocalPortType 3
-int op_transport_table(struct snmp_context *, struct snmp_value *, u_int, u_int, enum snmp_op);
-# define LEAF_begemotSnmpdTransportStatus 2
-# define LEAF_begemotSnmpdTransportOid 3
-int op_snmp_set(struct snmp_context *, struct snmp_value *, u_int, u_int, enum snmp_op);
-# define LEAF_snmpSetSerialNo 1
-#define CTREE_SIZE 44
-extern const struct snmp_node ctree[];
diff --git a/usr.sbin/bsnmpd/modules/Makefile.inc b/usr.sbin/bsnmpd/modules/Makefile.inc
index aa49857..ebeb521 100644
--- a/usr.sbin/bsnmpd/modules/Makefile.inc
+++ b/usr.sbin/bsnmpd/modules/Makefile.inc
@@ -1,8 +1,16 @@
# $FreeBSD$
SHLIB_NAME= snmp_${MOD}.so.${SHLIB_MAJOR}
-SRCS+= ${MOD}_tree.c
-CFLAGS+= -I${CONTRIB}/lib -I${CONTRIB}/snmpd -I${.CURDIR}
+SRCS+= ${MOD}_oid.h ${MOD}_tree.c ${MOD}_tree.h
+CLEANFILES+= ${MOD}_oid.h ${MOD}_tree.c ${MOD}_tree.h
+CFLAGS+= -I${CONTRIB}/lib -I${CONTRIB}/snmpd -I.
+
+${MOD}_oid.h: ${MOD}_tree.def
+ gensnmptree -e ${XSYM} < ${.ALLSRC} > ${.TARGET}
+
+.ORDER: ${MOD}_tree.c ${MOD}_tree.h
+${MOD}_tree.c ${MOD}_tree.h: ${MOD}_tree.def
+ gensnmptree -l -p ${MOD}_ < ${.ALLSRC}
.if defined(DEFS)
FILESGROUPS+= DEFS
diff --git a/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile b/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile
index 7215880..c677c53 100644
--- a/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile
+++ b/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile
@@ -9,6 +9,8 @@ MOD= mibII
SRCS= mibII.c mibII_ifmib.c mibII_ip.c mibII_interfaces.c \
mibII_ipaddr.c mibII_ifstack.c mibII_rcvaddr.c \
mibII_nettomedia.c mibII_tcp.c mibII_udp.c mibII_route.c
+XSYM= ipAddrTable ifTable ifRcvAddressEntry ifMIB ipMIB tcpMIB udpMIB \
+ ipForward ifIndex linkDown linkUp
MAN= snmp_mibII.3
DEFS= ${MOD}_tree.def
diff --git a/usr.sbin/bsnmpd/modules/snmp_netgraph/Makefile b/usr.sbin/bsnmpd/modules/snmp_netgraph/Makefile
index 3760c5d..6c3cfb4 100644
--- a/usr.sbin/bsnmpd/modules/snmp_netgraph/Makefile
+++ b/usr.sbin/bsnmpd/modules/snmp_netgraph/Makefile
@@ -6,6 +6,7 @@ CONTRIB=${.CURDIR}/../../../../contrib/bsnmp
MOD= netgraph
SRCS= snmp_netgraph.c
+XSYM= begemotNg
MAN= snmp_netgraph.3
MIBS= BEGEMOT-NETGRAPH.txt
OpenPOWER on IntegriCloud