vnet

package module
v1.2.0-rc.1.0...-65ced95 Latest Latest
Warning

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

Go to latest
Published: May 20, 2019 License: GPL-2.0, GPL-2.0-or-later Imports: 25 Imported by: 1

README

vnet


© 2015-2018 Platina Systems, Inc. All rights reserved. Use of this source code is governed by this BSD-style LICENSE.

Documentation

Overview

Network counters + packet/byte counters optimized for large tables and cache locality.

Index

Constants

View Source
const (
	BufferUnknown        = BufferState(hw.BufferUnknown)
	BufferKnownAllocated = BufferState(hw.BufferKnownAllocated)
	BufferKnownFree      = BufferState(hw.BufferKnownFree)
)
View Source
const (
	NextValid = BufferFlag(hw.NextValid)
	Cloned    = BufferFlag(hw.Cloned)
)
View Source
const (
	SiNil Si = ^Si(0)
	HiNil Hi = ^Hi(0)
)
View Source
const (
	Bps    = 1e0
	Kbps   = 1e3
	Mbps   = 1e6
	Gbps   = 1e9
	Tbps   = 1e12
	Bytes  = 1
	Kbytes = 1 << 10
	Mbytes = 1 << 20
	Gbytes = 1 << 30
)

To clarify units: 1e9 * vnet.Bps

View Source
const (
	IfDrops swIfCounterKind = iota
	IfPunts
)
View Source
const (
	IfRxCounter swIfCombinedCounterKind = iota
	IfTxCounter
)
View Source
const (
	MSG_FROM_VNET = iota
	MSG_SVI_BRIDGE_ADD
	MSG_SVI_BRIDGE_DELETE
	MSG_SVI_BRIDGE_MEMBER_ADD
	MSG_SVI_BRIDGE_MEMBER_DELETE
)
View Source
const (
	MSG_FROM_FE = iota + 128
	MSG_SVI_FDB_ADD
	MSG_SVI_FDB_DELETE
)
View Source
const License = `` /* 15871-byte string literal not displayed */
View Source
const MaxOutstandingTxRefs = 16 * MaxVectorLen

Largest number of outstanding transmit buffers before we suspend.

View Source
const MaxVectorLen = loop.MaxVectorLen
View Source
const Version = "v1.4.6"

Version format :: v<MAJOR>.<MINOR>.<PATCH>[-rc.<CANDIDATE>]

Variables

View Source
var (
	PortIsCopper = func(ifname string) bool { return false }
	PortIsFec74  = func(ifname string) bool { return false }
	PortIsFec91  = func(ifname string) bool { return false }
)
View Source
var AdjDebug bool

Debug Flags

View Source
var DefaultBufferPool = &BufferPool{
	Name:           "default",
	BufferTemplate: getDefaultBufferTemplate(),
}
View Source
var ErrNotSupported = errors.New("not supported")
View Source
var ErrorNode = &errorNode{}
View Source
var SviFromFeCh chan FromFeMsg // for l2-mod learning event reporting

Functions

func AddInit

func AddInit(f initHook, deps ...*dep.Dep)

func ByteAdd

func ByteAdd(a []byte, x uint64)

func HostIsNetworkByteOrder

func HostIsNetworkByteOrder() bool

func IPAdd

func IPAdd(ip *net.IP, x uint64)

func MakePacket

func MakePacket(args ...PacketHeader) (b []byte)

func Perform2Rewrites

func Perform2Rewrites(r0, r1 *Ref, rw0, rw1 *Rewrite)

func PerformRewrite

func PerformRewrite(r0 *Ref, rw0 *Rewrite)

func Pointer

func Pointer(b []byte) unsafe.Pointer

func RefFlag1

func RefFlag1(f BufferFlag, r []Ref, i uint) bool

func RefFlag2

func RefFlag2(f BufferFlag, r []Ref, i uint) bool

func RefFlag4

func RefFlag4(f BufferFlag, r []Ref, i uint) bool

Types

type ActionType

type ActionType int
const (
	PreVnetd       ActionType = iota // before vnetd is started
	ReadyVnetd                       // vnetd has declared it's ready
	PostReadyVnetd                   // vnetd processing something initated from previous state
	Dynamic                          // free-run case
)

type Arper

type Arper interface {
	SupportsArp()
}

Interface defines SupportsArp method to enable glean adjacencies.

type Bandwidth

type Bandwidth float64

func (*Bandwidth) Parse

func (b *Bandwidth) Parse(in *parse.Input)

func (Bandwidth) String

func (b Bandwidth) String() string

type Bool

type Bool bool

func (Bool) MaskedString

func (v Bool) MaskedString(r MaskedStringer) (s string)

type BridgeAddDelHook_t

type BridgeAddDelHook_t func(brsi Si, stag uint16, puntIndex uint8, addr net.HardwareAddr, isAdd bool) (err error)

simplified hooks for direct calls to fe1 from vnet

type BridgeMemberAddDelHook_t

type BridgeMemberAddDelHook_t func(stag uint16, brmSi Si, pipe_port uint16, ctag uint16, isAdd bool, nBrm uint8) (err error)

type BridgeMemberLookup_t

type BridgeMemberLookup_t func(stag uint16, addr net.HardwareAddr) (pipe_port uint16, err error)

type BridgeNotifierFn

type BridgeNotifierFn func()

type Buffer

type Buffer hw.Buffer

func Get1Buffer

func Get1Buffer(rs []Ref, i uint) (b0 *Buffer)

func Get4Buffers

func Get4Buffers(rs []Ref, i uint) (b0, b1, b2, b3 *Buffer)

type BufferError

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

type BufferFlag

type BufferFlag hw.BufferFlag

type BufferPool

type BufferPool hw.BufferPool

func (*BufferPool) AllocCachedRefs

func (p *BufferPool) AllocCachedRefs() (r RefVec)

func (*BufferPool) AllocRefs

func (p *BufferPool) AllocRefs(r RefVec)

func (*BufferPool) AllocRefsStride

func (p *BufferPool) AllocRefsStride(r *Ref, n, stride uint)

func (*BufferPool) FreeRefs

func (p *BufferPool) FreeRefs(r *Ref, n uint, freeNext bool)

func (*BufferPool) GetBufferTemplate

func (p *BufferPool) GetBufferTemplate() *Buffer

func (*BufferPool) GetRefTemplate

func (p *BufferPool) GetRefTemplate() *Ref

func (*BufferPool) ValidateRef

func (p *BufferPool) ValidateRef(r *Ref, want BufferState)

func (*BufferPool) ValidateRefs

func (p *BufferPool) ValidateRefs(refs []Ref, want hw.BufferState)

type BufferState

type BufferState hw.BufferState

type CombinedCounter

type CombinedCounter struct{ Packets, Bytes uint64 }

func (*CombinedCounter) Add

func (c *CombinedCounter) Add(d *CombinedCounter)

func (*CombinedCounter) Sub

func (c *CombinedCounter) Sub(d *CombinedCounter)

func (*CombinedCounter) Zero

func (c *CombinedCounter) Zero()

type CombinedCounterVec

type CombinedCounterVec []CombinedCounter

func (CombinedCounterVec) Len

func (p CombinedCounterVec) Len() uint

func (*CombinedCounterVec) ResetLen

func (p *CombinedCounterVec) ResetLen()

