this package is awesome. i built a wrapper around it to continuously aggregate results per netblock and IP and present that in a "top 10" table (or prometheus metrics):
https://gitlab.com/anarcat/scripts/-/blob/main/asncounter.py?ref_type=heads
while I'm not sure that wrapper itself belongs here, I wonder if you would be open with me submitting a PR for two other wrappers that i would really like to use, around asndb.get_as_prefixes and the other around asndb.lookup
like my wrapper around, i think both could assume files are present in ~/.cache/pyasn and tell the user to download those if missing.
i actually think the download scripts could be factored into the library itself, that way third parties could call those directly without doing the nasty subprocess stuff I'm doing. and I would standardize on XDG directories to automate lookups.
i'd be happy to start upstreaming any pieces of this you feel comfortable with, but would start with a simple:
... kind of syntax.
example, huawei:
$ pyasn lookup 124.243.128.0
136907 124.243.128.0/18
$ pyasn lookup 36907
1.178.32.0/20
1.178.48.0/20
101.44.0.0/20
101.44.144.0/20
101.44.16.0/20
101.44.160.0/20
101.44.173.0/24
101.44.176.0/20
101.44.192.0/20
[...]
this could be expanded to:
pyasn download rib
pyasn download asnames
pyasn convert
... and so on. maybe something to do lookups in the asnames.json file as well?
let me know!
this package is awesome. i built a wrapper around it to continuously aggregate results per netblock and IP and present that in a "top 10" table (or prometheus metrics):
https://gitlab.com/anarcat/scripts/-/blob/main/asncounter.py?ref_type=heads
while I'm not sure that wrapper itself belongs here, I wonder if you would be open with me submitting a PR for two other wrappers that i would really like to use, around
asndb.get_as_prefixesand the other aroundasndb.lookuplike my wrapper around, i think both could assume files are present in
~/.cache/pyasnand tell the user to download those if missing.i actually think the download scripts could be factored into the library itself, that way third parties could call those directly without doing the nasty
subprocessstuff I'm doing. and I would standardize on XDG directories to automate lookups.i'd be happy to start upstreaming any pieces of this you feel comfortable with, but would start with a simple:
... kind of syntax.
example, huawei:
this could be expanded to:
... and so on. maybe something to do lookups in the asnames.json file as well?
let me know!