# managed by Ansible function clean_own_communities() { bgp_large_community.delete([(CLEARNET_ASN, *, *)]); } function clearnet_import_ixp(int ixp_id) { clean_own_communities(); bgp_large_community.add((CLEARNET_ASN, LC_INFO, INFO_IXP_RS)); bgp_large_community.add((CLEARNET_ASN, LC_IXP_ID, ixp_id)); } function clearnet_import_transit() { clean_own_communities(); bgp_large_community.add((CLEARNET_ASN, LC_INFO, INFO_TRANSIT)); } function clearnet_import_peer() { clean_own_communities(); bgp_large_community.add((CLEARNET_ASN, LC_INFO, INFO_PEER)); } 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)); # ensure route never gets selected as "best" # (for direct peer connections: if that happened, no other route # would go from unfiltered to transit table). bgp_local_pref = 0; }