func (*CombinedCounterVec) Resize

func (p *CombinedCounterVec) Resize(n uint)

func (*CombinedCounterVec) Validate

func (p *CombinedCounterVec) Validate(i uint) *CombinedCounter

func (*CombinedCounterVec) ValidateInit

func (p *CombinedCounterVec) ValidateInit(i uint, zero CombinedCounter) *CombinedCounter

func (*CombinedCounterVec) ValidateLen

func (p *CombinedCounterVec) ValidateLen(l uint) (v *CombinedCounter)

func (*CombinedCounterVec) ValidateLenInit

func (p *CombinedCounterVec) ValidateLenInit(l uint, zero CombinedCounter) (v *CombinedCounter)

type CombinedCounters

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

func (*CombinedCounters) Add

func (c *CombinedCounters) Add(i uint, p, b uint)

func (*CombinedCounters) Add64

func (c *CombinedCounters) Add64(i uint, p, b uint64)

Add packet and byte increment to counter.

func (*CombinedCounters) Clear

func (c *CombinedCounters) Clear(i uint)

func (*CombinedCounters) ClearAll

func (c *CombinedCounters) ClearAll()

func (*CombinedCounters) Get

func (c *CombinedCounters) Get(i uint, r *CombinedCounter)

Get counter value: 2 flavors.

func (*CombinedCounters) Validate

func (c *CombinedCounters) Validate(i uint)

func (*CombinedCounters) Value

func (c *CombinedCounters) Value(i uint) (v CombinedCounter)

type CombinedCountersVec

type CombinedCountersVec []CombinedCounters

func (CombinedCountersVec) ClearAll

func (c CombinedCountersVec) ClearAll()

func (CombinedCountersVec) Len

func (p CombinedCountersVec) Len() uint

func (*CombinedCountersVec) ResetLen

func (p *CombinedCountersVec) ResetLen()

func (*CombinedCountersVec) Resize

func (p *CombinedCountersVec) Resize(n uint)

func (*CombinedCountersVec) Validate

func (p *CombinedCountersVec) Validate(i uint) *CombinedCounters

func (*CombinedCountersVec) ValidateInit

func (p *CombinedCountersVec) ValidateInit(i uint, zero CombinedCounters) *CombinedCounters

func (*CombinedCountersVec) ValidateLen

func (p *CombinedCountersVec) ValidateLen(l uint) (v *CombinedCounters)

func (*CombinedCountersVec) ValidateLenInit

func (p *CombinedCountersVec) ValidateLenInit(l uint, zero CombinedCounters) (v *CombinedCounters)

type ConfigFileData

type ConfigFileData struct {
	MirrorCfgFileData MirrorConfigFileData
	DestCfgFileData   DestConfigFileData
	SflowCfgFileData  SflowConfigFileData
}

func (*ConfigFileData) ReadConfigFile

func (cfd *ConfigFileData) ReadConfigFile() (err error)

func (*ConfigFileData) WriteConfigFile

func (cfd *ConfigFileData) WriteConfigFile() (err error)

type Counters

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

Array of single counters

func (*Counters) Add

func (c *Counters) Add(i, x uint)

Add x to counter with index i.

func (*Counters) Add64

func (c *Counters) Add64(i uint, x uint64)

func (*Counters) Clear

func (c *Counters) Clear(i uint)

func (*Counters) ClearAll

func (c *Counters) ClearAll()

func (*Counters) Get

func (c *Counters) Get(i uint, v *uint64)

func (*Counters) Set

func (c *Counters) Set(i uint, x uint64)

func (*Counters) Validate

func (c *Counters) Validate(i uint)

func (*Counters) Value

func (c *Counters) Value(i uint) (v uint64)

type CountersVec

type CountersVec []Counters

func (CountersVec) ClearAll

func (c CountersVec) ClearAll()

func (CountersVec) Len

func (p CountersVec) Len() uint

func (*CountersVec) ResetLen

func (p *CountersVec) ResetLen()

func (*CountersVec) Resize

func (p *CountersVec) Resize(n uint)

func (*CountersVec) Validate

func (p *CountersVec) Validate(i uint) *Counters

func (*CountersVec) ValidateInit

func (p *CountersVec) ValidateInit(i uint, zero Counters) *Counters

func (*CountersVec) ValidateLen

func (p *CountersVec) ValidateLen(l uint) (v *Counters)

func (*CountersVec) ValidateLenInit

func (p *CountersVec) ValidateLenInit(l uint, zero Counters) (v *Counters)

type DestConfigData

type DestConfigData struct {
	Name      string
	Encap     string
	Agent_IP  string
	Binded_to string
	Used_by   string
}

type DestConfigFileData

type DestConfigFileData struct {
	Dest []DestConfigData
}

type Devicer

type Devicer interface {
	Noder
	loop.OutputLooper
	DriverName() string // name of device driver
	LessThan(b HwInterfacer) bool
	IsUnix() bool
	ValidateSpeed(speed Bandwidth) error
	ValidateMedia(pi string) error
	SetLoopback(v IfLoopbackType) error
	GetHwInterfaceCounterNames() InterfaceCounterNames
	GetSwInterfaceCounterNames() InterfaceCounterNames
	GetHwInterfaceCounterValues(t *InterfaceThread)
	GetHwInterfaceFinalSpeed() (s Bandwidth)
}

type ErrorRef

type ErrorRef uint32

type Event

type Event struct {
	loop.Event
	// contains filtered or unexported fields
}

func (*Event) GetEvent

func (e *Event) GetEvent() *Event

func (*Event) Node

func (e *Event) Node() *Node

func (*Event) SignalEvent

func (e *Event) SignalEvent(r Eventer)

func (*Event) SignalEventAfter

func (e *Event) SignalEventAfter(r Eventer, dt float64)

func (*Event) Vnet

func (e *Event) Vnet() *Vnet

type Eventer

type Eventer interface {
	GetEvent() *Event
	event.Actor
}

type FromFeMsg

type FromFeMsg struct {
	MsgId    uint8
	Addr     [6]uint8
	Stag     uint16
	PipePort uint16
}

type GivenPayload

type GivenPayload struct{ Payload []byte }

Header for a given fixed payload.

func (*GivenPayload) Finalize

func (i *GivenPayload) Finalize(l []PacketHeader)

func (*GivenPayload) Len

func (i *GivenPayload) Len() uint

func (*GivenPayload) Read

func (i *GivenPayload) Read(b []byte) PacketHeader

func (*GivenPayload) String

func (i *GivenPayload) String() string

func (*GivenPayload) Write

func (i *GivenPayload) Write(b []byte)

type Hi

type Hi IfIndex

func (Hi) GetAddress

func (i Hi) GetAddress(v *Vnet) []byte

func (Hi) IsLinkUp

func (hi Hi) IsLinkUp(v *Vnet) bool

func (Hi) IsProvisioned

func (hi Hi) IsProvisioned(v *Vnet) bool

func (Hi) Name

func (i Hi) Name(v *Vnet) string

func (*Hi) ParseWithArgs

func (hi *Hi) ParseWithArgs(in *parse.Input, args *parse.Args)

func (Hi) SetAdminUp

func (hi Hi) SetAdminUp(v *Vnet, isUp bool) (err error)

func (Hi) SetMedia

func (hi Hi) SetMedia(v *Vnet, pi string) error

