function is_peer_route() { if (LOCAL_ASN, 110, 0) ~ bgp_large_community then return false; if (LOCAL_ASN, 110, 10) ~ bgp_large_community then return false; if bgp_path ~ [ 7018, 3320, 3257, 6830, 3356, 2914, 5511, 3491, 1239, 6453, 6762, 1299, 12956, 701, 6461, 174, 6939] then { return false; } return true; } function direct_peer_import_filter(int ASN) { if !is_valid() then return false; if !is_peer_route() then return false; pub_add_communities(ASN, 0); pub_preprocess_communities(); return true; } function direct_peer_export_filter(int ASN) { # Delete Self eBGP Confed Path. bgp_path.delete([4200000000..4225479999]); if !is_valid() then return false; if !is_peer_route() then return false; if pub_process_communities(ASN, 0) then return true; else return false; }