mellowdrifter / python-bgpstuff.net

Apache License 2.0
3 stars 1 forks source link

Implements bogons #7

Closed mellowdrifter closed 3 years ago

mellowdrifter commented 3 years ago

I have a Go library here - https://github.com/mellowdrifter/bogons/blob/main/bogons.go

Need to re-implement that in Python. But it should be a separate library to import

mellowdrifter commented 3 years ago

Initial commit here - https://github.com/mellowdrifter/python-bogons

crankynetman commented 3 years ago

Should this be a separate library entirely, or a module of the bgpstuff package? (Not really too sure that it matters TBH, I have just been reading a LOT about packages/modules and my head is now spinning thinking of where to use them LOL)

mellowdrifter commented 3 years ago

I think separate as it's useful not just for this client. Much like my Go bogons, I import that in at least three separate locations already

crankynetman commented 3 years ago

Makes sense!

mellowdrifter commented 3 years ago

bogons updated. ipaddress.ip_public is returning True for a lot of RFC bogon IPv6 addresses. I'll implement the specific IPv6 RFCs in the client to match my Go code.

IPv4 ispublic does seem to catch all my tests so I'll just use that. However it did return True for multicast addresses so I'm checking for that first

crankynetman commented 3 years ago

Added a PR to the bogons repo that will help us us to import this easily as a dependency.

mellowdrifter commented 3 years ago

This is done