Documentation ¶
Index ¶
- Constants
- Variables
- type ARP_STATE
- type ArpCache
- type ArpCe
- type Echo
- type Host
- type IP6Unreachable
- type IPProtocolControlMessage
- type IPUnreachable
- type IPv4Addr
- type IPv6Addr
- type List
- func (l *List) Back() *Member
- func (l *List) Copy() []interface{}
- func (l *List) CopyRaw(ol *list.List)
- func (l *List) Front() *Member
- func (l *List) Init() *List
- func (l *List) Len() int
- func (l *List) MoveFrontToBack() *Member
- func (l *List) PushBack(m *Member) bool
- func (l *List) PushFront(m *Member) bool
- type Member
- type ND6_NC_STATE
- type Nd6Cache
- func (n *Nd6Cache) AddRedirect(target, dest IPv6Addr)
- func (n *Nd6Cache) Init() *Nd6Cache
- func (n *Nd6Cache) Lookup(ip net.IP) *Nd6Nce
- func (n *Nd6Cache) LookupOrCreate(ip net.IP) *Nd6Nce
- func (n *Nd6Cache) LookupValidOnly(ip net.IP) *Nd6Nce
- func (n *Nd6Cache) Redirect(i *IPv6Addr)
- func (n *Nd6Cache) SelectRouter() *IPv6Addr
- func (n *Nd6Cache) TimerEvent(h *Host, e *eth.EthLayer2, po PacketOutput, NOW time.Time)
- type Nd6Nce
- type Notifyable
- type PacketOutput
Constants ¶
const ( ARP__PHANTOM_ = ARP_STATE(iota) ARP_INCOMPLETE ARP_COMPLETE )
const ( /* * This states indicates, that the Entry is a 'phantom-Entry' which * means, that it behaves like a non-existing Entry in the context of * the means of RFC-4861 (or any other specification). * * Phantom-Entries are used, for example, to represent entries in the * Default Router List, for which no Neigbor-Cache-Entry had been * created. * * In order to create an RFC-4861-compliant Entry over an existing * Phantom-Entry, the code MUST alter it's state into one of the states * as defined by RFC 4861. * Code creating Entries by eighter allocating new Entries or overwriting * Phantom-Entries MUST NOT differ it's behavoir depending on wether a * Phantom-Entry exists or not. */ ND6_NC__PHANTOM_ = ND6_NC_STATE(iota) /* RFC 4861 NC-Entry states */ ND6_NC_INCOMPLETE ND6_NC_REACHABLE ND6_NC_STALE ND6_NC_DELAY ND6_NC_PROBE )
Variables ¶
var EInvalid = fmt.Errorf("Protocol violation")
var ENoGateway = fmt.Errorf("No Gateway")
var ENotSupp = fmt.Errorf("Protocol not supported")
Functions ¶
This section is empty.
Types ¶
type ArpCache ¶
type ArpCache struct { Entries List Maxsize int Ipmap map[IPv4Addr]*ArpCe /* * Arp cache timeout = Timeout * Arp cache soft timeout = Timeout - SoftTmoDiff */ Timeout time.Duration SoftTmoDiff time.Duration /* Soft Timeout Difference */ // contains filtered or unexported fields }
func (*ArpCache) LookupOrCreate ¶
The returned *ArpCe is locked.
type ArpCe ¶
type Host ¶
type Host struct { NetN Notifyable NetNv6 Notifyable EchoSocket Notifyable NC6 *Nd6Cache ARP *ArpCache Host *ip.IPHost Mac net.HardwareAddr Vlan uint16 /* IPv6 */ CurHopLimit uint8 BaseReachableTime, ReachableTime uint32 IPv6MTU uint32 RetransTimer uint32 }
func (*Host) Input ¶
func (h *Host) Input(e *eth.EthLayer2, i *ip.IPLayerPart, po PacketOutput) error
func (*Host) ResolutionV4 ¶
func (*Host) ResolutionV6 ¶
type IP6Unreachable ¶
type IP6Unreachable struct { FailType layers.ICMPv6TypeCode Addr net.IP }
type IPProtocolControlMessage ¶
type IPProtocolControlMessage struct { Protocol layers.IPProtocol RemoteIP, LocalIP net.IP RemotePort, LocalPort uint16 FailType layers.ICMPv4TypeCode }
type IPUnreachable ¶
type IPUnreachable struct { FailType layers.ICMPv4TypeCode Addr net.IP }
type List ¶
type List struct { Value interface{} /* Should point to the object holding this List */ // contains filtered or unexported fields }
func (*List) MoveFrontToBack ¶
type Member ¶
type Member struct { Value interface{} // contains filtered or unexported fields }
func (*Member) MoveToBack ¶
func (m *Member) MoveToBack()
func (*Member) MoveToFront ¶
func (m *Member) MoveToFront()
type ND6_NC_STATE ¶
type ND6_NC_STATE uint8
* RFC 4861: * 5.1. Conceptual Data Structures * * INCOMPLETE Address resolution is in progress and the link-layer * address of the neighbor has not yet been determined. * * REACHABLE Roughly speaking, the neighbor is known to have been * reachable recently (within tens of seconds ago). * * STALE The neighbor is no longer known to be reachable but * until traffic is sent to the neighbor, no attempt * should be made to verify its reachability. * * DELAY The neighbor is no longer known to be reachable, and * traffic has recently been sent to the neighbor. * Rather than probe the neighbor immediately, however, * delay sending probes for a short while in order to * give upper-layer protocols a chance to provide * reachability confirmation. * * PROBE The neighbor is no longer known to be reachable, and * unicast Neighbor Solicitation probes are being sent to * verify reachability. *
type Nd6Cache ¶
type Nd6Cache struct { Entries List Routers List /* * Delay : Entries in DELAY-State * Retrans : Entries in PROBE-State or INCOMPLETE-State */ Delay, Retrans, Reachable List Maxsize int Ipmap map[IPv6Addr]*Nd6Nce // contains filtered or unexported fields }
func (*Nd6Cache) AddRedirect ¶
func (*Nd6Cache) SelectRouter ¶
func (*Nd6Cache) TimerEvent ¶
type Nd6Nce ¶
type Nd6Nce struct { sync.RWMutex State ND6_NC_STATE IPAddr IPv6Addr HWAddr net.HardwareAddr LocalIPAddr IPv6Addr /* Use as Source IP address, when sending ND6 packets. */ Tstamp, RouterTstamp time.Time RouterLifetime uint16 SolicitationSendCounter int IsRouter bool Entry, RouterEntry Member /* Router-List-Entry */ PlusEntry Member Sendchain *list.List }
* Neighbor-Cache Entry. * * RFC-4861 5.1. Conceptual Data Structures * Neighbor Cache (one for each interface) * A set of entries about individual neighbors to * which traffic has been sent recently. Entries are * keyed on the neighbor's on-link unicast IP address * and contain such information as its link-layer * address, a flag indicating whether the neighbor is * a router or a host (called IsRouter in this * document), a pointer to any queued packets waiting * for address resolution to complete, etc. A * Neighbor Cache entry also contains information used * by the Neighbor Unreachability Detection algorithm, * including the reachability state, the number of * unanswered probes, and the time the next Neighbor * Unreachability Detection event is scheduled to take * place.
type Notifyable ¶
type Notifyable interface {
Notify(i interface{})
}