- Add openbgpd 3.6, a free implementation of the Border Gateway Protocol.

Credits to:	Lukasz Bromirski <lukasz@bromirski.net>
This commit is contained in:
Florent Thoumie 2005-05-17 14:46:42 +00:00
parent 8a0deddf4a
commit 10863a75b8
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=135476
12 changed files with 253 additions and 0 deletions

View File

@ -443,6 +443,7 @@
SUBDIR += olsrd
SUBDIR += onenetd
SUBDIR += openam
SUBDIR += openbgpd
SUBDIR += opendchub
SUBDIR += opengk
SUBDIR += openh323

63
net/openbgpd/Makefile Normal file
View File

@ -0,0 +1,63 @@
# New ports collection makefile for: openbgpd
# Date created: May 10 2005
# Whom: Florent Thoumie <flz@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= openbgpd
PORTVERSION= 3.6
CATEGORIES= net
MASTER_SITES= ftp://ftp.openbsd.org/pub/OpenBSD/OpenBGPD/:openbsd \
${MASTER_SITE_LOCAL:S/$/:freebsd/g}
MASTER_SITE_SUBDIR= flz/openbgpd/:freebsd
DISTFILES= ${PORTNAME}-${PORTVERSION}.tgz:openbsd \
if_media.h:freebsd pfkey_compat.c:freebsd
DIST_SUBDIR= openbgpd
EXTRACT_ONLY= ${PORTNAME}-${PORTVERSION}.tgz
MAINTAINER= flz@FreeBSD.org
COMMENT= Free implementation of the Border Gateway Protocol, Version 4
WRKSRC= ${WRKDIR}
MANCOMPRESSED= yes
USE_RC_SUBR= openbgpd.sh
USE_REINPLACE= yes
MAKE_ENV= BINDIR="${PREFIX}/sbin" \
MANDIR="${PREFIX}/man/man"
PLIST_FILES= sbin/bgpctl \
sbin/bgpd
MAN5= bgpd.conf.5
MAN8= bgpctl.8 \
bgpd.8
SUBDIRS= bgpd \
bgpctl
.include <bsd.port.pre.mk>
post-extract:
@${CP} ${DISTDIR}/${DIST_SUBDIR}/if_media.h ${WRKSRC}/bgpctl/
@${CP} ${DISTDIR}/${DIST_SUBDIR}/pfkey_compat.c ${WRKSRC}/bgpd/
post-patch:
@${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" \
${WRKSRC}/bgpd/Makefile \
${WRKSRC}/bgpd/bgpd.8 \
${WRKSRC}/bgpd/bgpd.h \
${WRKSRC}/bgpd/bgpd.conf.5 \
${WRKSRC}/bgpctl/Makefile
do-build:
.for i in ${SUBDIRS}
cd ${WRKSRC}/$i; make
.endfor
do-install:
.for i in ${SUBDIRS}
cd ${WRKSRC}/$i; make install ${MAKE_ENV}
.endfor
.include <bsd.port.post.mk>

6
net/openbgpd/distinfo Normal file
View File

@ -0,0 +1,6 @@
MD5 (openbgpd/openbgpd-3.6.tgz) = e40c5dce08c3c0e7fb232bdd5ea11523
SIZE (openbgpd/openbgpd-3.6.tgz) = 109058
MD5 (openbgpd/if_media.h) = 4ff9297f5c133425dafe3ca565c0f811
SIZE (openbgpd/if_media.h) = 23762
MD5 (openbgpd/pfkey_compat.c) = 8c3bdf02fd308b327bd30e09674c1858
SIZE (openbgpd/pfkey_compat.c) = 360

View File

@ -0,0 +1,31 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: bgpd
# REQUIRE: LOGIN abi
# BEFORE: securelevel
# KEYWORD: FreeBSD shutdown
# Add the following line to /etc/rc.conf to enable `openbgpd':
#
# openbgpd_enable="YES"
#
# See bgpd(8) for openbgpd_flags
#
. "%%RC_SUBR%%"
name="openbgpd"
rcvar=`set_rcvar`
extra_commands="reload"
command="%%PREFIX%%/sbin/bgpd"
required_files="%%PREFIX%%/etc/bgpd.conf"
load_rc_config "$name"
: ${openbgpd_enable="NO"}
: ${openbgpd_flags=""}
run_rc_command "$1"

View File

@ -0,0 +1,16 @@
$FreeBSD$
--- bgpctl/bgpctl.8.orig
+++ bgpctl/bgpctl.8
@@ -138,8 +138,8 @@
and message counters.
.El
.Sh FILES
-.Bl -tag -width "/etc/bgpd.conf" -compact
-.It Pa /etc/bgpd.conf
+.Bl -tag -width "%%PREFIX%%/etc/bgpd.conf" -compact
+.It Pa %%PREFIX%%/etc/bgpd.conf
default
.Xr bgpd 8
configuration file

View File

@ -0,0 +1,18 @@
--- bgpctl/bgpctl.c.orig Fri Aug 20 17:49:35 2004
+++ bgpctl/bgpctl.c Sun Mar 20 15:27:10 2005
@@ -20,7 +20,6 @@
#include <sys/socket.h>
#include <sys/un.h>
#include <net/if.h>
-#include <net/if_media.h>
#include <net/if_types.h>
#include <err.h>
@@ -35,6 +34,7 @@
#include "rde.h"
#include "log.h"
#include "parser.h"
+#include "if_media.h"
enum neighbor_views {
NV_DEFAULT,

View File

@ -0,0 +1,14 @@
$FreeBSD$
--- bgpd/Makefile.orig
+++ bgpd/Makefile
@@ -5,7 +5,7 @@
PROG= bgpd
SRCS= bgpd.c buffer.c session.c log.c parse.y config.c imsg.c \
rde.c rde_rib.c rde_decide.c rde_prefix.c mrt.c kroute.c \
- control.c pfkey.c rde_update.c rde_attr.c printconf.c \
+ control.c pfkey_compat.c rde_update.c rde_attr.c printconf.c \
rde_filter.c pftable.c
CFLAGS+= -Wall -I${.CURDIR}
CFLAGS+= -Wstrict-prototypes -Wmissing-prototypes

View File

@ -0,0 +1,37 @@
$FreeBSD$
--- bgpd/bgpd.8.orig
+++ bgpd/bgpd.8
@@ -46,9 +46,9 @@
.Nm
is usually started at boot time, and can be enabled by
setting the following in
-.Pa /etc/rc.conf.local :
+.Pa /etc/rc.conf :
.Pp
-.Dl bgpd_flags=\&"\&"
+.Dl openbgpd_enable=\&"YES\&"
.Pp
See
.Xr rc 8
@@ -90,7 +90,7 @@
.Ar file
as the configuration file,
instead of the default
-.Pa /etc/bgpd.conf .
+.Pa %%PREFIX%%/etc/bgpd.conf .
.It Fl n
Configtest mode.
Only check the configuration file for validity.
@@ -98,8 +98,8 @@
Produce more verbose output.
.El
.Sh FILES
-.Bl -tag -width "/etc/bgpd.confXXX" -compact
-.It Pa /etc/bgpd.conf
+.Bl -tag -width "%%PREFIX%%/etc/bgpd.confXXX" -compact
+.It Pa %%PREFIX%%/etc/bgpd.conf
default
.Nm
configuration file

View File

@ -0,0 +1,30 @@
$FreeBSD$
--- bgpd/bgpd.conf.5.orig
+++ bgpd/bgpd.conf.5
@@ -431,11 +431,11 @@
With
.Xr isakmpd 8 ,
it is sufficient to copy the peer's public key, found in
-.Pa /etc/isakmpd/private/local.pub ,
+.Pa %%PREFIX%%/etc/isakmpd/private/local.pub ,
to the local machine.
It must be stored in a file
named after the peer's IP address and must be stored in
-.Pa /etc/isakmpd/pubkeys/ipv4/ .
+.Pa %%PREFIX%%/etc/isakmpd/pubkeys/ipv4/ .
The local public key must be copied to the peer in the same way.
As
.Xr bgpd 8
@@ -819,8 +819,8 @@
.Em AS path .
.El
.Sh FILES
-.Bl -tag -width "/etc/bgpd.conf" -compact
-.It Pa /etc/bgpd.conf
+.Bl -tag -width "%%PREFIX%%/etc/bgpd.conf" -compact
+.It Pa %%PREFIX%%/etc/bgpd.conf
.Xr bgpd 8
configuration file
.El

View File

@ -0,0 +1,14 @@
$FreeBSD$
--- bgpd/bgpd.h.orig
+++ bgpd/bgpd.h
@@ -31,7 +31,7 @@
#define BGP_VERSION 4
#define BGP_PORT 179
-#define CONFFILE "/etc/bgpd.conf"
+#define CONFFILE "%%PREFIX%%/etc/bgpd.conf"
#define BGPD_USER "_bgpd"
#define PEER_DESCR_LEN 32
#define PFTABLE_LEN 16

View File

@ -0,0 +1,15 @@
--- bgpd/session.c.orig Thu Sep 9 23:53:57 2004
+++ bgpd/session.c Sun Mar 20 15:33:51 2005
@@ -206,9 +206,12 @@
setproctitle("session engine");
bgpd_process = PROC_SE;
+/* we don't have PF_KEY implemented in a way OpenBSD has
+
if (pfkey_init(&sysdep) == -1)
fatalx("pfkey setup failed");
+*/
if (setgroups(1, &pw->pw_gid) ||
setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
seteuid(pw->pw_uid) || setuid(pw->pw_uid))

8
net/openbgpd/pkg-descr Normal file
View File

@ -0,0 +1,8 @@
OpenBGPD is a FREE implementation of the Border Gateway Protocol, Version 4.
It allows ordinary machines to be used as routers exchanging routes with
other systems speaking the BGP protocol.
WWW: http://www.openbgp.org/
- Florent Thoumie
flz@xbsd.org