0 Matches
# Types

r.route :: String
r.as_path :: [Integer]
r.bgp_community :: [String]
asdb :: [String] -- where the key is ASN

# Example Queries

/* Show route of 2001:470::/32 */
r.route == '2001:470::/32'

/* Show route w/ 6939 in AS Path */
r.as_path.includes(6939)

/* show route w/ community 65443:4134 */
if(r.bgp_community) r.bgp_community.includes('65443:4134')

/* show route to address 106.185.35.122 */
r.route.netOf('106.185.35.122')

/* Show route with community *:58453 or *:4134 */
if(r.bgp_community) r.bgp_community.some(c => { return c.match(/:58453/) || c.match(/:4134/) })

/* Show route with a prefix less than /9 */
Number.parseInt(r.route.split('/')[1]) < 9

/* "real" as_path (as_path w/o prepend) > 10 */
(r.as_path.filter((i, p, s) => s.indexOf(i) == p)).length > 10

/* Show path to prefixes with "carnegie mellon" in it's AS descr */
r.as_path.some(a => { if(asdb[a]) return asdb[a].toLowerCase().includes('carnegie mellon'); })