Skip to content

Commit

Permalink
BIRD 2.13, OpenBGPD 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
pierky committed Oct 10, 2023
1 parent 9bf3a5c commit 5cd4a16
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 33 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ jobs:
run: |
echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
docker pull pierky/bird:1.6.8
docker pull pierky/bird:2.13
docker pull pierky/bird:2.14
docker pull pierky/bird:3.0-alpha2
docker pull pierky/openbgpd:7.8
docker pull pierky/openbgpd:8.0
docker pull pierky/openbgpd:8.2
docker pull pierky/exabgp:4.2.7
docker pull nlnetlabs/routinator:v0.8.3
env:
Expand Down Expand Up @@ -225,7 +225,7 @@ jobs:
-e ROUTER_ID=192.0.2.124 \
-e LOCAL_PREFIXES=192.0.2.0/24,2001:db8::/32 \
-e DAEMON=openbgpd \
-e VERSION=8.0 \
-e VERSION=8.2 \
-e SECRET_PEERINGDB_API_KEY="${SECRET_PEERINGDB_API_KEY}" \
pierky/arouteserver:${{ matrix.docker-image.target_image }}
env:
Expand All @@ -237,7 +237,7 @@ jobs:
-t \
--rm \
-v ~/arouteserver_configs/openbgpd.cfg:/etc/bgpd/bgpd.conf \
pierky/openbgpd:8.0 \
pierky/openbgpd:8.2 \
bgpd \
-f /etc/bgpd/bgpd.conf \
-d \
Expand All @@ -258,7 +258,7 @@ jobs:
-v $(pwd)/examples/auto-config/bird-general.yml:/etc/arouteserver/general.yml:ro \
-v ~/arouteserver_configs:/root/arouteserver_configs \
-e DAEMON=bird \
-e VERSION=2.13 \
-e VERSION=2.14 \
-e SECRET_PEERINGDB_API_KEY="${SECRET_PEERINGDB_API_KEY}" \
pierky/arouteserver:${{ matrix.docker-image.target_image }}
env:
Expand All @@ -270,7 +270,7 @@ jobs:
-t \
--rm \
-v ~/arouteserver_configs/bird.cfg:/etc/bird/bird.cfg \
pierky/bird:2.13 \
pierky/bird:2.14 \
bird \
-c /etc/bird/bird.cfg \
-d \
Expand Down
6 changes: 3 additions & 3 deletions pierky/arouteserver/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,9 +875,9 @@ class BIRDConfigBuilder(ConfigBuilder):

AVAILABLE_VERSION = ["1.6.3", "1.6.4", "1.6.6", "1.6.7", "1.6.8",
"2.0.7", "2.0.7+b962967e", "2.0.8", "2.0.9",
"2.0.10", "2.0.11", "2.13",
"2.0.10", "2.0.11", "2.13", "2.14",
"3.0"]
DEFAULT_VERSION = "2.13"
DEFAULT_VERSION = "2.14"

def validate_bgpspeaker_specific_configuration(self):
res = True
Expand Down Expand Up @@ -1051,7 +1051,7 @@ class OpenBGPDConfigBuilder(ConfigBuilder):
LOCAL_FILES_BASE_DIR = "/etc/bgpd"

AVAILABLE_VERSION = ["7.0", "7.1", "7.2", "7.3", "7.4", "7.5", "7.6", "7.7",
"7.8", "8.0"]
"7.8", "8.0", "8.2"]
DEFAULT_VERSION = AVAILABLE_VERSION[-1]

IGNORABLE_ISSUES = ConfigBuilder.IGNORABLE_ISSUES + \
Expand Down
4 changes: 2 additions & 2 deletions pierky/arouteserver/tests/live_tests/bird.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,11 @@ def _birdcl(self, cmd):

class BIRD2Instance(BIRDInstance):

DOCKER_IMAGE = "pierky/bird:2.13"
DOCKER_IMAGE = "pierky/bird:2.14"

TAG = "bird2"

TARGET_VERSION = "2.13"
TARGET_VERSION = "2.14"

def _get_start_cmd(self):
return "bird -c /etc/bird/bird.conf -d"
Expand Down
14 changes: 12 additions & 2 deletions pierky/arouteserver/tests/live_tests/openbgpd.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,5 +661,15 @@ class OpenBGPD80PortableInstance(OpenBGPDPortableInstance):
TARGET_VERSION = "8.0"


OpenBGPDPortablePreviousInstance = OpenBGPD78PortableInstance
OpenBGPDPortableLatestInstance = OpenBGPD80PortableInstance
class OpenBGPD82PortableInstance(OpenBGPDPortableInstance):

DOCKER_IMAGE = "pierky/openbgpd:8.2"

TAG = "openbgpd82p"

BGP_SPEAKER_VERSION = "8.2"
TARGET_VERSION = "8.2"