func (Hi) SetSpeed

func (hi Hi) SetSpeed(v *Vnet, s Bandwidth) error

func (Hi) Si

func (hi Hi) Si(m *Vnet) Si

type HostUint16

type HostUint16 uint16

As above but host byte order.

func (HostUint16) MaskedString

func (v HostUint16) MaskedString(r MaskedStringer) string

type HostUint32

type HostUint32 uint32

func (HostUint32) MaskedString

func (v HostUint32) MaskedString(r MaskedStringer) string

type HostUint64

type HostUint64 uint64

func (HostUint64) MaskedString

func (v HostUint64) MaskedString(r MaskedStringer) string

type HwIf

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

func (*HwIf) DefaultId

func (h *HwIf) DefaultId() IfId

func (*HwIf) ElogName

func (h *HwIf) ElogName() elog.StringRef

func (*HwIf) FormatId

func (h *HwIf) FormatId(a IfId) string

func (*HwIf) GetHwIf

func (h *HwIf) GetHwIf() *HwIf

func (*HwIf) GetSwInterfaceCounterNames

func (h *HwIf) GetSwInterfaceCounterNames() (nm InterfaceCounterNames)

func (*HwIf) GetVnet

func (h *HwIf) GetVnet() *Vnet

func (*HwIf) Hi

func (h *HwIf) Hi() Hi

func (*HwIf) IsLinkUp

func (h *HwIf) IsLinkUp() bool

func (*HwIf) IsProvisioned

func (h *HwIf) IsProvisioned() bool

func (*HwIf) IsUnix

func (h *HwIf) IsUnix() bool

func (*HwIf) LaneMask

func (h *HwIf) LaneMask() LaneMask

func (*HwIf) LessThan

func (a *HwIf) LessThan(b HwInterfacer) bool

func (*HwIf) LessThanId

func (h *HwIf) LessThanId(a, b IfId) bool

func (*HwIf) LinkString

func (h *HwIf) LinkString() (s string)

func (*HwIf) MaxPacketSize

func (h *HwIf) MaxPacketSize() uint

func (*HwIf) Media

func (h *HwIf) Media() string

func (*HwIf) Name

func (h *HwIf) Name() string

func (*HwIf) ParseId

func (h *HwIf) ParseId(a *IfId, in *parse.Input) bool

func (*HwIf) SetAdminUp

func (h *HwIf) SetAdminUp(isUp bool) (err error)

func (*HwIf) SetLinkUp

func (h *HwIf) SetLinkUp(v bool) (err error)

func (*HwIf) SetLoopback

func (h *HwIf) SetLoopback(v IfLoopbackType) (err error)

func (*HwIf) SetMaxPacketSize

func (h *HwIf) SetMaxPacketSize(v uint) (err error)

func (*HwIf) SetMedia

func (hw *HwIf) SetMedia(pi string) (err error)

func (*HwIf) SetName

func (h *HwIf) SetName(v *Vnet, name string)

func (*HwIf) SetProvisioned

func (h *HwIf) SetProvisioned(v bool) (err error)

func (*HwIf) SetSpeed

func (hw *HwIf) SetSpeed(v Bandwidth) (err error)

func (*HwIf) Si

func (h *HwIf) Si() Si

func (*HwIf) Speed

func (h *HwIf) Speed() Bandwidth

func (*HwIf) ValidateMedia

func (h *HwIf) ValidateMedia(pi string) (err error)

func (*HwIf) ValidateSpeed

func (h *HwIf) ValidateSpeed(v Bandwidth) (err error)

Default versions.

type HwIfAddDelHook

type HwIfAddDelHook func(v *Vnet, hi Hi, isDel bool) error

type HwIfAddDelHookVec

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

func (*HwIfAddDelHookVec) Add

func (t *HwIfAddDelHookVec) Add(x HwIfAddDelHook, ds ...*dep.Dep)

func (*HwIfAddDelHookVec) Get

func (*HwIfAddDelHookVec) Len

func (t *HwIfAddDelHookVec) Len() int

type HwIfChooser

type HwIfChooser ifChooser

func (*HwIfChooser) Foreach

func (c *HwIfChooser) Foreach(f func(v *Vnet, h HwInterfacer))

func (*HwIfChooser) Init

func (c *HwIfChooser) Init(v *Vnet)

func (*HwIfChooser) Parse

func (c *HwIfChooser) Parse(in *parse.Input)

type HwIfClasser

type HwIfClasser interface {
	// Get/set/format interface address (e.g. mac address for ethernet).
	GetAddress() []byte
	SetAddress(a []byte)
	FormatAddress() string
	// Encapsulation rewrite string for this interface class.
	SetRewrite(v *Vnet, r *Rewrite, t PacketType, dstAddr []byte)
	FormatRewrite(r *Rewrite) []string
	ParseRewrite(r *Rewrite, in *parse.Input)
	// ID: for example VLAN tag(s) for ethernet.  32 bit number uniquely identifies sub-interface.
	DefaultId() IfId
	LessThanId(a, b IfId) bool
	ParseId(a *IfId, in *parse.Input) bool
	FormatId(a IfId) string
	ConfigureHwIf(in *cli.Input) (ok bool, err error)
}

Class of hardware interfaces, for example, ethernet, sonet, srp, docsis, etc.

type HwIfCombinedCounterKind

type HwIfCombinedCounterKind uint16

func (HwIfCombinedCounterKind) Add

func (c HwIfCombinedCounterKind) Add(t *InterfaceThread, hi Hi, packets, bytes uint)

func (HwIfCombinedCounterKind) Add64

func (c HwIfCombinedCounterKind) Add64(t *InterfaceThread, hi Hi, packets, bytes uint64)

type HwIfCounterKind

type HwIfCounterKind uint16

func (HwIfCounterKind) Add

func (c HwIfCounterKind) Add(t *InterfaceThread, hi Hi, value uint)

func (HwIfCounterKind) Add64

func (c HwIfCounterKind) Add64(t *InterfaceThread, hi Hi, value uint64)

func (HwIfCounterKind) Set

func (c HwIfCounterKind) Set(t *InterfaceThread, hi Hi, value uint)

type HwIfLinkUpDownHook

type HwIfLinkUpDownHook func(v *Vnet, hi Hi, isUp bool) error

type HwIfLinkUpDownHookVec

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

func (*HwIfLinkUpDownHookVec) Add

func (t *HwIfLinkUpDownHookVec) Add(x HwIfLinkUpDownHook, ds ...*dep.Dep)

func (*HwIfLinkUpDownHookVec) Get

func (*HwIfLinkUpDownHookVec) Len

func (t *HwIfLinkUpDownHookVec) Len() int

type HwIfProvisionHook

type HwIfProvisionHook func(v *Vnet, hi Hi, isProvisioned bool) error

type HwIfProvisionHookVec

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

func (*HwIfProvisionHookVec) Add

func (t *HwIfProvisionHookVec) Add(x HwIfProvisionHook, ds ...*dep.Dep)

func (*HwIfProvisionHookVec) Get

func (*HwIfProvisionHookVec) Len

func (t *HwIfProvisionHookVec) Len() int

type HwInterfacer

type HwInterfacer interface {
	Devicer
	HwIfClasser
	GetHwIf() *HwIf
}

type IfId

type IfId IfIndex

type IfIndex

