router

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package router implements an IPv4/IPv6 router. The routes map destination addresses to ring buffers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetMapI

type NetMapI interface {
	Add(*net.IPNet, addr.IA, *ringbuf.Ring) error
	Delete(*net.IPNet) error
	Lookup(net.IP) (addr.IA, *ringbuf.Ring)
}
var NetMap NetMapI = &Networks{}

type Networks

type Networks struct {
	// contains filtered or unexported fields
}

Networks is an unordered mapping of non-overlapping IP allocations to ASes. It is concurrency safe. It is intended to be a stand-in until we have a a proper mapping type, as the lookup is O(n) for the number of networks it contains.

func (*Networks) Add

func (ns *Networks) Add(ipnet *net.IPNet, ia addr.IA, ring *ringbuf.Ring) error

func (*Networks) Delete

func (ns *Networks) Delete(ipnet *net.IPNet) error

func (*Networks) Lookup

func (ns *Networks) Lookup(ip net.IP) (addr.IA, *ringbuf.Ring)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL