ip

package
v0.0.0-...-94a1d89 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LongestPrefixV6

func LongestPrefixV6(a, b, pivot net.IP) int

Longest Prefix Match

Types

type IPHost

type IPHost struct {
	sync.RWMutex
	V4      map[Key4]*IPv4AddressEntry
	V6      map[Key6]*IPv6AddressEntry
	S6      map[Key6]*IPv6AddressEntry
	Prefix6 map[IPv6Prefix]*IPv6PrefixEntry
}

func (*IPHost) AddIPAddr

func (i *IPHost) AddIPAddr(ip net.IP)

func (*IPHost) GetTarget6

func (i *IPHost) GetTarget6(targ net.IP) (obj *IPv6AddressEntry, my bool)

func (*IPHost) Init

func (i *IPHost) Init() *IPHost

func (*IPHost) Input

func (i *IPHost) Input(targ net.IP) (my bool)
func (i *IPHost) IsOnLink(ip net.IP) bool

func (*IPHost) SlaacFailedV6

func (i *IPHost) SlaacFailedV6(addr *IPv6AddressEntry)

type IPLayerPart

type IPLayerPart struct {
	layers.BaseLayer
	V4            layers.IPv4
	V6            layers.IPv6
	AR4           layers.ARP
	ES6           layers.IPv6ExtensionSkipper
	NetworkFlow   gopacket.Flow
	NextLayerType gopacket.LayerType
	SrcIP         net.IP
	DstIP         net.IP
	SrcMac        net.HardwareAddr
	DstMac        net.HardwareAddr
	IsAR          bool
	IsV6          bool
}

func (*IPLayerPart) DecodeType

func (ip *IPLayerPart) DecodeType(t gopacket.LayerType, data []byte, df gopacket.DecodeFeedback) (err error)

func (*IPLayerPart) Flow

func (ip *IPLayerPart) Flow() gopacket.Flow

func (*IPLayerPart) PayloadType

func (ip *IPLayerPart) PayloadType() gopacket.LayerType

func (*IPLayerPart) String

func (ip *IPLayerPart) String() string

type IPv4AddressEntry

type IPv4AddressEntry struct {
	Addr, Subnetmask, Gateway Key4
}

type IPv6AddressEntry

type IPv6AddressEntry struct {
	Unicast, SolicitedMulticast Key6

	Tentative bool

	/*
	 * The prefix this IPv6 Address was derived from, if any.
	 *
	 * This field is nil for link local addresses.
	 */
	Prefix *IPv6PrefixEntry
}

type IPv6Prefix

type IPv6Prefix struct {
	IP  [16]byte
	Len uint8
}

type IPv6PrefixEntry

type IPv6PrefixEntry struct {
	Prefix   IPv6Prefix
	Lifetime uint32
	Tstamp   time.Time
	Onlink   bool
	Slaac    bool

	ListSync sync.Mutex
	List     list.List /* a list of Key6 values */
}

type Key4

type Key4 uint32

func (*Key4) Decode

func (k *Key4) Decode(i net.IP)

func (Key4) IP

func (k Key4) IP() net.IP

type Key6

type Key6 struct {
	Hi, Lo uint64
}

func (*Key6) Decode

func (k *Key6) Decode(i net.IP)

func (Key6) Equals

func (k Key6) Equals(o Key6) bool

func (Key6) IP

func (k Key6) IP() net.IP

Jump to

Keyboard shortcuts

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