type IfIndex uint32

type IfLoopbackType

type IfLoopbackType int

Interface can loopback at MAC or PHY.

const (
	IfLoopbackNone IfLoopbackType = iota
	IfLoopbackMac
	IfLoopbackPhy
)

func (*IfLoopbackType) Parse

func (x *IfLoopbackType) Parse(in *parse.Input)

type InOutNode

type InOutNode struct {
	Node
	// contains filtered or unexported fields
}

func (*InOutNode) GetEnqueue

func (n *InOutNode) GetEnqueue(in *RefIn) (q *enqueue)

func (*InOutNode) GetInOutNode

func (n *InOutNode) GetInOutNode() *InOutNode

func (*InOutNode) LoopInputOutput

func (n *InOutNode) LoopInputOutput(l *loop.Loop, i loop.LooperIn, o loop.LooperOut)

func (*InOutNode) MakeLoopIn

func (n *InOutNode) MakeLoopIn() loop.LooperIn

func (*InOutNode) MakeLoopOut

func (n *InOutNode) MakeLoopOut() loop.LooperOut

type InOutNoder

type InOutNoder interface {
	Noder
	GetInOutNode() *InOutNode
	NodeInput(i *RefIn, o *RefOut)
}

type IncrementingPayload

type IncrementingPayload struct{ Count uint }

Packet header with incrementing data of given byte count.

func (*IncrementingPayload) Finalize

func (i *IncrementingPayload) Finalize(l []PacketHeader)

func (*IncrementingPayload) Len

func (i *IncrementingPayload) Len() uint

func (*IncrementingPayload) Read

func (i *IncrementingPayload) Read(b []byte) PacketHeader

func (*IncrementingPayload) String

func (i *IncrementingPayload) String() string

func (*IncrementingPayload) Write

func (i *IncrementingPayload) Write(b []byte)

type InputNode

type InputNode struct {
	Node
	// contains filtered or unexported fields
}

func (*InputNode) GetInputNode

func (n *InputNode) GetInputNode() *InputNode

func (*InputNode) LoopInput

func (n *InputNode) LoopInput(l *loop.Loop, o loop.LooperOut)

func (*InputNode) MakeLoopOut

func (n *InputNode) MakeLoopOut() loop.LooperOut

type InputNoder

type InputNoder interface {
	Noder
	GetInputNode() *InputNode
	NodeInput(o *RefOut)
}

type InterfaceCounterNames

type InterfaceCounterNames struct {
	Single, Combined []string
}

type InterfaceNode

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

func (*InterfaceNode) GetInterfaceNode

func (n *InterfaceNode) GetInterfaceNode() *interfaceNode

func (*InterfaceNode) LoopInput

func (n *InterfaceNode) LoopInput(l *loop.Loop, o loop.LooperOut)

func (*InterfaceNode) LoopOutput

func (n *InterfaceNode) LoopOutput(l *loop.Loop, i loop.LooperIn)

func (*InterfaceNode) MakeLoopIn

func (n *InterfaceNode) MakeLoopIn() loop.LooperIn

func (*InterfaceNode) MakeLoopOut

func (n *InterfaceNode) MakeLoopOut() loop.LooperOut

type InterfaceThread

type InterfaceThread struct {
	HfCounters map[Hi][]int
	// contains filtered or unexported fields
}

type IsDel

type IsDel bool

func (IsDel) String

func (x IsDel) String() string

type LaneMask

type LaneMask uint32

type Layer

type Layer interface {
	ParseLayer(b []byte, in *parse.Input) uint
	FormatLayer(b []byte) []string
}

type LinkStateEvent

type LinkStateEvent struct {
	Event
	Hi   Hi
	IsUp bool
}

func (*LinkStateEvent) EventAction

func (e *LinkStateEvent) EventAction()

func (*LinkStateEvent) String

func (e *LinkStateEvent) String() string

type MaskedStringer

type MaskedStringer interface {
	MaskedString(mask MaskedStringer) string
}

type MaskedStrings

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

func (*MaskedStrings) Add

func (x *MaskedStrings) Add(key string, v, m MaskedStringer)

func (*MaskedStrings) String

func (x *MaskedStrings) String() (s string)

func (*MaskedStrings) Strings

func (x *MaskedStrings) Strings() (s []string)

type MirrorConfigData

type MirrorConfigData struct {
	Name   string
	Src    string
	Dst    string
	Type   string
	Active string
}

type MirrorConfigFileData

type MirrorConfigFileData struct {
	Mirror []MirrorConfigData
}

type Node

type Node struct {
	Vnet *Vnet
	loop.Node
	Dep    dep.Dep
	Errors []string
	// contains filtered or unexported fields
}

func (*Node) AddSuspendActivity

func (n *Node) AddSuspendActivity(i *RefIn, a int)

func (*Node) CountError

func (d *Node) CountError(i, count uint)

func (*Node) ErrorRedirect

func (node *Node) ErrorRedirect(in *RefIn, out *RefOut, next uint, err ErrorRef)

func (*Node) ErrorRef

func (n *Node) ErrorRef(i uint) ErrorRef

func (*Node) GetIfThread

func (n *Node) GetIfThread() *InterfaceThread

func (*Node) GetVnetNode

func (n *Node) GetVnetNode() *Node

func (*Node) NewError

func (n *Node) NewError(s string) (r ErrorRef)

func (*Node) Redirect

func (node *Node) Redirect(in *RefIn, out *RefOut, next uint)

func (*Node) Resume

func (n *Node) Resume(i *RefIn)

func (*Node) SetError

func (n *Node) SetError(r *Ref, i uint)

func (*Node) SetOutLen

func (n *Node) SetOutLen(out *RefIn, in *RefIn, l uint)

func (*Node) SignalEvent

func (n *Node) SignalEvent(r Eventer)

func (*Node) SignalEventAfter

func (n *Node) SignalEventAfter(r Eventer, dt float64)

func (*Node) SignalEventAfterp

func (n *Node) SignalEventAfterp(r Eventer, dt float64, p elog.PointerToFirstArg)

func (*Node) SignalEventp

func (n *Node) SignalEventp(r Eventer, p elog.PointerToFirstArg)

func (*Node) Suspend

func (n *Node) Suspend(i *RefIn)

type Noder

type Noder interface {
	loop.Noder
	GetVnetNode() *Node
}

type OutputInterfaceNode

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

func (*OutputInterfaceNode) GetInterfaceNode

func (n *OutputInterfaceNode) GetInterfaceNode() *interfaceNode

func (*OutputInterfaceNode) LoopOutput

func (n *OutputInterfaceNode) LoopOutput(l *loop.Loop, i loop.LooperIn)

func (*OutputInterfaceNode) MakeLoopIn

func (n *OutputInterfaceNode) MakeLoopIn() loop.LooperIn

func (*OutputInterfaceNode) MakeLoopOut

func (n *OutputInterfaceNode) MakeLoopOut() loop.LooperOut

type OutputNode

type OutputNode struct {
	Node
	// contains filtered or unexported fields
}

func (*OutputNode) GetOutputNode

func (n *OutputNode) GetOutputNode() *OutputNode

func (*OutputNode) LoopOutput

func (n *OutputNode) LoopOutput(l *loop.Loop, i loop.LooperIn)

func (*OutputNode) MakeLoopIn

