Michael Tremer wrote:
In your code, you are creating a new AS which is not what you want.
I figured that after I sent my previous message.
struct loc_network* network = loc_database_lookup_from_string(db, "81.3.27.38");
I use 'loc_database_lookup()' directly since I do not want to waste CPU-cycles on 'inet_pton()'. Works fine for me, except I must always map an IPv4 to a IPv6-mapped address first.
In my code (and 'location lookup'), e.g. a '37.142.14.15' never works. But this works '::ffff:37.142.14.15' always: Network : 37.142.0.0/20 Country : Israel Autonomous System : AS12849 - Hot-Net internet services Ltd.
// Copy the name to somewhere
I found the AS-name can be quite long: AS49450 - Federal State Budget Institution NATIONAL MEDICAL RESEARCH CENTER FOR OBSTETRICS, GYNECOLOGY AND PERINATOLOGY named after academician V. I. Kulakov of the Ministry of Healthcare of the Russian Federation,
Longest I found, a whopping 214 characters. I suppose 'libloc' handle any length?
Besides, how can I (if possible with libloc/location.py) figure out all the Peers for an AS? Like what: https://dnslytics.com/bgp/as39029 (Redpill Linpro AS)
reports for "IP Prefixes and Peers". For IPv6: 8473 Bahnhof AB 2119 Telenor AS 56655 TerraHost AS ...
If I do: location list-networks-by-as --family ipv6 39029 2001:67c:21e0::/48 << ! ... and: location list-networks-by-as --family ipv6 8473 2001:67c:107c::/48 2001:67c:2fb8::/48 << ! this looks close to 2001:67c:21e0:: ...
Is the relation with an AS and a peer only a routing (BGP) thing? Where each of the AS'es have a common routing path?
I'm just beginning to understand all these concepts. So sorry for nagging..