Sourced

Sourced #

The sourced handler will return all the prefixes sourced by a specific ASN. Note that prefixes returned will be in the ipaddress format.

Always check the status_code is 200 after each query.
c = bgpstuff.Client()

c.get_sourced(1)
if c.status_code == 200 and c.exists:
    print(f"AS1 is originating {len(c.sourced)} prefixes: {c.sourced}")
AS1 is originating 11 prefixes: [IPv4Network('96.2.223.0/24'), IPv4Network('91.210.38.0/24'), IPv4Network('12.51.30.0/24'), IPv4Network('205.207.214.0/24'), IPv4Network('96.2.221.0/24'), IPv4Network('91.210.36.0/24'), IPv4Network('91.210.37.0/24'), IPv4Network('45.182.198.0/23'), IPv4Network('24.220.77.0/24'), IPv4Network('212.94.84.0/22'), IPv6Network('2804:2720::/32')]
TODO