status-go/vendor/github.com/libp2p/go-libp2p-asn-util
Richard Ramos ad326fa290
feat: wakuv2 store (#2780)
Allows runnning a store node depending on node config settings.
2022-08-19 12:34:07 -04:00
..
LICENSE chore: bump go-waku 2022-04-06 10:36:06 -04:00
README.md chore: bump go-waku 2022-04-06 10:36:06 -04:00
asn.go feat: wakuv2 store (#2780) 2022-08-19 12:34:07 -04:00
doc.go chore: bump go-waku 2022-04-06 10:36:06 -04:00
ipv6_asn_map.gen.go feat: wakuv2 store (#2780) 2022-08-19 12:34:07 -04:00
version.json feat: wakuv2 store (#2780) 2022-08-19 12:34:07 -04:00

README.md

go-libp2p-asn-util

===

A library to lookup the ASN(Autonomous System Number) for an IP address. It uses the IPv6 to ASN database downloaded from https://iptoasn.com/. Supports ONLY IPv6 addresses for now.

Table of Contents

Install

go get github.com/libp2p/go-libp2p-asn-util

Usage

import (
    asn "github.com/libp2p/go-libp2p-asn-util"
)

func main() {
   store, err := asn.NewAsnStore()
   
   asNumber,err := store.AsnForIP(net.ParseIP("2a03:2880:f003:c07:face:b00c::2"))
 }

Contribute

Feel free to join in. All welcome. Open an issue!

This repository falls under the IPFS Code of Conduct.

License

MIT