Invalids

Invalids #

The invalids handler will return all the invalid prefixes originated by an ASN.

Invalids is unique in which the query will fetch all current invalids. You’ll then be able to iterate through the response to check for invalids from any 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_invalids()
if c.status_code == 200:
    print(f"AS3356 is originating the following invalids: {c.invalids(3356)}")
AS3356 is originating the following invalids: [IPv4Network('103.75.231.0/24'), IPv4Network('181.215.37.0/24')]

print(f"AS15169 is originating the following invalids: {c.invalids(15169)}")
AS15169 is originating the following invalids: None
TODO