Documentation
¶
Overview ¶
Package cfgplugins is a collection of OpenConfig configuration libraries.
Each plugin function has parameters for a gnmi Batch, values to use in the configuration and an ondatra.DUTDevice. Each function returns OpenConfig values.
The configuration function will modify the batch which is passed in by reference. The caller may pass nil as the configuration values to use in which case the function will provide a set of default values. The ondatra.DUTDevice is used to determine any configuration deviations which may be necessary.
The caller may choose to use the returned OC value to customize the values set by this function or for use in a non-batch use case.
Package cfgplugins provides configuration plugins for network protocols, including IS-IS related configuration helpers.
Package cfgplugins is a collection of OpenConfig configuration libraries for system and network instance.
Each plugin function has parameters for a gnmi Batch, values to use in the configuration and an ondatra.DUTDevice. Each function returns OpenConfig values.
The configuration function will modify the batch which is passed in by reference. The caller may pass nil as the configuration values to use in which case the function will provide a set of default values. The ondatra.DUTDevice is used to determine any configuration deviations which may be necessary.
The caller may choose to use the returned OC value to customize the values set by this function or for use in a non-batch use case.
Index ¶
- Constants
- Variables
- func AddInterfaceMTUOps(b *gnmi.SetBatch, dut *ondatra.DUTDevice, intfName string, mtu uint16, ...)
- func AddPortToAggregate(t *testing.T, dut *ondatra.DUTDevice, aggID string, ...)
- func AddSubInterface(t *testing.T, dut *ondatra.DUTDevice, b *gnmi.SetBatch, i *oc.Interface, ...)
- func AppendBGPNeighbor(t *testing.T, dut *ondatra.DUTDevice, batch *gnmi.SetBatch, ...) *oc.NetworkInstance_Protocol_Bgp
- func ApplyEthernetConfig(t *testing.T, i *oc.Interface, p *ondatra.Port, d *ondatra.DUTDevice)
- func ApplyPolicyToInterfaceOC(t *testing.T, pf *oc.NetworkInstance_PolicyForwarding, interfaceID string, ...)
- func ApplyQosPolicyOnInterface(t *testing.T, dut *ondatra.DUTDevice, batch *gnmi.SetBatch, ...)
- func ApplyVrfSelectionPolicyToInterfaceOC(t *testing.T, pf *oc.NetworkInstance_PolicyForwarding, interfaceID string, ...)
- func AssignETHIndexes(t *testing.T, dut *ondatra.DUTDevice) map[string]uint32
- func AssignInterfaceToNetworkInstance(t testing.TB, batch *gnmi.SetBatch, d *ondatra.DUTDevice, i string, ...)
- func AssignOTNIndexes(t *testing.T, dut *ondatra.DUTDevice) map[string]uint32
- func AssignToNetworkInstance(t testing.TB, d *ondatra.DUTDevice, i string, ni string, si uint32)
- func BGPClearConfig(t *testing.T, dut *ondatra.DUTDevice)
- func BgpISISRedistribution(t *testing.T, dut *ondatra.DUTDevice, afisafi string, b *gnmi.SetBatch, ...) *oc.Root
- func BuildBGPOCConfig(t *testing.T, dut *ondatra.DUTDevice, routerID string, ...) *oc.NetworkInstance_Protocol_Bgp
- func ConfigETHChannel(t *testing.T, dut *ondatra.DUTDevice, interfaceName, transceiverName string, ...)
- func ConfigOTNChannel(t *testing.T, dut *ondatra.DUTDevice, och string, otnIndex, ethIndex uint32)
- func ConfigOpticalChannel(t *testing.T, dut *ondatra.DUTDevice, och string, frequency uint64, ...)
- func ConfigureACL(t *testing.T, dut *ondatra.DUTDevice, batch *gnmi.SetBatch, params AclParams)
- func ConfigureBGPNeighbor(t *testing.T, dut *ondatra.DUTDevice, ni *oc.NetworkInstance, ...)
- func ConfigureBMP(t *testing.T, dut *ondatra.DUTDevice, batch *gnmi.SetBatch, ...)
- func ConfigureBMPAccessList(t *testing.T, dut *ondatra.DUTDevice, batch *gnmi.SetBatch, ...)
- func ConfigureCommonBGPPolicies(t *testing.T, dut *ondatra.DUTDevice) *oc.RoutingPolicy
- func ConfigureDUTBGP(t *testing.T, dut *ondatra.DUTDevice, batch *gnmi.SetBatch, cfg BGPConfig) *oc.NetworkInstance_Protocol
- func ConfigureDUTBGPMaxSegmentSize(t *testing.T, dut *ondatra.DUTDevice, intfName string, mtu uint16, ...)
- func ConfigureDutWithGueDecap(t *testing.T, dut *ondatra.DUTDevice, guePort int, ...)
- func ConfigureEBgpPeersScale(t *testing.T, dut *ondatra.DUTDevice, ate *ondatra.ATEDevice, ...) (gosnappi.Config, *oc.NetworkInstance_Protocol)
- func ConfigureGNPSI(t *testing.T, dut *ondatra.DUTDevice, params *GNPSIParams)
- func ConfigureGlobal(bgp *oc.NetworkInstance_Protocol_Bgp, dut *ondatra.DUTDevice, ...)
- func ConfigureLoadbalance(t *testing.T, dut *ondatra.DUTDevice)
- func ConfigureNDPRulesFromCLI(t *testing.T, dut *ondatra.DUTDevice, params AclParams)
- func ConfigureNetworkInstance(t *testing.T, dut *ondatra.DUTDevice, netInstName string, isDefault bool) *oc.NetworkInstance
- func ConfigurePeer(peer *oc.NetworkInstance_Protocol_Bgp_Neighbor, dut *ondatra.DUTDevice, ...)
- func ConfigurePeerGroup(pg *oc.NetworkInstance_Protocol_Bgp_PeerGroup, dut *ondatra.DUTDevice, ...)
- func ConfigureQoSDSCPRemarkFix(t *testing.T, dut *ondatra.DUTDevice)
- func ConfigureQosClassifierDscpRemark(t *testing.T, dut *ondatra.DUTDevice, qos *oc.Qos, classifierName string, ...)
- func ConfigureSubinterfaceIPs(s *oc.Interface_Subinterface, dut *ondatra.DUTDevice, ipv4Addr string, ...)
- func ConfigureTrafficPolicyACL(t *testing.T, dut *ondatra.DUTDevice, params ACLTrafficPolicyParams)
- func ConfigureURPFonDutInt(t *testing.T, dut *ondatra.DUTDevice, cfg URPFConfigParams)
- func ConfigureVLAN(s *oc.Interface_Subinterface, dut *ondatra.DUTDevice, vlanID uint16)
- func ConfigureVlan(t *testing.T, dut *ondatra.DUTDevice, cfg VlanParams)
- func ConfigureVrfSelectionPolicy(t *testing.T, dut *ondatra.DUTDevice, pf *oc.NetworkInstance_PolicyForwarding, ...)
- func CreateBGPNeighbors(t *testing.T, dut *ondatra.DUTDevice, sb *gnmi.SetBatch, ...) error
- func CreateGNMIServer(t testing.TB, d *ondatra.DUTDevice, batch *gnmi.SetBatch, ...)
- func CreateQueues(t *testing.T, dut *ondatra.DUTDevice, qos *oc.Qos, queues []string)
- func CreateVRFs(t *testing.T, dut *ondatra.DUTDevice, vrfBatch *gnmi.SetBatch, cfg VRFConfig) []string
- func DecapGroupConfigGre(t *testing.T, dut *ondatra.DUTDevice, pf *oc.NetworkInstance_PolicyForwarding, ...)
- func DecapGroupConfigGue(t *testing.T, dut *ondatra.DUTDevice, pf *oc.NetworkInstance_PolicyForwarding, ...)
- func DecapPolicyRulesandActionsGre(t *testing.T, pf *oc.NetworkInstance_PolicyForwarding, ...)
- func DecapPolicyRulesandActionsGue(t *testing.T, pf *oc.NetworkInstance_PolicyForwarding, ...)
- func DeleteACL(t *testing.T, batch *gnmi.SetBatch, params AclParams)
- func DeleteAggregate(t *testing.T, dut *ondatra.DUTDevice, aggID string, ...)
- func DeleteDUTBGPMaxSegmentSize(t *testing.T, dut *ondatra.DUTDevice, intfName string, mtu uint16, ...)
- func DeviationAristaBGPNeighborMaxPrefixes(t *testing.T, dut *ondatra.DUTDevice, neighborIP string, maxPrefixes uint32)
- func DeviationAristaRoutingPolicyBGPAsPathSetUnsupported(t *testing.T, dut *ondatra.DUTDevice, aclName string, routeMap string, ...)
- func DeviationBgpRibStreamingConfigRequired(t *testing.T, dut *ondatra.DUTDevice)
- func DeviationCiscoRoutingPolicyBGPActionSetCommunity(t *testing.T, dut *ondatra.DUTDevice, policyName string, statement string, ...)
- func DeviationCiscoRoutingPolicyBGPActionSetMed(t *testing.T, dut *ondatra.DUTDevice, policyName string, statement string, ...)
- func DeviationCiscoRoutingPolicyBGPToISIS(t *testing.T, dut *ondatra.DUTDevice, asn uint32, bgpInstance string, ...)
- func DeviationCiscoTableConnectionsStatictoBGPMetricPropagation(t *testing.T, dut *ondatra.DUTDevice, isV4 bool, metric int, ...)
- func DeviationJuniperRoutingPolicyBGPActionSetCommunity(t *testing.T, dut *ondatra.DUTDevice, policyName string, statement string, ...)
- func EnableACLCountersFromCLI(t *testing.T, dut *ondatra.DUTDevice, params AclParams)
- func EnableDefaultNetworkInstanceBgp(t *testing.T, dut *ondatra.DUTDevice, dutAS uint32)
- func EnableInterfaceAndSubinterfaces(t *testing.T, dut *ondatra.DUTDevice, b *gnmi.SetBatch, ...)
- func EnsureRoutedSubinterface0(i *oc.Interface, d *ondatra.DUTDevice, ipv4Addr string, ipv6Addr string, ...)
- func FindLineCardParent(t *testing.T, dut *ondatra.DUTDevice, startComponentName string) string
- func GenerateDynamicRouteWithISIS(t *testing.T, dut *ondatra.DUTDevice, sb *gnmi.SetBatch)
- func GetPolicyCLICounters(t *testing.T, dut *ondatra.DUTDevice, policyName string) string
- func IncrementIP(ipStr string, num int) (string, string)
- func InterfaceConfig(t *testing.T, dut *ondatra.DUTDevice, dp *ondatra.Port)
- func InterfaceGetOpMode() uint16
- func InterfaceInitialize(t *testing.T, dut *ondatra.DUTDevice, initialOperationalMode uint16) uint16
- func InterfacePolicyForwardingApply(t *testing.T, dut *ondatra.DUTDevice, params OcPolicyForwardingParams)
- func InterfacePolicyForwardingConfig(t *testing.T, dut *ondatra.DUTDevice, a *attrs.Attributes, aggID string, ...)
- func InterfaceQosClassificationConfig(t *testing.T, dut *ondatra.DUTDevice, a *attrs.Attributes, aggID string)
- func InterfacelocalProxyConfig(t *testing.T, dut *ondatra.DUTDevice, a *attrs.Attributes, aggID string)
- func IsIPv4InterfaceARPresolved(t *testing.T, ate *ondatra.ATEDevice, cfg AddressFamilyParams) error
- func IsIPv6InterfaceARPresolved(t *testing.T, ate *ondatra.ATEDevice, cfg AddressFamilyParams) error
- func LabelRangeConfig(t *testing.T, dut *ondatra.DUTDevice)
- func LabelRangeOCConfig(t *testing.T, dut *ondatra.DUTDevice)
- func MPLSStaticLSP(t *testing.T, batch *gnmi.SetBatch, dut *ondatra.DUTDevice, lspName string, ...)
- func MPLSStaticLSPByPass(t *testing.T, batch *gnmi.SetBatch, dut *ondatra.DUTDevice, lspName string, ...)
- func MPLSStaticLSPConfig(t *testing.T, dut *ondatra.DUTDevice, ni *oc.NetworkInstance, ...)
- func MplsConfig(t *testing.T, dut *ondatra.DUTDevice)
- func NewAggregateInterface(t *testing.T, dut *ondatra.DUTDevice, b *gnmi.SetBatch, l *DUTAggData) *oc.Interface
- func NewConfigureGRETunnel(t *testing.T, dut *ondatra.DUTDevice, decapIp string, decapGrpName string)
- func NewDUTHardwareInit(t *testing.T, dut *ondatra.DUTDevice, feature FeatureType) string
- func NewISIS(t *testing.T, dut *ondatra.DUTDevice, ISISData *ISISGlobalParams, ...) *oc.Root
- func NewISISBasic(t *testing.T, batch *gnmi.SetBatch, dut *ondatra.DUTDevice, ...) *oc.NetworkInstance_Protocol
- func NewInterfaceConfigAll(t *testing.T, dut *ondatra.DUTDevice, batch *gnmi.SetBatch, ...)
- func NewMPLSSRBasic(t *testing.T, batch *gnmi.SetBatch, dut *ondatra.DUTDevice, ...)
- func NewNetworkInstance(t testing.TB, d *ondatra.DUTDevice, batch *gnmi.SetBatch, ...)
- func NewOneRateTwoColorScheduler(t *testing.T, dut *ondatra.DUTDevice, batch *gnmi.SetBatch, ...)
- func NewPolicyForwardingEncapGre(t *testing.T, dut *ondatra.DUTDevice, pf *oc.NetworkInstance_PolicyForwarding, ...)
- func NewPolicyForwardingGueEncap(t *testing.T, dut *ondatra.DUTDevice, params GueEncapPolicyParams)
- func NewPolicyForwardingMatchAndSetTTL(t *testing.T, dut *ondatra.DUTDevice, pf *oc.NetworkInstance_PolicyForwarding, ...)
- func NewPolicyForwardingVRFSelection(t *testing.T, dut *ondatra.DUTDevice, sb *gnmi.SetBatch, ...) *gnmi.SetBatch
- func NewQoSClassifierConfiguration(t *testing.T, dut *ondatra.DUTDevice, q *oc.Qos, classifiers []QosClassifier) *oc.Qos
- func NewQoSForwardingGroup(t *testing.T, dut *ondatra.DUTDevice, q *oc.Qos, ...)
- func NewQoSQueue(t *testing.T, dut *ondatra.DUTDevice, q *oc.Qos)
- func NewQoSSchedulerInterface(t *testing.T, dut *ondatra.DUTDevice, q *oc.Qos, ...) *oc.Qos
- func NewQoSSchedulerPolicy(t *testing.T, dut *ondatra.DUTDevice, q *oc.Qos, policies []SchedulerPolicy) *oc.Qos
- func NewQosInitialize(t *testing.T, dut *ondatra.DUTDevice)
- func NewSFlowCollector(t *testing.T, batch *gnmi.SetBatch, newcfg *oc.Sampling_Sflow_Collector, ...) []*oc.Sampling_Sflow_Collector
- func NewSFlowGlobalCfg(t *testing.T, batch *gnmi.SetBatch, newcfg *oc.Sampling_Sflow, ...) *oc.Sampling_Sflow
- func NewStaticMplsLspPopLabel(t *testing.T, dut *ondatra.DUTDevice, lspName string, incomingLabel uint32, ...)
- func NewStaticMplsLspPushLabel(t *testing.T, dut *ondatra.DUTDevice, lspName string, intfName string, ...)
- func NewStaticMplsLspSwapLabel(t *testing.T, dut *ondatra.DUTDevice, lspName string, incomingLabel uint32, ...)
- func NewStaticRouteCfg(batch *gnmi.SetBatch, cfg *StaticRouteCfg, d *ondatra.DUTDevice) (*oc.NetworkInstance_Protocol_Static, error)
- func NewStaticVRFRoute(t *testing.T, batch *gnmi.SetBatch, cfg *StaticVRFRouteCfg, ...) (*oc.NetworkInstance_Protocol_Static, error)
- func NewSubInterfaces(t *testing.T, dut *ondatra.DUTDevice, dutPorts []Attributes)
- func NewTwoRateThreeColorScheduler(t *testing.T, dut *ondatra.DUTDevice, batch *gnmi.SetBatch, ...)
- func NextHopGroupConfig(t *testing.T, dut *ondatra.DUTDevice, traffictype string, ...)
- func NextHopGroupConfigForIpOverUdp(t *testing.T, dut *ondatra.DUTDevice, params NexthopGroupUDPParams)
- func NextHopGroupConfigForMulticloud(t *testing.T, dut *ondatra.DUTDevice, traffictype string, ...)
- func PolicyForwardingConfig(t *testing.T, dut *ondatra.DUTDevice, traffictype string, ...)
- func PolicyForwardingGreDecapsulation(t *testing.T, batch *gnmi.SetBatch, dut *ondatra.DUTDevice, decapIP string, ...)
- func PushDUTHardwareInitConfig(t *testing.T, dut *ondatra.DUTDevice, hardwareInitConf string)
- func PushPolicyForwardingConfig(t *testing.T, dut *ondatra.DUTDevice, ni *oc.NetworkInstance)
- func QosClassificationConfig(t *testing.T, dut *ondatra.DUTDevice)
- func QosClassificationOCConfig(t *testing.T)
- func RemoveStaticMplsLspPopLabel(t *testing.T, dut *ondatra.DUTDevice, lspName string, incomingLabel uint32, ...)
- func RemoveStaticMplsLspPushLabel(t *testing.T, dut *ondatra.DUTDevice, lspName string, intfName string)
- func RemoveStaticMplsLspSwapLabel(t *testing.T, dut *ondatra.DUTDevice, lspName string, incomingLabel uint32, ...)
- func RoutingPolicyBGPAdvertiseAggregate(t *testing.T, dut *ondatra.DUTDevice, triggerPfxName string, triggerPfx string, ...)
- func RulesAndActions(params OcPolicyForwardingParams, pf *oc.NetworkInstance_PolicyForwarding)
- func SetupAggregateAtomically(t *testing.T, dut *ondatra.DUTDevice, aggID string, ...)
- func SetupPolicyForwardingInfraOC(networkInstanceName string) (*oc.Root, *oc.NetworkInstance, *oc.NetworkInstance_PolicyForwarding)
- func SetupStaticAggregateAtomically(t *testing.T, dut *ondatra.DUTDevice, aggrBatch *gnmi.SetBatch, ...) *oc.Interface
- func StaticARPWithMagicUniversalIP(t *testing.T, dut *ondatra.DUTDevice, sb *gnmi.SetBatch, cfg StaticARPConfig) *gnmi.SetBatch
- func StaticARPWithSecondaryIP(t *testing.T, dut *ondatra.DUTDevice, sb *gnmi.SetBatch, cfg SecondaryIPConfig) *gnmi.SetBatch
- func StaticRouteNextNetworkInstance(t *testing.T, dut *ondatra.DUTDevice, cfg *StaticRouteCfg)
- func ToggleInterface(t *testing.T, dut *ondatra.DUTDevice, intf string, isEnabled bool)
- func ToggleInterfaceState(t *testing.T, dut *ondatra.DUTDevice, p *ondatra.Port, ...)
- func UpdateNetworkInstanceOnDut(t *testing.T, dut *ondatra.DUTDevice, netInstName string, ...)
- func ValidateInterfaceConfig(t *testing.T, dut *ondatra.DUTDevice, dp *ondatra.Port, ...)
- func VerifyBGPCapabilities(t *testing.T, dut *ondatra.DUTDevice, nbrs []*BgpNeighbor)
- func VerifyDUTBGPEstablished(t *testing.T, dut *ondatra.DUTDevice, duration ...time.Duration)
- func VerifyDUTVrfBGPState(t *testing.T, dut *ondatra.DUTDevice, cfg VrfBGPState)
- func VerifyOTGBGPEstablished(t *testing.T, ate *ondatra.ATEDevice, duration ...time.Duration)
- func VerifyPortsUp(t *testing.T, dev *ondatra.Device)
- func VerifyRoutes(t *testing.T, dut *ondatra.DUTDevice, routesToAdvertise map[string]RouteInfo)
- type ACLTrafficPolicyParams
- type AclParams
- type AclTerm
- type AddressFamilyParams
- type Attributes
- type BGPConfig
- type BGPNeighborConfig
- type BGPNeighborsConfig
- type BGPSession
- type BMPConfigParams
- type BgpNeighbor
- type BgpNeighborScale
- type ConfigParameters
- type DUTAggData
- type DUTSubInterfaceData
- type DecapMPLSParams
- type DecapPolicyParams
- type DynamicStructParams
- type EBgpConfigScale
- type FeatureType
- type ForwardingGroup
- type FrequencyList
- type GNPSIParams
- type GlobalOption
- func WithAS(as uint32) GlobalOption
- func WithExternalRouteDistance(distance uint8) GlobalOption
- func WithGlobalAfiSafiEnabled(afiSafi oc.E_BgpTypes_AFI_SAFI_TYPE, enabled bool) GlobalOption
- func WithGlobalEBGPMultipath(maxPaths uint32) GlobalOption
- func WithGlobalGracefulRestart(enabled bool, restartTime, staleTime uint16) GlobalOption
- func WithRouterID(id string) GlobalOption
- type GueEncapPolicyParams
- type ISISConfigBasic
- type ISISGlobalParams
- type LACPParams
- type MPLSSRConfigBasic
- type NeighborConfig
- type NetworkInstanceParams
- type NexthopGroupUDPParams
- type OcPolicyForwardingParams
- type OperationalModeList
- type OpticalChannelOpt
- type PbrRule
- type PeerGroupOption
- func ApplyPGRoutingPolicy(importPolicy, exportPolicy string, addDeleteLinkBW bool) PeerGroupOption
- func WithPGAfiSafiEnabled(afiSafi oc.E_BgpTypes_AFI_SAFI_TYPE, enabled bool, configureGR bool) PeerGroupOption
- func WithPGDescription(desc string) PeerGroupOption
- func WithPGGracefulRestart(enabled bool) PeerGroupOption
- func WithPGMultipath(pgName string, enableMultipath bool) PeerGroupOption
- func WithPGSendCommunity(communities []oc.E_Bgp_CommunityType) PeerGroupOption
- func WithPGTimers(holdTime, keepalive, minAdvInterval uint16) PeerGroupOption
- func WithPGTransport(transportAddress string) PeerGroupOption
- func WithPeerAS(as uint32) PeerGroupOption
- type PeerOption
- func ApplyPeerPerAfiSafiRoutingPolicy(isV4 bool, importPolicy, exportPolicy string, addDeleteLinkBW bool) PeerOption
- func WithPeerAfiSafiEnabled(isV4 bool, importPolicy, exportPolicy string, addDeleteLinkBW bool) PeerOption
- func WithPeerGroup(pgName string, as uint32, importPolicy, exportPolicy string, ...) PeerOption
- type PolicyForwardingConfigName
- type PolicyForwardingRule
- type PortCount
- type QoSSchedulerInterface
- type QosClassifier
- type RouteInfo
- type SFlowCollectorParams
- type SFlowGlobalParams
- type SchedulerParams
- type SchedulerPolicy
- type SecondaryIPConfig
- type SecondaryIPEntry
- type StaticARPConfig
- type StaticARPEntry
- type StaticAggregateConfig
- type StaticNextHopGroupParams
- type StaticRouteCfg
- type StaticVRFRouteCfg
- type TargetOpticalPowerList
- type URPFConfigParams
- type VRFConfig
- type VlanParams
- type VrfBGPState
- type VrfRule
Constants ¶
const ( IPFragmentFirst = oc.Transport_BuiltinDetail_TCP_INITIAL IPFragmentLater = oc.Transport_BuiltinDetail_FRAGMENT ICMPv4ProtocolNum = 1 ICMPv6ProtocolNum = 58 TCPProtocolNum = 6 UDPProtocolNum = 17 DefaultEntryID = 990 )
const ( // RPLPermitAll policy RPLPermitAll = "PERMIT-ALL" // ALLOW policy ALLOW = "ALLOW" // DutAS dut AS DutAS = uint32(65501) // AteAS1 for ATE port1 AteAS1 = uint32(65511) // AteAS2 for ATE port2 AteAS2 = uint32(65512) // AteAS3 for ATE port3 AteAS3 = uint32(65513) // AteAS4 for ATE port4 AteAS4 = uint32(65514) // BGPPeerGroup1 for ATE port1 BGPPeerGroup1 = "BGP-PEER-GROUP1" // BGPPeerGroup2 for ATE port2 BGPPeerGroup2 = "BGP-PEER-GROUP2" // BGPPeerGroup3 for ATE port3 BGPPeerGroup3 = "BGP-PEER-GROUP3" // BGPPeerGroup4 for ATE port4 BGPPeerGroup4 = "BGP-PEER-GROUP4" // PTBGP is shorthand for the long oc protocol type constant PTBGP = oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP )
const ( IPv4 = "IPv4" IPv6 = "IPv6" )
Consts
Variables ¶
var ( // PolicyForwardingConfigv4Arista configuration for policy-forwarding for ipv4. PolicyForwardingConfigv4Arista = `` /* 499-byte string literal not displayed */ // PolicyForwardingConfigv6Arista configuration for policy-forwarding for ipv6. PolicyForwardingConfigv6Arista = `` /* 585-byte string literal not displayed */ // PolicyForwardingConfigDualStackArista configuration for policy-forwarding for the dualstack. PolicyForwardingConfigDualStackArista = `` /* 1045-byte string literal not displayed */ // PolicyForwardingConfigMulticloudAristav4 configuration for policy-forwarding for multicloud ipv4. PolicyForwardingConfigMulticloudAristav4 = `` /* 535-byte string literal not displayed */ )
Functions ¶
func AddInterfaceMTUOps ¶
func AddInterfaceMTUOps(b *gnmi.SetBatch, dut *ondatra.DUTDevice, intfName string, mtu uint16, isDelete bool)
AddInterfaceMTUOps adds gNMI operations for interface MTU to the batch.
func AddPortToAggregate ¶
func AddPortToAggregate(t *testing.T, dut *ondatra.DUTDevice, aggID string, dutAggPorts []*ondatra.Port, b *gnmi.SetBatch, op *ondatra.Port)
AddPortToAggregate adds an Ondatra port as a member to the aggregate interface.
func AddSubInterface ¶
func AddSubInterface(t *testing.T, dut *ondatra.DUTDevice, b *gnmi.SetBatch, i *oc.Interface, s *DUTSubInterfaceData)
AddSubInterface adds a subinterface to an interface.
func AppendBGPNeighbor ¶
func AppendBGPNeighbor(t *testing.T, dut *ondatra.DUTDevice, batch *gnmi.SetBatch, bgp *oc.NetworkInstance_Protocol_Bgp, cfg BGPNeighborConfig) *oc.NetworkInstance_Protocol_Bgp
AppendBGPNeighbor configures BGP peer-groups and neighbors into a batch.
func ApplyEthernetConfig ¶
ApplyEthernetConfig configures Ethernet-specific settings like port speed and duplex.
func ApplyPolicyToInterfaceOC ¶
func ApplyPolicyToInterfaceOC(t *testing.T, pf *oc.NetworkInstance_PolicyForwarding, interfaceID string, appliedPolicyName string)
ApplyPolicyToInterfaceOC configures the policy-forwarding interfaces section to apply the specified policy to the given interface ID.
func ApplyQosPolicyOnInterface ¶
func ApplyQosPolicyOnInterface(t *testing.T, dut *ondatra.DUTDevice, batch *gnmi.SetBatch, params *SchedulerParams)
ApplyQosPolicyOnInterface applies a QoS policy on the specified interface. The configuration is applied using either CLI or OC based on the QosSchedulerIngressPolicer deviation.
func AssignETHIndexes ¶
AssignETHIndexes assigns the ETH indexes for the given ports.
func AssignInterfaceToNetworkInstance ¶
func AssignInterfaceToNetworkInstance(t testing.TB, batch *gnmi.SetBatch, d *ondatra.DUTDevice, i string, nip *NetworkInstanceParams, si uint32)
AssignInterfaceToNetworkInstance attaches an interface to a network instance using batch update. This is required for vendors that do not support subinterfaces and only support interface to network instance assignment.
func AssignOTNIndexes ¶
AssignOTNIndexes assigns the OTN indexes for the given ports.
func AssignToNetworkInstance ¶
AssignToNetworkInstance attaches a subinterface to a network instance. TODO: To migrate to AssignInterfaceToNetworkInstance() which uses gnmi.BatchReplace
func BGPClearConfig ¶
BGPClearConfig removes all BGP configuration from the DUT.
func BgpISISRedistribution ¶
func BgpISISRedistribution(t *testing.T, dut *ondatra.DUTDevice, afisafi string, b *gnmi.SetBatch, importPolicy string) *oc.Root
BgpISISRedistribution configures the BGP to ISIS redistribution for a given AFI/SAFI.
func BuildBGPOCConfig ¶
func BuildBGPOCConfig(t *testing.T, dut *ondatra.DUTDevice, routerID string, afiTypes []oc.E_BgpTypes_AFI_SAFI_TYPE, neighborConfig []*NeighborConfig) *oc.NetworkInstance_Protocol_Bgp
BuildBGPOCConfig builds the BGP OC config applying global, neighbors and peer-group config
func ConfigETHChannel ¶
func ConfigETHChannel(t *testing.T, dut *ondatra.DUTDevice, interfaceName, transceiverName string, otnIndex, ethIndex uint32)
ConfigETHChannel configures the ETH channel.
func ConfigOTNChannel ¶
ConfigOTNChannel configures the OTN channel.
func ConfigOpticalChannel ¶
func ConfigOpticalChannel(t *testing.T, dut *ondatra.DUTDevice, och string, frequency uint64, targetOpticalPower float64, operationalMode uint16, opts ...OpticalChannelOpt)
ConfigOpticalChannel configures the optical channel.
func ConfigureACL ¶
func ConfigureBGPNeighbor ¶
func ConfigureBGPNeighbor(t *testing.T, dut *ondatra.DUTDevice, ni *oc.NetworkInstance, routerID, peerAddress string, routerAS, peerAS uint32, ipType string, sendReceivePaths bool)
ConfigureBGPNeighbor configures a BGP neighbor.
func ConfigureBMP ¶
func ConfigureBMP(t *testing.T, dut *ondatra.DUTDevice, batch *gnmi.SetBatch, cfgParams BMPConfigParams)
ConfigureBMP applies BMP station configuration on DUT.
func ConfigureBMPAccessList ¶
func ConfigureBMPAccessList(t *testing.T, dut *ondatra.DUTDevice, batch *gnmi.SetBatch, cfgParams BMPConfigParams)
ConfigureBMPAccessList applies access-list to permit BMP port if blocked by default rules.
func ConfigureCommonBGPPolicies ¶
ConfigureCommonBGPPolicies applies a standard set of BGP route policies and defined sets to the provided oc.RoutingPolicy object.
func ConfigureDUTBGP ¶
func ConfigureDUTBGP(t *testing.T, dut *ondatra.DUTDevice, batch *gnmi.SetBatch, cfg BGPConfig) *oc.NetworkInstance_Protocol
ConfigureDUTBGP configures BGP on the DUT using OpenConfig.
func ConfigureDUTBGPMaxSegmentSize ¶
func ConfigureDUTBGPMaxSegmentSize(t *testing.T, dut *ondatra.DUTDevice, intfName string, mtu uint16, nbrList []string, mss uint16)
ConfigureDUTBGPMaxSegmentSize configures the DUT interface MTU and BGP neighbor TCP MSS. intfName is the name of the interface to configure MTU on.
func ConfigureDutWithGueDecap ¶
func ConfigureDutWithGueDecap(t *testing.T, dut *ondatra.DUTDevice, guePort int, ipType, tunIP, decapInt, policyName string, policyId int)
ConfigureDutWithGueDecap configures the DUT to decapsulate GUE (Generic UDP Encapsulation) traffic. It supports both native CLI configuration (for vendors like Arista) and OpenConfig (GNMI) configuration.
func ConfigureEBgpPeersScale ¶
func ConfigureEBgpPeersScale(t *testing.T, dut *ondatra.DUTDevice, ate *ondatra.ATEDevice, top gosnappi.Config, cfg []*EBgpConfigScale, ) (gosnappi.Config, *oc.NetworkInstance_Protocol)
ConfigureEBgpPeersScale configures EBGP peers between DUT and ATE ports.
func ConfigureGNPSI ¶
func ConfigureGNPSI(t *testing.T, dut *ondatra.DUTDevice, params *GNPSIParams)
func ConfigureGlobal ¶
func ConfigureGlobal(bgp *oc.NetworkInstance_Protocol_Bgp, dut *ondatra.DUTDevice, opts ...GlobalOption)
ConfigureGlobal applies a series of GlobalOptions to the BGP global configuration.
func ConfigureLoadbalance ¶
ConfigureLoadbalance configures baseline DUT settings across all platforms.
func ConfigureNetworkInstance ¶
func ConfigureNetworkInstance(t *testing.T, dut *ondatra.DUTDevice, netInstName string, isDefault bool) *oc.NetworkInstance
ConfigureNetworkInstance configures a new network instance on the DUT not using batch update TODO: To migrate to AssignInterfaceToNetworkInstance() which uses gnmi.BatchReplace
func ConfigurePeer ¶
func ConfigurePeer(peer *oc.NetworkInstance_Protocol_Bgp_Neighbor, dut *ondatra.DUTDevice, opts ...PeerOption)
ConfigurePeer applies a series of PeerOptions to a BGP Peer.
func ConfigurePeerGroup ¶
func ConfigurePeerGroup(pg *oc.NetworkInstance_Protocol_Bgp_PeerGroup, dut *ondatra.DUTDevice, opts ...PeerGroupOption)
ConfigurePeerGroup applies a series of PeerGroupOptions to a BGP Peer Group.
func ConfigureQoSDSCPRemarkFix ¶
ConfigureQoSDSCPRemarkFix adds configuration that may be needed to rewrite DSCP packet fields. It is intended to be called only if DSCP remarking is used. It must be called after NewQoSClassifierConfiguration and SetInputClassifier
func ConfigureQosClassifierDscpRemark ¶
func ConfigureQosClassifierDscpRemark(t *testing.T, dut *ondatra.DUTDevice, qos *oc.Qos, classifierName string, interfaceName string, ipv4DscpValues []uint8, ipv6DscpValues []uint8)
ConfigureQosClassifierDscpRemark configures the QoS classifier DSCP remark through OC or CLI based on the deviation.
func ConfigureSubinterfaceIPs ¶
func ConfigureSubinterfaceIPs(s *oc.Interface_Subinterface, dut *ondatra.DUTDevice, ipv4Addr string, ipv4Prefix uint8, ipv6Addr string, ipv6Prefix uint8)
ConfigureSubinterfaceIPs configures IPv4 and IPv6 addresses for a subinterface.
func ConfigureTrafficPolicyACL ¶
func ConfigureTrafficPolicyACL(t *testing.T, dut *ondatra.DUTDevice, params ACLTrafficPolicyParams)
ConfigureTrafficPolicyACL configures acl related configs
func ConfigureURPFonDutInt ¶
func ConfigureURPFonDutInt(t *testing.T, dut *ondatra.DUTDevice, cfg URPFConfigParams)
ConfigureURPFonDutInt configures URPF on the interface.
func ConfigureVLAN ¶
func ConfigureVLAN(s *oc.Interface_Subinterface, dut *ondatra.DUTDevice, vlanID uint16)
ConfigureVLAN configures VLAN settings for a subinterface.
func ConfigureVlan ¶
func ConfigureVlan(t *testing.T, dut *ondatra.DUTDevice, cfg VlanParams)
ConfigureVlan configures the Vlan and remove the spanning-tree with ID.
func CreateBGPNeighbors ¶
func CreateBGPNeighbors(t *testing.T, dut *ondatra.DUTDevice, sb *gnmi.SetBatch, cfg BGPNeighborsConfig) error
CreateBGPNeighbors creates BGP neighbors for the given router ID, peer group names, and neighbors. The global AS and router ID are set to the AS and router ID of the first neighbor, assuming that all neighbors provided have the same local AS and the same peer AS. The sb is updated with the BGP neighbors configuration.
func CreateGNMIServer ¶
func CreateGNMIServer(t testing.TB, d *ondatra.DUTDevice, batch *gnmi.SetBatch, nip *NetworkInstanceParams)
CreateGNMIServer creates a gNMI server on the DUT on a given network-instance.
func CreateQueues ¶
CreateQueues configures the given queues within the provided oc.Qos object. It handles setting the queue name and optionally the QueueId based on deviations.
func CreateVRFs ¶
func CreateVRFs(t *testing.T, dut *ondatra.DUTDevice, vrfBatch *gnmi.SetBatch, cfg VRFConfig) []string
CreateVRFs creates multiple VRFs on the DUT in a single GNMI SetBatch. Returns a slice of all created VRF names (including the default NI).
func DecapGroupConfigGre ¶
func DecapGroupConfigGre(t *testing.T, dut *ondatra.DUTDevice, pf *oc.NetworkInstance_PolicyForwarding, ocPFParams OcPolicyForwardingParams)
DecapGroupConfigGre configures the interface decap-group.
func DecapGroupConfigGue ¶
func DecapGroupConfigGue(t *testing.T, dut *ondatra.DUTDevice, pf *oc.NetworkInstance_PolicyForwarding, ocPFParams OcPolicyForwardingParams)
DecapGroupConfigGue configures the interface decap-group for GUE.
func DecapPolicyRulesandActionsGre ¶
func DecapPolicyRulesandActionsGre(t *testing.T, pf *oc.NetworkInstance_PolicyForwarding, params OcPolicyForwardingParams)
DecapPolicyRulesandActionsGre configures the "decap MPLS in GRE" policy and related MPLS global and static LSP settings.
func DecapPolicyRulesandActionsGue ¶
func DecapPolicyRulesandActionsGue(t *testing.T, pf *oc.NetworkInstance_PolicyForwarding, params OcPolicyForwardingParams)
DecapPolicyRulesandActionsGue configures the "decap MPLS in GUE" policy and related MPLS global and static LSP settings.
func DeleteAggregate ¶
func DeleteAggregate(t *testing.T, dut *ondatra.DUTDevice, aggID string, dutAggPorts []*ondatra.Port)
DeleteAggregate deletes the aggregate interface.
func DeleteDUTBGPMaxSegmentSize ¶
func DeleteDUTBGPMaxSegmentSize(t *testing.T, dut *ondatra.DUTDevice, intfName string, mtu uint16, nbrList []string, mss uint16)
DeleteDUTBGPMaxSegmentSize removes the DUT interface MTU and BGP neighbor TCP MSS configurations. intfName is the name of the interface to remove MTU config from.
func DeviationAristaBGPNeighborMaxPrefixes ¶
func DeviationAristaBGPNeighborMaxPrefixes(t *testing.T, dut *ondatra.DUTDevice, neighborIP string, maxPrefixes uint32)
DeviationAristaBGPNeighborMaxPrefixes updates the max-prefixes of a specific BGP neighbor. This is an Arista specific augmented model which sets the following path: /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/prefix-limit/config/max-prefixes Set max-prefixes to 0 will mean no limit will be set. Tracking the removal of this deviation in b/438620249
func DeviationAristaRoutingPolicyBGPAsPathSetUnsupported ¶
func DeviationAristaRoutingPolicyBGPAsPathSetUnsupported(t *testing.T, dut *ondatra.DUTDevice, aclName string, routeMap string, asPathRegex string)
DeviationAristaRoutingPolicyBGPAsPathSetUnsupported is used for DUTs that don't support filtering by AS-Set (in tests such as RT-1.64) This deviation implements CLI to perform the same function
func DeviationBgpRibStreamingConfigRequired ¶
DeviationBgpRibStreamingConfigRequired updates required config for BGP RIB streaming
func DeviationCiscoRoutingPolicyBGPActionSetCommunity ¶
func DeviationCiscoRoutingPolicyBGPActionSetCommunity(t *testing.T, dut *ondatra.DUTDevice, policyName string, statement string, community string)
DeviationCiscoRoutingPolicyBGPActionSetCommunity is used as an alternative to /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/set-community This deviation implements CLI to perform the equivalent function.
func DeviationCiscoRoutingPolicyBGPActionSetMed ¶
func DeviationCiscoRoutingPolicyBGPActionSetMed(t *testing.T, dut *ondatra.DUTDevice, policyName string, statement string, prefixSetName string, setMed int, origin string)
DeviationCiscoRoutingPolicyBGPActionSetMed is used as an alternative to /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/config/set-med. This deviation implements CLI to perform the equivalent function.
func DeviationCiscoRoutingPolicyBGPToISIS ¶
func DeviationCiscoRoutingPolicyBGPToISIS(t *testing.T, dut *ondatra.DUTDevice, asn uint32, bgpInstance string, policyName string, community string, tagSet int)
DeviationCiscoRoutingPolicyBGPToISIS is used as an alternative for DUTs that don't support direct redistribution from BGP to ISIS using community match as condition. This deviation implements CLI to perform the equivalent function.
func DeviationCiscoTableConnectionsStatictoBGPMetricPropagation ¶
func DeviationCiscoTableConnectionsStatictoBGPMetricPropagation(t *testing.T, dut *ondatra.DUTDevice, isV4 bool, metric int, routePolicyName string)
DeviationCiscoTableConnectionsStatictoBGPMetricPropagation is used as an alternative to /network-instances/network-instance/table-connections/table-connection/config/disable-metric-propagation. In OC this path is set to 'false' by default, therefore enabling table-connections to propagate metrics from one protocol to another. This deviation implements CLI to perform the equivalent function.
func DeviationJuniperRoutingPolicyBGPActionSetCommunity ¶
func DeviationJuniperRoutingPolicyBGPActionSetCommunity(t *testing.T, dut *ondatra.DUTDevice, policyName string, statement string, community string)
DeviationJuniperRoutingPolicyBGPActionSetCommunity is used as an alternative to /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/set-community This deviation implements CLI to perform the equivalent function.
func EnableInterfaceAndSubinterfaces ¶
func EnableInterfaceAndSubinterfaces(t *testing.T, dut *ondatra.DUTDevice, b *gnmi.SetBatch, portAttribs attrs.Attributes)
EnableInterfaceAndSubinterfaces enables the parent interface and v4 and v6 subinterfaces.
func EnsureRoutedSubinterface0 ¶
func EnsureRoutedSubinterface0(i *oc.Interface, d *ondatra.DUTDevice, ipv4Addr string, ipv6Addr string, ipv4Prefix uint8, ipv6Prefix uint8)
EnsureRoutedSubinterface0 creates and enables IPv4/IPv6 on subinterface 0 if required by deviations.
func FindLineCardParent ¶
FindLineCardParent traverses up the component hierarchy starting from the given component name to find the nearest ancestor component of type LINECARD. It returns the name of the LINECARD component if found, or an error otherwise.
func GenerateDynamicRouteWithISIS ¶
GenerateDynamicRouteWithISIS configures the DUT to generate dynamic routes using ISIS as the trigger protocol.
func GetPolicyCLICounters ¶
func IncrementIP ¶
IncrementIP increments an IPv4 or IPv6 address by a specified number of addresses.
func InterfaceConfig ¶
InterfaceConfig configures the interface with the given port.
func InterfaceGetOpMode ¶
func InterfaceGetOpMode() uint16
InterfaceGetOpMode returns the opmode value after the Initialize function has been called
func InterfaceInitialize ¶
func InterfaceInitialize(t *testing.T, dut *ondatra.DUTDevice, initialOperationalMode uint16) uint16
InterfaceInitialize assigns OpMode with value received through operationalMode flag.
func InterfacePolicyForwardingApply ¶
func InterfacePolicyForwardingApply(t *testing.T, dut *ondatra.DUTDevice, params OcPolicyForwardingParams)
InterfacePolicyForwardingApply configure to apply policy forwarding.
func InterfacePolicyForwardingConfig ¶
func InterfacePolicyForwardingConfig(t *testing.T, dut *ondatra.DUTDevice, a *attrs.Attributes, aggID string, pf *oc.NetworkInstance_PolicyForwarding, params OcPolicyForwardingParams)
InterfacePolicyForwardingConfig configures the interface policy-forwarding config.
func InterfaceQosClassificationConfig ¶
func InterfaceQosClassificationConfig(t *testing.T, dut *ondatra.DUTDevice, a *attrs.Attributes, aggID string)
InterfaceQosClassificationConfig configures the interface qos classification.
func InterfacelocalProxyConfig ¶
func InterfacelocalProxyConfig(t *testing.T, dut *ondatra.DUTDevice, a *attrs.Attributes, aggID string)
InterfacelocalProxyConfig configures the interface local-proxy-arp.
func IsIPv4InterfaceARPresolved ¶
func IsIPv4InterfaceARPresolved(t *testing.T, ate *ondatra.ATEDevice, cfg AddressFamilyParams) error
IsIPv4InterfaceARPresolved validates that the IPv4 interface is resolved based on the interface configured.
func IsIPv6InterfaceARPresolved ¶
func IsIPv6InterfaceARPresolved(t *testing.T, ate *ondatra.ATEDevice, cfg AddressFamilyParams) error
IsIPv6InterfaceARPresolved validates that the IPv6 interface is resolved based on the interface configured.
func LabelRangeConfig ¶
LabelRangeConfig configures the interface label range.
func LabelRangeOCConfig ¶
LabelRangeOCConfig configures MPLS label ranges on the DUT using OpenConfig.
func MPLSStaticLSP ¶
func MPLSStaticLSP(t *testing.T, batch *gnmi.SetBatch, dut *ondatra.DUTDevice, lspName string, incomingLabel uint32, nextHopIP string, intfName string, protocolType string)
MPLSStaticLSP configures static MPLS label binding using OC on device.
func MPLSStaticLSPByPass ¶
func MPLSStaticLSPConfig ¶
func MPLSStaticLSPConfig(t *testing.T, dut *ondatra.DUTDevice, ni *oc.NetworkInstance, ocPFParams OcPolicyForwardingParams)
MPLSStaticLSPConfig configures the interface mpls static lsp. TODO: Need to refactor this function by adding one more parameter ocMPLSStaticLSPParams
func MplsConfig ¶
MplsConfig configures the interface mpls.
func NewAggregateInterface ¶
func NewAggregateInterface(t *testing.T, dut *ondatra.DUTDevice, b *gnmi.SetBatch, l *DUTAggData) *oc.Interface
NewAggregateInterface creates the below configuration for the aggregate interface: 1. Create a new aggregate interface 2. LACP configuration 3. Adds member Ports configuration to an aggregate interface 4. Subinterface configuration including thier IP address and VLAN ID Note that you will still need to push the batch config to the DUT in your code.
func NewConfigureGRETunnel ¶
func NewConfigureGRETunnel(t *testing.T, dut *ondatra.DUTDevice, decapIp string, decapGrpName string)
Configure GRE decapsulated. Adding deviation when device doesn't support OC
func NewDUTHardwareInit ¶
func NewISIS ¶
func NewISIS(t *testing.T, dut *ondatra.DUTDevice, ISISData *ISISGlobalParams, b *gnmi.SetBatch) *oc.Root
NewISIS configures the DUT with ISIS protocol.
func NewISISBasic ¶
func NewISISBasic(t *testing.T, batch *gnmi.SetBatch, dut *ondatra.DUTDevice, cfg ISISConfigBasic) *oc.NetworkInstance_Protocol
NewISISBasic configures ISIS on the DUT using OpenConfig. It enables ISIS globally, sets AFs, and applies interface-level config.
func NewInterfaceConfigAll ¶
func NewInterfaceConfigAll(t *testing.T, dut *ondatra.DUTDevice, batch *gnmi.SetBatch, params *ConfigParameters)
NewInterfaceConfigAll configures all the ports.
func NewMPLSSRBasic ¶
func NewMPLSSRBasic(t *testing.T, batch *gnmi.SetBatch, dut *ondatra.DUTDevice, cfg MPLSSRConfigBasic)
NewMPLSSRBasic configures MPLS on the DUT using OpenConfig.
func NewNetworkInstance ¶
func NewNetworkInstance(t testing.TB, d *ondatra.DUTDevice, batch *gnmi.SetBatch, nip *NetworkInstanceParams)
ConfigureCustomNetworkInstance configures a default or non-default network instance name and type.
func NewOneRateTwoColorScheduler ¶
func NewOneRateTwoColorScheduler(t *testing.T, dut *ondatra.DUTDevice, batch *gnmi.SetBatch, params *SchedulerParams)
NewOneRateTwoColorScheduler is the top-level API used by callers to configure an ORTC scheduler.
func NewPolicyForwardingEncapGre ¶
func NewPolicyForwardingEncapGre(t *testing.T, dut *ondatra.DUTDevice, pf *oc.NetworkInstance_PolicyForwarding, policyName string, interfaceName string, targetName string, rules []PolicyForwardingRule)
func NewPolicyForwardingGueEncap ¶
func NewPolicyForwardingGueEncap(t *testing.T, dut *ondatra.DUTDevice, params GueEncapPolicyParams)
NewPolicyForwardingGueEncap configure policy forwarding for GUE encapsulation.
func NewPolicyForwardingMatchAndSetTTL ¶
func NewPolicyForwardingMatchAndSetTTL(t *testing.T, dut *ondatra.DUTDevice, pf *oc.NetworkInstance_PolicyForwarding, params OcPolicyForwardingParams)
NewPolicyForwardingMatchAndSetTTL configures a policy-forwarding rule that matches packets based on IP TTL and rewrites the TTL before redirecting traffic to a specified next-hop group.
func NewPolicyForwardingVRFSelection ¶
func NewPolicyForwardingVRFSelection(t *testing.T, dut *ondatra.DUTDevice, sb *gnmi.SetBatch, cfg PolicyForwardingConfigName) *gnmi.SetBatch
NewPolicyForwardingVRFSelection configures Policy-Based Routing for VRF selection.
func NewQoSClassifierConfiguration ¶
func NewQoSClassifierConfiguration(t *testing.T, dut *ondatra.DUTDevice, q *oc.Qos, classifiers []QosClassifier) *oc.Qos
NewQoSClassifierConfiguration creates a QoS classifier configuration.
func NewQoSForwardingGroup ¶
func NewQoSForwardingGroup(t *testing.T, dut *ondatra.DUTDevice, q *oc.Qos, forwardingGroups []ForwardingGroup)
NewQoSForwardingGroup creates a QoS forwarding group configuration.
func NewQoSQueue ¶
NewQoSQueue creates a QoS queue configuration.
func NewQoSSchedulerInterface ¶
func NewQoSSchedulerInterface(t *testing.T, dut *ondatra.DUTDevice, q *oc.Qos, schedulerIntfs []QoSSchedulerInterface, schedulerPort string) *oc.Qos
NewQoSSchedulerInterface creates a QoS scheduler interface configuration.
func NewQoSSchedulerPolicy ¶
func NewQoSSchedulerPolicy(t *testing.T, dut *ondatra.DUTDevice, q *oc.Qos, policies []SchedulerPolicy) *oc.Qos
NewQoSSchedulerPolicy creates a QoS scheduler policy configuration.
func NewQosInitialize ¶
NewQosInitialize initializes the QoS on the DUT. This is a temporary solution to initialize the QoS on the DUT. This will be removed once the QoS initialization is supported in the Ondatra.
func NewSFlowCollector ¶
func NewSFlowCollector(t *testing.T, batch *gnmi.SetBatch, newcfg *oc.Sampling_Sflow_Collector, d *ondatra.DUTDevice, p *SFlowCollectorParams) []*oc.Sampling_Sflow_Collector
NewSFlowCollector creates a collector to be appended to SFlowConfig. If sfc is nil, default values are provided.
func NewSFlowGlobalCfg ¶
func NewSFlowGlobalCfg(t *testing.T, batch *gnmi.SetBatch, newcfg *oc.Sampling_Sflow, d *ondatra.DUTDevice, p *SFlowGlobalParams) *oc.Sampling_Sflow
NewSFlowGlobalCfg takes optional input of sflow global and sfcollector and returns OC configuration including any deviations for the device. If sfglobal is nil, default values are provided. The SFlow configuration is returned to give the caller an option to override default values.
func NewStaticMplsLspPopLabel ¶
func NewStaticMplsLspPopLabel(t *testing.T, dut *ondatra.DUTDevice, lspName string, incomingLabel uint32, intfName string, nextHopIP string, protocolType string)
NewStaticMplsLspPopLabel configures static MPLS label binding (LBL1) using CLI with deviation, if OC is unsupported on the device.
func NewStaticMplsLspPushLabel ¶
func NewStaticMplsLspPushLabel(t *testing.T, dut *ondatra.DUTDevice, lspName string, intfName string, nextHopIP string, destIP string, mplsPushLabel uint32, lspNextHopIndex uint32, protocolType string)
NewStaticMplsLspPushLabel configures a static MPLS LSP.
func NewStaticMplsLspSwapLabel ¶
func NewStaticMplsLspSwapLabel(t *testing.T, dut *ondatra.DUTDevice, lspName string, incomingLabel uint32, nextHopIP string, mplsSwapLabelTo uint32, lspNextHopIndex uint32)
NewStaticMplsLspSwapLabel configures a static MPLS LSP and swaps label.
func NewStaticRouteCfg ¶
func NewStaticRouteCfg(batch *gnmi.SetBatch, cfg *StaticRouteCfg, d *ondatra.DUTDevice) (*oc.NetworkInstance_Protocol_Static, error)
NewStaticRouteCfg provides OC configuration for a static route for a specific NetworkInstance, Prefix and NextHops.
Configuration deviations are applied based on the ondatra device passed in.
func NewStaticVRFRoute ¶
func NewStaticVRFRoute(t *testing.T, batch *gnmi.SetBatch, cfg *StaticVRFRouteCfg, d *ondatra.DUTDevice) (*oc.NetworkInstance_Protocol_Static, error)
NewStaticVRFRoute configures a static route inside a given VRF on the DUT.
func NewSubInterfaces ¶
func NewSubInterfaces(t *testing.T, dut *ondatra.DUTDevice, dutPorts []Attributes)
NewSubInterfaces creates the below configuration for the subinterfaces:
func NewTwoRateThreeColorScheduler ¶
func NewTwoRateThreeColorScheduler(t *testing.T, dut *ondatra.DUTDevice, batch *gnmi.SetBatch, params *SchedulerParams)
NewTwoRateThreeColorScheduler configures a two-rate three-color policer/scheduler on the DUT. It uses either OC or CLI based on the QosTwoRateThreeColorPolicerOCUnsupported deviation.
func NextHopGroupConfig ¶
func NextHopGroupConfig(t *testing.T, dut *ondatra.DUTDevice, traffictype string, ni *oc.NetworkInstance, params StaticNextHopGroupParams)
NextHopGroupConfig configures the interface next-hop-group config.
func NextHopGroupConfigForIpOverUdp ¶
func NextHopGroupConfigForIpOverUdp(t *testing.T, dut *ondatra.DUTDevice, params NexthopGroupUDPParams)
NextHopGroupConfigForIpOverUdp configures the interface next-hop-group config for ip over udp.
func NextHopGroupConfigForMulticloud ¶
func NextHopGroupConfigForMulticloud(t *testing.T, dut *ondatra.DUTDevice, traffictype string, ni *oc.NetworkInstance, params StaticNextHopGroupParams)
NextHopGroupConfigForMulticloud configures the interface next-hop-group config for multicloud.
func PolicyForwardingConfig ¶
func PolicyForwardingConfig(t *testing.T, dut *ondatra.DUTDevice, traffictype string, pf *oc.NetworkInstance_PolicyForwarding, params OcPolicyForwardingParams)
PolicyForwardingConfig configures the interface policy-forwarding config.
func PolicyForwardingGreDecapsulation ¶
func PolicyForwardingGreDecapsulation(t *testing.T, batch *gnmi.SetBatch, dut *ondatra.DUTDevice, decapIP string, policyName string, portName string, decapGrpName string)
Configure GRE decapsulated. Adding deviation when device doesn't support OC
func PushPolicyForwardingConfig ¶
PushPolicyForwardingConfig pushes the complete Policy Forwarding config.
func QosClassificationConfig ¶
QosClassificationConfig configures the interface qos classification.
func QosClassificationOCConfig ¶
QosClassificationOCConfig builds an OpenConfig QoS classification configuration.
func RemoveStaticMplsLspPopLabel ¶
func RemoveStaticMplsLspPopLabel(t *testing.T, dut *ondatra.DUTDevice, lspName string, incomingLabel uint32, intfName string, nextHopIP string, protocolType string)
RemoveStaticMplsLspPopLabel removes static MPLS POP label binding using CLI with deviation, if OC is unsupported on the device.
func RemoveStaticMplsLspPushLabel ¶
func RemoveStaticMplsLspPushLabel(t *testing.T, dut *ondatra.DUTDevice, lspName string, intfName string)
RemoveStaticMplsLspPushLabel removes a static MPLS LSP.
func RemoveStaticMplsLspSwapLabel ¶
func RemoveStaticMplsLspSwapLabel(t *testing.T, dut *ondatra.DUTDevice, lspName string, incomingLabel uint32, nextHopIP string, mplsSwapLabelTo uint32)
RemoveStaticMplsLspSwapLabel removes a static MPLS LSP and swaps label.
func RulesAndActions ¶
func RulesAndActions(params OcPolicyForwardingParams, pf *oc.NetworkInstance_PolicyForwarding)
RulesAndActions defines forwarding policies, their rules, and associated next-hop groups within the provided policy-forwarding container, based on canonical OpenConfig modeling.
func SetupAggregateAtomically ¶
func SetupAggregateAtomically(t *testing.T, dut *ondatra.DUTDevice, aggID string, dutAggPorts []*ondatra.Port)
SetupAggregateAtomically sets up the aggregate interface atomically.
func SetupPolicyForwardingInfraOC ¶
func SetupPolicyForwardingInfraOC(networkInstanceName string) (*oc.Root, *oc.NetworkInstance, *oc.NetworkInstance_PolicyForwarding)
SetupPolicyForwardingInfraOC creates a new OpenConfig root object, the specified network instance, and the policy-forwarding container within it. It returns the root, the network instance, and the policy-forwarding container.
func SetupStaticAggregateAtomically ¶
func SetupStaticAggregateAtomically(t *testing.T, dut *ondatra.DUTDevice, aggrBatch *gnmi.SetBatch, cfg StaticAggregateConfig) *oc.Interface
SetupStaticAggregateAtomically sets up the static aggregate interface atomically.
func StaticARPWithMagicUniversalIP ¶
func StaticARPWithMagicUniversalIP(t *testing.T, dut *ondatra.DUTDevice, sb *gnmi.SetBatch, cfg StaticARPConfig) *gnmi.SetBatch
StaticARPWithMagicUniversalIP configures static ARP and static routes per-port.
func StaticARPWithSecondaryIP ¶
func StaticARPWithSecondaryIP(t *testing.T, dut *ondatra.DUTDevice, sb *gnmi.SetBatch, cfg SecondaryIPConfig) *gnmi.SetBatch
StaticARPWithSecondaryIP configures secondary IPs and static ARP for gRIBI compatibility
func StaticRouteNextNetworkInstance ¶
func StaticRouteNextNetworkInstance(t *testing.T, dut *ondatra.DUTDevice, cfg *StaticRouteCfg)
StaticRouteNextNetworkInstance configures a static route with a next network instance (cross-VRF routing).
func ToggleInterface ¶
ToggleInterface toggles the interface.
func ToggleInterfaceState ¶
func ToggleInterfaceState(t *testing.T, dut *ondatra.DUTDevice, p *ondatra.Port, params *ConfigParameters)
ToggleInterfaceState toggles the interface with operational mode.
func UpdateNetworkInstanceOnDut ¶
func UpdateNetworkInstanceOnDut(t *testing.T, dut *ondatra.DUTDevice, netInstName string, netInst *oc.NetworkInstance)
UpdateNetworkInstanceOnDut updates the network instance on the DUT. Not using batch update
func ValidateInterfaceConfig ¶
func ValidateInterfaceConfig(t *testing.T, dut *ondatra.DUTDevice, dp *ondatra.Port, targetOutputPowerdBm float64, targetFrequencyMHz uint64, targetOutputPowerTolerancedBm float64, targetFrequencyToleranceMHz float64)
ValidateInterfaceConfig validates the output power and frequency for the given port.
func VerifyBGPCapabilities ¶
func VerifyBGPCapabilities(t *testing.T, dut *ondatra.DUTDevice, nbrs []*BgpNeighbor)
VerifyBGPCapabilities function is used to Verify BGP capabilities like route refresh as32 and mpbgp.
func VerifyDUTBGPEstablished ¶
VerifyDUTBGPEstablished verifies on DUT BGP peer establishment
func VerifyDUTVrfBGPState ¶
func VerifyDUTVrfBGPState(t *testing.T, dut *ondatra.DUTDevice, cfg VrfBGPState)
VerifyDUTVrfBGPState verify BGP neighbor status with configured DUT VRF configuration.
func VerifyOTGBGPEstablished ¶
VerifyOTGBGPEstablished verifies on OTG BGP peer establishment
func VerifyPortsUp ¶
VerifyPortsUp asserts that each port on the device is operating.
Types ¶
type ACLTrafficPolicyParams ¶
type ACLTrafficPolicyParams struct {
PolicyName string
ProtocolType string
SrcPrefix []string
DstPrefix []string
SrcPort string
DstPort string
IntfName string
Direction string
Action string
}
ACLTrafficPolicyParams holds parameters for configuring ACL forwarding configs.
type AddressFamilyParams ¶
type AddressFamilyParams struct {
InterfaceNames []string
}
AddressFamilyParams defines parameters for IPv4/v6 interfaces.
type Attributes ¶
type Attributes struct {
*attrs.Attributes
NumSubIntf uint32
Index uint8
AteISISSysID string
V4Route func(vlan int) string
V4ISISRouteCount uint32
V6Route func(vlan int) string
V6ISISRouteCount uint32
Ip4 func(vlan int) (string, string)
Ip6 func(vlan int) (string, string)
Gateway func(vlan int) (string, string)
Gateway6 func(vlan int) (string, string)
Ip4Loopback func(vlan int) (string, string)
Ip6Loopback func(vlan int) (string, string)
LagMAC string
EthMAC string
Port1MAC string
Pg4 string
Pg6 string
}
Attributes is a type for the attributes of a port.
type BGPConfig ¶
type BGPConfig struct {
// DutAS is the AS number of the DUT.
DutAS uint32
// ECMPMaxPath is the maximum number of paths to advertise per prefix for both iBGP and eBGP.
ECMPMaxPath uint32
// RouterID is the router ID of the DUT. (Usually the IPv4 address.)
RouterID string
//Maximum Routes
EnableMaxRoutes bool
//Peer Groups
PeerGroups []string
}
BGPConfig holds all parameters needed to configure BGP on the DUT.
type BGPNeighborConfig ¶
type BGPNeighborConfig struct {
AteAS uint32
PortName string
NeighborIPv4 string
NeighborIPv6 string
IsLag bool
MultiPathEnabled bool
PolicyName *string
}
BGPNeighborConfig holds params for creating BGP neighbors + peer groups.
type BGPNeighborsConfig ¶
type BGPNeighborsConfig struct {
// Router ID of the BGP neighbors.
RouterID string
// Name of the peer group for IPv4 neighbors.
PeerGrpNameV4 string
// Name of the peer group for IPv6 neighbors.
PeerGrpNameV6 string
// List of BGP neighbors to be configured.
Nbrs []*BgpNeighbor
}
BGPNeighborsConfig contains the configuration for configuring multiple BGP neighbors.
type BGPSession ¶
type BGPSession struct {
DUT *ondatra.DUTDevice
ATE *ondatra.ATEDevice
OndatraDUTPorts []*ondatra.Port
OndatraATEPorts []*ondatra.Port
ATEIntfs []gosnappi.Device
DUTConf *oc.Root
ATETop gosnappi.Config
DUTPorts []*attrs.Attributes
ATEPorts []*attrs.Attributes
// contains filtered or unexported fields
}
BGPSession is a convenience wrapper around the dut, ate, ports, and topology we're using.
func NewBGPSession ¶
func NewBGPSession(t *testing.T, pc PortCount, ni *string) *BGPSession
NewBGPSession creates a new BGPSession using the default global config, and configures the interfaces on the dut and the ate based in given topology port count. Only supports 2 and 4 port DUT-ATE topology
func (*BGPSession) PushAndStart ¶
func (bs *BGPSession) PushAndStart(t testing.TB) error
PushAndStart calls PushDUT and PushAndStartATE to send config to both devices
func (*BGPSession) PushAndStartATE ¶
func (bs *BGPSession) PushAndStartATE(t testing.TB)
PushAndStartATE pushes the ATETop to the ATE and starts protocols on it.
func (*BGPSession) PushDUT ¶
func (bs *BGPSession) PushDUT(t testing.TB) error
PushDUT replaces DUT config with s.dutConf. Only interfaces and the ISIS protocol are written
func (*BGPSession) WithEBGP ¶
func (bs *BGPSession) WithEBGP(t *testing.T, afiTypes []oc.E_BgpTypes_AFI_SAFI_TYPE, bgpPorts []string, isSamePG, isSameAS bool) *BGPSession
WithEBGP adds eBGP specific config
type BMPConfigParams ¶
type BMPConfigParams struct {
DutAS uint32
BGPObj *oc.NetworkInstance_Protocol_Bgp
Source string
LocalAddr string
StationAddr string
StationPort uint16
StatsTimeOut uint16
PrePolicy bool
PostPolicy bool
}
BMPConfigParams holds the parameters to bgp BMP collector
type BgpNeighbor ¶
BgpNeighbor holds BGP Peer information.
type BgpNeighborScale ¶
BgpNeighborScale holds parameters for configuring BGP neighbors in a scale test.
func BuildIPv4v6NbrScale ¶
func BuildIPv4v6NbrScale(t *testing.T, cfg *EBgpConfigScale) []*BgpNeighborScale
BuildIPv4v6NbrScale generates a list of BgpNeighborScale configurations for IPv4 and IPv6 peers.
type ConfigParameters ¶
type ConfigParameters struct {
Enabled bool
Frequency uint64
TargetOpticalPower float64
OperationalMode uint16
PortSpeed oc.E_IfEthernet_ETHERNET_SPEED
FormFactor oc.E_TransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE
NumPhysicalChannels uint8
RateClass oc.E_TransportTypes_TRIBUTARY_RATE_CLASS_TYPE
TribProtocol oc.E_TransportTypes_TRIBUTARY_PROTOCOL_TYPE
Allocation float64
HWPortNames map[string]string
TransceiverNames map[string]string
TempSensorNames map[string]string
OpticalChannelNames map[string]string
OTNIndexes map[string]uint32
ETHIndexes map[string]uint32
}
ConfigParameters contains the configuration parameters for the ports.
type DUTAggData ¶
type DUTAggData struct {
attrs.Attributes
SubInterfaces []*DUTSubInterfaceData
OndatraPortsIdx []int
OndatraPorts []*ondatra.Port
LagName string
LacpParams *LACPParams
AggType oc.E_IfAggregate_AggregationType
}
DUTAggData is the data structure for a LAG in the DUT.
func (*DUTAggData) PopulateOndatraPorts ¶
func (d *DUTAggData) PopulateOndatraPorts(t *testing.T, dut *ondatra.DUTDevice)
PopulateOndatraPorts populates the OndatraPorts field of the DutLagData from the OndatraPortsIdx field.
type DUTSubInterfaceData ¶
type DUTSubInterfaceData struct {
VlanID int
IPv4Address net.IP
IPv6Address net.IP
IPv4PrefixLen int
IPv6PrefixLen int
}
DUTSubInterfaceData is the data structure for a subinterface in the DUT.
type DecapMPLSParams ¶
type DecapPolicyParams ¶
type DecapPolicyParams struct {
PolicyID string
RuleSeqID uint32
IPv4DestAddress string // For the match criteria in the decap rule
MPLSInterfaceID string // For MPLS global interface attributes (e.g., "Aggregate4")
StaticLSPNameIPv4 string
StaticLSPLabelIPv4 uint32
StaticLSPNextHopIPv4 string
StaticLSPNameIPv6 string
StaticLSPLabelIPv6 uint32
StaticLSPNextHopIPv6 string
StaticLSPNameMulticast string
StaticLSPLabelMulticast uint32
StaticLSPNextHopMulticast string
DecapMPLSParams DecapMPLSParams
}
DecapPolicyParams defines parameters for the Decap MPLS in GRE policy and related MPLS configs.
type DynamicStructParams ¶
type EBgpConfigScale ¶
type EBgpConfigScale struct {
AteASV4 uint32
AteASV6 uint32
AtePortIPV4 string
AtePortIPV6 string
PeerV4GrpName string
PeerV6GrpName string
NumOfPeers uint32
PortName string
}
EBgpConfigScale holds parameters for configuring eBGP peers in a scale test. Use same value for AteASV4 and AteASV6 to configures ipv4 and ipv6 in the same AS.
type FeatureType ¶
type FeatureType int
const ( FeatureMplsTracking FeatureType = iota FeatureVrfSelectionExtended FeaturePolicyForwarding FeatureQOSCounters FeatureEnableAFTSummaries FeatureNGPR FeatureTTLPolicyForwarding FeatureQOSIn FeatureACLCounters )
type ForwardingGroup ¶
ForwardingGroup is a struct to hold the forwarding group configuration.
type FrequencyList ¶
type FrequencyList []uint64
FrequencyList is a type for a list of frequencies in uint64 format.
func (*FrequencyList) Default ¶
func (f *FrequencyList) Default(t *testing.T, dut *ondatra.DUTDevice) FrequencyList
Default returns the default frequency list.
func (*FrequencyList) Set ¶
func (f *FrequencyList) Set(value string) error
Set sets the list of frequencies from the string representation.
func (*FrequencyList) String ¶
func (f *FrequencyList) String() string
String returns the string representation of the list of frequencies.
type GNPSIParams ¶
type GlobalOption ¶
type GlobalOption func(*oc.NetworkInstance_Protocol_Bgp_Global, *ondatra.DUTDevice)
GlobalOption is a function that sets options for BGP Global configuration.
func WithExternalRouteDistance ¶
func WithExternalRouteDistance(distance uint8) GlobalOption
WithExternalRouteDistance sets the default external route distance.
func WithGlobalAfiSafiEnabled ¶
func WithGlobalAfiSafiEnabled(afiSafi oc.E_BgpTypes_AFI_SAFI_TYPE, enabled bool) GlobalOption
WithGlobalAfiSafiEnabled enables or disables a global AFI/SAFI.
func WithGlobalEBGPMultipath ¶
func WithGlobalEBGPMultipath(maxPaths uint32) GlobalOption
WithGlobalEBGPMultipath configures global EBGP multipath settings.
func WithGlobalGracefulRestart ¶
func WithGlobalGracefulRestart(enabled bool, restartTime, staleTime uint16) GlobalOption
WithGlobalGracefulRestart configures global BGP Graceful Restart settings.
type GueEncapPolicyParams ¶
type GueEncapPolicyParams struct {
IPFamily string // IPFamily specifies the IP address family for encapsulation. For example, "V4Udp" for IPv4-over-UDP or "V6Udp" for IPv6-over-UDP.
PolicyName string
NexthopGroupName string
SrcIntfName string
DstAddr []string
SrcAddr []string
Ttl uint8
Rule uint8
}
GueEncapPolicyParams defines parameters required to configure a GUE (Generic UDP Encapsulation) policy-based forwarding rule on the DUT.
type ISISConfigBasic ¶
type ISISConfigBasic struct {
InstanceName string
AreaAddress string
SystemID string
AggID string
Ports []*ondatra.Port
LoopbackIntf string
}
ISISConfigBasic holds all parameters needed for configuring ISIS on the DUT.
type ISISGlobalParams ¶
type ISISGlobalParams struct {
DUTArea string
DUTSysID string
NetworkInstanceName string
ISISInterfaceNames []string
NetworkInstanceType *oc.E_NetworkInstanceTypes_NETWORK_INSTANCE_TYPE
}
ISISGlobalParams is the data structure for the DUT data.
type LACPParams ¶
type LACPParams struct {
Activity *oc.E_Lacp_LacpActivityType
Period *oc.E_Lacp_LacpPeriodType
}
LACPParams is the data structure for the LACP parameters used in the DUTLagData.
type MPLSSRConfigBasic ¶
type MPLSSRConfigBasic struct {
InstanceName string
SrgbName string
SrgbStartLabel uint32
SrgbEndLabel uint32
SrgbID string
}
MPLSSRConfigBasic holds all parameters needed to configure MPLS and SR on the DUT.
type NeighborConfig ¶
type NeighborConfig struct {
Name string
IPv4Neighbor string
IPv6Neighbor string
PeerGroup string
AS uint32
}
NeighborConfig to hold neighbor specific config
type NetworkInstanceParams ¶
type NexthopGroupUDPParams ¶
type NexthopGroupUDPParams struct {
IPFamily string // IPFamily specifies the IP address family for encapsulation. For example, "V4Udp" for IPv4-over-UDP or "V6Udp" for IPv6-over-UDP.
NexthopGrpName string
DstIp []string
SrcIp string
DstUdpPort uint16
SrcUdpPort uint16
TTL uint8
DSCP uint8
NetworkInstanceObj *oc.NetworkInstance
}
NexthopGroupUDPParams defines the parameters used to create or configure a Next Hop Group that performs UDP encapsulation for traffic forwarding.
type OcPolicyForwardingParams ¶
type OcPolicyForwardingParams struct {
NetworkInstanceName string
InterfaceID string
AppliedPolicyName string
// Policy Rule specific params
InnerDstIPv6 string
InnerDstIPv4 string
CloudV4NHG string
CloudV6NHG string
DecapPolicy DecapPolicyParams
GUEPort uint32
IPType string
DecapProtocol string
Dynamic bool
TunnelIP string
InterfaceName string // InterfaceName specifies the DUT interface where the policy will be applied.
PolicyName string // PolicyName refers to the traffic policy that is bound to the given interface in CLI-based configuration.
NetworkInstanceObj *oc.NetworkInstance // NetworkInstanceObj represents the OpenConfig network instance (default/non-default VRF).
HasMPLS bool // HasMPLS indicates whether the policy forwarding configuration involves an MPLS overlay.
MatchTTL int
ActionSetTTL int
ActionNHGName string
RemovePolicy bool
}
OcPolicyForwardingParams holds parameters for generating the OC Policy Forwarding config.
type OperationalModeList ¶
type OperationalModeList []uint16
OperationalModeList is a type for a list of operational modes in uint16 format.
func (*OperationalModeList) Default ¶
func (om *OperationalModeList) Default(t *testing.T, dut *ondatra.DUTDevice) OperationalModeList
Default returns the default operational mode list.
func (*OperationalModeList) Get ¶
func (om *OperationalModeList) Get() any
Get returns the list of operational modes.
func (*OperationalModeList) Set ¶
func (om *OperationalModeList) Set(value string) error
Set sets the list of operational modes from the string representation.
func (*OperationalModeList) String ¶
func (om *OperationalModeList) String() string
String returns the string representation of the list of operational modes.
type OpticalChannelOpt ¶
type OpticalChannelOpt func(*oc.Component_OpticalChannel)
OpticalChannelOpt is an option for ConfigOpticalChannel.
func WithLinePort ¶
func WithLinePort(dut *ondatra.DUTDevice, och string) OpticalChannelOpt
WithLinePort sets the line-port for the optical channel if supported by the DUT.
type PbrRule ¶
type PbrRule struct {
Sequence uint32
EtherType oc.NetworkInstance_PolicyForwarding_Policy_Rule_L2_Ethertype_Union
EncapVrf string
}
PbrRule defines a policy-based routing rule configuration
type PeerGroupOption ¶
type PeerGroupOption func(*oc.NetworkInstance_Protocol_Bgp_PeerGroup, *ondatra.DUTDevice)
PeerGroupOption is a function that sets options for BGP Peer Group configuration.
func ApplyPGRoutingPolicy ¶
func ApplyPGRoutingPolicy(importPolicy, exportPolicy string, addDeleteLinkBW bool) PeerGroupOption
ApplyPGRoutingPolicy applies routing policies to the peer group.
func WithPGAfiSafiEnabled ¶
func WithPGAfiSafiEnabled(afiSafi oc.E_BgpTypes_AFI_SAFI_TYPE, enabled bool, configureGR bool) PeerGroupOption
WithPGAfiSafiEnabled enables or disables an AFI/SAFI for the peer group.
func WithPGDescription ¶
func WithPGDescription(desc string) PeerGroupOption
WithPGDescription sets the description for the peer group.
func WithPGGracefulRestart ¶
func WithPGGracefulRestart(enabled bool) PeerGroupOption
WithPGGracefulRestart configures Graceful Restart for the peer group.
func WithPGMultipath ¶
func WithPGMultipath(pgName string, enableMultipath bool) PeerGroupOption
WithPGMultipath configures multipath settings for the peer group.
func WithPGSendCommunity ¶
func WithPGSendCommunity(communities []oc.E_Bgp_CommunityType) PeerGroupOption
WithPGSendCommunity sets the community types to send.
func WithPGTimers ¶
func WithPGTimers(holdTime, keepalive, minAdvInterval uint16) PeerGroupOption
WithPGTimers configures BGP timers for the peer group.
func WithPGTransport ¶
func WithPGTransport(transportAddress string) PeerGroupOption
WithPGTransport sets the transport address for the peer group.
func WithPeerAS ¶
func WithPeerAS(as uint32) PeerGroupOption
WithPeerAS sets the Peer Autonomous System number for the group.
type PeerOption ¶
type PeerOption func(*oc.NetworkInstance_Protocol_Bgp_Neighbor, *ondatra.DUTDevice)
PeerOption is a function that sets options for BGP Peer configuration.
func ApplyPeerPerAfiSafiRoutingPolicy ¶
func ApplyPeerPerAfiSafiRoutingPolicy(isV4 bool, importPolicy, exportPolicy string, addDeleteLinkBW bool) PeerOption
ApplyPeerPerAfiSafiRoutingPolicy applies routing policies to the peer per AFI/SAFI.
func WithPeerAfiSafiEnabled ¶
func WithPeerAfiSafiEnabled(isV4 bool, importPolicy, exportPolicy string, addDeleteLinkBW bool) PeerOption
WithPeerAfiSafiEnabled enables or disables an AFI/SAFI for the peer group.
func WithPeerGroup ¶
func WithPeerGroup(pgName string, as uint32, importPolicy, exportPolicy string, addDeleteLinkBW bool) PeerOption
WithPeerGroup sets the Peer Group for the neighbor.
type PolicyForwardingConfigName ¶
type PolicyForwardingConfigName struct {
Name string // Policy name (e.g., "VRF-SELECT-POLICY")
}
PolicyForwardingConfigName defines the configuration parameters for PBR VRF selection.
type PolicyForwardingRule ¶
type QoSSchedulerInterface ¶
QoSSchedulerInterface is a struct to hold the QoS scheduler interface configuration.
type QosClassifier ¶
type QosClassifier struct {
Desc string
Name string
ClassType oc.E_Qos_Classifier_Type
TermID string
TargetGroup string
DscpSet []uint8
RemarkDscp uint8
}
QosClassifier is a struct to hold the QoS classifier configuration parameters.
type SFlowCollectorParams ¶
type SFlowCollectorParams struct {
Ni string
IntfName string
SrcAddrV4 string
SrcAddrV6 string
IP string
}
SFlowCollectorParams defines parameters for the SFlow collector configuration.
type SFlowGlobalParams ¶
type SFlowGlobalParams struct {
Ni string
IntfName string
SrcAddrV4 string
SrcAddrV6 string
IP string
MinSamplingRate uint32
}
SFlowGlobalParams defines parameters for the SFlow global configuration.
type SchedulerParams ¶
type SchedulerParams struct {
SchedulerName string
PolicerName string
InterfaceName string
ClassName string
CirValue uint64
PirValue uint64
BurstSize uint32
SequenceNumber uint32
QueueID uint32
QueueName string
}
SchedulerParams is a struct to hold parameters for configuring a QoS scheduler.
type SchedulerPolicy ¶
type SchedulerPolicy struct {
Desc string
Sequence uint32
SetPriority bool
Priority oc.E_Scheduler_Priority
InputID string
InputType oc.E_Input_InputType
SetWeight bool
QueueName string
TargetGroup string
}
SchedulerPolicy is a struct to hold the scheduler policy configuration.
type SecondaryIPConfig ¶
type SecondaryIPConfig struct {
Entries []SecondaryIPEntry
}
SecondaryIPConfig holds all per-port secondary IP configurations.
type SecondaryIPEntry ¶
type SecondaryIPEntry struct {
PortName string // DUT port name (e.g., "port2")
PortDummyAttr attrs.Attributes // DUT dummy IP attributes
DummyIP string // OTG Dummy IPv4 address (e.g., "192.0.2.10")
MagicMAC string // MAC to use for static ARP (e.g., "00:1A:2B:3C:4D:FF")
}
SecondaryIPEntry defines per-port dummy IP + ARP mapping for secondary IP config.
type StaticARPConfig ¶
type StaticARPConfig struct {
Entries []StaticARPEntry
}
StaticARPConfig holds all per-port static ARP entries.
type StaticARPEntry ¶
type StaticARPEntry struct {
PortName string // DUT port name (e.g., "port2")
MagicIP string // Per-port IP (e.g., "192.0.2.1")
MagicMAC string // Per-port MAC (e.g., "00:1A:2B:3C:4D:5E")
}
StaticARPEntry defines per-port static ARP mapping.
type StaticAggregateConfig ¶
type StaticAggregateConfig struct {
AggID string
DutLag attrs.Attributes
AggPorts []*ondatra.Port
}
StaticAggregateConfig defines the parameters for configuring a static LAG.
type StaticNextHopGroupParams ¶
type StaticNextHopGroupParams struct {
// For the "MPLS_in_GRE_Encap" Next-Hop Group definition from JSON's "static" block
StaticNHGName string
NHIPAddr1 string
NHIPAddr2 string
// OuterIpv4Src*Def / OuterIpv4DstDef are used only when DynamicVal == false.
// When DynamicVal == true, tunnel src/dst must be provided per-entry via DynamicStructParams and these fields are ignored.
OuterIpv4DstDef string
OuterIpv4Src1Def string
OuterIpv4Src2Def string
OuterDscpDef uint8
OuterTTLDef uint8
DynamicValues []DynamicStructParams
DynamicVal bool
}
StaticNextHopGroupParams holds parameters for generating the OC Static Next Hop Group config.
type StaticRouteCfg ¶
type StaticRouteCfg struct {
NetworkInstance string
Prefix string
NextHops map[string]oc.NetworkInstance_Protocol_Static_NextHop_NextHop_Union
IPType string
NextHopAddr string
}
StaticRouteCfg defines commonly used attributes for setting a static route
type StaticVRFRouteCfg ¶
type StaticVRFRouteCfg struct {
NetworkInstance string
Prefix string
NextHopGroup string
ProtocolStr string
}
StaticVRFRouteCfg represents a static route configuration within a specific network instance (VRF). It defines the destination prefix, associated next-hop group, and the protocol string used for identification.
type TargetOpticalPowerList ¶
type TargetOpticalPowerList []float64
TargetOpticalPowerList is a type for a list of target optical powers in float64 format.
func (*TargetOpticalPowerList) Default ¶
func (top *TargetOpticalPowerList) Default(t *testing.T, dut *ondatra.DUTDevice) TargetOpticalPowerList
Default returns the default target optical power list.
func (*TargetOpticalPowerList) Get ¶
func (top *TargetOpticalPowerList) Get() any
Get returns the list of target optical powers.
func (*TargetOpticalPowerList) Set ¶
func (top *TargetOpticalPowerList) Set(value string) error
Set sets the list of target optical powers from the string representation.
func (*TargetOpticalPowerList) String ¶
func (top *TargetOpticalPowerList) String() string
String returns the string representation of the list of target optical powers.
type URPFConfigParams ¶
type URPFConfigParams struct {
InterfaceName string
IPv4Obj *oc.Interface_Subinterface_Ipv4
IPv6Obj *oc.Interface_Subinterface_Ipv6
}
URPFConfigParams holds all parameters required to configure Unicast Reverse Path Forwarding (uRPF) on a DUT interface. It includes the interface name and its IPv4/IPv6 subinterface objects.
type VRFConfig ¶
type VRFConfig struct {
VRFCount int
}
VRFConfig holds input parameters for creating VRFs in a batched way.
type VlanParams ¶
type VlanParams struct {
VlanID uint16
}
VlanParams defines the parameters for configuring a VLAN.
type VrfBGPState ¶
VrfBGPState holds the parameters to verify BGP neighbors state.