func (n *OutputNode) MakeLoopIn() loop.LooperIn

type OutputNoder

type OutputNoder interface {
	Noder
	GetOutputNode() *OutputNode
	NodeOutput(i *RefIn)
}

type Package

type Package struct {
	Vnet *Vnet
	// contains filtered or unexported fields
}

func (*Package) Configure

func (p *Package) Configure(in *parse.Input)

func (*Package) DependedOnBy

func (p *Package) DependedOnBy(names ...string)

func (*Package) DependsOn

func (p *Package) DependsOn(names ...string)

func (*Package) Exit

func (p *Package) Exit() (err error)

func (*Package) GetPackage

func (p *Package) GetPackage() *Package

func (*Package) Init

func (p *Package) Init() (err error)

type Packager

type Packager interface {
	GetPackage() *Package
	Configure(in *parse.Input)
	Init() (err error)
	Exit() (err error)
}

type PacketHeader

type PacketHeader interface {
	// Number of packet bytes in this header's payload.
	Len() uint

	// Write this header's packet data to given slice.
	Write([]byte)

	// Return given slice as packet header type.
	Read([]byte) PacketHeader

	String() string
}

func ReadPacket

func ReadPacket(b []byte, args ...PacketHeader) (hs []PacketHeader)

type PacketType

type PacketType int

Generic packet type

const (
	IP4 PacketType = 1 + iota
	IP6
	MPLS_UNICAST
	MPLS_MULTICAST
	ARP
)

type PortEntry

type PortEntry struct {
	Net          uint64
	Ifindex      int32
	Iflinkindex  int32 // system side eth# ifindex
	Ifname       string
	Flags        xeth.EthtoolPrivFlags
	Iff          net.Flags
	Speed        xeth.Mbps
	Autoneg      uint8
	PortVid      uint16
	Stag         uint16 // internal vlan tag for bridge
	Ctag         uint16 // vlan tag to identify vlan member and set l3_iif/vrf via vlan_xlate
	Portindex    int16
	Subportindex int8
	PuntIndex    uint8 // 0-based meth#, derived from Iflinkindex
	Devtype      uint8
	StationAddr  net.HardwareAddr
	IPNets       []*net.IPNet
}

func (*PortEntry) AddIPNet

func (pe *PortEntry) AddIPNet(ipnet *net.IPNet)

func (*PortEntry) DelIPNet

func (pe *PortEntry) DelIPNet(ipnet *net.IPNet)

type PortsMap

type PortsMap struct {
	sync.Map // indexed by ifname, value is *PortEntry
	// contains filtered or unexported fields
}
var Ports PortsMap

func (*PortsMap) Foreach

func (p *PortsMap) Foreach(f func(ifname string, pe *PortEntry))

func (*PortsMap) ForeachNameByIndex

func (p *PortsMap) ForeachNameByIndex(f func(ifindex int32, ifname string))

func (*PortsMap) ForeachSiByIndex

func (p *PortsMap) ForeachSiByIndex(f func(ifindex int32, si Si))

func (*PortsMap) GetNameByIndex

func (p *PortsMap) GetNameByIndex(ifindex int32) (string, bool)

func (*PortsMap) GetNumSubports

func (p *PortsMap) GetNumSubports(ifname string) (numSubports uint)

func (*PortsMap) GetPortByIndex

func (p *PortsMap) GetPortByIndex(ifindex int32) (*PortEntry, bool)

func (*PortsMap) GetPortByName

func (p *PortsMap) GetPortByName(ifname string) (*PortEntry, bool)

func (*PortsMap) GetSiByIndex

func (p *PortsMap) GetSiByIndex(ifindex int32) (Si, bool)

func (*PortsMap) IfName

func (p *PortsMap) IfName(portindex, subportindex int) (name string)

func (*PortsMap) SetPort

func (p *PortsMap) SetPort(ifname string) (pe *PortEntry)

port or bridge member

func (*PortsMap) SetPortByIndex

func (p *PortsMap) SetPortByIndex(ifindex int32, ifname string) *PortEntry

func (*PortsMap) SetSiByIfindex

func (p *PortsMap) SetSiByIfindex(ifindex int32, si Si)

func (*PortsMap) UnsetPort

func (p *PortsMap) UnsetPort(ifname string)

type Ref

type Ref struct {
	hw.RefHeader
	RefOpaque
}

func Get4Refs

func Get4Refs(rs []Ref, i uint) (r0, r1, r2, r3 *Ref)

func (*Ref) Flags

func (r *Ref) Flags() BufferFlag

func (*Ref) Foreach

func (r *Ref) Foreach(f func(r *Ref, i uint))

func (*Ref) GetBuffer

func (r *Ref) GetBuffer() *Buffer

func (*Ref) NextRef

func (r *Ref) NextRef() *Ref

func (*Ref) NextValidFlag

func (r *Ref) NextValidFlag() BufferFlag

func (*Ref) Trace

func (r *Ref) Trace(p *BufferPool, i hw.BufferTracer, e int)

func (*Ref) ValidateState

func (r *Ref) ValidateState(p *BufferPool, s BufferState)

type RefChain

type RefChain hw.RefChain

func (*RefChain) Append

func (c *RefChain) Append(r *Ref)

func (*RefChain) Done

func (c *RefChain) Done() (h Ref)

func (*RefChain) Head

func (c *RefChain) Head() *Ref

func (*RefChain) Len

func (c *RefChain) Len() uint

func (*RefChain) Reset

func (c *RefChain) Reset()

func (*RefChain) Validate

func (c *RefChain) Validate()

type RefHeader

type RefHeader hw.RefHeader

type RefIn

type RefIn struct {
	Refs [MaxVectorLen]Ref
	// contains filtered or unexported fields
}

func (*RefIn) AddLen

func (i *RefIn) AddLen(v *Vnet) (l uint)

func (*RefIn) AllocPoolRefs

func (r *RefIn) AllocPoolRefs(p *BufferPool, n uint)

func (*RefIn) AllocRefs

func (i *RefIn) AllocRefs(n uint)

func (*RefIn) Cap

func (r *RefIn) Cap() uint

func (*RefIn) Dup

func (i *RefIn) Dup(x *RefIn)

func (*RefIn) FreePoolRefs

func (r *RefIn) FreePoolRefs(p *BufferPool, n uint)

func (*RefIn) FreeRefs

func (i *RefIn) FreeRefs(n uint)

func (*RefIn) Get1

func (r *RefIn) Get1(i uint) (_ *Ref)

func (*RefIn) Get2

func (r *RefIn) Get2(i uint) (_, _ *Ref)

func (*RefIn) Get4

func (r *RefIn) Get4(i uint) (_, _, _, _ *Ref)

func (*RefIn) GetLen

func (i *RefIn) GetLen(v *Vnet) uint

func (*RefIn) SetLen

func (in *RefIn) SetLen(v *Vnet, new_len uint)

func (*RefIn) SetPoolAndLen

func (i *RefIn) SetPoolAndLen(v *Vnet, p *BufferPool, l uint)

type RefOpaque

type RefOpaque struct {
	// Software interface.
	Si Si

	// Aux data.
	// For example, used by error node to give reason for dropping this packet.
	Aux uint32
}

func (*RefOpaque) SetError

func (r *RefOpaque) SetError(n *Node, i uint)

type RefOut

