summaryrefslogtreecommitdiff
path: root/net-misc/exabgp
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/exabgp')
-rw-r--r--net-misc/exabgp/Manifest5
-rw-r--r--net-misc/exabgp/exabgp-4.2.11-r2.ebuild59
-rw-r--r--net-misc/exabgp/files/exabgp-4.2.11-healthcheck-allow-disable-metric.patch22
-rw-r--r--net-misc/exabgp/files/exabgp-4.2.11-healthcheck-fix-log-crash.patch13
-rw-r--r--net-misc/exabgp/files/exabgp-4.2.11-less-verbose-logging.patch44
-rw-r--r--net-misc/exabgp/files/exabgp.initd-r164
6 files changed, 207 insertions, 0 deletions
diff --git a/net-misc/exabgp/Manifest b/net-misc/exabgp/Manifest
index 5b4015ed617b..eb54a27b1d6d 100644
--- a/net-misc/exabgp/Manifest
+++ b/net-misc/exabgp/Manifest
@@ -1,9 +1,14 @@
AUX exabgp-4.2.10-ip-path.patch 794 BLAKE2B 54a55550f928eaa3c3a64e3c7e19acff21b71753255f6c3abfede6e2f3446417e7e99413d82d12e03fcc292802ec76ccf6e572c0af081c46351b7d15ebcd5970 SHA512 71568d0d6b11f427d795e3a47e7877fd7ea5c5708d49e51958ee5077758a5ca2af0272d8143a3cca506f07e010cf4e8875403dce1d8d366a171c2c9eb1c7ef6c
+AUX exabgp-4.2.11-healthcheck-allow-disable-metric.patch 1200 BLAKE2B c3cbe40e36a89ebf777501aafabd6c0f855313a35792b057ee38321c5d58916f5caf8e8d037ade697f4fb55be8851d0b03087412cecb913be627267b703db49e SHA512 04a6e0cf857b28406408bf768f12acb3f1e71e224c9881ff0bedceea7ae8b54b502833db6b560754a5ff27c3c437127b8443d686becadff073dec0d97b9d49e8
+AUX exabgp-4.2.11-healthcheck-fix-log-crash.patch 504 BLAKE2B ba1070bfd58e84748cdf54435f7c0d525cfa426f4ecc0e922ec61be81df75e735e1fda21f4aed42df51edec89c2a3502c2219f127c82d135bd1c03e9bd5b2b4e SHA512 59b794bb383e510b6ef4ab2aee8f40644982275079d83aff124f0769e7a88fe1f0b86c3b1df910f923f2cbbe602b0df5ce144813f06145cf669c1a90bcae7b5b
+AUX exabgp-4.2.11-less-verbose-logging.patch 2346 BLAKE2B 7a08fe4ac14622a69136a0456a7249d1a3ab08cd1fd07338ec05eedaff05ece565c5d86abaf24ab3147a248067f91d84982118e2713362c0648c2e8ade139a59 SHA512 2f76c8eb7b4fdd9ea39f896af6892a1b13a7357868e8a99803df295a9955149d09c6a25c17f2f0c50c435bcc320fccfe9b424f899b17d4c9a73ee359deabf6ff
AUX exabgp-4.2.7-paths.patch 302 BLAKE2B 52110fefb75e0a36452ea3e53f099897b30df8287d033b353f66df25cf75c4a75a80e91ef49a47c652a46274faabfcf5385653ae03eb75ed1afd866c068967c7 SHA512 678258e4848b17b9880849cb8d105ee64b4cb6bdd678c3c96707467a2bae51c30d34b8609bf5c9a48bcd0722f6247b009dc5c406a3bab02d77bf2f919e7f4fbc
AUX exabgp.confd 183 BLAKE2B 59338bbd61001e4418b970abc45786004b833f80576117122fec99f148c1bab3bc7feed80c46b8bac2ac639b720daa320bd141f65b25a37a6ce1f229653f3741 SHA512 7b888ea5053ebb8da9acbd4a85b6a9900663cadb89258aea86d47cade505e8bbfc6e741fed599d410480467f76f759175d710c284bc6caafdabb4a61c53611ac
AUX exabgp.initd 1472 BLAKE2B 488c1de5222be9f5f67e279fa9607c326922d80c2aafa6cb098f5f721ef1df30f1d56a2a0a0ef6ca376cdb00f65cb1fc644214248b7ea9dbc9dfd55442be7d2b SHA512 453ab87961b4647374af62a02280e750ba0b1bf535a5e92c4434c4ff6c0a55f7ec52a5e0e5a784a31695e02ece42543260186aa25c658368331c06c12794d4b4
+AUX exabgp.initd-r1 1587 BLAKE2B b3462e4e990b96975ee6904937ffb859ad761581b596d71adda251e6a2aeeb9c2559c517d5f99e5d7cf5b62f155545fd7e3e43be8fd7ce89a30eae180ebd1c5c SHA512 0e4f93a1fcadea383da86bccb886dfc340f92cab6814c01fc6a5f2923ad85b894ee8b314312c04b55f2f94c28f46af5081ac55592f45882c9ae5d328fa08d91e
AUX exabgp.logrotate 61 BLAKE2B 63024bebc07e3eadacf1550674f5fbb7cf22d903a02784d8d5f1aae3b8f6e543e5b4b2f7208af91b4c063cb68d831caf18c2b03fce211c4c447f3828c5c8127f SHA512 27e751f0ff066448fc0121a129a9c48ac645738f65041aa29816cddc80dc73f2458110ccd12fa48b2ccb573908357425070103303d5645987b2a4e74986a2786
AUX exabgp.tmpfiles 136 BLAKE2B 1255c9e510f9dc53b4e1b678ab8be2c7e88aac461789b15106ebf1e9606eb48ccd732efcc8ebfc8271efa5d0f6972705476a5f8c658480909b35ebf6eb399281 SHA512 3a11a011967f83483c85035ab63376bc92af3c3076ddbaac2e2cb3557aa314cfb188ee8e3208bfec7cb74d86a7b877c50487cbfa5f3097534cdbc7e98fc4b537
DIST exabgp-4.2.11.tar.gz 2931753 BLAKE2B e5241619db24e2e82dfb42bc613d6b2c28efac205d2bedf732a665a5a9eff1b384833cb1fec3e68a285fc01269c2eaca55b311650e59bcda13d8f024e5294dc3 SHA512 61c143e90fd81323b03682ad46f2861576ab0328e2030259eff15bb9ef965477c514fb355112cbaf3dc138fb9f5582b6e1e1efb8d0d4313a9b9924ced156a155
EBUILD exabgp-4.2.11-r1.ebuild 1250 BLAKE2B 32b423c361ba950250135dab442d795dfd8fc191bf3070877e2df2aae34dc76392030c15ce87bbe07b170d71c4ea64a1b5cace7885cb7bc308d6983731fad98a SHA512 0e245f536632f8cbf4869dd5cd52f945fb03e604ab2115d64ad9539075d384c64e003f3f5310ef8d4d31dc9a652705e1a684f579ec2b69184e91cd4fb70b222e
+EBUILD exabgp-4.2.11-r2.ebuild 1438 BLAKE2B 37e34dfe62a42ab901abf44a77b7a84c4434eb7da2d4c41b3fb007e14f93d98c3b91b545e345f8603c8f616e3dd79917c2081b6b77921df13ff3077c985a3e97 SHA512 57c1c36a2431e10de4dba2f788303d6a70a0d9446e4287fab535893ec2779c32a166f5b6e848132446580077d02c0df1838ece80a44ed7a6336abd94d3edb6cd
MISC metadata.xml 343 BLAKE2B 306f12e34e1edf8060cdd1515f77040a2b400a9d853b8b46a73b219464947cf3fc1f64efc32bde26074aa61cb483466ea752481876a02cb14c8388787105e61f SHA512 9c4c8e26eb586fa1153b1f02db408cebd9a460c6ceca049fe121977d1a14ec130d9289aca2f0cffee009a5e7f314818eb37b55790c75502817bb2941be7352f6
diff --git a/net-misc/exabgp/exabgp-4.2.11-r2.ebuild b/net-misc/exabgp/exabgp-4.2.11-r2.ebuild
new file mode 100644
index 000000000000..3e7774c03533
--- /dev/null
+++ b/net-misc/exabgp/exabgp-4.2.11-r2.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python3_{7..9} )
+DISTUTILS_USE_SETUPTOOLS=rdepend
+inherit tmpfiles systemd distutils-r1
+
+DESCRIPTION="The BGP swiss army knife of networking"
+HOMEPAGE="https://github.com/Exa-Networks/exabgp"
+SRC_URI="https://github.com/Exa-Networks/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ acct-group/exabgp
+ acct-user/exabgp
+"
+BDEPEND="
+ test? (
+ dev-python/psutil[${PYTHON_USEDEP}]
+ dev-python/nose[${PYTHON_USEDEP}]
+ dev-python/six[${PYTHON_USEDEP}]
+ )
+"
+
+PATCHES=(
+ "${FILESDIR}/exabgp-4.2.7-paths.patch"
+ "${FILESDIR}/exabgp-4.2.10-ip-path.patch"
+ "${FILESDIR}/exabgp-4.2.11-healthcheck-allow-disable-metric.patch"
+ "${FILESDIR}/exabgp-4.2.11-healthcheck-fix-log-crash.patch"
+ "${FILESDIR}/exabgp-4.2.11-less-verbose-logging.patch"
+)
+
+python_test() {
+ ./qa/bin/parsing || die "tests fail with ${EPYTHON}"
+ nosetests -v ./qa/tests/*_test.py || die "tests fail with ${EPYTHON}"
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ newinitd "${FILESDIR}/${PN}.initd-r1" ${PN}
+ newconfd "${FILESDIR}/${PN}.confd" ${PN}
+
+ newtmpfiles "${FILESDIR}/exabgp.tmpfiles" ${PN}.conf
+ systemd_dounit etc/systemd/*
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/${PN}.logrotate" ${PN}
+
+ keepdir /etc/exabgp
+
+ doman doc/man/*.?
+}
diff --git a/net-misc/exabgp/files/exabgp-4.2.11-healthcheck-allow-disable-metric.patch b/net-misc/exabgp/files/exabgp-4.2.11-healthcheck-allow-disable-metric.patch
new file mode 100644
index 000000000000..768fe80a8107
--- /dev/null
+++ b/net-misc/exabgp/files/exabgp-4.2.11-healthcheck-allow-disable-metric.patch
@@ -0,0 +1,22 @@
+diff --git a/lib/exabgp/application/healthcheck.py b/lib/exabgp/application/healthcheck.py
+index a4f6b8d1..805cf8af 100644
+--- a/lib/exabgp/application/healthcheck.py
++++ b/lib/exabgp/application/healthcheck.py
+@@ -168,6 +168,7 @@
+ g.add_argument(
+ "--start-ip", metavar='N', type=int, default=0, help="index of the first IP in the list of IP addresses"
+ )
++ g.add_argument("--no-metric", action="store_true", default=False, help="don't send metrics when updating announcements")
+ g.add_argument(
+ "--up-metric", metavar='M', type=int, default=100, help="first IP get the metric M when the service is up"
+ )
+@@ -494,7 +495,8 @@
+ announce = "route {0} next-hop {1}".format(str(ip), options.next_hop or "self")
+
+ if command == "announce":
+- announce = "{0} med {1}".format(announce, metric)
++ if not options.no_metric:
++ announce = "{0} med {1}".format(announce, metric)
+ if options.local_preference >= 0:
+ announce = "{0} local-preference {1}".format(announce, options.local_preference)
+ if options.community or options.disabled_community:
diff --git a/net-misc/exabgp/files/exabgp-4.2.11-healthcheck-fix-log-crash.patch b/net-misc/exabgp/files/exabgp-4.2.11-healthcheck-fix-log-crash.patch
new file mode 100644
index 000000000000..a43e90a724e4
--- /dev/null
+++ b/net-misc/exabgp/files/exabgp-4.2.11-healthcheck-fix-log-crash.patch
@@ -0,0 +1,13 @@
+diff --git a/lib/exabgp/logger.py b/lib/exabgp/logger.py
+index 41a1cf28..f87785a2 100644
+--- a/lib/exabgp/logger.py
++++ b/lib/exabgp/logger.py
+@@ -339,7 +339,7 @@ class Logger(object):
+ else:
+ src = source
+
+- log = self._option.get(src, True) and getattr(syslog, 'LOG_%s' % level) <= self.level
++ log = self._option.get(src, True) and getattr(syslog, 'LOG_%s' % level, logging.handlers.SysLogHandler.LOG_DAEMON) <= self.level
+
+ if not log:
+ return
diff --git a/net-misc/exabgp/files/exabgp-4.2.11-less-verbose-logging.patch b/net-misc/exabgp/files/exabgp-4.2.11-less-verbose-logging.patch
new file mode 100644
index 000000000000..fe09a58ed776
--- /dev/null
+++ b/net-misc/exabgp/files/exabgp-4.2.11-less-verbose-logging.patch
@@ -0,0 +1,44 @@
+diff --git a/lib/exabgp/application/healthcheck.py b/lib/exabgp/application/healthcheck.py
+index a4f6b8d1..d8195074 100644
+--- a/lib/exabgp/application/healthcheck.py
++++ b/lib/exabgp/application/healthcheck.py
+@@ -159,7 +159,16 @@ def setup_logging(debug, silent, name, syslog_facility, syslog):
+ enable_syslog = syslog and not debug
+ # To syslog
+ if enable_syslog:
+- facility = getattr(logging.handlers.SysLogHandler, "LOG_{0}".format(syslog_facility.upper()))
++ if isinstance(syslog_facility, int) or syslog_facility.isdigit():
++ for log_facility, value in sorted(logging.handlers.SysLogHandler.facility_names.items(), key=lambda x: x[1]):
++ if value >= int(syslog_facility):
++ facility = log_facility
++ break
++ elif hasattr(logging.handlers.SysLogHandler, "LOG_{0}".format(syslog_facility.upper())):
++ facility = getattr(logging.handlers.SysLogHandler, "LOG_{0}".format(syslog_facility.upper()))
++ else:
++ facility = logging.handlers.SysLogHandler.LOG_DAEMON
++
+ sh = logging.handlers.SysLogHandler(address=str(syslog_address()), facility=facility)
+ if name:
+ healthcheck_name = "healthcheck-{0}".format(name)
+diff --git a/lib/exabgp/reactor/api/command/announce.py b/lib/exabgp/reactor/api/command/announce.py
+index 3c9091d2..e21cbe95 100644
+--- a/lib/exabgp/reactor/api/command/announce.py
++++ b/lib/exabgp/reactor/api/command/announce.py
+@@ -6,6 +6,7 @@ Created by Thomas Mangin on 2017-07-01.
+ Copyright (c) 2009-2017 Exa Networks. All rights reserved.
+ License: 3-clause BSD. (See the COPYRIGHT file)
+ """
++import logging
+
+ from exabgp.reactor.api.command.command import Command
+ from exabgp.reactor.api.command.limit import match_neighbors
+@@ -50,7 +51,8 @@ def announce_route(self, reactor, service, line):
+ change.nlri.action = OUT.ANNOUNCE
+ reactor.configuration.inject_change(peers, change)
+ self.log_message(
+- 'route added to %s : %s' % (', '.join(peers) if peers else 'all peers', change.extensive())
++ 'route added to %s : %s' % (', '.join(peers) if peers else 'all peers', change.extensive()),
++ level=logging.WARNING
+ )
+ yield False
+
diff --git a/net-misc/exabgp/files/exabgp.initd-r1 b/net-misc/exabgp/files/exabgp.initd-r1
new file mode 100644
index 000000000000..ec2f01704b8b
--- /dev/null
+++ b/net-misc/exabgp/files/exabgp.initd-r1
@@ -0,0 +1,64 @@
+#!/sbin/openrc-run
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# default arguments
+: "${EXABGP_ARGS:=--env=/etc/${RC_SVCNAME}/exabgp.env /etc/${RC_SVCNAME}/exabgp.conf}"
+
+command="capsh"
+command_args="
+ --uid=${EXABGP_USER:=exabgp}
+ --gid=${EXABGP_GROUP:=exabgp}
+ --caps='cap_net_admin+epi cap_setuid+ep-i cap_setgid+ep-i'
+ -- -c \"/usr/bin/exabgp ${EXABGP_ARGS}\""
+
+supervisor=supervise-daemon
+
+: "${pidfile:=/run/exabgp/${RC_SVCNAME}-supervisor.pid}"
+: "${output_log:=/var/log/${RC_SVCNAME}/exabgp.log}"
+: "${error_log:=/var/log/${RC_SVCNAME}/exabgp.log}"
+
+extra_started_commands="routes sessions"
+extra_commands="checkconfig"
+
+depend() {
+ need net
+}
+
+start_pre() {
+ checkpath -q -d -m 0755 -o "${EXABGP_USER}:${EXABGP_GROUP}" \
+ /run/exabgp || return
+
+ checkpath -q -p -m 0600 -o "${EXABGP_USER}:${EXABGP_GROUP}" \
+ /run/exabgp/${RC_SVCNAME}.{in,out} || return
+
+ checkpath -q -d -m 0755 -o "${EXABGP_USER}:${EXABGP_GROUP}" \
+ "/var/log/${RC_SVCNAME}" || return
+
+ checkconfig || return
+}
+
+stop_pre() {
+ # don't restart if the configuration is bad
+ if [ "${RC_CMD}" = restart ]; then
+ checkconfig || return
+ fi
+}
+
+checkconfig() {
+ ebegin "Checking configuration for ${RC_SVCNAME}"
+ exabgp -t ${EXABGP_ARGS}
+ eend ${?} "Invalid configuration"
+}
+
+sessions() {
+ ebegin "Querying sessions"
+ exabgpcli --env /etc/${RC_SVCNAME}/exabgp.env show neighbor summary
+ eend ${?} "exabgpcli failed"
+}
+
+routes() {
+ ebegin "Querying routes"
+ exabgpcli --env /etc/${RC_SVCNAME}/exabgp.env show adj-rib out
+ eend ${?} "exabgpcli failed"
+}