From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gisle Vanem To: location@lists.ipfire.org Subject: Re: Problem with 'loc_as_get_name()' Date: Fri, 23 Oct 2020 18:29:40 +0200 Message-ID: <9fdd2b0e-056e-1e5a-ce2c-e03c26cc37d9@gmail.com> In-Reply-To: <3C3541B3-64F4-4077-B13B-FBE63040784C@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1960481473076993156==" List-Id: --===============1960481473076993156== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 =3D loc_database_lookup_from_string(db, "81.3.2= 7.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 Federa= tion, 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.. --=20 --gv --===============1960481473076993156==--