type RefOut struct {
	loop.Out
	Outs []RefIn
}

type RefVec

type RefVec []Ref

func (RefVec) Len

func (p RefVec) Len() uint

func (*RefVec) ResetLen

func (p *RefVec) ResetLen()

func (*RefVec) Resize

func (p *RefVec) Resize(n uint)

func (*RefVec) Validate

func (p *RefVec) Validate(i uint) *Ref

func (*RefVec) ValidateInit

func (p *RefVec) ValidateInit(i uint, zero Ref) *Ref

func (*RefVec) ValidateLen

func (p *RefVec) ValidateLen(l uint) (v *Ref)

func (*RefVec) ValidateLenInit

func (p *RefVec) ValidateLenInit(l uint, zero Ref) (v *Ref)

type RefVecIn

type RefVecIn struct {
	Refs RefVec
	// contains filtered or unexported fields
}

func (*RefVecIn) FreePoolRefs

func (r *RefVecIn) FreePoolRefs(p *BufferPool, freeNext bool)

func (*RefVecIn) FreeRefs

func (r *RefVecIn) FreeRefs(freeNext bool)

func (*RefVecIn) Len

func (r *RefVecIn) Len() uint

func (*RefVecIn) NPackets

func (r *RefVecIn) NPackets() uint

type Reg32

type Reg32 uint32

func (*Reg32) Or

func (s *Reg32) Or(v uint32) (new uint32)

Atomically set 32-bit register shadow. Typically done in interrupt routine.

func (*Reg32) ReadClear

func (s *Reg32) ReadClear() (v uint32)

Atomically read and clear 32-bit status.

type Reg64

type Reg64 uint64

func (*Reg64) Or

func (s *Reg64) Or(v uint64)

Atomically set 64-bit status. Typically done in interrupt routine.

func (*Reg64) ReadClear

func (s *Reg64) ReadClear() (v uint64)

Atomically read and clear 64-bit status.

type Rewrite

type Rewrite struct {
	// Software interface to mark re-written packets with.
	Si   Si
	Stag uint16

	// Node where packet will be rewritten.
	NodeIndex uint32

	// Next node to feed packet after rewrite.
	NextIndex uint32

	// Max packet size layer 3 (MTU) for output interface.
	// Used for MTU check after packet rewrite.
	// Avoids having to lookup egress interface's MTU.
	MaxL3PacketSize uint16
	// contains filtered or unexported fields
}

func (*Rewrite) AddData

func (r *Rewrite) AddData(p unsafe.Pointer, size uintptr) (l uintptr)

func (*Rewrite) Data

func (r *Rewrite) Data() []byte

func (*Rewrite) GetData

func (r *Rewrite) GetData() unsafe.Pointer

func (*Rewrite) Len

func (r *Rewrite) Len() uint

func (*Rewrite) Lines

func (r *Rewrite) Lines(v *Vnet) (lines []string)

func (*Rewrite) ParseWithArgs

func (r *Rewrite) ParseWithArgs(in *parse.Input, args *parse.Args)

func (*Rewrite) ResetData

func (r *Rewrite) ResetData()

func (*Rewrite) SetData

func (r *Rewrite) SetData(d []byte)

func (*Rewrite) SetLen

func (r *Rewrite) SetLen(l uint)

func (*Rewrite) SetMaxPacketSize

func (r *Rewrite) SetMaxPacketSize(hw *HwIf)

func (*Rewrite) Slice

func (r *Rewrite) Slice() []byte

func (*Rewrite) String

func (r *Rewrite) String() (dump string)

type RxDmaDescriptorFlags

type RxDmaDescriptorFlags uint64

type RxDmaRefState

type RxDmaRefState struct {
	// Next index.
	Next uint

	// Number of byte to advance ref data.
	Advance int

	// Interface and error.
	RefOpaque
}

type RxDmaRing

type RxDmaRing struct {
	RxDmaRefState
	// contains filtered or unexported fields
}

func (*RxDmaRing) Flush

func (g *RxDmaRing) Flush()

func (*RxDmaRing) MaxNext

func (g *RxDmaRing) MaxNext() (n uint)

func (*RxDmaRing) RefillRef

func (g *RxDmaRing) RefillRef(i rxDmaRingIndex) *Ref

func (*RxDmaRing) RingIndex

func (r *RxDmaRing) RingIndex(i uint) rxDmaRingIndex

For even ring sequence, rx refs are even; refills are odd; vice versa for odd sequences.

func (*RxDmaRing) Rx1Descriptor

func (g *RxDmaRing) Rx1Descriptor(ri rxDmaRingIndex, b0 uint, f0 RxDmaDescriptorFlags)

func (*RxDmaRing) Rx4Descriptors

func (g *RxDmaRing) Rx4Descriptors(ri rxDmaRingIndex, b0, b1, b2, b3 uint, f0, f1, f2, f3 RxDmaDescriptorFlags)

func (*RxDmaRing) RxDmaRingInit

func (g *RxDmaRing) RxDmaRingInit(v *Vnet, r RxDmaRinger, flags RxDmaDescriptorFlags, desc_flag_end_of_packet_shift uint, pool *BufferPool, ring_len uint)

func (*RxDmaRing) RxRef

func (g *RxDmaRing) RxRef(i rxDmaRingIndex) *Ref

Aliases.

func (*RxDmaRing) WrapRefill

func (r *RxDmaRing) WrapRefill()

Allocate new re-fill buffers when ring wraps.

type RxDmaRinger

type RxDmaRinger interface {
	GetRefState(flags RxDmaDescriptorFlags) RxDmaRefState
	// contains filtered or unexported methods
}

type RxTx

type RxTx int
const (
	Rx RxTx = iota
	Tx
	NRxTx
)

func (RxTx) String

func (x RxTx) String() (s string)

type SflowConfigData

type SflowConfigData struct {
	Name   string
	Src    string
	Active string
	Cpu    string
	Mirror string
	Rate   string
	Dst    string
}

type SflowConfigFileData

type SflowConfigFileData struct {
	Sflow []SflowConfigData
}

type Si

type Si IfIndex

Software and hardware interface index. Alias for commonly used types.

func (Si) GetType

func (si Si) GetType(v *Vnet) swInterfaceTyper

func (Si) Id

func (si Si) Id(v *Vnet) (id IfId)

func (Si) IsAdminUp

func (si Si) IsAdminUp(v *Vnet) bool

func (Si) IsSwSubInterface

func (si Si) IsSwSubInterface(v *Vnet) bool

func (Si) Kind

func (si Si) Kind(v *Vnet) SwIfKind

func (*Si) ParseWithArgs

func (si *Si) ParseWithArgs(in *parse.Input, args *parse.Args)

func (Si) SetAdminUp

func (si Si) SetAdminUp(v *Vnet, isUp bool) (err error)

func (Si) SetId

func (si Si) SetId(v *Vnet, id IfId)

func (Si) SupSi

func (si Si) SupSi(v *Vnet) Si

type SiName

type SiName struct {
	V  *Vnet
	Si Si
}

func (SiName) String

func (sn SiName) String() string

type SviVnetFeMsg

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

Could collapse all vnet Hooks calls into this message to avoid direct function calls from vnet to fe

type SwIf

type SwIf struct {
	Name string //if SwIfKindHardware, then name should same as HwIf.name
	// contains filtered or unexported fields
}

