sbng / mrt2mmdb

Convert a mrt file into a maxmind database file
1 stars 0 forks source link

Feature request: add full route summary to lookup.py by ASN #2

Closed johnhtodd closed 4 months ago

johnhtodd commented 4 months ago

I really like the “lookup.py” tool - that’s quite handy. Could you extend it a bit? this is really really not critical, but it seems like a very useful thing to add some iterations so that every prefix from a particular ASN could be delivered with one command. I tried this:

root@dev01:~/mrt/mrt2mmdb/mrt2mmdb# python3 lookup.py --mmdb out.mmdb --asn 701
{'autonomous_system_number': '701', 'autonomous_system_organization': 'UUNET', 'organization': '2a02:c180:1fff::/48', 'isp': '42 2914 701'}
root@dev01:~/mrt/mrt2mmdb/mrt2mmdb#

…but it only gave me one result. It would be really handy to give ALL results that were originated by AS701.

sbng commented 4 months ago

My original goal of lookup.py is to help in debugging. So I use a dictionary to capture the key,value. Since the key is ASN, it can only store one value :-( I have since convert it to a list so all the key,vlues are captured and display in json format. Thanks for this wonderful suggestion @johnhtodd

sbng commented 4 months ago

fixed in ca96b2b. Please verify

sbng commented 4 months ago

merge into main