otg

package
v0.0.0-...-195271a Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CapturedPacket

type CapturedPacket struct {
	Sequence       int
	Timestamp      time.Time
	Data           []byte
	ActualLength   int
	CapturedLength int
}

type CapturedPackets

type CapturedPackets struct {
	Packets []CapturedPacket
}

func (*CapturedPackets) CheckField

func (c *CapturedPackets) CheckField(sequence int, startOffSet int, field []byte) error

func (*CapturedPackets) CheckSize

func (c *CapturedPackets) CheckSize(sequence int, size int) error

func (*CapturedPackets) HasField

func (c *CapturedPackets) HasField(t *testing.T, name string, sequence int, startOffSet int, field []byte) bool

func (*CapturedPackets) ValidateField

func (c *CapturedPackets) ValidateField(t *testing.T, name string, sequence int, startOffSet int, field []byte)

func (*CapturedPackets) ValidateSize

func (c *CapturedPackets) ValidateSize(t *testing.T, sequence int, size int)

type OtgApi

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

func NewOtgApi

func NewOtgApi(t *testing.T) *OtgApi

func (*OtgApi) Api

func (o *OtgApi) Api() gosnappi.Api

func (*OtgApi) CleanupConfig

func (o *OtgApi) CleanupConfig()

func (*OtgApi) ConfigToJson

func (o *OtgApi) ConfigToJson(config gosnappi.Config) string

func (*OtgApi) ConfigToPbText

func (o *OtgApi) ConfigToPbText(config gosnappi.Config) string

func (*OtgApi) ConfigToYaml

func (o *OtgApi) ConfigToYaml(config gosnappi.Config) string

func (*OtgApi) GetBgpPrefixes

func (o *OtgApi) GetBgpPrefixes() []gosnappi.BgpPrefixesState

func (*OtgApi) GetBgpv4Metrics

func (o *OtgApi) GetBgpv4Metrics() []gosnappi.Bgpv4Metric

func (*OtgApi) GetCapture

func (o *OtgApi) GetCapture(portName string) *CapturedPackets

func (*OtgApi) GetConfig

func (o *OtgApi) GetConfig() gosnappi.Config

func (*OtgApi) GetFlowMetrics

func (o *OtgApi) GetFlowMetrics() []gosnappi.FlowMetric

func (*OtgApi) GetIpv4Neighbors

func (o *OtgApi) GetIpv4Neighbors() []gosnappi.Neighborsv4State

func (*OtgApi) GetIsIsMetrics

func (o *OtgApi) GetIsIsMetrics() []gosnappi.IsisMetric

func (*OtgApi) GetIsisLsps

func (o *OtgApi) GetIsisLsps() []gosnappi.IsisLspsState

func (*OtgApi) GetLacpMetrics

func (o *OtgApi) GetLacpMetrics() []gosnappi.LacpMetric

func (*OtgApi) GetLagMetrics

func (o *OtgApi) GetLagMetrics() []gosnappi.LagMetric

func (*OtgApi) GetLldpMetrics

func (o *OtgApi) GetLldpMetrics() []gosnappi.LldpMetric

func (*OtgApi) GetLldpNeighbors

func (o *OtgApi) GetLldpNeighbors() []gosnappi.LldpNeighborsState

func (*OtgApi) Ipv4AddrToBytes

func (o *OtgApi) Ipv4AddrToBytes(ip string) []byte

func (*OtgApi) Ipv6AddrToBytes

func (o *OtgApi) Ipv6AddrToBytes(ip string) []byte

func (*OtgApi) Layer1SpeedToMpbs

func (o *OtgApi) Layer1SpeedToMpbs(speed string) int

func (*OtgApi) LogPlot

func (o *OtgApi) LogPlot(name string)

func (*OtgApi) LogWrnErr

func (o *OtgApi) LogWrnErr(wrn gosnappi.Warning, err error, exitOnErr bool)

func (*OtgApi) MacAddrToBytes

func (o *OtgApi) MacAddrToBytes(mac string) []byte

func (*OtgApi) NewConfigFromJson

func (o *OtgApi) NewConfigFromJson(jsonStr string) gosnappi.Config

func (*OtgApi) NewConfigFromPbText

func (o *OtgApi) NewConfigFromPbText(pbStr string) gosnappi.Config

func (*OtgApi) NewConfigFromYaml

func (o *OtgApi) NewConfigFromYaml(yamlStr string) gosnappi.Config

func (*OtgApi) Plot

func (o *OtgApi) Plot() *plot.Plot

func (*OtgApi) SetConfig

func (o *OtgApi) SetConfig(config gosnappi.Config)

func (*OtgApi) StartCapture

func (o *OtgApi) StartCapture()

func (*OtgApi) StartProtocols

func (o *OtgApi) StartProtocols()

func (*OtgApi) StartTransmit

func (o *OtgApi) StartTransmit()

func (*OtgApi) StopCapture

func (o *OtgApi) StopCapture()

func (*OtgApi) StopProtocols

func (o *OtgApi) StopProtocols()

func (*OtgApi) StopTransmit

func (o *OtgApi) StopTransmit()

func (*OtgApi) TestConfig

func (o *OtgApi) TestConfig() *testconfig.TestConfig

func (*OtgApi) Testing

func (o *OtgApi) Testing() *testing.T

func (*OtgApi) Timer

func (o *OtgApi) Timer(start time.Time, fnName string)

func (*OtgApi) Uint64ToBytes

func (o *OtgApi) Uint64ToBytes(num uint64, size int) []byte

func (*OtgApi) WaitFor

func (o *OtgApi) WaitFor(fn func() bool, opts *WaitForOpts)

type ThroughputMetric

type ThroughputMetric struct {
	ConfiguredLineSpeedMbps int
	ConfiguredLineRate      float32
	ConfiguredPps           int
	ConfiguredFrames        uint64
	ConfiguredSize          int
	ConfiguredDuration      time.Duration
	TxFrames                uint64
	MinTxPps                int
	MaxTxPps                int
	AvgTxPps                int
	TxThroughput            float32
	TransmitDuration        time.Duration
	Ok                      bool
	// contains filtered or unexported fields
}

func NewThroughputMetric

func NewThroughputMetric(lineSpeedMbps int, lineRate float32, frames uint64, size int) *ThroughputMetric

func (*ThroughputMetric) AddPpsSnapshot

func (m *ThroughputMetric) AddPpsSnapshot(txFrames uint64, txPps int)

func (*ThroughputMetric) StartCollecting

func (m *ThroughputMetric) StartCollecting()

func (*ThroughputMetric) StopCollecting

func (m *ThroughputMetric) StopCollecting()

type ThroughputMetrics

type ThroughputMetrics struct {
	Metrics []ThroughputMetric
}

func (*ThroughputMetrics) ToTable

func (m *ThroughputMetrics) ToTable() (string, error)

type WaitForOpts

type WaitForOpts struct {
	FnName   string
	Interval time.Duration
	Timeout  time.Duration
}

Jump to

Keyboard shortcuts

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