func (*SwIf) GetId

func (i *SwIf) GetId() IfId

func (*SwIf) GetType

func (s *SwIf) GetType(v *Vnet) swInterfaceTyper

func (*SwIf) Id

func (i *SwIf) Id(v *Vnet) (id IfId)

func (*SwIf) IsAdminUp

func (i *SwIf) IsAdminUp() bool

func (*SwIf) SetAdminUp

func (sw *SwIf) SetAdminUp(v *Vnet, wantUp bool) (err error)

type SwIfAddDelHook

type SwIfAddDelHook func(v *Vnet, si Si, isDel bool) error

type SwIfAddDelHookVec

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

func (*SwIfAddDelHookVec) Add

func (t *SwIfAddDelHookVec) Add(x SwIfAddDelHook, ds ...*dep.Dep)

func (*SwIfAddDelHookVec) Get

func (*SwIfAddDelHookVec) Len

func (t *SwIfAddDelHookVec) Len() int

type SwIfAdminUpDownHook

type SwIfAdminUpDownHook func(v *Vnet, si Si, isUp bool) error

type SwIfAdminUpDownHookVec

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

func (*SwIfAdminUpDownHookVec) Add

func (*SwIfAdminUpDownHookVec) Get

func (*SwIfAdminUpDownHookVec) Len

func (t *SwIfAdminUpDownHookVec) Len() int

type SwIfChooser

type SwIfChooser ifChooser

func (*SwIfChooser) Foreach

func (c *SwIfChooser) Foreach(f func(v *Vnet, si Si))

func (*SwIfChooser) Init

func (c *SwIfChooser) Init(v *Vnet)

func (*SwIfChooser) Parse

func (c *SwIfChooser) Parse(in *parse.Input)

type SwIfCounterSyncHook

type SwIfCounterSyncHook func(v *Vnet)

type SwIfCounterSyncHookVec

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

func (*SwIfCounterSyncHookVec) Add

func (*SwIfCounterSyncHookVec) Get

func (*SwIfCounterSyncHookVec) Len

func (t *SwIfCounterSyncHookVec) Len() int

type SwIfKind

type SwIfKind uint16
const (
	SwIfKindInvalid SwIfKind = iota
	// Hardware interface.
	SwIfKindHardware
	// Sub interface (e.g. vlan) of hardware interface.
	SwIfKindSubInterface
	// Sw interface for a bridge
	SwBridgeInterface
)

func (SwIfKind) String

func (k SwIfKind) String() string

type SwInterfaceType

type SwInterfaceType struct {
	SwIfKind SwIfKind
}

func (*SwInterfaceType) GetSwInterfaceType

func (t *SwInterfaceType) GetSwInterfaceType() *SwInterfaceType

func (*SwInterfaceType) SwInterfaceLessThan

func (t *SwInterfaceType) SwInterfaceLessThan(v *Vnet, a, b *SwIf) bool

func (*SwInterfaceType) SwInterfaceName

func (t *SwInterfaceType) SwInterfaceName(v *Vnet, s *SwIf) string

func (*SwInterfaceType) SwInterfaceRewriteString

func (t *SwInterfaceType) SwInterfaceRewriteString(v *Vnet, r *Rewrite) []string

func (*SwInterfaceType) SwInterfaceSetRewrite

func (t *SwInterfaceType) SwInterfaceSetRewrite(rw *Rewrite, si Si, noder Noder, typ PacketType)

type TxDmaRing

type TxDmaRing struct {
	ToInterrupt chan *TxRefVecIn
	// contains filtered or unexported fields
}

Transmit ring common code.

func (*TxDmaRing) Init

func (r *TxDmaRing) Init(v *Vnet)

func (*TxDmaRing) InterruptAdvance

func (r *TxDmaRing) InterruptAdvance(n uint)

type TxRefVecIn

type TxRefVecIn struct {
	RefVecIn
	// contains filtered or unexported fields
}

func (*TxRefVecIn) Free

func (i *TxRefVecIn) Free(v *Vnet)

type Uint16

type Uint16 uint16

func (Uint16) FromHost

func (x Uint16) FromHost() Uint16

func (Uint16) MaskedString

func (v Uint16) MaskedString(r MaskedStringer) string

func (*Uint16) Set

func (x *Uint16) Set(v uint)

func (Uint16) ToHost

func (x Uint16) ToHost() uint16

type Uint32

type Uint32 uint32

func (Uint32) FromHost

func (x Uint32) FromHost() Uint32

func (Uint32) MaskedString

func (v Uint32) MaskedString(r MaskedStringer) string

func (*Uint32) Set

func (x *Uint32) Set(v uint)

func (Uint32) ToHost

func (x Uint32) ToHost() uint32

type Uint64

type Uint64 uint64

func (Uint64) FromHost

func (x Uint64) FromHost() Uint64

func (Uint64) MaskedString

func (v Uint64) MaskedString(r MaskedStringer) string

func (*Uint64) Set

func (x *Uint64) Set(v uint)

func (Uint64) ToHost

func (x Uint64) ToHost() uint64

type Uint8

type Uint8 uint8 // dummy used to satisfy MaskedStringer interface

Network byte order helpers.

func (Uint8) MaskedString

func (v Uint8) MaskedString(r MaskedStringer) string

type Vnet

type Vnet struct {
	hw.BufferMain

	BridgeAddDelHook       BridgeAddDelHook_t
	BridgeMemberAddDelHook BridgeMemberAddDelHook_t
	BridgeMemberLookup     BridgeMemberLookup_t
	// contains filtered or unexported fields
}

Main structure.

func (*Vnet) AddBufferPool

func (v *Vnet) AddBufferPool(p *BufferPool)

func (*Vnet) AddNamedNext

func (v *Vnet) AddNamedNext(n Noder, name string) uint

func (*Vnet) AddPackage

func (v *Vnet) AddPackage(name string, r Packager) (pi uint)

func (*Vnet) CleanAndDownSwInterface

func (m *Vnet) CleanAndDownSwInterface(si Si)

remove ifaddr, neighbor via hooks and admin down (removes glean and local fib), but does not delete the SwIf

func (*Vnet) CliAdd

func (v *Vnet) CliAdd(c *cli.Command)

func (*Vnet) CliInit

func (v *Vnet) CliInit()

func (*Vnet) Configure

func (v *Vnet) Configure(in *parse.Input) (err error)

func (*Vnet) ConfigurePackages

func (v *Vnet) ConfigurePackages(in *parse.Input) (err error)

func (*Vnet) CurrentEvent

func (v *Vnet) CurrentEvent() *loop.Event

func (*Vnet) DelSwIf

func (m *Vnet) DelSwIf(si Si)

func (*Vnet) ExitPackages

func (m *Vnet) ExitPackages() (err error)

func (*Vnet) Fatalf

func (v *Vnet) Fatalf(format string, args ...interface{})

func (*Vnet) ForeachHighFreqHwIfCounter

func (v *Vnet) ForeachHighFreqHwIfCounter(zero bool, unixOnly bool, f func(hi Hi, name string, value uint64))

func (*Vnet) ForeachHwIf

func (v *Vnet) ForeachHwIf(unixOnly bool, f func(hi Hi))

func (*Vnet) ForeachHwIfCounter

func (v *Vnet) ForeachHwIfCounter(zero bool, unixOnly bool, f func(hi Hi, name string, value uint64))

