Documentation
¶
Overview ¶
Package attrs bundles some common interface attributes and provides helpers to generate the appropriate OpenConfig and ATETopology.
The use of this package in new tests is discouraged. Legacy tests using this package will be migrated to use testbed topology helpers.
Index ¶
- type Attributes
- func (a *Attributes) AddToOTG(top gosnappi.Config, ap *ondatra.Port, peer *Attributes)
- func (a *Attributes) ConfigOCInterface(intf *oc.Interface, _ *ondatra.DUTDevice) *oc.Interface
- func (a *Attributes) IPv4CIDR() string
- func (a *Attributes) IPv6CIDR() string
- func (a *Attributes) NewOCInterface(name string, dut *ondatra.DUTDevice) *oc.Interface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attributes ¶
type Attributes struct {
IPv4 string
IPv6 string
MAC string
Name string // Interface name, only applied to ATE ports.
Desc string // Description, only applied to DUT interfaces.
IPv4Len uint8 // Prefix length for IPv4.
IPv6Len uint8 // Prefix length for IPv6.
MTU uint16
}
Attributes bundles some common attributes for devices and/or interfaces. It provides helpers to generate appropriate configuration for OpenConfig and for an ATETopology. All fields are optional; only those that are non-empty will be set when configuring an interface.
func (*Attributes) AddToOTG ¶
func (a *Attributes) AddToOTG(top gosnappi.Config, ap *ondatra.Port, peer *Attributes)
AddToOTG adds basic elements to a gosnappi configuration
func (*Attributes) ConfigOCInterface ¶
ConfigOCInterface configures an OpenConfig interface with these attributes.
func (*Attributes) IPv4CIDR ¶
func (a *Attributes) IPv4CIDR() string
IPv4CIDR constructs the IPv4 CIDR notation with the given prefix length, e.g. "192.0.2.1/30".
func (*Attributes) IPv6CIDR ¶
func (a *Attributes) IPv6CIDR() string
IPv6CIDR constructs the IPv6 CIDR notation with the given prefix length, e.g. "2001:db8::1/126".
func (*Attributes) NewOCInterface ¶
NewOCInterface returns a new *oc.Interface configured with these attributes.