Popularity
3.0
Growing
Activity
0.0
Stable
15
4
2

Monthly Downloads: 24
Programming language: Elixir
License: Do What The F*ck You Want To Public License
Tags: Networking    
Latest version: v0.2.1

asn alternatives and similar packages

Based on the "Networking" category.
Alternatively, view asn alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of asn or a related project?

Add another 'Networking' Package

README

Build Status Hex.pm Hex version Documentation

IP-to-AS-to-ASname lookup

Uses approximately the algorithm and resources described here: https://quaxio.com/bgp/

We support only IPv4 at this point (Until someone wants IPv6 and dares to update this :D)

ASN databases

We use the APNIC files:

setup

In your mix.exs file:

def application do
  [applications: [:asn]] # simply add asn to your loaded applications
end

def deps do
  [{:asn, ">= 0.1.0"}]
end

Note that the initial compilation might take a few more seconds since it compiles the lookup table.

In case you don't want the application single process solution, you can also start ASN.Matcher.start_link processes by hand and use them through a similat API like the ASN module, just that you will need to pass the matcher process as the first value before the function args.

usage

Due to the sheer size of the table, the compiler refuses to statically put it into the matcher module within a reasonable amount of time, and with a reasonable usage of memory. That's why we pre-compile the data into erlang-terms in external format and store that, and load it again on demand into a process.

BEWARE of wrongly formatted IP addresses! This accepts strings and tuples for IPs and integers for AS IDs, where IP-Strings need to be formatted like 'a.b.c.d' where a-d are integers between 0-255.

# standard usage:
ASN.ip_to_asn("8.8.8.8")
# => {:ok, "Google Inc."}
ASN.ip_to_asn({8, 8, 8, 8})
# => {:ok, "Google Inc."}

ASN.ip_to_as("8.8.8.8")
# => {:ok, 15169}
ASN.ip_to_as({8, 8, 8, 8})
# => {:ok, 15169}

ASN.as_to_asn(15169)
# => {:ok, "Google Inc."}

is it any good?

bien sûr.


*Note that all licence references and agreements mentioned in the asn README section above are relevant to that project's source code only.