aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt
diff options
context:
space:
mode:
authorMarcus Alves Grando <mnag@FreeBSD.org>2005-09-27 17:32:27 +0000
committerMarcus Alves Grando <mnag@FreeBSD.org>2005-09-27 17:32:27 +0000
commitebb76bfcdb15b07bca51670523a860338bffb6ba (patch)
tree672ec623deebfa55641150f71febe01a50ece6ff /net-mgmt
parent0960e2f2f51bf727bac0930ff4b8ad2254e01ad4 (diff)
downloadports-ebb76bfcdb15b07bca51670523a860338bffb6ba.tar.gz
ports-ebb76bfcdb15b07bca51670523a860338bffb6ba.zip
Notes
Diffstat (limited to 'net-mgmt')
-rw-r--r--net-mgmt/Makefile1
-rw-r--r--net-mgmt/bsnmpd/Makefile49
-rw-r--r--net-mgmt/bsnmpd/distinfo2
-rw-r--r--net-mgmt/bsnmpd/files/bsnmpd.sh.in20
-rw-r--r--net-mgmt/bsnmpd/files/patch-config__Makefile.post67
-rw-r--r--net-mgmt/bsnmpd/files/patch-config__Makefile.pre19
-rw-r--r--net-mgmt/bsnmpd/files/patch-configure.ac53
-rw-r--r--net-mgmt/bsnmpd/files/patch-gensnmptree__gensnmptree.c12
-rw-r--r--net-mgmt/bsnmpd/files/patch-lib__asn1.c14
-rw-r--r--net-mgmt/bsnmpd/files/patch-lib__asn1.h13
-rw-r--r--net-mgmt/bsnmpd/files/patch-lib__snmp.c14
-rw-r--r--net-mgmt/bsnmpd/files/patch-lib__snmpagent.c14
-rw-r--r--net-mgmt/bsnmpd/files/patch-lib__snmpclient.c14
-rw-r--r--net-mgmt/bsnmpd/files/patch-snmp_mibII__mibII_ipaddr.c15
-rw-r--r--net-mgmt/bsnmpd/files/patch-snmp_ntp__snmp_ntp.c48
-rw-r--r--net-mgmt/bsnmpd/files/patch-snmpd__config.c20
-rw-r--r--net-mgmt/bsnmpd/files/patch-snmpd__main.c10
-rw-r--r--net-mgmt/bsnmpd/files/patch-snmpd__snmpd.config14
-rw-r--r--net-mgmt/bsnmpd/files/patch-snmpd__trap.c11
-rw-r--r--net-mgmt/bsnmpd/pkg-descr8
-rw-r--r--net-mgmt/bsnmpd/pkg-plist30
21 files changed, 448 insertions, 0 deletions
diff --git a/net-mgmt/Makefile b/net-mgmt/Makefile
index e651a865ce84..a004c79ca5fe 100644
--- a/net-mgmt/Makefile
+++ b/net-mgmt/Makefile
@@ -25,6 +25,7 @@
SUBDIR += bpft
SUBDIR += braa
SUBDIR += bsd-airtools
+ SUBDIR += bsnmpd
SUBDIR += cdpd
SUBDIR += cdpr
SUBDIR += cfgstoragemk
diff --git a/net-mgmt/bsnmpd/Makefile b/net-mgmt/bsnmpd/Makefile
new file mode 100644
index 000000000000..41af50959299
--- /dev/null
+++ b/net-mgmt/bsnmpd/Makefile
@@ -0,0 +1,49 @@
+# New ports collection makefile for: bsnmpd
+# Date created: Sep 22 2005
+# Whom: Andrey V. Elsukov <bu7cher@yandex.ru>
+#
+# $FreeBSD$
+#
+
+PORTNAME= bsnmpd
+PORTVERSION= 1.10
+CATEGORIES= net-mgmt
+MASTER_SITES= http://people.freebsd.org/~harti/bsnmp/
+DISTNAME= bsnmp-${PORTVERSION}
+
+MAINTAINER= bu7cher@yandex.ru
+COMMENT= A mini-SNMP daemon
+
+LIB_DEPENDS= begemot.1:${PORTSDIR}/devel/libbegemot \
+ smi.2:${PORTSDIR}/net-mgmt/libsmi
+
+USE_GMAKE= yes
+GNU_CONFIGURE= yes
+CONFIGURE_ARGS= --with-libbegemot=${LOCALBASE}
+
+USE_AUTOCONF_VER= 259
+USE_AUTOMAKE_VER= 19
+INSTALLS_SHLIB= yes
+
+USE_GCC= 3.2+
+USE_RC_SUBR= bsnmpd.sh
+
+MAN1= bsnmpd.1 gensnmpdef.1 gensnmptree.1
+MAN3= asn1.3 bsnmplib.3 bsnmpclient.3 bsnmpagent.3 snmpmod.3 \
+ snmp_mibII.3
+
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} > 600000
+IGNORE= bsnmpd already in base system
+.endif
+
+#run-autotools:
+# @(cd ${CONFIGURE_WRKSRC} && ${LOCALBASE}/bin/aclocal19 )
+# @(cd ${CONFIGURE_WRKSRC} && ${LOCALBASE}/bin/autoconf259 )
+
+post-install:
+ @${MKDIR} ${PREFIX}/etc
+ @${INSTALL_DATA} ${BUILD_WRKSRC}/snmpd/snmpd.config ${PREFIX}/etc/snmpd.config.example
+
+.include <bsd.port.post.mk>
diff --git a/net-mgmt/bsnmpd/distinfo b/net-mgmt/bsnmpd/distinfo
new file mode 100644
index 000000000000..ca6c3e429e93
--- /dev/null
+++ b/net-mgmt/bsnmpd/distinfo
@@ -0,0 +1,2 @@
+MD5 (bsnmp-1.10.tar.gz) = d0d8d538639c899eb3e8602876bd28be
+SIZE (bsnmp-1.10.tar.gz) = 451797
diff --git a/net-mgmt/bsnmpd/files/bsnmpd.sh.in b/net-mgmt/bsnmpd/files/bsnmpd.sh.in
new file mode 100644
index 000000000000..8e2346542a08
--- /dev/null
+++ b/net-mgmt/bsnmpd/files/bsnmpd.sh.in
@@ -0,0 +1,20 @@
+#!/bin/sh
+# $FreeBSD$
+#
+# PROVIDE: bsnmpd
+# REQUIRE: NETWORKING syslogd
+# KEYWORD: nojail
+
+bsnmpd_enable="NO"
+
+. %%RC_SUBR%%
+
+name="bsnmpd"
+rcvar=`set_rcvar`
+required_files="%%PREFIX%%/etc/snmpd.config"
+pidfile="/var/run/bsnmpd.pid"
+command_args="-c ${required_files} -p ${pidfile}"
+command="%%PREFIX%%/sbin/${name}"
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/net-mgmt/bsnmpd/files/patch-config__Makefile.post b/net-mgmt/bsnmpd/files/patch-config__Makefile.post
new file mode 100644
index 000000000000..5dbf5294df88
--- /dev/null
+++ b/net-mgmt/bsnmpd/files/patch-config__Makefile.post
@@ -0,0 +1,67 @@
+--- config/Makefile.post.orig Thu Sep 22 08:33:16 2005
++++ config/Makefile.post Thu Sep 22 08:37:05 2005
+@@ -31,7 +31,7 @@
+ install-man1:
+ @$(srcdir)/../config/mkinstalldirs $(mandir)/man1
+ for f in $(MAN1) ; do \
+- $(INSTALL_DATA) $${f}out $(mandir)/man1/$${f} ; \
++ $(BSD_INSTALL_MAN) $${f}out $(mandir)/man1/$${f} ; \
+ done
+
+ %.1out: %.1
+@@ -48,7 +48,7 @@
+ install-man3:
+ @$(srcdir)/../config/mkinstalldirs $(mandir)/man3
+ for f in $(MAN3) ; do \
+- $(INSTALL_DATA) $${f}out $(mandir)/man3/$${f} ; \
++ $(BSD_INSTALL_MAN) $${f}out $(mandir)/man3/$${f} ; \
+ done
+
+ %.3out: %.3
+@@ -61,7 +61,7 @@
+ ifneq "$(DEFS)" ""
+ install-defs:
+ @$(srcdir)/../config/mkinstalldirs $(DEFSDIR)
+- $(INSTALL_DATA) $(DEFS:%=$(srcdir)/%) $(DEFSDIR)
++ $(BSD_INSTALL_DATA) $(DEFS:%=$(srcdir)/%) $(DEFSDIR)
+
+ DEFSDIR= ${datadir}/snmp/defs
+
+@@ -76,7 +76,7 @@
+ install-incs:
+ @$(srcdir)/../config/mkinstalldirs $(INCDIR)
+ for f in $(INCS) ; do \
+- $(INSTALL_DATA) $(srcdir)/$$f $(INCDIR) ; \
++ $(BSD_INSTALL_DATA) $(srcdir)/$$f $(INCDIR) ; \
+ done
+
+ else
+@@ -90,7 +90,7 @@
+ install-mibs:
+ @$(srcdir)/../config/mkinstalldirs $(BMIBSDIR)
+ for f in $(BMIBS) ; do \
+- $(INSTALL_DATA) $(srcdir)/$$f $(BMIBSDIR) ; \
++ $(BSD_INSTALL_DATA) $(srcdir)/$$f $(BMIBSDIR) ; \
+ done
+
+ else
+@@ -101,8 +101,8 @@
+ build-prog: $(PROG)
+
+ install-prog:
+- @$(srcdir)/../config/mkinstalldirs $(bindir)
+- $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $(builddir)/$(PROG) $(bindir)/$(PROG)
++ @$(srcdir)/../config/mkinstalldirs $(sbindir)
++ $(LIBTOOL) --mode=install $(BSD_INSTALL_PROGRAM) $(builddir)/$(PROG) $(sbindir)/$(PROG)
+
+ else
+ build-prog:
+@@ -114,7 +114,7 @@
+
+ install-lib:
+ @$(srcdir)/../config/mkinstalldirs $(libdir)
+- $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $(LIB) $(libdir)
++ $(LIBTOOL) --mode=install $(BSD_INSTALL_DATA) $(LIB) $(libdir)
+
+ else
+ build-lib:
diff --git a/net-mgmt/bsnmpd/files/patch-config__Makefile.pre b/net-mgmt/bsnmpd/files/patch-config__Makefile.pre
new file mode 100644
index 000000000000..11b55a885648
--- /dev/null
+++ b/net-mgmt/bsnmpd/files/patch-config__Makefile.pre
@@ -0,0 +1,19 @@
+--- config/Makefile.pre.orig Mon Sep 19 22:07:05 2005
++++ config/Makefile.pre Mon Sep 19 22:09:02 2005
+@@ -17,6 +17,7 @@
+ prefix= @prefix@
+ exec_prefix= @exec_prefix@
+ bindir= @bindir@
++sbindir= @sbindir@
+ libdir= @libdir@
+ includedir= @includedir@
+ mandir= @mandir@
+@@ -34,7 +35,7 @@
+
+ LIBEV= @LIBEV@
+
+-SUBMAKE= $(MAKE) -$(MAKEFLAGS) --no-print-directory
++SUBMAKE= $(MAKE) $(MAKEFLAGS) --no-print-directory
+
+ WARNS= -Wsystem-headers -Werror -Wall -Wno-format-y2k -W \
+ -Wstrict-prototypes -Wmissing-prototypes \
diff --git a/net-mgmt/bsnmpd/files/patch-configure.ac b/net-mgmt/bsnmpd/files/patch-configure.ac
new file mode 100644
index 000000000000..6327f72fa778
--- /dev/null
+++ b/net-mgmt/bsnmpd/files/patch-configure.ac
@@ -0,0 +1,53 @@
+--- configure.ac.orig Mon Apr 25 15:49:28 2005
++++ configure.ac Thu Sep 22 08:53:11 2005
+@@ -75,6 +75,50 @@
+ # check for getaddrinfo
+ AC_CHECK_FUNCS(getaddrinfo)
+
++AC_CHECK_HEADER(stdint.h,
++ AC_DEFINE(HAVE_STDINT_H))
++AC_CHECK_HEADER(inttypes.h,
++ [AC_DEFINE(HAVE_INTTYPES_H)
++ ac_have_inttypes_h=yes])
++AC_CACHE_CHECK([how to print quads],
++ ac_cv_quad_fmt,
++ [if test "$ac_have_inttypes_h" = "yes" ; then
++ AC_EGREP_CPP(yes,
++[
++# include <inttypes.h>
++# ifdef PRIu64
++yes
++# endif
++],
++ ac_cv_quad_fmt=PRIu64,
++ AC_TRY_RUN(
++[[
++# include <stdio.h>
++# include <stdlib.h>
++# include <string.h>
++int
++main()
++{
++ char buf[100];
++
++ sprintf(buf, "%llx", 0x1234567887654321LLU);
++ exit((strcmp(buf, "1234567887654321") == 0) ? 0 : 1);
++}
++]],
++ ac_cv_quad_fmt='"ll"',
++ ac_cv_quad_fmt='"q"',
++ ac_cv_quad_fmt='"q"')
++ fi ]))
++
++if test "$ac_cv_quad_fmt" = "PRIu64" ; then
++ AC_DEFINE(QUADFMT, PRIu64)
++ AC_DEFINE(QUADXFMT, PRIx64)
++else
++ AC_DEFINE_UNQUOTED(QUADFMT, ${ac_cv_quad_fmt}"u")
++ AC_DEFINE_UNQUOTED(QUADXFMT, ${ac_cv_quad_fmt}"x")
++fi
++
++
+ AC_CONFIG_FILES([
+ Makefile:config/Makefile.pre:Makefile.in
+ lib/Makefile:config/Makefile.pre:config/Makefile.build:lib/Makefile.in:config/Makefile.post
diff --git a/net-mgmt/bsnmpd/files/patch-gensnmptree__gensnmptree.c b/net-mgmt/bsnmpd/files/patch-gensnmptree__gensnmptree.c
new file mode 100644
index 000000000000..75ed34b47a0d
--- /dev/null
+++ b/net-mgmt/bsnmpd/files/patch-gensnmptree__gensnmptree.c
@@ -0,0 +1,12 @@
+--- gensnmptree/gensnmptree.c.orig Thu Sep 22 08:58:15 2005
++++ gensnmptree/gensnmptree.c Thu Sep 22 08:59:03 2005
+@@ -595,7 +595,9 @@
+
+ fprintf(fp, "#include <sys/types.h>\n");
+ fprintf(fp, "#include <stdio.h>\n");
++#ifdef HAVE_STDINT_H
+ fprintf(fp, "#include <stdint.h>\n");
++#endif
+ if (localincs) {
+ fprintf(fp, "#include \"asn1.h\"\n");
+ fprintf(fp, "#include \"snmp.h\"\n");
diff --git a/net-mgmt/bsnmpd/files/patch-lib__asn1.c b/net-mgmt/bsnmpd/files/patch-lib__asn1.c
new file mode 100644
index 000000000000..fc20064dc337
--- /dev/null
+++ b/net-mgmt/bsnmpd/files/patch-lib__asn1.c
@@ -0,0 +1,14 @@
+--- lib/asn1.c.orig Thu Sep 22 09:02:07 2005
++++ lib/asn1.c Thu Sep 22 09:03:46 2005
+@@ -35,7 +35,11 @@
+ #include <stdlib.h>
+ #include <stdarg.h>
+ #include <string.h>
++#ifdef HAVE_STDINT_H
+ #include <stdint.h>
++#elif defined(HAVE_INTTYPES_H)
++#include <inttypes.h>
++#endif
+ #include <assert.h>
+ #include "asn1.h"
+
diff --git a/net-mgmt/bsnmpd/files/patch-lib__asn1.h b/net-mgmt/bsnmpd/files/patch-lib__asn1.h
new file mode 100644
index 000000000000..7ea606571d8f
--- /dev/null
+++ b/net-mgmt/bsnmpd/files/patch-lib__asn1.h
@@ -0,0 +1,13 @@
+--- lib/asn1.h.orig Tue Dec 2 18:52:37 2003
++++ lib/asn1.h Wed Sep 21 09:53:04 2005
+@@ -183,4 +183,10 @@
+ ASN_EXCEPT_ENDOFMIBVIEW = 0x02,
+ };
+
++#if !defined(__STDC_LIMIT_MACROS)
++#define INT32_MIN (-0x7fffffff-1)
++#define INT32_MAX 0x7fffffff
++#define UINT32_MAX 0xffffffffU
++#endif
++
+ #endif
diff --git a/net-mgmt/bsnmpd/files/patch-lib__snmp.c b/net-mgmt/bsnmpd/files/patch-lib__snmp.c
new file mode 100644
index 000000000000..2861afd6a9d2
--- /dev/null
+++ b/net-mgmt/bsnmpd/files/patch-lib__snmp.c
@@ -0,0 +1,14 @@
+--- lib/snmp.c.orig Fri Sep 23 08:48:16 2005
++++ lib/snmp.c Fri Sep 23 08:47:34 2005
+@@ -36,7 +36,11 @@
+ #include <stdlib.h>
+ #include <stddef.h>
+ #include <stdarg.h>
++#ifdef HAVE_STDINT_H
+ #include <stdint.h>
++#elif defined(HAVE_INTTYPES_H)
++#include <inttypes.h>
++#endif
+ #include <string.h>
+ #include <ctype.h>
+ #include <netdb.h>
diff --git a/net-mgmt/bsnmpd/files/patch-lib__snmpagent.c b/net-mgmt/bsnmpd/files/patch-lib__snmpagent.c
new file mode 100644
index 000000000000..9ebe9869afe2
--- /dev/null
+++ b/net-mgmt/bsnmpd/files/patch-lib__snmpagent.c
@@ -0,0 +1,14 @@
+--- lib/snmpagent.c.orig Thu Sep 22 09:06:25 2005
++++ lib/snmpagent.c Thu Sep 22 09:07:19 2005
+@@ -36,7 +36,11 @@
+ #include <stdlib.h>
+ #include <stddef.h>
+ #include <stdarg.h>
++#ifdef HAVE_STDINT_H
+ #include <stdint.h>
++#elif defined(HAVE_INTTYPES_H)
++#include <inttypes.h>
++#endif
+ #include <string.h>
+
+ #include "asn1.h"
diff --git a/net-mgmt/bsnmpd/files/patch-lib__snmpclient.c b/net-mgmt/bsnmpd/files/patch-lib__snmpclient.c
new file mode 100644
index 000000000000..163711937de7
--- /dev/null
+++ b/net-mgmt/bsnmpd/files/patch-lib__snmpclient.c
@@ -0,0 +1,14 @@
+--- lib/snmpclient.c.orig Thu Sep 22 09:07:57 2005
++++ lib/snmpclient.c Thu Sep 22 09:08:38 2005
+@@ -48,7 +48,11 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <netdb.h>
++#ifdef HAVE_STDINT_H
+ #include <stdint.h>
++#elif defined(HAVE_INTTYPES_H)
++#include <inttypes.h>
++#endif
+ #include <limits.h>
+ #ifdef HAVE_ERR_H
+ #include <err.h>
diff --git a/net-mgmt/bsnmpd/files/patch-snmp_mibII__mibII_ipaddr.c b/net-mgmt/bsnmpd/files/patch-snmp_mibII__mibII_ipaddr.c
new file mode 100644
index 000000000000..6cde906bd272
--- /dev/null
+++ b/net-mgmt/bsnmpd/files/patch-snmp_mibII__mibII_ipaddr.c
@@ -0,0 +1,15 @@
+--- snmp_mibII/mibII_ipaddr.c.orig Wed Sep 21 12:21:53 2005
++++ snmp_mibII/mibII_ipaddr.c Wed Sep 21 12:18:56 2005
+@@ -88,8 +88,10 @@
+ }
+
+ bcast.s_addr = upd->addr.s_addr & upd->mask.s_addr;
+- if (!(upd->set & UPD_BCAST) || upd->bcast)
+- bcast.s_addr |= htonl(0xffffffff & ~ntohl(upd->mask.s_addr));
++ if (!(upd->set & UPD_BCAST) || upd->bcast) {
++ uint32_t tmp = ~ntohl(upd->mask.s_addr);
++ bcast.s_addr |= htonl(0xffffffff & tmp);
++ }
+
+ if ((ifa = mib_create_ifa(upd->ifindex, upd->addr, upd->mask, bcast)) == NULL)
+ return (SNMP_ERR_GENERR);
diff --git a/net-mgmt/bsnmpd/files/patch-snmp_ntp__snmp_ntp.c b/net-mgmt/bsnmpd/files/patch-snmp_ntp__snmp_ntp.c
new file mode 100644
index 000000000000..81db6376ba72
--- /dev/null
+++ b/net-mgmt/bsnmpd/files/patch-snmp_ntp__snmp_ntp.c
@@ -0,0 +1,48 @@
+--- snmp_ntp/snmp_ntp.c.orig Mon May 23 06:03:48 2005
++++ snmp_ntp/snmp_ntp.c Mon Sep 26 12:50:42 2005
+@@ -40,7 +40,11 @@
+ #include <ctype.h>
+ #include <errno.h>
+ #include <netdb.h>
++#ifdef HAVE_STDINT_H
+ #include <stdint.h>
++#elif defined(HAVE_INTTYPES_H)
++#include <inttypes.h>
++#endif
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -360,6 +364,7 @@
+ free(rpkt);
+ return (-1);
+ }
++ return 0;
+ }
+
+ /*
+@@ -720,7 +725,7 @@
+ {
+ int r, n, error;
+ struct addrinfo hints, *res0;
+- struct sockaddr_in *sin;
++ struct sockaddr_in *sin_local;
+
+ r = sscanf(val, "%hhd.%hhd.%hhd.%hhd%n",
+ &ip[0], &ip[1], &ip[2], &ip[3], &n);
+@@ -743,11 +748,11 @@
+ return (-1);
+ }
+
+- sin = (struct sockaddr_in *)(void *)res0->ai_addr;
+- ip[3] = sin->sin_addr.s_addr >> 24;
+- ip[2] = sin->sin_addr.s_addr >> 16;
+- ip[1] = sin->sin_addr.s_addr >> 8;
+- ip[0] = sin->sin_addr.s_addr >> 0;
++ sin_local = (struct sockaddr_in *)(void *)res0->ai_addr;
++ ip[3] = sin_local->sin_addr.s_addr >> 24;
++ ip[2] = sin_local->sin_addr.s_addr >> 16;
++ ip[1] = sin_local->sin_addr.s_addr >> 8;
++ ip[0] = sin_local->sin_addr.s_addr >> 0;
+
+ freeaddrinfo(res0);
+ return (0);
diff --git a/net-mgmt/bsnmpd/files/patch-snmpd__config.c b/net-mgmt/bsnmpd/files/patch-snmpd__config.c
new file mode 100644
index 000000000000..e4ea1468e787
--- /dev/null
+++ b/net-mgmt/bsnmpd/files/patch-snmpd__config.c
@@ -0,0 +1,20 @@
+--- snmpd/config.c.orig Thu Sep 22 08:43:58 2005
++++ snmpd/config.c Thu Sep 22 08:44:54 2005
+@@ -820,7 +820,7 @@
+ while (token == '.') {
+ if (gettoken() == TOK_NUM) {
+ if (numval > ASN_MAXID)
+- report("subid too large %#"PRIx64, numval);
++ report("subid too large %#"QUADXFMT, numval);
+ if (oid->len == ASN_MAXOIDLEN)
+ report("index too long");
+ oid->subs[oid->len++] = numval;
+@@ -863,7 +863,7 @@
+ if (token != TOK_NUM)
+ report("bad INTEGER syntax");
+ if (numval > 0x7fffffff)
+- report("INTEGER too large %"PRIu64, numval);
++ report("INTEGER too large %"QUADFMT, numval);
+
+ value->v.integer = numval;
+ gettoken();
diff --git a/net-mgmt/bsnmpd/files/patch-snmpd__main.c b/net-mgmt/bsnmpd/files/patch-snmpd__main.c
new file mode 100644
index 000000000000..99553c9e00f4
--- /dev/null
+++ b/net-mgmt/bsnmpd/files/patch-snmpd__main.c
@@ -0,0 +1,10 @@
+--- snmpd/main.c.orig Thu Sep 22 09:14:31 2005
++++ snmpd/main.c Thu Sep 22 09:15:49 2005
+@@ -33,6 +33,7 @@
+ #include <sys/param.h>
+ #include <sys/un.h>
+ #include <sys/ucred.h>
++#include <sys/uio.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stddef.h>
diff --git a/net-mgmt/bsnmpd/files/patch-snmpd__snmpd.config b/net-mgmt/bsnmpd/files/patch-snmpd__snmpd.config
new file mode 100644
index 000000000000..b7bc1ac7ed40
--- /dev/null
+++ b/net-mgmt/bsnmpd/files/patch-snmpd__snmpd.config
@@ -0,0 +1,14 @@
+--- snmpd/snmpd.config.orig Tue Sep 20 20:43:27 2005
++++ snmpd/snmpd.config Tue Sep 20 20:43:38 2005
+@@ -82,11 +82,3 @@
+ # Load MIB-2 module
+ #
+ begemotSnmpdModulePath."mibII" = "/usr/local/lib/snmp_mibII.so"
+-
+-#
+-# Netgraph module
+-#
+-begemotSnmpdModulePath."netgraph" = "/usr/local/lib/snmp_netgraph.so"
+-
+-%netgraph
+-begemotNgControlNodeName = "snmpd"
diff --git a/net-mgmt/bsnmpd/files/patch-snmpd__trap.c b/net-mgmt/bsnmpd/files/patch-snmpd__trap.c
new file mode 100644
index 000000000000..23454e747812
--- /dev/null
+++ b/net-mgmt/bsnmpd/files/patch-snmpd__trap.c
@@ -0,0 +1,11 @@
+--- snmpd/trap.c.orig Wed Sep 21 11:42:50 2005
++++ snmpd/trap.c Wed Sep 21 11:42:06 2005
+@@ -111,7 +111,7 @@
+
+ if (connect(t->socket, (struct sockaddr *)&sa, sa.sin_len) == -1) {
+ syslog(LOG_ERR, "connect(%s,%u): %m",
+- inet_ntoa(sa.sin_addr), ntohl(sa.sin_port));
++ inet_ntoa(sa.sin_addr), ntohs(sa.sin_port));
+ (void)close(t->socket);
+ free(t);
+ return (SNMP_ERR_GENERR);
diff --git a/net-mgmt/bsnmpd/pkg-descr b/net-mgmt/bsnmpd/pkg-descr
new file mode 100644
index 000000000000..4c5622815b91
--- /dev/null
+++ b/net-mgmt/bsnmpd/pkg-descr
@@ -0,0 +1,8 @@
+This is a mini-SNMP daemon. The basic daemon implements the system group
+and a number of private extensions to manage the UDP transport mapping,
+communities, trap destinations and loadable modules. In this form it can
+be used to provide remote access to arbitrary data that can be described in
+the form as required by the SMI. The daemon speaks both SNMPv1 and SNMPv2c.
+
+WWW: http://people.freebsd.org/~harti/bsnmp/
+Author: Andrey V. Elsukov <bu7cher@yandex.ru>
diff --git a/net-mgmt/bsnmpd/pkg-plist b/net-mgmt/bsnmpd/pkg-plist
new file mode 100644
index 000000000000..424a5184053f
--- /dev/null
+++ b/net-mgmt/bsnmpd/pkg-plist
@@ -0,0 +1,30 @@
+etc/snmpd.config.example
+lib/libbsnmp.a
+lib/libbsnmp.so
+lib/libbsnmp.so.2
+lib/snmp_mibII.so
+lib/snmp_mibII.so.3
+lib/snmp_ntp.so
+lib/snmp_ntp.so.3
+include/bsnmp/asn1.h
+include/bsnmp/snmp.h
+include/bsnmp/snmpagent.h
+include/bsnmp/snmpclient.h
+include/bsnmp/snmpmod.h
+include/bsnmp/snmp_mibII.h
+sbin/bsnmpd
+sbin/gensnmpdef
+sbin/gensnmptree
+share/snmp/defs/mibII_tree.def
+share/snmp/defs/ntp_tree.def
+share/snmp/defs/tree.def
+share/snmp/mibs/BEGEMOT-MIB.txt
+share/snmp/mibs/BEGEMOT-NTP-MIB.txt
+share/snmp/mibs/BEGEMOT-SNMPD.txt
+share/snmp/mibs/FOKUS-MIB.txt
+share/snmp/mibs/NTP-MIB.txt
+share/snmp/mibs/NTP-PROXY-MIB.txt
+@dirrm include/bsnmp
+@dirrm share/snmp/defs
+@dirrm share/snmp/mibs
+@dirrm share/snmp