diff options
| -rw-r--r-- | net/Makefile | 1 | ||||
| -rw-r--r-- | net/openospfd-devel/Makefile | 80 | ||||
| -rw-r--r-- | net/openospfd-devel/distinfo | 9 | ||||
| -rw-r--r-- | net/openospfd-devel/files/openospfd.sh.in | 31 | ||||
| -rw-r--r-- | net/openospfd-devel/files/patch-ospfd_packet.c | 26 | ||||
| -rw-r--r-- | net/openospfd-devel/pkg-descr | 8 | ||||
| -rw-r--r-- | net/openospfd-devel/pkg-install | 36 | ||||
| -rw-r--r-- | net/openospfd/Makefile | 80 | ||||
| -rw-r--r-- | net/openospfd/distinfo | 9 | ||||
| -rw-r--r-- | net/openospfd/files/openospfd.sh.in | 31 | ||||
| -rw-r--r-- | net/openospfd/files/patch-ospfd_packet.c | 26 | ||||
| -rw-r--r-- | net/openospfd/pkg-descr | 8 | ||||
| -rw-r--r-- | net/openospfd/pkg-install | 36 |
13 files changed, 381 insertions, 0 deletions
diff --git a/net/Makefile b/net/Makefile index d5a7d6a87988..87c48ee82148 100644 --- a/net/Makefile +++ b/net/Makefile @@ -365,6 +365,7 @@ SUBDIR += openmcu SUBDIR += openmpi SUBDIR += openntpd + SUBDIR += openospfd-devel SUBDIR += openradius SUBDIR += openser SUBDIR += openslp diff --git a/net/openospfd-devel/Makefile b/net/openospfd-devel/Makefile new file mode 100644 index 000000000000..0e6617b5a493 --- /dev/null +++ b/net/openospfd-devel/Makefile @@ -0,0 +1,80 @@ +# New ports collection makefile for: openospfd-devel +# Date created: Mar 08 2005 +# Whom: Florent Thoumie <flz@FreeBSD.org> +# +# $FreeBSD$ +# + +PORTNAME= openospfd-devel +PORTVERSION= ${SNAPSHOT} +CATEGORIES= net +MASTER_SITES= ftp://ftp.openbsd.org/pub/OpenBSD/OpenOSPFD/:openbsd \ + ${MASTER_SITE_LOCAL:S/$/:freebsd/g} +MASTER_SITE_SUBDIR= flz/openospfd/:freebsd +DISTFILES= ${PORTNAME}-${PORTVERSION}.tgz:freebsd \ + if_media.h:freebsd hash.h:freebsd +DIST_SUBDIR= openospfd +EXTRACT_ONLY= ${PORTNAME}-${PORTVERSION}.tgz + +MAINTAINER= flz@FreeBSD.org +COMMENT= Free implementation of the Open Shortest Path First Protocol + +LIB_DEPENDS= event-1.1a.1:${PORTSDIR}/devel/libevent + +CONFLICTS= zebra-0* quagga-0* + +SNAPSHOT= 20060320 +WRKSRC= ${WRKDIR} +MANCOMPRESSED= yes +USE_RC_SUBR= openospfd.sh +MAKE_ENV= BINDIR="${PREFIX}/sbin" \ + MANDIR="${PREFIX}/man/man" +COPTS= -I${LOCALBASE}/include -DMD5_DIGEST_LENGTH=16 +LDADD= -L${LOCALBASE}/lib -levent -lmd + +PLIST_FILES= sbin/ospfctl \ + sbin/ospfd + +MAN5= ospfd.conf.5 +MAN8= ospfctl.8 \ + ospfd.8 + +SUBDIRS= ospfd \ + ospfctl + +.include <bsd.port.pre.mk> + +.if ${OSVERSION} < 500037 +IGNORE= requires macros present in <sys/tree.h> +.endif + +post-extract: + @${CP} ${DISTDIR}/${DIST_SUBDIR}/if_media.h ${WRKSRC}/ospfctl/ + @${CP} ${DISTDIR}/${DIST_SUBDIR}/hash.h ${WRKSRC}/ospfd/ + +post-patch: + @${REINPLACE_CMD} -e "s|sys/hash.h|hash.h|" ${WRKSRC}/ospfd/lsupdate.c + @${REINPLACE_CMD} -e "s|<net/if_media.h>|\"if_media.h\"|" ${WRKSRC}/ospfctl/ospfctl.c + @${REINPLACE_CMD} -e "s|rtm_fmask|rtm_use|" ${WRKSRC}/ospfd/kroute.c + @${REINPLACE_CMD} -e "/rc.conf.local/d" ${WRKSRC}/ospfd/ospfd.conf.5 + @${REINPLACE_CMD} -e "s|/etc|${PREFIX}/etc|g" \ + ${WRKSRC}/ospfd/ospfd.h \ + ${WRKSRC}/ospfd/ospfd.8 \ + ${WRKSRC}/ospfd/ospfd.conf.5 + @${REINPLACE_CMD} -e "s|__dead ||" \ + ${WRKSRC}/ospfd/ospfd.c ${WRKSRC}/ospfctl/ospfctl.c + +do-build: +.for i in ${SUBDIRS} + cd ${WRKSRC}/$i; make COPTS="${COPTS}" LDADD="${LDADD}" +.endfor + +do-install: +.for i in ${SUBDIRS} + cd ${WRKSRC}/$i; make install ${MAKE_ENV} LOCALBASE=${LOCALBASE} +.endfor + +post-install: + @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL + +.include <bsd.port.post.mk> diff --git a/net/openospfd-devel/distinfo b/net/openospfd-devel/distinfo new file mode 100644 index 000000000000..ea8e045f6f7e --- /dev/null +++ b/net/openospfd-devel/distinfo @@ -0,0 +1,9 @@ +MD5 (openospfd/openospfd-devel-20060320.tgz) = 3053dc1a4e798884cb3868f89a379322 +SHA256 (openospfd/openospfd-devel-20060320.tgz) = ef667d1396213ffbf3472b6b5699379ebe0ecb57d0ae2b4ecf60b30146b63293 +SIZE (openospfd/openospfd-devel-20060320.tgz) = 79379 +MD5 (openospfd/if_media.h) = 4ff9297f5c133425dafe3ca565c0f811 +SHA256 (openospfd/if_media.h) = 58225d0ed363c2beb23426f0f8254089d4541c3334776f3750ba434d4491a1d1 +SIZE (openospfd/if_media.h) = 23762 +MD5 (openospfd/hash.h) = 0c397692b9b152f1bca968b6248bc09c +SHA256 (openospfd/hash.h) = 0c5561c6765325f49d82d5c5fd9471dbfadf21f44e554758eb112a23f7c317b1 +SIZE (openospfd/hash.h) = 3488 diff --git a/net/openospfd-devel/files/openospfd.sh.in b/net/openospfd-devel/files/openospfd.sh.in new file mode 100644 index 000000000000..47240e48f699 --- /dev/null +++ b/net/openospfd-devel/files/openospfd.sh.in @@ -0,0 +1,31 @@ +#!/bin/sh +# +# $FreeBSD: /tmp/pcvs/ports/net/openospfd-devel/files/Attic/openospfd.sh.in,v 1.1 2006-03-20 10:41:04 flz Exp $ +# + +# PROVIDE: ospfd +# REQUIRE: LOGIN abi +# BEFORE: securelevel +# KEYWORD: shutdown + +# Add the following line to /etc/rc.conf to enable `openospfd': +# +# openospfd_enable="YES" +# +# See ospfd(8) for openospfd_flags +# + +. "%%RC_SUBR%%" + +name="openospfd" +rcvar=`set_rcvar` + +extra_commands="reload" +command="%%PREFIX%%/sbin/ospfd" +required_files="%%PREFIX%%/etc/ospfd.conf" + +load_rc_config "$name" +: ${openospfd_enable="NO"} +: ${openospfd_flags=""} + +run_rc_command "$1" diff --git a/net/openospfd-devel/files/patch-ospfd_packet.c b/net/openospfd-devel/files/patch-ospfd_packet.c new file mode 100644 index 000000000000..414554a9a169 --- /dev/null +++ b/net/openospfd-devel/files/patch-ospfd_packet.c @@ -0,0 +1,26 @@ +--- ospfd/packet.c.orig 9 Mar 2006 13:31:57 -0000 1.20 ++++ ospfd/packet.c 16 Mar 2006 18:21:38 -0000 +@@ -34,7 +34,7 @@ + #include "log.h" + #include "ospfe.h" + +-int ip_hdr_sanity_check(const struct ip *, u_int16_t); ++int ip_hdr_sanity_check(struct ip *, u_int16_t); + int ospf_hdr_sanity_check(const struct ip *, + struct ospf_hdr *, u_int16_t, const struct iface *); + struct iface *find_iface(struct ospfd_conf *, struct in_addr); +@@ -196,8 +196,13 @@ recv_packet(int fd, short event, void *b + } + + int +-ip_hdr_sanity_check(const struct ip *ip_hdr, u_int16_t len) ++ip_hdr_sanity_check(struct ip *ip_hdr, u_int16_t len) + { ++#if defined(__NetBSD__) || defined(__FreeBSD__) ++ /* FreeBSD and NetBSD modify the IP header. Undo it! */ ++ ip_hdr->ip_len = htons(ip_hdr->ip_len + (ip_hdr->ip_hl << 2)); ++#endif ++ + if (ntohs(ip_hdr->ip_len) != len) { + log_debug("recv_packet: invalid IP packet length %u", + ntohs(ip_hdr->ip_len)); diff --git a/net/openospfd-devel/pkg-descr b/net/openospfd-devel/pkg-descr new file mode 100644 index 000000000000..261b929be89e --- /dev/null +++ b/net/openospfd-devel/pkg-descr @@ -0,0 +1,8 @@ +OpenOSPFD is a FREE implementation of the Open Shortest Path First Protocol. +It allows ordinary machines to be used as routers exchanging routes with +other systems speaking the OSPF protocol. + +WWW: http://www.openbgp.org/ + +- Florent Thoumie +flz@xbsd.org diff --git a/net/openospfd-devel/pkg-install b/net/openospfd-devel/pkg-install new file mode 100644 index 000000000000..dda8b52eb6fd --- /dev/null +++ b/net/openospfd-devel/pkg-install @@ -0,0 +1,36 @@ +#!/bin/sh + +case $2 in +POST-INSTALL) + USER=_ospfd + GROUP=${USER} + UID=131 + GID=${UID} + PW=/usr/sbin/pw + + if ${PW} group show "${GROUP}" 2>/dev/null; then + echo "You already have a group \"${GROUP}\", so I will use it." + else + if ${PW} groupadd ${GROUP} -g ${GID}; then + echo "Added group \"${GROUP}\"." + else + echo "Adding group \"${GROUP}\" failed..." + exit 1 + fi + fi + + if ${PW} user show "${USER}" 2>/dev/null; then + echo "You already have a user \"${USER}\", so I will use it." + else + if ${PW} useradd ${USER} -u ${UID} -g ${GROUP} -h - \ + -d "/var/empty" -s /sbin/nologin -c "OSPF Daemon" + then + echo "Added user \"${USER}\"." + else + echo "Adding user \"${USER}\" failed..." + exit 1 + fi + fi + exit 0 + ;; +esac diff --git a/net/openospfd/Makefile b/net/openospfd/Makefile new file mode 100644 index 000000000000..0e6617b5a493 --- /dev/null +++ b/net/openospfd/Makefile @@ -0,0 +1,80 @@ +# New ports collection makefile for: openospfd-devel +# Date created: Mar 08 2005 +# Whom: Florent Thoumie <flz@FreeBSD.org> +# +# $FreeBSD$ +# + +PORTNAME= openospfd-devel +PORTVERSION= ${SNAPSHOT} +CATEGORIES= net +MASTER_SITES= ftp://ftp.openbsd.org/pub/OpenBSD/OpenOSPFD/:openbsd \ + ${MASTER_SITE_LOCAL:S/$/:freebsd/g} +MASTER_SITE_SUBDIR= flz/openospfd/:freebsd +DISTFILES= ${PORTNAME}-${PORTVERSION}.tgz:freebsd \ + if_media.h:freebsd hash.h:freebsd +DIST_SUBDIR= openospfd +EXTRACT_ONLY= ${PORTNAME}-${PORTVERSION}.tgz + +MAINTAINER= flz@FreeBSD.org +COMMENT= Free implementation of the Open Shortest Path First Protocol + +LIB_DEPENDS= event-1.1a.1:${PORTSDIR}/devel/libevent + +CONFLICTS= zebra-0* quagga-0* + +SNAPSHOT= 20060320 +WRKSRC= ${WRKDIR} +MANCOMPRESSED= yes +USE_RC_SUBR= openospfd.sh +MAKE_ENV= BINDIR="${PREFIX}/sbin" \ + MANDIR="${PREFIX}/man/man" +COPTS= -I${LOCALBASE}/include -DMD5_DIGEST_LENGTH=16 +LDADD= -L${LOCALBASE}/lib -levent -lmd + +PLIST_FILES= sbin/ospfctl \ + sbin/ospfd + +MAN5= ospfd.conf.5 +MAN8= ospfctl.8 \ + ospfd.8 + +SUBDIRS= ospfd \ + ospfctl + +.include <bsd.port.pre.mk> + +.if ${OSVERSION} < 500037 +IGNORE= requires macros present in <sys/tree.h> +.endif + +post-extract: + @${CP} ${DISTDIR}/${DIST_SUBDIR}/if_media.h ${WRKSRC}/ospfctl/ + @${CP} ${DISTDIR}/${DIST_SUBDIR}/hash.h ${WRKSRC}/ospfd/ + +post-patch: + @${REINPLACE_CMD} -e "s|sys/hash.h|hash.h|" ${WRKSRC}/ospfd/lsupdate.c + @${REINPLACE_CMD} -e "s|<net/if_media.h>|\"if_media.h\"|" ${WRKSRC}/ospfctl/ospfctl.c + @${REINPLACE_CMD} -e "s|rtm_fmask|rtm_use|" ${WRKSRC}/ospfd/kroute.c + @${REINPLACE_CMD} -e "/rc.conf.local/d" ${WRKSRC}/ospfd/ospfd.conf.5 + @${REINPLACE_CMD} -e "s|/etc|${PREFIX}/etc|g" \ + ${WRKSRC}/ospfd/ospfd.h \ + ${WRKSRC}/ospfd/ospfd.8 \ + ${WRKSRC}/ospfd/ospfd.conf.5 + @${REINPLACE_CMD} -e "s|__dead ||" \ + ${WRKSRC}/ospfd/ospfd.c ${WRKSRC}/ospfctl/ospfctl.c + +do-build: +.for i in ${SUBDIRS} + cd ${WRKSRC}/$i; make COPTS="${COPTS}" LDADD="${LDADD}" +.endfor + +do-install: +.for i in ${SUBDIRS} + cd ${WRKSRC}/$i; make install ${MAKE_ENV} LOCALBASE=${LOCALBASE} +.endfor + +post-install: + @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL + +.include <bsd.port.post.mk> diff --git a/net/openospfd/distinfo b/net/openospfd/distinfo new file mode 100644 index 000000000000..ea8e045f6f7e --- /dev/null +++ b/net/openospfd/distinfo @@ -0,0 +1,9 @@ +MD5 (openospfd/openospfd-devel-20060320.tgz) = 3053dc1a4e798884cb3868f89a379322 +SHA256 (openospfd/openospfd-devel-20060320.tgz) = ef667d1396213ffbf3472b6b5699379ebe0ecb57d0ae2b4ecf60b30146b63293 +SIZE (openospfd/openospfd-devel-20060320.tgz) = 79379 +MD5 (openospfd/if_media.h) = 4ff9297f5c133425dafe3ca565c0f811 +SHA256 (openospfd/if_media.h) = 58225d0ed363c2beb23426f0f8254089d4541c3334776f3750ba434d4491a1d1 +SIZE (openospfd/if_media.h) = 23762 +MD5 (openospfd/hash.h) = 0c397692b9b152f1bca968b6248bc09c +SHA256 (openospfd/hash.h) = 0c5561c6765325f49d82d5c5fd9471dbfadf21f44e554758eb112a23f7c317b1 +SIZE (openospfd/hash.h) = 3488 diff --git a/net/openospfd/files/openospfd.sh.in b/net/openospfd/files/openospfd.sh.in new file mode 100644 index 000000000000..b9a7c2606865 --- /dev/null +++ b/net/openospfd/files/openospfd.sh.in @@ -0,0 +1,31 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: ospfd +# REQUIRE: LOGIN abi +# BEFORE: securelevel +# KEYWORD: shutdown + +# Add the following line to /etc/rc.conf to enable `openospfd': +# +# openospfd_enable="YES" +# +# See ospfd(8) for openospfd_flags +# + +. "%%RC_SUBR%%" + +name="openospfd" +rcvar=`set_rcvar` + +extra_commands="reload" +command="%%PREFIX%%/sbin/ospfd" +required_files="%%PREFIX%%/etc/ospfd.conf" + +load_rc_config "$name" +: ${openospfd_enable="NO"} +: ${openospfd_flags=""} + +run_rc_command "$1" diff --git a/net/openospfd/files/patch-ospfd_packet.c b/net/openospfd/files/patch-ospfd_packet.c new file mode 100644 index 000000000000..414554a9a169 --- /dev/null +++ b/net/openospfd/files/patch-ospfd_packet.c @@ -0,0 +1,26 @@ +--- ospfd/packet.c.orig 9 Mar 2006 13:31:57 -0000 1.20 ++++ ospfd/packet.c 16 Mar 2006 18:21:38 -0000 +@@ -34,7 +34,7 @@ + #include "log.h" + #include "ospfe.h" + +-int ip_hdr_sanity_check(const struct ip *, u_int16_t); ++int ip_hdr_sanity_check(struct ip *, u_int16_t); + int ospf_hdr_sanity_check(const struct ip *, + struct ospf_hdr *, u_int16_t, const struct iface *); + struct iface *find_iface(struct ospfd_conf *, struct in_addr); +@@ -196,8 +196,13 @@ recv_packet(int fd, short event, void *b + } + + int +-ip_hdr_sanity_check(const struct ip *ip_hdr, u_int16_t len) ++ip_hdr_sanity_check(struct ip *ip_hdr, u_int16_t len) + { ++#if defined(__NetBSD__) || defined(__FreeBSD__) ++ /* FreeBSD and NetBSD modify the IP header. Undo it! */ ++ ip_hdr->ip_len = htons(ip_hdr->ip_len + (ip_hdr->ip_hl << 2)); ++#endif ++ + if (ntohs(ip_hdr->ip_len) != len) { + log_debug("recv_packet: invalid IP packet length %u", + ntohs(ip_hdr->ip_len)); diff --git a/net/openospfd/pkg-descr b/net/openospfd/pkg-descr new file mode 100644 index 000000000000..261b929be89e --- /dev/null +++ b/net/openospfd/pkg-descr @@ -0,0 +1,8 @@ +OpenOSPFD is a FREE implementation of the Open Shortest Path First Protocol. +It allows ordinary machines to be used as routers exchanging routes with +other systems speaking the OSPF protocol. + +WWW: http://www.openbgp.org/ + +- Florent Thoumie +flz@xbsd.org diff --git a/net/openospfd/pkg-install b/net/openospfd/pkg-install new file mode 100644 index 000000000000..dda8b52eb6fd --- /dev/null +++ b/net/openospfd/pkg-install @@ -0,0 +1,36 @@ +#!/bin/sh + +case $2 in +POST-INSTALL) + USER=_ospfd + GROUP=${USER} + UID=131 + GID=${UID} + PW=/usr/sbin/pw + + if ${PW} group show "${GROUP}" 2>/dev/null; then + echo "You already have a group \"${GROUP}\", so I will use it." + else + if ${PW} groupadd ${GROUP} -g ${GID}; then + echo "Added group \"${GROUP}\"." + else + echo "Adding group \"${GROUP}\" failed..." + exit 1 + fi + fi + + if ${PW} user show "${USER}" 2>/dev/null; then + echo "You already have a user \"${USER}\", so I will use it." + else + if ${PW} useradd ${USER} -u ${UID} -g ${GROUP} -h - \ + -d "/var/empty" -s /sbin/nologin -c "OSPF Daemon" + then + echo "Added user \"${USER}\"." + else + echo "Adding user \"${USER}\" failed..." + exit 1 + fi + fi + exit 0 + ;; +esac |
