summaryrefslogtreecommitdiff
path: root/roles/uvok_bird/files/clear_functions.conf
blob: f9e3c107d57c9f6a37ead47b33ec58cb1f599f88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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));
}