art

package module
v0.0.0-...-8639ed2 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2022 License: MIT Imports: 0 Imported by: 0

README

Allotment Routing Table

A Go implementation of ART ("A Fast Free Multibit Trie Based Routing Table").

See https://cseweb.ucsd.edu/~varghese/TEACH/cs228/artlookup.pdf

Godoc at http://godoc.org/github.com/bradfitz/art

Status

So far I'm just reading the paper and implementing as I go. This isn't used in production yet.

Documentation

Overview

Package art implements the Allotment Routing Table, a "A Fast Free Multibit Trie Based Routing Table".

See https://cseweb.ucsd.edu/~varghese/TEACH/cs228/artlookup.pdf

Warning: this is a work-in-progress; see https://github.com/bradfitz/art#status

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Route

type Route interface {
	// RouteParams returns the properties of the routing table entry.
	RouteParams() RouteParams
}

A Route is an entry in the routing table.

type RouteParams

type RouteParams struct {
	Width int    // bits of routable porition address (32-bit for IPv4, 64-bit for IPv6)
	Addr  uint64 // the destination address
	Len   int    // prefix length of route (e.g. 24 for a 192.168.0.0/24)
}

RouteParams are the properties of the routing table entry.

type Table

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

func NewTable

func NewTable(stride int) *Table

func (*Table) Delete

func (x *Table) Delete(rp RouteParams) (deleted Route, ok bool)

Delete deletes the route described by the parameters. If a route was deleted, it returns the deleted route.

func (*Table) Insert

func (x *Table) Insert(r Route) bool

func (*Table) Lookup

func (x *Table) Lookup(addr uint64) (r Route, ok bool)

Lookup looks up the most specific Route for the given addr.

Jump to

Keyboard shortcuts

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