diff options
author | Ryan Steinmetz <zi@FreeBSD.org> | 2020-01-31 17:24:43 +0000 |
---|---|---|
committer | Ryan Steinmetz <zi@FreeBSD.org> | 2020-01-31 17:24:43 +0000 |
commit | 1e564295866eff3d49322f6a456d553e6939b7e5 (patch) | |
tree | de0779e413f0860eb1d1af717d464ec7c4ceddca /net | |
parent | - Pet portlint (diff) |
- Add new/exabgp4, version 4.x of net/exabgp
Notes
Notes:
svn path=/head/; revision=524735
Diffstat (limited to 'net')
-rw-r--r-- | net/Makefile | 1 | ||||
-rw-r--r-- | net/exabgp4/Makefile | 60 | ||||
-rw-r--r-- | net/exabgp4/distinfo | 3 | ||||
-rw-r--r-- | net/exabgp4/files/exabgp.env | 57 | ||||
-rw-r--r-- | net/exabgp4/files/exabgp.in | 70 | ||||
-rw-r--r-- | net/exabgp4/files/exabgp.sh.in | 16 | ||||
-rw-r--r-- | net/exabgp4/files/pkg-message.in | 9 | ||||
-rw-r--r-- | net/exabgp4/pkg-descr | 6 | ||||
-rw-r--r-- | net/exabgp4/pkg-plist | 101 |
9 files changed, 323 insertions, 0 deletions
diff --git a/net/Makefile b/net/Makefile index 9a53545a4500..3534ec4f8ea9 100644 --- a/net/Makefile +++ b/net/Makefile @@ -150,6 +150,7 @@ SUBDIR += etrace SUBDIR += eventviews SUBDIR += exabgp + SUBDIR += exabgp4 SUBDIR += exaddos SUBDIR += fb SUBDIR += fiche diff --git a/net/exabgp4/Makefile b/net/exabgp4/Makefile new file mode 100644 index 000000000000..bee74c64e02d --- /dev/null +++ b/net/exabgp4/Makefile @@ -0,0 +1,60 @@ +# Created by: Ryan Steinmetz <zi@FreeBSD.org> +# $FreeBSD$ + +PORTNAME= exabgp +PORTVERSION= 4.2.4 +CATEGORIES= net +MASTER_SITES= GH \ + ZI +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} +PKGNAMESUFFIX= 4 + +MAINTAINER= zi@FreeBSD.org +COMMENT= BGP engine and route injector + +LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/COPYRIGHT + +RUN_DEPENDS= ${PY_IPADDRESS} + +USES= python shebangfix +USE_PYTHON= distutils autoplist + +CONFLICTS_INSTALL= exabgp-[0-9]* + +SUB_FILES= pkg-message +SUB_LIST= PYTHON_LIBDIR=${PYTHON_LIBDIR} PYTHON_CMD=${PYTHON_CMD} \ + PYTHON_SITELIBDIR=${PYTHON_SITELIBDIR} +USE_RC_SUBR= ${PORTNAME} +NO_ARCH= yes + +SHEBANG_FILES= etc/exabgp/run/*.run etc/exabgp/run/*.pl \ + etc/exabgp/run/*.py + +USE_GITHUB= yes +GH_ACCOUNT= Exa-Networks + +USERS= _bgpd +GROUPS= _bgpd + +OPTIONS_DEFINE= EXAMPLES + +post-patch: + @${REINPLACE_CMD} -e 's|exabgp.env|${ETCDIR}/exabgp.env|' \ + ${WRKSRC}/lib/exabgp/application/bgp.py + @${REINPLACE_CMD} -e 's|/etc/|${PREFIX}/etc/|' \ + ${WRKSRC}/doc/man/exabgp.1 \ + ${WRKSRC}/lib/exabgp/configuration/usage.py \ + ${WRKSRC}/lib/exabgp/configuration/process/parser.py \ + ${WRKSRC}/lib/exabgp/application/flow.py \ + ${WRKSRC}/lib/exabgp/application/healthcheck.py \ + +post-install: + @${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}/${PORTNAME} ${STAGEDIR}${ETCDIR} + ${INSTALL_DATA} ${FILESDIR}/exabgp.env ${STAGEDIR}${ETCDIR}/exabgp.env.sample + +do-install-EXAMPLES-on: + @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} + (cd ${WRKSRC}/etc/exabgp && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}) + +.include <bsd.port.mk> diff --git a/net/exabgp4/distinfo b/net/exabgp4/distinfo new file mode 100644 index 000000000000..4e5ce991a238 --- /dev/null +++ b/net/exabgp4/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1580484817 +SHA256 (Exa-Networks-exabgp-4.2.4_GH0.tar.gz) = f70ab656a1973b4c614a769e9829341df2028481a43ce246756e39828f5ab9bd +SIZE (Exa-Networks-exabgp-4.2.4_GH0.tar.gz) = 2922485 diff --git a/net/exabgp4/files/exabgp.env b/net/exabgp4/files/exabgp.env new file mode 100644 index 000000000000..8d5e72f96c50 --- /dev/null +++ b/net/exabgp4/files/exabgp.env @@ -0,0 +1,57 @@ +[exabgp.api] +ack = true +chunk = 1 +cli = true +compact = false +encoder = json +pipename = 'exabgp' +respawn = true +terminate = false + +[exabgp.bgp] +openwait = 60 + +[exabgp.cache] +attributes = true +nexthops = true + +[exabgp.daemon] +daemonize = true +drop = true +pid = '/var/run/exabgp/exabgp.pid' +user = '_bgpd' + +[exabgp.log] +all = false +configuration = false +daemon = true +destination = '/var/log/exabgp/exabgp.log' +enable = true +level = INFO +message = false +network = true +packets = false +parser = false +processes = true +reactor = true +rib = false +routes = false +short = false +timers = false + +[exabgp.pdb] +enable = false + +[exabgp.profile] +enable = false +file = '' + +[exabgp.reactor] +speed = 1.0 + +[exabgp.tcp] +acl = false +bind = '' +delay = 0 +once = false +port = 179 diff --git a/net/exabgp4/files/exabgp.in b/net/exabgp4/files/exabgp.in new file mode 100644 index 000000000000..cb87e0d8b282 --- /dev/null +++ b/net/exabgp4/files/exabgp.in @@ -0,0 +1,70 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: exabgp +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following line(s) to /etc/rc.conf to enable exabgp: +# +# exabgp_enable="YES" + +. /etc/rc.subr + +name=exabgp +rcvar=exabgp_enable + +load_rc_config $name + +exabgp_enable=${exabgp_enable:-"NO"} +exabgp_conf=${exabgp_conf:-"%%ETCDIR%%/exabgp.conf"} + +pidfile=/var/run/${name}/${name}.pid + +required_files=${exabgp_conf} + +command="%%PYTHON_CMD%%" +command_args="-m exabgp --root %%PREFIX%% -e %%ETCDIR%%/${name}.env ${exabgp_conf} 1>/dev/null" + +configtest_cmd="exabgp_configtest" +start_precmd="exabgp_precmd" +reload_precmd="exabgp_configtest" +restart_precmd="exabgp_configtest" +reload_all_cmd="exabgp_reload_all" +reload_all_precmd="exabgp_configtest" +extra_commands="configtest reload reload_all" +sig_reload="USR1" + +exabgp_reload_all() +{ + echo "Reloading exabgp configuration and processes." + kill -USR2 $rc_pid +} + +exabgp_configtest() +{ + echo "Performing sanity check on ${name} configuration." + result=$(env exabgp.log.configuration=true exabgp.daemon.daemonize=false exabgp.log.level=ERR exabgp.log.destination=stdout ${command} -m ${name} --root %%PREFIX%% --test ${exabgp_conf} 2>&1) + if [ ! -z "${result}" ]; then + echo "${result}" + err 1 "Failed to validate configuration file, aborting." + fi +} + +exabgp_precmd() +{ + install -d -o _bgpd -g _bgpd -m 755 /var/run/${name} + install -d -o _bgpd -g _bgpd -m 755 /var/log/${name} + if [ ! -p /var/run/${name}/exabgp.in ]; then + mkfifo -m 660 /var/run/${name}/exabgp.in + fi + if [ ! -p /var/run/${name}/exabgp.out ]; then + mkfifo -m 660 /var/run/${name}/exabgp.out + fi + chown _bgpd:_bgpd /var/run/${name}/exabgp.in /var/run/${name}/exabgp.out + exabgp_configtest + rm -f ${pidfile} +} + +run_rc_command "$1" diff --git a/net/exabgp4/files/exabgp.sh.in b/net/exabgp4/files/exabgp.sh.in new file mode 100644 index 000000000000..0789e32cfc4b --- /dev/null +++ b/net/exabgp4/files/exabgp.sh.in @@ -0,0 +1,16 @@ +#!/bin/sh + +export PYTHONPATH=%%PYTHON_LIBDIR%%:%%PYTHON_SITELIBDIR%%/exabgp + +INTERPRETER=%%PYTHON_CMD%% + +APPLICATIONS=`$INTERPRETER -c "import sys,os; print ' '.join(os.path.join(_,'exabgp','application','bgp.py') for _ in sys.path if os.path.isfile('/'.join((_,'exabgp','application','bgp.py'))))"` +APPLICATION=`echo $APPLICATIONS | awk '{ print $1; }'` + +if [ $# -eq 0 ]; then + $INTERPRETER -m exabgp $APPLICATION --folder %%PREFIX%%/etc/exabgp --help + echo "===> To start exabgp, you should use:" + echo "===> service exabgp start" +else + exec $INTERPRETER -m exabgp $APPLICATION --folder %%PREFIX%%/etc/exabgp $* +fi diff --git a/net/exabgp4/files/pkg-message.in b/net/exabgp4/files/pkg-message.in new file mode 100644 index 000000000000..9ca7aa00e596 --- /dev/null +++ b/net/exabgp4/files/pkg-message.in @@ -0,0 +1,9 @@ +=========================================================================== +Sample configurations are located in %%EXAMPLESDIR%%. + +Please create %%ETCDIR%%/exabgp.conf based on one of the above examples and +add exabgp_enable="YES" to /etc/rc.conf + +For information on using MD5 signatures, please visit the examples page at: +https://code.google.com/p/exabgp/wiki/examples +=========================================================================== diff --git a/net/exabgp4/pkg-descr b/net/exabgp4/pkg-descr new file mode 100644 index 000000000000..e4c3dac75d94 --- /dev/null +++ b/net/exabgp4/pkg-descr @@ -0,0 +1,6 @@ +A BGP route injector which can inject routes with arbitrary next-hops into +your network (source some ipv4/ipv6 routes using both IPv4 and IPv6 TCP +connections), mitigate DDOS using flowspec, or pass the route it receives +in textual form to third party application. + +WWW: https://github.com/Exa-Networks/exabgp diff --git a/net/exabgp4/pkg-plist b/net/exabgp4/pkg-plist new file mode 100644 index 000000000000..e91d19bade8e --- /dev/null +++ b/net/exabgp4/pkg-plist @@ -0,0 +1,101 @@ +@sample etc/exabgp/exabgp.env.sample +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-add-remove.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-announce.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-announcement.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-api.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-attributes.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-attributes-vpn.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-broken-flow.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-check.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-eor.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-fast.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-flow.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-manual-eor.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-multi-neighbor.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-multisession.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-nexthop-self.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-nexthop.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-no-respawn.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-no-respawn-1.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-no-respawn-2.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-notification.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-open.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-reload.1.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-reload.2.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-teardown.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-vpls.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-vpnv4.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/api-watchdog.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-addpath.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-aggregator.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-attributes.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-flow-redirect.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-flow.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-generic-attribute.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-group-limit.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-group.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-ipself4.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-ipself6.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-ipv46routes4family.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-ipv46routes6family.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-ipv6grouping.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-l2vpn.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-largecommunity.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-name.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-new-v4.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-new-v6.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-no-asn4.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-parity.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-path-information.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-prefix-sid.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-prefix-sid-srv6.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-split.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-template.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-unknowncap.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/conf-vpn.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/example-api-program.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/example-healthcheck.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/example-tcp-control.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/example-tcp-control.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/extended-nexthop.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parse-community.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parse-dual-neighbor.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parse-md5.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parse-multiple-process.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parse-multisession.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parse-process.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parse-simple-v4.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parse-simple-v6.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parse-ttl.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-add-remove.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-announce.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-announcement.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-api.nothing.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-api.receive.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-attributes.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-attributes-vpn.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-broken-flow.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-check.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-eor.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-fast.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-flow.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-manual-eor.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-multi-neighbor.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-multisession.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-nexthop-self.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-nexthop.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-notification.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-open.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-reload.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-teardown.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-vpls.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/api-vpnv4.run +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/dynamic-1.pl +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/dynamic-1.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/stderr-1.py +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/syslog-1.py +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/watchdog-1.pl +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/watchdog-1.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/run/watchdog.run +@dir etc/exabgp +@postunexec if [ -d %D/%%ETCDIR%% ]; then echo "==> If you are permanently removing this port, you should do a ``rm -rf ${PKG_PREFIX}/etc/exabgp`` to remove any configuration files left."; fi |