func (*Vnet) ForeachSwIf

func (v *Vnet) ForeachSwIf(f func(si Si))

func (*Vnet) ForeachSwIfCounter

func (v *Vnet) ForeachSwIfCounter(zero bool, f func(si Si, siName, counterName string, value uint64))

func (*Vnet) FreeTxRefIn

func (v *Vnet) FreeTxRefIn(i *TxRefVecIn)

func (*Vnet) GetIfThread

func (m *Vnet) GetIfThread(id uint) (t *InterfaceThread)

func (*Vnet) GetLoop

func (v *Vnet) GetLoop() *loop.Loop

func (*Vnet) GetPackage

func (m *Vnet) GetPackage(i uint) Packager

func (*Vnet) HwIf

func (m *Vnet) HwIf(i Hi) *HwIf

func (*Vnet) HwIfByName

func (v *Vnet) HwIfByName(name string) (Hi, bool)

func (*Vnet) HwIfer

func (m *Vnet) HwIfer(i Hi) HwInterfacer

func (*Vnet) HwIferForSupSi

func (m *Vnet) HwIferForSupSi(si Si) (h HwInterfacer)

func (*Vnet) HwLessThan

func (v *Vnet) HwLessThan(a, b *HwIf) bool

Interface ordering for output.

func (*Vnet) HwSwCombinedIfCounter

func (m *Vnet) HwSwCombinedIfCounter(i uint) swIfCombinedCounterKind

func (*Vnet) HwSwSingleIfCounter

func (m *Vnet) HwSwSingleIfCounter(i uint) swIfCounterKind

func (*Vnet) InitPackages

func (m *Vnet) InitPackages() (err error)

func (*Vnet) Logf

func (v *Vnet) Logf(format string, args ...interface{})

func (*Vnet) Logln

func (v *Vnet) Logln(args ...interface{})

func (*Vnet) NewSwCombinedCounters

func (v *Vnet) NewSwCombinedCounters(names []string) swIfCombinedCounterKind

func (*Vnet) NewSwCounters

func (v *Vnet) NewSwCounters(names []string) swIfCounterKind

func (*Vnet) NewSwIf

func (m *Vnet) NewSwIf(kind SwIfKind, id IfId, ifname string) Si

func (*Vnet) NewSwSubInterface

func (m *Vnet) NewSwSubInterface(supSi Si, id IfId, ifname string) (si Si)

func (*Vnet) PackageByName

func (m *Vnet) PackageByName(name string) (i uint, ok bool)

func (*Vnet) Quit

func (v *Vnet) Quit()

func (*Vnet) RegisterAndProvisionHwInterface

func (v *Vnet) RegisterAndProvisionHwInterface(h HwInterfacer, provision bool, format string, args ...interface{}) (err error)

func (*Vnet) RegisterBridgeAddDelHook

func (v *Vnet) RegisterBridgeAddDelHook(h BridgeAddDelHook_t)

func (*Vnet) RegisterBridgeMemberAddDelHook

func (v *Vnet) RegisterBridgeMemberAddDelHook(h BridgeMemberAddDelHook_t)

func (*Vnet) RegisterBridgeMemberLookup

func (v *Vnet) RegisterBridgeMemberLookup(h BridgeMemberLookup_t)

func (*Vnet) RegisterHwIfAddDelHook

func (m *Vnet) RegisterHwIfAddDelHook(h HwIfAddDelHook)

func (*Vnet) RegisterHwIfLinkUpDownHook

func (m *Vnet) RegisterHwIfLinkUpDownHook(h HwIfLinkUpDownHook)

func (*Vnet) RegisterHwIfProvisionHook

func (m *Vnet) RegisterHwIfProvisionHook(h HwIfProvisionHook)

func (*Vnet) RegisterHwInterface

func (v *Vnet) RegisterHwInterface(h HwInterfacer, format string, args ...interface{}) (err error)

func (*Vnet) RegisterInOutNode

func (v *Vnet) RegisterInOutNode(n InOutNoder, name string, args ...interface{})

func (*Vnet) RegisterInputNode

func (v *Vnet) RegisterInputNode(n InputNoder, name string, args ...interface{})

func (*Vnet) RegisterInterfaceNode

func (v *Vnet) RegisterInterfaceNode(n inputOutputInterfaceNoder, hi Hi, name string, args ...interface{})

func (*Vnet) RegisterNode

func (v *Vnet) RegisterNode(n Noder, format string, args ...interface{})

func (*Vnet) RegisterOutputInterfaceNode

func (v *Vnet) RegisterOutputInterfaceNode(n outputInterfaceNoder, hi Hi, name string, args ...interface{})

func (*Vnet) RegisterOutputNode

func (v *Vnet) RegisterOutputNode(n OutputNoder, name string, args ...interface{})

func (*Vnet) RegisterSwIfAddDelHook

func (m *Vnet) RegisterSwIfAddDelHook(h SwIfAddDelHook)

func (*Vnet) RegisterSwIfAdminUpDownHook

func (m *Vnet) RegisterSwIfAdminUpDownHook(h SwIfAdminUpDownHook)

func (*Vnet) RegisterSwIfCounterSyncHook

func (m *Vnet) RegisterSwIfCounterSyncHook(h SwIfCounterSyncHook)

func (*Vnet) RegisterSwInterfaceType

func (i *Vnet) RegisterSwInterfaceType(r swInterfaceTyper)

func (*Vnet) Run

func (v *Vnet) Run(in *parse.Input) (err error)

func (*Vnet) SetRewrite

func (v *Vnet) SetRewrite(rw *Rewrite, si Si, noder Noder, t PacketType, dstAddr []byte)

func (*Vnet) SetRewriteNodeHwIf

func (v *Vnet) SetRewriteNodeHwIf(rw *Rewrite, hw *HwIf, noder Noder) (h HwInterfacer)

func (*Vnet) SignalEvent

func (v *Vnet) SignalEvent(r Eventer)

func (*Vnet) SignalEventAfter

func (v *Vnet) SignalEventAfter(r Eventer, dt float64)

func (*Vnet) SupHi

func (m *Vnet) SupHi(si Si) Hi

func (*Vnet) SupHwIf

func (m *Vnet) SupHwIf(s *SwIf) (h *HwIf)

func (*Vnet) SupSi

func (m *Vnet) SupSi(i Si) Si

func (*Vnet) SupSwIf

func (m *Vnet) SupSwIf(s *SwIf) (sup *SwIf)

func (*Vnet) SwIf

func (m *Vnet) SwIf(i Si) *SwIf

func (*Vnet) SwIfValid

func (m *Vnet) SwIfValid(i Si) bool

func (*Vnet) SwLessThan

func (v *Vnet) SwLessThan(a, b *SwIf) bool

func (*Vnet) TimeDiff

func (v *Vnet) TimeDiff(t0, t1 cpu.Time) float64

Directories

Path Synopsis
devices
ethernet/ixge
Driver for Intel 10G Ethernet controllers.
Driver for Intel 10G Ethernet controllers.
phy/xge
10 GIG E (XGE) PHY IEEE 802.3 clause 45 definitions.
10 GIG E (XGE) PHY IEEE 802.3 clause 45 definitions.
internal
ip
cli
platforms
fe1
mk1

Jump to

Keyboard shortcuts

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