summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--roles/uvok_bird/files/clear_functions.conf26
1 files changed, 26 insertions, 0 deletions
diff --git a/roles/uvok_bird/files/clear_functions.conf b/roles/uvok_bird/files/clear_functions.conf
new file mode 100644
index 0000000..f9e3c10
--- /dev/null
+++ b/roles/uvok_bird/files/clear_functions.conf
@@ -0,0 +1,26 @@
+# managed by Ansible
+
+function clean_own_communities() {
+ bgp_large_community.delete([(CLEARNET_ASN, *, *)]);
+}
+
+function clearnet_import_ixp() {
+ clean_own_communities();
+ bgp_large_community.add((CLEARNET_ASN, LC_INFO, INFO_IXP_RS));
+}
+
+function clearnet_import_transit() {
+ clean_own_communities();
+ bgp_large_community.add((CLEARNET_ASN, LC_INFO, INFO_TRANSIT));
+}
+
+function clearnet_is_ixp() {
+ if (CLEARNET_ASN, LC_INFO, INFO_IXP_RS) ~ bgp_large_community then {
+ return true;
+ }
+ return false;
+}
+
+function clearnet_add_filter(int filter_reason) {
+ bgp_large_community.add((CLEARNET_ASN, LC_FILTERED, filter_reason));
+}