All Projects → thekvs → go-net-radix

thekvs / go-net-radix

Licence: MIT license
Go bindings for radix tree library for fast subnet (IPv4 and IPv6) lookups

Programming Languages

c
50402 projects - #5 most used programming language
go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to go-net-radix

net-protocol
golang模拟内核协议栈 实现链路层、网络层、传输层、应用层 用户态协议栈 ,基于虚拟网卡TUN/TAP
Stars: ✭ 129 (+248.65%)
Mutual labels:  ipv6, ipv4
IP2Location-PHP-Module
This module is a PHP module that enables the user to find the country, region, city, coordinates, zip code, ISP, domain name, timezone, connection speed, IDD code, area code, weather station code, weather station name, mobile, usage types, address type, IAB category, etc that any IP address or host name originates from.
Stars: ✭ 154 (+316.22%)
Mutual labels:  ipv6, ipv4
freebind
IPv4 and IPv6 address rate limiting evasion tool
Stars: ✭ 88 (+137.84%)
Mutual labels:  ipv6, ipv4
tracetrout
A magical reverse traceroute HTTP(S) server
Stars: ✭ 48 (+29.73%)
Mutual labels:  ipv6, ipv4
Aggregator
A stand-alone class implementation of the IPv4+IPv6 IP+CIDR aggregator from CIDRAM.
Stars: ✭ 19 (-48.65%)
Mutual labels:  ipv6, ipv4
hphr
Halophile Router (a VyOS-based, SaltStack-automated, NetBox-configured router for small provider networks)
Stars: ✭ 39 (+5.41%)
Mutual labels:  ipv6, ipv4
treebitmap
Fast IP lookup table for IPv4/IPv6 prefixes
Stars: ✭ 81 (+118.92%)
Mutual labels:  ipv6, ipv4
PHP-IPAddress
IP Address utility classes for PHP
Stars: ✭ 63 (+70.27%)
Mutual labels:  ipv6, ipv4
whereabouts
An HTTP service for mapping IPv4 and IPv6 addresses to cities, countries & continents
Stars: ✭ 16 (-56.76%)
Mutual labels:  ipv6, ipv4
uC-TCP-IP
A compact, reliable, high-performance TCP/IP protocol stack. Features dual IPv4 and IPv6 support, an SSL/TLS socket option, and support for Ethernet, Wi-Fi, and PHY controllers.
Stars: ✭ 66 (+78.38%)
Mutual labels:  ipv6, ipv4
IP2Location-C-Library
IP2Location C library enables the user to find the country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather station code, weather station name, mobile, usage types, etc that any IP address or hostname originates from.
Stars: ✭ 37 (+0%)
Mutual labels:  ipv6, ipv4
bacnet-stack
BACnet Protocol Stack library provides a BACnet application layer, network layer and media access (MAC) layer communications services.
Stars: ✭ 199 (+437.84%)
Mutual labels:  ipv6, ipv4
ip2location-nginx
Nginx module that allows user to lookup for geolocation information using IP2Location database.
Stars: ✭ 33 (-10.81%)
Mutual labels:  ipv6, ipv4
ipapi-python
Python bindings for https://ipapi.co (IP Address Location) - Use with python / django / flask for IP address location lookup
Stars: ✭ 42 (+13.51%)
Mutual labels:  ipv6, ipv4
ipv6calc
ipv6calc
Stars: ✭ 33 (-10.81%)
Mutual labels:  ipv6, ipv4
Geolocate-IP-Browser-Extension
A browser extension, which shows you the origin of your IP address.
Stars: ✭ 21 (-43.24%)
Mutual labels:  ipv6, ipv4
php-ip-anonymizer
IP address anonymizer library for PHP
Stars: ✭ 55 (+48.65%)
Mutual labels:  ipv6, ipv4
python-iptools
A few useful functions and objects for manipulating ip addresses in python.
Stars: ✭ 68 (+83.78%)
Mutual labels:  ipv6, ipv4
Ip
🌏根据IpV4、IpV6地址获取定位信息的PHP🐘组件 PHP components that obtain location information based on IpV4, IpV6 addresses
Stars: ✭ 23 (-37.84%)
Mutual labels:  ipv6, ipv4
ip
Immutable value object for IPv4 and IPv6 addresses, including helper methods and Doctrine support.
Stars: ✭ 212 (+472.97%)
Mutual labels:  ipv6, ipv4

About

Go programming language (http://golang.org/) bindings for radix tree library for fast subnet (both IPv4 and IPv6) lookups.

Installing

$ go get github.com/thekvs/go-net-radix

After this command go-net-radix library is ready to use and will be located in:

$GOROOT/src/pkg/github.com/thekvs/go-net-radix

Basic usage example

package main

import (
        "github.com/thekvs/go-net-radix"

        "fmt"
        "log"
)

func main() {
        rtree, err := netradix.NewNetRadixTree()
        if err != nil {
                panic(err)
        }
        defer rtree.Close()

        if err = rtree.Add("217.72.192.0/20", "UDATA1"); err != nil {
                log.Fatal(err)
        }

        if err = rtree.Add("2001:220::/35", "UDATA2"); err != nil {
                log.Fatal(err)
        }

        var found bool
        var udata string

        found, udata, err = rtree.SearchBest("217.72.192.2")
        if err != nil {
                log.Fatal(err)
        }
        if found {
                fmt.Printf("found: %v\n", udata)
        }

        found, udata, err = rtree.SearchBest("2001:220::")
        if err != nil {
                log.Fatal(err)
        }
        if found {
                fmt.Printf("found: %v\n", udata)
        }

        if err = rtree.Remove("217.72.192.0/20"); err != nil {
                log.Fatal(err)
        }
}

Documentation

GoDoc

Licensing

All source code included in this distribution is covered by the MIT License found in the LICENSE file, unless specifically stated otherwise within each file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].