OpenBGPDPortablePreviousInstance = OpenBGPD80PortableInstance
OpenBGPDPortableLatestInstance = OpenBGPD82PortableInstance
8 changes: 4 additions & 4 deletions templates/bird/clients.j2
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ reject {{ err_msg }};
{% for client in clients|sort(attribute="id") if client.ip is current_ipver %}

# AS-SET for {{ client.id }}
function origin_as_is_in_{{ client.id }}_as_set() {
function origin_as_is_in_{{ client.id }}_as_set(){% if "2.14"|target_version_ge %} -> bool{% endif %} {
{% if client.cfg.filtering.irrdb.as_set_bundle_ids %}
{% for as_set_bundle_id in client.cfg.filtering.irrdb.as_set_bundle_ids|sort %}
{% if irrdb_info[as_set_bundle_id].asns %}
Expand All @@ -54,7 +54,7 @@ function origin_as_is_in_{{ client.id }}_as_set() {
}

# R-SET for {{ client.id }}
function prefix_is_in_{{ client.id }}_as_set() {
function prefix_is_in_{{ client.id }}_as_set(){% if "2.14"|target_version_ge %} -> bool{% endif %} {
{% if client.cfg.filtering.irrdb.as_set_bundle_ids %}
{% for as_set_bundle_id in client.cfg.filtering.irrdb.as_set_bundle_ids|sort %}
{% set this_ip_ver = client.ip|ipaddr_ver %}
Expand All @@ -76,7 +76,7 @@ function prefix_is_in_{{ client.id }}_as_set() {
return false;
}

function next_hop_is_valid_for_{{ client.id }}()
function next_hop_is_valid_for_{{ client.id }}(){% if "2.14"|target_version_ge %} -> bool{% endif +%}
{
# Checks if NEXT_HOP is one of those allowed for routes announced by {{ client.id }}
{% if client.ip|ipaddr_ver == 6 and (client.ip|lower).startswith("fe80::") %}
Expand All @@ -102,7 +102,7 @@ function next_hop_is_valid_for_{{ client.id }}()
}

{% if client.cfg.filtering.black_list_pref %}
function prefix_is_in_{{ client.id }}_blacklist()
function prefix_is_in_{{ client.id }}_blacklist(){% if "2.14"|target_version_ge %} -> bool{% endif +%}
prefix set {{ client.id }}_blacklist;
{
{{ client.id }}_blacklist = [
Expand Down
28 changes: 14 additions & 14 deletions templates/bird/common.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{% if asn3216_map %}
# Get the 16bit value used to represent a peer with a 32bit ASN.
# Return 0 if no mapping exists for the peer.
function get_16bit_mapped_asn(int asn_32_bit) {
function get_16bit_mapped_asn(int asn_32_bit){% if "2.14"|target_version_ge %} -> int{% endif %} {
case asn_32_bit {
{% for asn in asn3216_map %}
{% if asn3216_map[asn] %}
Expand All @@ -23,7 +23,7 @@ function get_16bit_mapped_asn(int asn_32_bit) {

# This function returns True if 'net' is a bogon prefix
# or falls within a bogon prefix.
function prefix_is_bogon()
function prefix_is_bogon(){% if "2.14"|target_version_ge %} -> bool{% endif +%}
{% for this_ip_ver in list_ip_vers %}
prefix set bogons_{{ this_ip_ver }};
{% endfor %}
Expand All @@ -48,7 +48,7 @@ prefix set bogons_{{ this_ip_ver }};
# This function returns True if 'net' falls within a
# prefix contained in the global blacklist (for example,
# local networks)
function prefix_is_in_global_blacklist()
function prefix_is_in_global_blacklist(){% if "2.14"|target_version_ge %} -> bool{% endif +%}
{% for this_ip_ver in list_ip_vers %}
{% set prefixes = cfg.filtering.global_black_list_pref|selectattr("prefix", "is_ipver", this_ip_ver )|list %}
{% if prefixes|length > 0 %}
Expand Down Expand Up @@ -79,15 +79,15 @@ prefix set global_blacklist_{{ this_ip_ver }};

# This function returns True if the length of 'net' prefix
# falls within the range 'min'-'max' (included).
function prefix_len_is_valid (int pref_len_min; int pref_len_max) {
function prefix_len_is_valid (int pref_len_min; int pref_len_max){% if "2.14"|target_version_ge %} -> bool{% endif %} {
if net.len < pref_len_min then return false;
if net.len > pref_len_max then return false;
return true;
}

# This function returns True if the AS_PATH contains one or
# more private/reserved ASN.
function as_path_contains_invalid_asn()
function as_path_contains_invalid_asn(){% if "2.14"|target_version_ge %} -> bool{% endif +%}
int set invalid_asns;
{
# http://www.iana.org/assignments/as-numbers/as-numbers.xhtml
Expand All @@ -111,7 +111,7 @@ int set invalid_asns;
{% if rtt_based_functions_are_used %}
# This function returns the RTT measured for the peer given in client_ip.
# If the RTT is not available it returns 0.
function get_peer_rtt(ip client_ip) {
function get_peer_rtt(ip client_ip){% if "2.14"|target_version_ge %} -> int{% endif %} {
case client_ip {
{% for client in clients|sort(attribute="ip") if client.ip is current_ipver %}
{% if "rtt" in client and client["rtt"]|get_normalized_rtt %}
Expand Down Expand Up @@ -182,7 +182,7 @@ int mapped_16bit_asn;

# This function verifies if the route is tagged with one of
# the blackhole filtering communities.
function is_blackhole_filtering_request()
function is_blackhole_filtering_request(){% if "2.14"|target_version_ge %} -> bool{% endif +%}
{% if asn3216_map %}
int mapped_16bit_asn;
{% endif %}
Expand Down Expand Up @@ -242,7 +242,7 @@ function apply_blackhole_filtering_policy() {
# This function verifies if the current route can be announced to
# the given client on the basis of the attached control BGP
# communities.
function route_can_be_announced_to(int peer_as; ip client_ip; string client_id)
function route_can_be_announced_to(int peer_as; ip client_ip; string client_id){% if "2.14"|target_version_ge %} -> bool{% endif +%}
int client_rtt;
{% if asn3216_map %}
int mapped_16bit_asn;
Expand Down Expand Up @@ -305,7 +305,7 @@ function do_prepend(int times) {

# This function verifies if the current route matches one of the
# control communities in charge of prepending client's ASN.
function apply_prepend(int peer_as; ip client_ip)
function apply_prepend(int peer_as; ip client_ip){% if "2.14"|target_version_ge %} -> bool{% endif +%}
int client_rtt;
{% if asn3216_map %}
int mapped_16bit_asn;
Expand Down Expand Up @@ -411,13 +411,13 @@ function perform_rpki_validation () {
}

# This function returns True if the route is INVALID.
function route_is_rpki_invalid () {
function route_is_rpki_invalid (){% if "2.14"|target_version_ge %} -> bool{% endif %} {
return (unknown 0x4300, 0, 2) ~ bgp_ext_community;
}

# This function returns True if RPKI INVALID routes
# should be announced to clients.
function announce_rpki_invalid_to_client(int client_asn; ip client_ip; string client_id) {
function announce_rpki_invalid_to_client(int client_asn; ip client_ip; string client_id){% if "2.14"|target_version_ge %} -> bool{% endif %} {
{% if "announce_rpki_invalid_to_client"|hook_is_set %}
return hook_announce_rpki_invalid_to_client(client_asn, client_ip, client_id);
{% else %}
Expand Down Expand Up @@ -531,7 +531,7 @@ function perform_graceful_shutdown() {
{% if cfg.filtering.irrdb.use_rpki_roas_as_route_objects.enabled %}
# This function verifies if there is such a ROA for the
# current route's origin ASN to validate the announced prefix.
function prefix_in_rpki_roas_as_route_objects() {
function prefix_in_rpki_roas_as_route_objects(){% if "2.14"|target_version_ge %} -> bool{% endif %} {
{% if "2.0.0"|target_version_le %}
case roa_check(RPKI) {
ROA_VALID: return true;
Expand All @@ -556,7 +556,7 @@ function prefix_in_rpki_roas_as_route_objects() {
# Whois DB: if there is such an entry for the current route's
# origin ASN to validate the announced prefix the function
# returns True, otherwise False.
function prefix_in_arin_whois_db() {
function prefix_in_arin_whois_db(){% if "2.14"|target_version_ge %} -> bool{% endif %} {
{% for this_ip_ver in list_ip_vers %}
{% if "2.0"|target_version_ge %}
if net.type = NET_IP{{ this_ip_ver }} then {
Expand All @@ -582,7 +582,7 @@ function prefix_in_arin_whois_db() {
# Whois DB: if there is such an entry for the current route's
# origin ASN to validate the announced prefix the function
# returns True, otherwise False.
function prefix_in_registrobr_whois_db() {
function prefix_in_registrobr_whois_db(){% if "2.14"|target_version_ge %} -> bool{% endif %} {
{% for this_ip_ver in list_ip_vers %}
{% if "2.0"|target_version_ge %}
if net.type = NET_IP{{ this_ip_ver }} then {
Expand Down
4 changes: 2 additions & 2 deletions utils/update_tests
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ fi
echo "Pulling Docker images needed for the tests..."
# To be kept in sync with .github/workflows/cicd.yml
docker pull pierky/bird:1.6.8
docker pull pierky/bird:2.13
docker pull pierky/bird:2.14
docker pull pierky/bird:3.0-alpha2
docker pull pierky/openbgpd:7.8
docker pull pierky/openbgpd:8.0
docker pull pierky/openbgpd:8.2
docker pull pierky/exabgp:4.2.7
docker pull nlnetlabs/routinator:v0.8.3
Expand Down

0 comments on commit 5cd4a16

Please sign in to comment.