ixnet

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package ixnet provides an IxNetwork API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressIncRange

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

AddressIncRange is a range network addresses that increment by a fixed step.

func (*AddressIncRange) WithCount

func (r *AddressIncRange) WithCount(count uint32) *AddressIncRange

WithCount sets the number of values in the range; must not be zero.

func (*AddressIncRange) WithMax

func (r *AddressIncRange) WithMax(max string) *AddressIncRange

WithMax sets the maximum value of the range.

func (*AddressIncRange) WithMin

func (r *AddressIncRange) WithMin(addr string) *AddressIncRange

WithMin sets the minimum value of the range.

func (*AddressIncRange) WithStep

func (r *AddressIncRange) WithStep(step string) *AddressIncRange

WithStep sets the step address between values in the range. If not specified, defaults to the largest step that fits the specified count of values.

type AddressRange

type AddressRange struct {
	AddressIncRange
}

AddressRange is a range of addresses.

func NewAddressRange

func NewAddressRange(pb *opb.AddressRange) *AddressRange

NewAddressRange returns a new Address Range. Tests should not call this method directly.

func (*AddressRange) WithCount

func (r *AddressRange) WithCount(count uint32) *AddressRange

WithCount sets the number of values in the range; must not be zero.

func (*AddressRange) WithMax

func (r *AddressRange) WithMax(max string) *AddressRange

WithMax sets the maximum value of the range.

func (*AddressRange) WithMin

func (r *AddressRange) WithMin(min string) *AddressRange

WithMin sets the minimum value of the range.

func (*AddressRange) WithRandom

func (r *AddressRange) WithRandom() *AddressRange

WithRandom sets the values in the range to be chosen randomly.

func (*AddressRange) WithStep

func (r *AddressRange) WithStep(step string) *AddressRange

WithStep sets the step address between values in the range. If not specified, the default depends on whether the range is random. For non-random ranges, step defaults to the largest step that fits the specified count of values. For random ranges, the step defaults to a single address.

type AdjacencySID

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

AdjacencySID holds the Adjacency SID configuration.

func (*AdjacencySID) WithAdjacencySID

func (as *AdjacencySID) WithAdjacencySID(sid string) *AdjacencySID

WithAdjacencySID sets SID for the adjacency.

func (*AdjacencySID) WithFlagAddressFamily

func (as *AdjacencySID) WithFlagAddressFamily(enabled bool) *AdjacencySID

WithFlagAddressFamily sets the AddressFamily(F) flag.

func (*AdjacencySID) WithFlagBackup

func (as *AdjacencySID) WithFlagBackup(enabled bool) *AdjacencySID

WithFlagBackup sets the Backup(B) flag.

func (*AdjacencySID) WithFlagLocal

func (as *AdjacencySID) WithFlagLocal(enabled bool) *AdjacencySID

WithFlagLocal sets the Local(L) flag. [Default = true]

func (*AdjacencySID) WithFlagPersistent

func (as *AdjacencySID) WithFlagPersistent(enabled bool) *AdjacencySID

WithFlagPersistent sets the Persistent(P) flag.

func (*AdjacencySID) WithFlagSet

func (as *AdjacencySID) WithFlagSet(enabled bool) *AdjacencySID

WithFlagSet sets the Set(S) flag.

func (*AdjacencySID) WithFlagValue

func (as *AdjacencySID) WithFlagValue(enabled bool) *AdjacencySID

WithFlagValue sets the Value(V) flag. [Default = true]

type BGP

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

BGP is a representation of a BGP config on the ATE.

func NewBGP

func NewBGP(pb *opb.BgpConfig) *BGP

NewBGP returns a new BGP configuration. Tests must not call this method directly.

func (*BGP) AddPeer

func (b *BGP) AddPeer() *BGPPeer

AddPeer adds a new BGP peer to the interface. By default, the peer will have the following configuration:

Active: true
Peer type: external
Hold time: 90 seconds (per RFC 4271)
Keepalive time: 30 second (per RFC 4271)
Restart time: 90 seconds (per RFC 4724)
Stale time: 300 seconds (per JunOS defaults)
Capabilities:
  IPv4 unicast
  IPv4 multicast
  IPv4 MPLS VPN
  IPv6 unicast
  IPv6 multicast
  IPv6 MPLS VPN
  VPLS
  Route refresh

func (*BGP) ClearPeers

func (b *BGP) ClearPeers() *BGP

ClearPeers clears BGP peers from the interface.

type BGPASPathSegment

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

BGPASPathSegment is a representation of an BGP AS path segment on the ATE.

func (*BGPASPathSegment) WithTypeSEQ

func (a *BGPASPathSegment) WithTypeSEQ() *BGPASPathSegment

WithTypeSEQ sets the type of the AS path segment to AS-SEQ.

func (*BGPASPathSegment) WithTypeSEQConfederation

func (a *BGPASPathSegment) WithTypeSEQConfederation() *BGPASPathSegment

WithTypeSEQConfederation sets the type of the AS path segment to AS-SEQ-CONFEDERATION.

func (*BGPASPathSegment) WithTypeSET

func (a *BGPASPathSegment) WithTypeSET() *BGPASPathSegment

WithTypeSET sets the type of the AS path segment to AS-SET.

func (*BGPASPathSegment) WithTypeSETConfederation

func (a *BGPASPathSegment) WithTypeSETConfederation() *BGPASPathSegment

WithTypeSETConfederation sets the type of the AS path segment to AS-SET-CONFEDERATION.

type BGPAttributes

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

BGPAttributes is a representation of BGP attributes on the ATE.

func (*BGPAttributes) AddASPathSegment

func (a *BGPAttributes) AddASPathSegment(asns ...uint32) *BGPASPathSegment

AddASPathSegment adds an AS path segment with the given ASNs. By default, the AS path segment will have the following configuration:

Segment type: AS-SEQ

func (*BGPAttributes) AddExtendedCommunityColor

func (a *BGPAttributes) AddExtendedCommunityColor() *BGPExtendedCommunityColor

AddExtendedCommunityColor adds a color extended community to the advertised prefixes and returns it for further configuration. By default, the color extended community will have the following configuration:

CO bits: 00

func (*BGPAttributes) ClearASPathSegments

func (a *BGPAttributes) ClearASPathSegments() *BGPAttributes

ClearASPathSegments clears AS path segments.

func (*BGPAttributes) ClearExtendedCommunityColors

func (a *BGPAttributes) ClearExtendedCommunityColors() *BGPAttributes

ClearExtendedCommunityColors clears color extended communities from the advertised prefixes.

func (*BGPAttributes) Communities

func (a *BGPAttributes) Communities() *BGPCommunities

Communities creates a BGP communities config for the advertised prefixes or returns the existing config.

func (*BGPAttributes) OriginatorIDRange

func (a *BGPAttributes) OriginatorIDRange() *StringIncRange

OriginatorIDRange sets the originator ID of the routes to a range of values and returns the range. By default, the range will have the following configuration:

Start: 0.0.0.1
Step: 0.0.0.1

func (*BGPAttributes) WithASNSetModeDoNotInclude

func (a *BGPAttributes) WithASNSetModeDoNotInclude() *BGPAttributes

WithASNSetModeDoNotInclude sets the ASN set mode to not include the local ASN for the advertised prefixes.

func (*BGPAttributes) WithASNSetModePrepend

func (a *BGPAttributes) WithASNSetModePrepend() *BGPAttributes

WithASNSetModePrepend sets the ASN set mode to prepend the local ASN to the first segment for the advertised prefixes.

func (*BGPAttributes) WithASNSetModeSEQ

func (a *BGPAttributes) WithASNSetModeSEQ() *BGPAttributes

WithASNSetModeSEQ sets the ASN set mode to include the local ASN as AS-SEQ for the advertised prefixes.

func (*BGPAttributes) WithASNSetModeSEQConfederation

func (a *BGPAttributes) WithASNSetModeSEQConfederation() *BGPAttributes

WithASNSetModeSEQConfederation sets the ASN set mode to include the local ASN as AS-SEQ-CONFEDERATION for the advertised prefixes.

func (*BGPAttributes) WithASNSetModeSET

func (a *BGPAttributes) WithASNSetModeSET() *BGPAttributes

WithASNSetModeSET sets the ASN set mode to include the local ASN as AS-SET for the advertised prefixes.

func (*BGPAttributes) WithASNSetModeSETConfederation

func (a *BGPAttributes) WithASNSetModeSETConfederation() *BGPAttributes

WithASNSetModeSETConfederation sets the ASN set mode to include the local ASN as AS-SET-CONFEDERATION for the advertised prefixes.

func (*BGPAttributes) WithActive

func (a *BGPAttributes) WithActive(active bool) *BGPAttributes

WithActive sets whether the prefixes are active.

func (*BGPAttributes) WithAdvertisementProtocolSameAsRoute

func (a *BGPAttributes) WithAdvertisementProtocolSameAsRoute() *BGPAttributes

WithAdvertisementProtocolSameAsRoute sets the routes to be exported over the BGP peer matching the routes' IP protocol.

func (*BGPAttributes) WithAdvertisementProtocolV4

func (a *BGPAttributes) WithAdvertisementProtocolV4() *BGPAttributes

WithAdvertisementProtocolV4 sets the routes to be advertised over a BGP V4 peer.

func (*BGPAttributes) WithAdvertisementProtocolV4AndV6

func (a *BGPAttributes) WithAdvertisementProtocolV4AndV6() *BGPAttributes

WithAdvertisementProtocolV4AndV6 sets the routes to be advertised over both BGP V4 and V6 peers.

func (*BGPAttributes) WithAdvertisementProtocolV6

func (a *BGPAttributes) WithAdvertisementProtocolV6() *BGPAttributes

WithAdvertisementProtocolV6 sets the routes to be advertised over a BGP V6 peer.

func (*BGPAttributes) WithClusterIDs

func (a *BGPAttributes) WithClusterIDs(values ...string) *BGPAttributes

WithClusterIDs sets the given cluster IDs for the associated routes.

func (*BGPAttributes) WithLocalPreference

func (a *BGPAttributes) WithLocalPreference(localPref uint32) *BGPAttributes

WithLocalPreference sets the local preference for the advertised prefixes.

func (*BGPAttributes) WithNextHopAddress

func (a *BGPAttributes) WithNextHopAddress(address string) *BGPAttributes

WithNextHopAddress sets the next hop address for the advertised prefixes.

func (*BGPAttributes) WithOriginEGP

func (a *BGPAttributes) WithOriginEGP() *BGPAttributes

WithOriginEGP sets the origin to EGP for the advertised prefixes.

func (*BGPAttributes) WithOriginIGP

func (a *BGPAttributes) WithOriginIGP() *BGPAttributes

WithOriginIGP sets the origin to IGP for the advertised prefixes.

func (*BGPAttributes) WithOriginIncomplete

func (a *BGPAttributes) WithOriginIncomplete() *BGPAttributes

WithOriginIncomplete sets the origin to incomplete for the advertised prefixes.

func (*BGPAttributes) WithOriginatorID

func (a *BGPAttributes) WithOriginatorID(id string) *BGPAttributes

WithOriginatorID sets the originator ID for the routes.

type BGPCapabilities

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

BGPCapabilities is a representation of BGP capabilities on the ATE.

func (*BGPCapabilities) WithEVPNEnabled

func (c *BGPCapabilities) WithEVPNEnabled(enabled bool) *BGPCapabilities

WithEVPNEnabled sets whether the EVPN capability is enabled on the ATE.

func (*BGPCapabilities) WithExtendedNextHopEncodingEnabled

func (c *BGPCapabilities) WithExtendedNextHopEncodingEnabled(enabled bool) *BGPCapabilities

WithExtendedNextHopEncodingEnabled sets whether the extended next hop encoding capability is enabled on the ATE. This is only applicable to IPv6 peers.

func (*BGPCapabilities) WithGracefulRestart

func (c *BGPCapabilities) WithGracefulRestart(enabled bool) *BGPCapabilities

WithGracefulRestart sets whether the Graceful restart capability is enabled on the ATE.

func (*BGPCapabilities) WithIPv4MDTEnabled

func (c *BGPCapabilities) WithIPv4MDTEnabled(enabled bool) *BGPCapabilities

WithIPv4MDTEnabled sets whether the IPv4 MDT capability is enabled on the ATE.

func (*BGPCapabilities) WithIPv4MPLSVPNEnabled

func (c *BGPCapabilities) WithIPv4MPLSVPNEnabled(enabled bool) *BGPCapabilities

WithIPv4MPLSVPNEnabled sets whether the IPv4 MPLS VPN capability is enabled on the ATE.

func (*BGPCapabilities) WithIPv4MulticastBGPMPLSVPNEnabled

func (c *BGPCapabilities) WithIPv4MulticastBGPMPLSVPNEnabled(enabled bool) *BGPCapabilities

WithIPv4MulticastBGPMPLSVPNEnabled sets whether the IPv4 multicast BGP MPLS VPN capability is enabled on the ATE.

func (*BGPCapabilities) WithIPv4MulticastEnabled

func (c *BGPCapabilities) WithIPv4MulticastEnabled(enabled bool) *BGPCapabilities

WithIPv4MulticastEnabled sets whether the IPv4 multicast capability is enabled on the ATE.

func (*BGPCapabilities) WithIPv4MulticastVPNEnabled

func (c *BGPCapabilities) WithIPv4MulticastVPNEnabled(enabled bool) *BGPCapabilities

WithIPv4MulticastVPNEnabled sets whether the IPv4 multicast VPN capability is enabled on the ATE.

func (*BGPCapabilities) WithIPv4SRTEPolicyEnabled

func (c *BGPCapabilities) WithIPv4SRTEPolicyEnabled(enabled bool) *BGPCapabilities

WithIPv4SRTEPolicyEnabled sets whether the IPv4 SR-TE policy capability is enabled on the ATE.

func (*BGPCapabilities) WithIPv4UnicastAddPathEnabled

func (c *BGPCapabilities) WithIPv4UnicastAddPathEnabled(enabled bool) *BGPCapabilities

WithIPv4UnicastAddPathEnabled sets whether the IPv4 unicast add path capability is enabled on the ATE.

func (*BGPCapabilities) WithIPv4UnicastEnabled

func (c *BGPCapabilities) WithIPv4UnicastEnabled(enabled bool) *BGPCapabilities

WithIPv4UnicastEnabled sets whether the IPv4 unicast capability is enabled on the ATE.

func (*BGPCapabilities) WithIPv4UnicastFlowSpecEnabled

func (c *BGPCapabilities) WithIPv4UnicastFlowSpecEnabled(enabled bool) *BGPCapabilities

WithIPv4UnicastFlowSpecEnabled sets whether the IPv4 unicast flow spec capability is enabled on the ATE.

func (*BGPCapabilities) WithIPv6MPLSVPNEnabled

func (c *BGPCapabilities) WithIPv6MPLSVPNEnabled(enabled bool) *BGPCapabilities

WithIPv6MPLSVPNEnabled sets whether the IPv6 MPLS VPN capability is enabled on the ATE.

func (*BGPCapabilities) WithIPv6MulticastBGPMPLSVPNEnabled

func (c *BGPCapabilities) WithIPv6MulticastBGPMPLSVPNEnabled(enabled bool) *BGPCapabilities

WithIPv6MulticastBGPMPLSVPNEnabled sets whether the IPv6 multicast BGP MPLS VPN capability is enabled on the ATE.

func (*BGPCapabilities) WithIPv6MulticastEnabled

func (c *BGPCapabilities) WithIPv6MulticastEnabled(enabled bool) *BGPCapabilities

WithIPv6MulticastEnabled sets whether the IPv6 multicast capability is enabled on the ATE.

func (*BGPCapabilities) WithIPv6MulticastVPNEnabled

func (c *BGPCapabilities) WithIPv6MulticastVPNEnabled(enabled bool) *BGPCapabilities

WithIPv6MulticastVPNEnabled sets whether the IPv6 multicast VPN capability is enabled on the ATE.

func (*BGPCapabilities) WithIPv6SRTEPolicyEnabled

func (c *BGPCapabilities) WithIPv6SRTEPolicyEnabled(enabled bool) *BGPCapabilities

WithIPv6SRTEPolicyEnabled sets whether the IPv6 SR-TE policy capability is enabled on the ATE.

func (*BGPCapabilities) WithIPv6UnicastAddPathEnabled

func (c *BGPCapabilities) WithIPv6UnicastAddPathEnabled(enabled bool) *BGPCapabilities

WithIPv6UnicastAddPathEnabled sets whether the IPv6 unicast add path capability is enabled on the ATE.

func (*BGPCapabilities) WithIPv6UnicastEnabled

func (c *BGPCapabilities) WithIPv6UnicastEnabled(enabled bool) *BGPCapabilities

WithIPv6UnicastEnabled sets whether the IPv6 unicast capability is enabled on the ATE.

func (*BGPCapabilities) WithIPv6UnicastFlowSpecEnabled

func (c *BGPCapabilities) WithIPv6UnicastFlowSpecEnabled(enabled bool) *BGPCapabilities

WithIPv6UnicastFlowSpecEnabled sets whether the IPv6 unicast flow spec capability is enabled on the ATE.

func (*BGPCapabilities) WithLinkStateNonVPNEnabled

func (c *BGPCapabilities) WithLinkStateNonVPNEnabled(enabled bool) *BGPCapabilities

WithLinkStateNonVPNEnabled sets whether the link state non-VPN capability is enabled on the ATE.

func (*BGPCapabilities) WithRouteConstraintEnabled

func (c *BGPCapabilities) WithRouteConstraintEnabled(enabled bool) *BGPCapabilities

WithRouteConstraintEnabled sets whether the route constraint capability is enabled on the ATE.

func (*BGPCapabilities) WithRouteRefreshEnabled

func (c *BGPCapabilities) WithRouteRefreshEnabled(enabled bool) *BGPCapabilities

WithRouteRefreshEnabled sets whether the route refresh capability is enabled on the ATE.

func (*BGPCapabilities) WithVPLSEnabled

func (c *BGPCapabilities) WithVPLSEnabled(enabled bool) *BGPCapabilities

WithVPLSEnabled sets whether the VPLS capability is enabled on the ATE.

type BGPCommunities

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

BGPCommunities is a representation of BGP communities on the ATE.

func (*BGPCommunities) WithLLGRStale

func (c *BGPCommunities) WithLLGRStale() *BGPCommunities

WithLLGRStale includes the well-known community type LLGR_STALE.

func (*BGPCommunities) WithNoAdvertise

func (c *BGPCommunities) WithNoAdvertise() *BGPCommunities

WithNoAdvertise includes the well-known community type NO_ADVERTISE.

func (*BGPCommunities) WithNoExport

func (c *BGPCommunities) WithNoExport() *BGPCommunities

WithNoExport includes the well-known community type NO_EXPORT.

func (*BGPCommunities) WithNoExportSubconfed

func (c *BGPCommunities) WithNoExportSubconfed() *BGPCommunities

WithNoExportSubconfed includes the well-known community type NO_EXPORT_SUBCONFED.

func (*BGPCommunities) WithNoLLGR

func (c *BGPCommunities) WithNoLLGR() *BGPCommunities

WithNoLLGR includes the well-known community type NO_LLGR.

func (*BGPCommunities) WithPrivateCommunities

func (c *BGPCommunities) WithPrivateCommunities(values ...string) *BGPCommunities

WithPrivateCommunities includes private communities using an "AS:value" format.

type BGPExtendedCommunityColor

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

BGPExtendedCommunityColor is a representation of the BGP color extended community on the ATE.

func (*BGPExtendedCommunityColor) WithCOBits00

WithCOBits00 sets the CO bits to 00 for the color extended community.

func (*BGPExtendedCommunityColor) WithCOBits01

WithCOBits01 sets the CO bits to 01 for the color extended community.

func (*BGPExtendedCommunityColor) WithCOBits10

WithCOBits10 sets the CO bits to 10 for the color extended community.

func (*BGPExtendedCommunityColor) WithCOBits11

WithCOBits11 sets the CO bits to 11 for the color extended community.

func (*BGPExtendedCommunityColor) WithReservedBits

func (c *BGPExtendedCommunityColor) WithReservedBits(reservedBits uint16) *BGPExtendedCommunityColor

WithReservedBits sets the reserved bits for the color extended community.

func (*BGPExtendedCommunityColor) WithValue

WithValue sets the value for the color extended community.

type BGPPeer

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

BGPPeer is a representation of a BGP peer on the ATE.

func (*BGPPeer) AddSRTEPolicyGroup

func (b *BGPPeer) AddSRTEPolicyGroup() *BGPSRTEPolicyGroup

AddSRTEPolicyGroup adds SR-TE policies to the peer. Multiple policies that share the same configuration can be added by using WithCount. By default, the SR-TE policies will have the following configuration:

Count: 1
Active: true
Distinguisher: 1
Policy color: 100

func (*BGPPeer) Capabilities

func (b *BGPPeer) Capabilities() *BGPCapabilities

Capabilities returns the existing capabilities config.

func (*BGPPeer) ClearSRTEPolicyGroups

func (b *BGPPeer) ClearSRTEPolicyGroups() *BGPPeer

ClearSRTEPolicyGroups clears SR-TE policies from the peer.

func (*BGPPeer) ID

func (b *BGPPeer) ID() uint32

ID returns the id of the peer.

func (*BGPPeer) WithActAsRestarted

func (b *BGPPeer) WithActAsRestarted(enabled bool) *BGPPeer

WithActAsRestarted sets whether the Restart State bit is advertised in the BGP session graceful restart flags.

func (*BGPPeer) WithActive

func (b *BGPPeer) WithActive(active bool) *BGPPeer

WithActive sets whether the peering is active.

func (*BGPPeer) WithAdvertiseEndOfRIB

func (b *BGPPeer) WithAdvertiseEndOfRIB(enabled bool) *BGPPeer

WithAdvertiseEndOfRIB sets whether the End-of-RIB marker is advertised in the BGP session.

func (*BGPPeer) WithHoldTime

func (b *BGPPeer) WithHoldTime(holdTimeSec uint16) *BGPPeer

WithHoldTime sets the hold time in seconds.

func (*BGPPeer) WithKeepaliveTime

func (b *BGPPeer) WithKeepaliveTime(keepaliveTimeSec uint16) *BGPPeer

WithKeepaliveTime sets the keepalive time in seconds configured on the ATE.

func (*BGPPeer) WithLocalASN

func (b *BGPPeer) WithLocalASN(localASN uint32) *BGPPeer

WithLocalASN sets the local ASN.

func (*BGPPeer) WithMD5Key

func (b *BGPPeer) WithMD5Key(key string) *BGPPeer

WithMD5Key enables authentication and sets the MD5 key configured on the ATE.

func (*BGPPeer) WithOnLoopback

func (b *BGPPeer) WithOnLoopback(enable bool) *BGPPeer

WithOnLoopback sets whether the peering should configured on the loopback IP.

func (*BGPPeer) WithPeerAddress

func (b *BGPPeer) WithPeerAddress(peerAddress string) *BGPPeer

WithPeerAddress sets the IP address (IPv4 or IPv6) of the ATE's peer, which is typically the IP address of the DUT.

func (*BGPPeer) WithRestartTime

func (b *BGPPeer) WithRestartTime(restartTime time.Duration) *BGPPeer

WithRestartTime sets the graceful restart time.

func (*BGPPeer) WithStaleTime

func (b *BGPPeer) WithStaleTime(staleTime time.Duration) *BGPPeer

WithStaleTime sets the graceful restart stale route time.

func (*BGPPeer) WithTypeExternal

func (b *BGPPeer) WithTypeExternal() *BGPPeer

WithTypeExternal sets the peering type to external.

func (*BGPPeer) WithTypeInternal

func (b *BGPPeer) WithTypeInternal() *BGPPeer

WithTypeInternal sets the peering type to internal.

type BGPSRTEPolicyGroup

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

BGPSRTEPolicyGroup is a representation of BGP SR-TE policies on the ATE.

func (*BGPSRTEPolicyGroup) AddSegmentList

func (p *BGPSRTEPolicyGroup) AddSegmentList() *BGPSegmentList

AddSegmentList adds a segment list to the policies. By default, the segment list will have the following configuration:

Active: true

func (*BGPSRTEPolicyGroup) BindingSID4OctetMPLSRange

func (p *BGPSRTEPolicyGroup) BindingSID4OctetMPLSRange() *UInt32IncRange

BindingSID4OctetMPLSRange sets the binding SID of the polices to a range of values as MPLS labels and returns the range. By default, the range will have the following configuration:

Start: 0
Step: 1

func (*BGPSRTEPolicyGroup) BindingSID4OctetRange

func (p *BGPSRTEPolicyGroup) BindingSID4OctetRange() *UInt32IncRange

BindingSID4OctetRange sets the binding SID of the polices to a range of values and returns the range. By default, the range will have the following configuration:

Start: 0
Step: 1

func (*BGPSRTEPolicyGroup) ClearSegmentLists

func (p *BGPSRTEPolicyGroup) ClearSegmentLists() *BGPSRTEPolicyGroup

ClearSegmentLists clears segment lists from the policies.

func (*BGPSRTEPolicyGroup) Communities

func (p *BGPSRTEPolicyGroup) Communities() *BGPCommunities

Communities creates a BGP communities config for the advertised prefixes or returns the existing config.

func (*BGPSRTEPolicyGroup) OriginatorIDRange

func (p *BGPSRTEPolicyGroup) OriginatorIDRange() *StringIncRange

OriginatorIDRange sets the originator ID of the policies to a range of values and returns the range. By default, the range will have the following configuration:

Start: 0.0.0.1
Step: 0.0.0.1

func (*BGPSRTEPolicyGroup) PolicyColorRange

func (p *BGPSRTEPolicyGroup) PolicyColorRange() *UInt32IncRange

PolicyColorRange sets the policy color of the policies to a range of values and returns the range. By default, the range will have the following configuration:

Start: 100
Step: 1

func (*BGPSRTEPolicyGroup) WithASNSetModeDoNotInclude

func (p *BGPSRTEPolicyGroup) WithASNSetModeDoNotInclude() *BGPSRTEPolicyGroup

WithASNSetModeDoNotInclude sets the ASN set mode to not include the local ASN of the policies.

func (*BGPSRTEPolicyGroup) WithASNSetModePrepend

func (p *BGPSRTEPolicyGroup) WithASNSetModePrepend() *BGPSRTEPolicyGroup

WithASNSetModePrepend sets the ASN set mode to prepend the local ASN to the first segment of the policies.

func (*BGPSRTEPolicyGroup) WithASNSetModeSEQ

func (p *BGPSRTEPolicyGroup) WithASNSetModeSEQ() *BGPSRTEPolicyGroup

WithASNSetModeSEQ sets the ASN set mode to include the local ASN as AS-SEQ of the policies.

func (*BGPSRTEPolicyGroup) WithASNSetModeSEQConfederation

func (p *BGPSRTEPolicyGroup) WithASNSetModeSEQConfederation() *BGPSRTEPolicyGroup

WithASNSetModeSEQConfederation sets the ASN set mode to include the local ASN as AS-SEQ-CONFEDERATION of the policies.

func (*BGPSRTEPolicyGroup) WithASNSetModeSET

func (p *BGPSRTEPolicyGroup) WithASNSetModeSET() *BGPSRTEPolicyGroup

WithASNSetModeSET sets the ASN set mode to include the local ASN as AS-SET of the policies.

func (*BGPSRTEPolicyGroup) WithASNSetModeSETConfederation

func (p *BGPSRTEPolicyGroup) WithASNSetModeSETConfederation() *BGPSRTEPolicyGroup

WithASNSetModeSETConfederation sets the ASN set mode to include the local ASN as AS-SET-CONFEDERATION of the policies.

func (*BGPSRTEPolicyGroup) WithActive

func (p *BGPSRTEPolicyGroup) WithActive(active bool) *BGPSRTEPolicyGroup

WithActive sets whether the policies are active.

func (*BGPSRTEPolicyGroup) WithBindingSID4Octet

func (p *BGPSRTEPolicyGroup) WithBindingSID4Octet(bsid uint32) *BGPSRTEPolicyGroup

WithBindingSID4Octet sets the binding SID of the polices to the 4-octet value.

func (*BGPSRTEPolicyGroup) WithBindingSID4OctetMPLS

func (p *BGPSRTEPolicyGroup) WithBindingSID4OctetMPLS(bsid uint32) *BGPSRTEPolicyGroup

WithBindingSID4OctetMPLS sets the binding SID of the polices to the 4-octet value as an MPLS label.

func (*BGPSRTEPolicyGroup) WithBindingSIDIPv6

func (p *BGPSRTEPolicyGroup) WithBindingSIDIPv6(bsid string) *BGPSRTEPolicyGroup

WithBindingSIDIPv6 sets the binding SID of the polices to the IPv6 value.

func (*BGPSRTEPolicyGroup) WithBindingSIDNone

func (p *BGPSRTEPolicyGroup) WithBindingSIDNone() *BGPSRTEPolicyGroup

WithBindingSIDNone sets the binding SID of the polices to no binding.

func (*BGPSRTEPolicyGroup) WithCount

func (p *BGPSRTEPolicyGroup) WithCount(count uint32) *BGPSRTEPolicyGroup

WithCount sets the number of policies that will be added with the same configuration.

func (*BGPSRTEPolicyGroup) WithDistinguisher

func (p *BGPSRTEPolicyGroup) WithDistinguisher(distinguisher uint32) *BGPSRTEPolicyGroup

WithDistinguisher sets the distinguisher of the policies.

func (*BGPSRTEPolicyGroup) WithENLP

func (p *BGPSRTEPolicyGroup) WithENLP(enlp uint32) *BGPSRTEPolicyGroup

WithENLP sets the ENLP value of the policies.

func (*BGPSRTEPolicyGroup) WithEndpoint

func (p *BGPSRTEPolicyGroup) WithEndpoint(endpoint string) *BGPSRTEPolicyGroup

WithEndpoint sets the endpoint of the policies.

func (*BGPSRTEPolicyGroup) WithNextHopAddress

func (p *BGPSRTEPolicyGroup) WithNextHopAddress(address string) *BGPSRTEPolicyGroup

WithNextHopAddress sets the next hop address of the policies.

func (*BGPSRTEPolicyGroup) WithOriginatorID

func (p *BGPSRTEPolicyGroup) WithOriginatorID(id string) *BGPSRTEPolicyGroup

WithOriginatorID sets the originator ID of the policies.

func (*BGPSRTEPolicyGroup) WithPolicyColor

func (p *BGPSRTEPolicyGroup) WithPolicyColor(policyColor uint32) *BGPSRTEPolicyGroup

WithPolicyColor sets the policy color of the policies.

func (*BGPSRTEPolicyGroup) WithPreference

func (p *BGPSRTEPolicyGroup) WithPreference(preference uint32) *BGPSRTEPolicyGroup

WithPreference sets the preference of the policies.

type BGPSegment

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

BGPSegment is a representation of a segment on the ATE.

func (*BGPSegment) BGPSegmentMPLSSID

func (s *BGPSegment) BGPSegmentMPLSSID() *BGPSegmentMPLSSID

BGPSegmentMPLSSID sets the segment type to MPLS SID and returns the segment. By default, the segment will have the following configuration:

Label: 16
TC: 0
S: false
TTL: 255

func (*BGPSegment) WithActive

func (s *BGPSegment) WithActive(active bool) *BGPSegment

WithActive sets whether the segment is active.

func (*BGPSegment) WithIPv6SID

func (s *BGPSegment) WithIPv6SID(sid string) *BGPSegment

WithIPv6SID sets the segment type to IPv6 SID and sets the SID to the IPv6 value.

type BGPSegmentList

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

BGPSegmentList is a representation of a segment list on the ATE.

func (*BGPSegmentList) AddSegment

func (l *BGPSegmentList) AddSegment() *BGPSegment

AddSegment adds a segment to the segment list. By default, the segment will have the following configuration:

Active: true

func (*BGPSegmentList) ClearSegments

func (l *BGPSegmentList) ClearSegments() *BGPSegmentList

ClearSegments clears segments from the segment list.

func (*BGPSegmentList) WithActive

func (l *BGPSegmentList) WithActive(active bool) *BGPSegmentList

WithActive sets whether the segment list is active.

func (*BGPSegmentList) WithWeight

func (l *BGPSegmentList) WithWeight(weight uint32) *BGPSegmentList

WithWeight sets the weight of the segment list.

type BGPSegmentMPLSSID

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

BGPSegmentMPLSSID is a representation of an MPLS SID segment on the ATE.

func (*BGPSegmentMPLSSID) WithLabel

func (m *BGPSegmentMPLSSID) WithLabel(label uint32) *BGPSegmentMPLSSID

WithLabel sets the label of the MPLS SID segment.

func (*BGPSegmentMPLSSID) WithS

WithS sets the bottom-of-stack bit of the MPLS SID segment.

func (*BGPSegmentMPLSSID) WithTC

func (m *BGPSegmentMPLSSID) WithTC(tc uint8) *BGPSegmentMPLSSID

WithTC sets the traffic class of the MPLS SID segment.

func (*BGPSegmentMPLSSID) WithTTL

func (m *BGPSegmentMPLSSID) WithTTL(ttl uint8) *BGPSegmentMPLSSID

WithTTL sets the TTL of the MPLS SID segment.

type ConnectivityAssociation

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

ConnectivityAssociation is a representation of a connectivity association for an MKA protocol.

func (*ConnectivityAssociation) WithCAK

WithCAK sets the key, specified as a hex string.

func (*ConnectivityAssociation) WithCKN

WithCKN sets the key name, specified as a hex string.

type DHCPV6Client added in v0.1.1

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

DHCPV6Client is a DHCP v6 Client config on an ATE.

func NewDHCPV6Client added in v0.1.1

func NewDHCPV6Client(pb *opb.DhcpV6Client) *DHCPV6Client

NewDHCPV6Client returns a new DHCP v6 client configuration. Tests must not call this method directly.

type DHCPV6Server added in v0.1.1

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

DHCPV6Server is a DHCP v6 Server config on an ATE.

func NewDHCPV6Server added in v0.1.1

func NewDHCPV6Server(pb *opb.DhcpV6Server) *DHCPV6Server

NewDHCPV6Server returns a new DHCP v6 server configuration. Tests must not call this method directly.

func (*DHCPV6Server) LeaseAddressRange added in v0.1.2

func (s *DHCPV6Server) LeaseAddressRange() *AddressRange

LeaseAddressRange returns the range of addresses available for lease. By default, the range will be nonrandom values in the interval ["::1", "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"]. The count of values in the range is not set by default; the user must set it explicitly.

type Ethernet

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

Ethernet is a representation of Ethernet config on the ATE.

func NewEthernet

func NewEthernet(pb *opb.EthernetConfig) *Ethernet

NewEthernet returns a new ethernet configuration. Tests must not call this method directly.

func (*Ethernet) FEC

func (e *Ethernet) FEC() *FEC

FEC creates a an FEC config or returns the existing config.

func (*Ethernet) MACsec

func (e *Ethernet) MACsec() *MACsec

MACsec creates a MACsec config or returns the existing config. The default config params are: Encrypted Traffic: Stateless L2-3 Cipher Suite: GCM-AES-128 Confidentiality Offset: 0 Encrypted VLANs Enabled: false

func (*Ethernet) WithMTU

func (e *Ethernet) WithMTU(mtu uint16) *Ethernet

WithMTU specifies the MTU in bytes for the interface.

func (*Ethernet) WithVLANID

func (e *Ethernet) WithVLANID(id uint16) *Ethernet

WithVLANID enables a VLAN with a 12-bit specified ID on the interface.

type FEC

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

FEC is a representation of forward error correction settings on an ATE.

func (*FEC) WithEnabled

func (f *FEC) WithEnabled(enabled bool) *FEC

WithEnabled sets whether FEC is enabled.

type IP

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

IP is a representation of IP config on the ATE.

func NewIP

func NewIP(pb *opb.IpConfig) *IP

NewIP returns a new IP configuration. Tests must not call this method directly.

func (*IP) WithAddress

func (i *IP) WithAddress(address string) *IP

WithAddress sets the IP address in CIDR notation.

func (*IP) WithDefaultGateway

func (i *IP) WithDefaultGateway(gateway string) *IP

WithDefaultGateway sets the default gateway.

type IPReachabilityConfig

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

IPReachabilityConfig is the IS-IS config for a simulated network pool. Must be constructed by calling NewIPReachability().

func (*IPReachabilityConfig) WithActive

func (ip *IPReachabilityConfig) WithActive(active bool) *IPReachabilityConfig

WithActive sets whether the prefixes are active.

func (*IPReachabilityConfig) WithFlagExplicitNull

func (ip *IPReachabilityConfig) WithFlagExplicitNull(enabled bool) *IPReachabilityConfig

WithFlagExplicitNull sets the ExplicitNull(E) flag.

func (*IPReachabilityConfig) WithFlagLocal

func (ip *IPReachabilityConfig) WithFlagLocal(enabled bool) *IPReachabilityConfig

WithFlagLocal sets the Local(L) flag.

func (*IPReachabilityConfig) WithFlagNoPHP

func (ip *IPReachabilityConfig) WithFlagNoPHP(enabled bool) *IPReachabilityConfig

WithFlagNoPHP sets the NoPHP(P) flag.

func (*IPReachabilityConfig) WithFlagNodeSID

func (ip *IPReachabilityConfig) WithFlagNodeSID(enabled bool) *IPReachabilityConfig

WithFlagNodeSID sets the NodeSID(N) flag.

func (*IPReachabilityConfig) WithFlagReadvertise

func (ip *IPReachabilityConfig) WithFlagReadvertise(enabled bool) *IPReachabilityConfig

WithFlagReadvertise sets the Readvertise(R) flag.

func (*IPReachabilityConfig) WithFlagValue

func (ip *IPReachabilityConfig) WithFlagValue(enabled bool) *IPReachabilityConfig

WithFlagValue sets the Value(V) flag.

func (*IPReachabilityConfig) WithIPReachabilityAlgorithm

func (ip *IPReachabilityConfig) WithIPReachabilityAlgorithm(algo uint32) *IPReachabilityConfig

WithIPReachabilityAlgorithm sets SR algorithm for the reachable IPs.

func (*IPReachabilityConfig) WithIPReachabilityExternal

func (ip *IPReachabilityConfig) WithIPReachabilityExternal() *IPReachabilityConfig

WithIPReachabilityExternal sets route origin as external.

func (*IPReachabilityConfig) WithIPReachabilityInternal

func (ip *IPReachabilityConfig) WithIPReachabilityInternal() *IPReachabilityConfig

WithIPReachabilityInternal sets route origin as internal.

func (*IPReachabilityConfig) WithIPReachabilityMetric

func (ip *IPReachabilityConfig) WithIPReachabilityMetric(metric uint32) *IPReachabilityConfig

WithIPReachabilityMetric sets metric for the reachable IPs.

func (*IPReachabilityConfig) WithIPReachabilitySIDIndexLabel

func (ip *IPReachabilityConfig) WithIPReachabilitySIDIndexLabel(label uint32) *IPReachabilityConfig

WithIPReachabilitySIDIndexLabel sets SID/Index/Label for the reachable IPs.

func (*IPReachabilityConfig) WithSIDIndexLabelEnabled

func (ip *IPReachabilityConfig) WithSIDIndexLabelEnabled(enabled bool) *IPReachabilityConfig

WithSIDIndexLabelEnabled enables or disables SID/Index/Label for the reachable IPs.

type ISIS

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

ISIS is a representation of a IS-IS config on the ATE. Must be constructed by calling NewISIS().

func NewISIS

func NewISIS(pb *opb.ISISConfig) *ISIS

NewISIS constructs a new ISIS configuration. Tests should not call this directly; call Interface.ISIS() instead.

func (*ISIS) AddISReachability

func (i *ISIS) AddISReachability() *ISReachabilityConfig

AddISReachability adds an ISReachability config to the ISIS config.

func (*ISIS) ClearISReachabilities

func (i *ISIS) ClearISReachabilities() *ISIS

ClearISReachabilities clears ISReachability configs from the ISIS config.

func (*ISIS) SegmentRouting

func (i *ISIS) SegmentRouting() *ISISSegmentRouting

SegmentRouting creates or returns the ISIS Segment Routing configuration.

func (*ISIS) WithAreaAuthDisabled added in v0.1.20

func (i *ISIS) WithAreaAuthDisabled() *ISIS

WithAreaAuthDisabled disables area authentication.

func (*ISIS) WithAreaAuthMD5 added in v0.1.20

func (i *ISIS) WithAreaAuthMD5(key string) *ISIS

WithAreaAuthMD5 sets md5 authentication for area.

func (*ISIS) WithAreaAuthPassword added in v0.1.20

func (i *ISIS) WithAreaAuthPassword(key string) *ISIS

WithAreaAuthPassword sets password authentication for area.

func (*ISIS) WithAreaID

func (i *ISIS) WithAreaID(areaID string) *ISIS

WithAreaID sets the area id for the device.

func (*ISIS) WithAuthDisabled

func (i *ISIS) WithAuthDisabled() *ISIS

WithAuthDisabled disables authentication.

func (*ISIS) WithAuthMD5

func (i *ISIS) WithAuthMD5(key string) *ISIS

WithAuthMD5 sets md5 authentication.

func (*ISIS) WithAuthPassword

func (i *ISIS) WithAuthPassword(key string) *ISIS

WithAuthPassword sets password authentication.

func (*ISIS) WithCapabilityRouterID

func (i *ISIS) WithCapabilityRouterID(routerID string) *ISIS

WithCapabilityRouterID sets the ISIS capability router id.

func (*ISIS) WithDeadInterval

func (i *ISIS) WithDeadInterval(intervalSec uint32) *ISIS

WithDeadInterval sets the interval in seconds before considering that the adjacency is down.

func (*ISIS) WithDomainAuthDisabled added in v0.1.20

func (i *ISIS) WithDomainAuthDisabled() *ISIS

WithDomainAuthDisabled disables domain authentication.

func (*ISIS) WithDomainAuthMD5 added in v0.1.20

func (i *ISIS) WithDomainAuthMD5(key string) *ISIS

WithDomainAuthMD5 sets md5 authentication for domain.

func (*ISIS) WithDomainAuthPassword added in v0.1.20

func (i *ISIS) WithDomainAuthPassword(key string) *ISIS

WithDomainAuthPassword sets password authentication for domain.

func (*ISIS) WithHelloInterval

func (i *ISIS) WithHelloInterval(intervalSec uint32) *ISIS

WithHelloInterval sets the interval in seconds between hello packets.

func (*ISIS) WithHelloPaddingEnabled

func (i *ISIS) WithHelloPaddingEnabled(enabled bool) *ISIS

WithHelloPaddingEnabled sets whether hello padding is enabled.

func (*ISIS) WithLSPsDiscarded

func (i *ISIS) WithLSPsDiscarded(discard bool) *ISIS

WithLSPsDiscarded sets whether to discard learned LSP info.

func (*ISIS) WithLevelL1

func (i *ISIS) WithLevelL1() *ISIS

WithLevelL1 sets the IS-IS level to L1.

func (*ISIS) WithLevelL1L2 added in v0.1.17

func (i *ISIS) WithLevelL1L2() *ISIS

WithLevelL1L2 sets the IS-IS level to L1/L2.

func (*ISIS) WithLevelL2

func (i *ISIS) WithLevelL2() *ISIS

WithLevelL2 sets the IS-IS level to L2.

func (*ISIS) WithMetric

func (i *ISIS) WithMetric(metric uint32) *ISIS

WithMetric sets the IS-IS link metric.

func (*ISIS) WithNetworkTypeBroadcast

func (i *ISIS) WithNetworkTypeBroadcast() *ISIS

WithNetworkTypeBroadcast sets the IS-IS network type to broadcast.

func (*ISIS) WithNetworkTypePointToPoint

func (i *ISIS) WithNetworkTypePointToPoint() *ISIS

WithNetworkTypePointToPoint sets the IS-IS network type to point-to-point.

func (*ISIS) WithPriority

func (i *ISIS) WithPriority(priority uint32) *ISIS

WithPriority sets the priority of the interface.

func (*ISIS) WithTEEnabled

func (i *ISIS) WithTEEnabled(enabled bool) *ISIS

WithTEEnabled sets whether traffic engineering is enabled.

func (*ISIS) WithTERouterID

func (i *ISIS) WithTERouterID(routerID string) *ISIS

WithTERouterID sets the TE router id.

func (*ISIS) WithWideMetricEnabled

func (i *ISIS) WithWideMetricEnabled(enabled bool) *ISIS

WithWideMetricEnabled sets whether the wide metric is enabled.

type ISISNode

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

ISISNode is a representation of a simulated IS-IS node.

func (node *ISISNode) AddLink() *ISISNodeLink

AddLink adds a simulated IS-IS node link.

func (node *ISISNode) ClearLinks() *ISISNode

ClearLinks clears simulated links for an IS-IS node.

func (*ISISNode) RoutesIPv4

func (node *ISISNode) RoutesIPv4() *ISISRoutes

RoutesIPv4 creates or returns the ISIS IPv4 route configuration.

func (*ISISNode) RoutesIPv6

func (node *ISISNode) RoutesIPv6() *ISISRoutes

RoutesIPv6 creates or returns the ISIS IPv6 route configuration.

func (*ISISNode) SegmentRouting

func (node *ISISNode) SegmentRouting() *ISISSegmentRouting

SegmentRouting creates or returns the ISIS Segment Routing configuration for the node.

func (*ISISNode) WithCapabilityRouterID

func (node *ISISNode) WithCapabilityRouterID(id string) *ISISNode

WithCapabilityRouterID sets the capability router ID for the node.

func (*ISISNode) WithEgressMetric

func (node *ISISNode) WithEgressMetric(metric uint32) *ISISNode

WithEgressMetric sets the metric on the egress link.

func (*ISISNode) WithIngressMetric

func (node *ISISNode) WithIngressMetric(metric uint32) *ISISNode

WithIngressMetric sets the metric on the ingress link.

func (*ISISNode) WithSystemID

func (node *ISISNode) WithSystemID(id string) *ISISNode

WithSystemID sets the system id for the simulated node.

func (*ISISNode) WithTEEnabled

func (node *ISISNode) WithTEEnabled(enabled bool) *ISISNode

WithTEEnabled enables TE on the simulated IS-IS node.

func (*ISISNode) WithTERouterID

func (node *ISISNode) WithTERouterID(id string) *ISISNode

WithTERouterID sets the TE router ID for the node.

func (*ISISNode) WithWideMetricEnabled

func (node *ISISNode) WithWideMetricEnabled(enabled bool) *ISISNode

WithWideMetricEnabled enables wide metric on the simulated IS-IS node.

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

ISISNodeLink is a representation of a simulated IS-IS node link.

func (*ISISNodeLink) WithFromIPv4

func (link *ISISNodeLink) WithFromIPv4(ip string) *ISISNodeLink

WithFromIPv4 sets the IPv4 'from' address for the link.

func (*ISISNodeLink) WithFromIPv6

func (link *ISISNodeLink) WithFromIPv6(ip string) *ISISNodeLink

WithFromIPv6 sets the IPv6 'from' address for the link.

func (*ISISNodeLink) WithToIPv4

func (link *ISISNodeLink) WithToIPv4(ip string) *ISISNodeLink

WithToIPv4 sets the IPv4 'to' address for the link.

func (*ISISNodeLink) WithToIPv6

func (link *ISISNodeLink) WithToIPv6(ip string) *ISISNodeLink

WithToIPv6 sets the IPv6 'to' address for the link.

type ISISRoutes

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

ISISRoutes represents the routes exported by an IS-IS node.

func (*ISISRoutes) IPReachability

func (routes *ISISRoutes) IPReachability() *IPReachabilityConfig

IPReachability creates an IP reachability configuration for the network or returns the existing config. The default config params are:

Active: True
Route Origin: Internal
Metric: 10

func (*ISISRoutes) WithNumRoutes

func (routes *ISISRoutes) WithNumRoutes(numRoutes uint64) *ISISRoutes

WithNumRoutes sets the number of exported routes.

func (*ISISRoutes) WithPrefix

func (routes *ISISRoutes) WithPrefix(prefix string) *ISISRoutes

WithPrefix sets the (CIDR-string) prefix for the exported routes.

type ISISSegmentRouting

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

ISISSegmentRouting holds the segment routing configuration.

func (*ISISSegmentRouting) AddSRGBRange

func (sr *ISISSegmentRouting) AddSRGBRange() *SIDRange

AddSRGBRange adds a SRGB range.

func (*ISISSegmentRouting) AddSRLBRange

func (sr *ISISSegmentRouting) AddSRLBRange() *SIDRange

AddSRLBRange adds a SRLB range.

func (*ISISSegmentRouting) AdjacencySID

func (sr *ISISSegmentRouting) AdjacencySID() *AdjacencySID

AdjacencySID gets or creates an AdjacencySID configuration with Local(L) and Value(V) flags set.

func (*ISISSegmentRouting) ClearSRGBRanges

func (sr *ISISSegmentRouting) ClearSRGBRanges() *ISISSegmentRouting

ClearSRGBRanges clears SRGB ranges.

func (*ISISSegmentRouting) ClearSRLBRanges

func (sr *ISISSegmentRouting) ClearSRLBRanges() *ISISSegmentRouting

ClearSRLBRanges clears SRLB ranges.

func (*ISISSegmentRouting) WithAlgorithms

func (sr *ISISSegmentRouting) WithAlgorithms(algos ...uint32) *ISISSegmentRouting

WithAlgorithms sets the SR algorithms.

func (*ISISSegmentRouting) WithEnabled

func (sr *ISISSegmentRouting) WithEnabled(enabled bool) *ISISSegmentRouting

WithEnabled sets whether segment routing is enabled.

func (*ISISSegmentRouting) WithFlagExplicitNull

func (sr *ISISSegmentRouting) WithFlagExplicitNull(enabled bool) *ISISSegmentRouting

WithFlagExplicitNull sets the ExplicitNull(E) flag.

func (*ISISSegmentRouting) WithFlagLocal

func (sr *ISISSegmentRouting) WithFlagLocal(enabled bool) *ISISSegmentRouting

WithFlagLocal sets the Local(L) flag.

func (*ISISSegmentRouting) WithFlagNoPHP

func (sr *ISISSegmentRouting) WithFlagNoPHP(enabled bool) *ISISSegmentRouting

WithFlagNoPHP sets the NoPHP(P) flag.

func (*ISISSegmentRouting) WithFlagNodeSID

func (sr *ISISSegmentRouting) WithFlagNodeSID(enabled bool) *ISISSegmentRouting

WithFlagNodeSID sets the NodeSID(N) flag.

func (*ISISSegmentRouting) WithFlagReadvertise

func (sr *ISISSegmentRouting) WithFlagReadvertise(enabled bool) *ISISSegmentRouting

WithFlagReadvertise sets the Readvertise(R) flag.

func (*ISISSegmentRouting) WithFlagValue

func (sr *ISISSegmentRouting) WithFlagValue(enabled bool) *ISISSegmentRouting

WithFlagValue sets the Value(V) flag.

func (*ISISSegmentRouting) WithPrefixSID

func (sr *ISISSegmentRouting) WithPrefixSID(sid string) *ISISSegmentRouting

WithPrefixSID sets the prefix SID, specified in CIDR notation.

func (*ISISSegmentRouting) WithSIDIndexLabel

func (sr *ISISSegmentRouting) WithSIDIndexLabel(label uint32) *ISISSegmentRouting

WithSIDIndexLabel sets the SID index label.

type ISReachabilityConfig

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

ISReachabilityConfig is a representation of the simulated topology of IS-IS nodes.

func (*ISReachabilityConfig) AddISISNode

func (ir *ISReachabilityConfig) AddISISNode() *ISISNode

AddISISNode adds a simulated IS-IS node with ingress/egress metrics defaulted to 10.

func (*ISReachabilityConfig) ClearISISNodes

func (ir *ISReachabilityConfig) ClearISISNodes() *ISReachabilityConfig

ClearISISNodes clears simulated IS-IS nodes.

func (*ISReachabilityConfig) WithName

func (ir *ISReachabilityConfig) WithName(name string) *ISReachabilityConfig

WithName assigns a name to the IS-IS reachability config. It should be unique among all reachability configs on the interface.

type ImportedBGPRoutes

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

ImportedBGPRoutes is the config for importing existing route tables into a network.

func (*ImportedBGPRoutes) WithIPv4RoutesPath

func (i *ImportedBGPRoutes) WithIPv4RoutesPath(path string) *ImportedBGPRoutes

WithIPv4RoutesPath sets the path for a file containing a BGP IPv4 route table.

func (*ImportedBGPRoutes) WithIPv6RoutesPath

func (i *ImportedBGPRoutes) WithIPv6RoutesPath(path string) *ImportedBGPRoutes

WithIPv6RoutesPath sets the path for a file containing a BGP IPv6 route table.

func (*ImportedBGPRoutes) WithNexthopOverwrite

func (i *ImportedBGPRoutes) WithNexthopOverwrite(enabled bool) *ImportedBGPRoutes

WithNexthopOverwrite specifies whether nexthops will be overwritten.

func (*ImportedBGPRoutes) WithRouteTableFormatCSV

func (i *ImportedBGPRoutes) WithRouteTableFormatCSV() *ImportedBGPRoutes

WithRouteTableFormatCSV sets CSV(IXIA) as the expected route table format of the specified routes.

func (*ImportedBGPRoutes) WithRouteTableFormatCisco

func (i *ImportedBGPRoutes) WithRouteTableFormatCisco() *ImportedBGPRoutes

WithRouteTableFormatCisco sets Cisco as the expected route table format of the specified routes.

func (*ImportedBGPRoutes) WithRouteTableFormatJuniper

func (i *ImportedBGPRoutes) WithRouteTableFormatJuniper() *ImportedBGPRoutes

WithRouteTableFormatJuniper sets Juniper as the expected route table format of the specified routes.

type MACsec

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

MACsec is a representation of MACsec config on an ATE.

func (*MACsec) MKA

func (m *MACsec) MKA() *MKA

MKA creates an MKA protocol for a MACsec configuration or returns the existing config. The default config params are:

Capability: Not implemented
Cipher Suite: GCM-AES-128
Confidentiality Offset: No confidentiality

func (*MACsec) RxSAKPool

func (m *MACsec) RxSAKPool() *RxSAKPool

RxSAKPool create an Rx SAK Pool or returns the existing pool.

func (*MACsec) WithCipherSuiteAES128

func (m *MACsec) WithCipherSuiteAES128() *MACsec

WithCipherSuiteAES128 sets the cipher suite to be GCM-AES-128.

func (*MACsec) WithCipherSuiteAES256

func (m *MACsec) WithCipherSuiteAES256() *MACsec

WithCipherSuiteAES256 sets the cipher suite to be GCM-AES-256.

func (*MACsec) WithCipherSuiteAESXPN128

func (m *MACsec) WithCipherSuiteAESXPN128() *MACsec

WithCipherSuiteAESXPN128 sets the cipher suite to be GCM-AES-XPN-128.

func (*MACsec) WithCipherSuiteAESXPN256

func (m *MACsec) WithCipherSuiteAESXPN256() *MACsec

WithCipherSuiteAESXPN256 sets the cipher suite to be GCM-AES-XPN-256.

func (*MACsec) WithEncryptedVLANsEnabled

func (m *MACsec) WithEncryptedVLANsEnabled(enabled bool) *MACsec

WithEncryptedVLANsEnabled sets whether encrypted VLANS are enabled.

type MKA

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

MKA is a representation of the MACSec Key Agreement protocol on an ATE.

func (*MKA) ConnectivityAssociation

func (m *MKA) ConnectivityAssociation() *ConnectivityAssociation

ConnectivityAssociation creates a ConnectivityAssociation config for an MKA protocol or returns the existing config.

func (*MKA) WithCapabilityIntegrityWithConfidentialityOffset

func (m *MKA) WithCapabilityIntegrityWithConfidentialityOffset() *MKA

WithCapabilityIntegrityWithConfidentialityOffset sets the MKA protocol to indicate the confidentiality with offset MacSec capability.

func (*MKA) WithCapabilityIntegrityWithNoConfidentialityOffset

func (m *MKA) WithCapabilityIntegrityWithNoConfidentialityOffset() *MKA

WithCapabilityIntegrityWithNoConfidentialityOffset sets the MKA protocol to indicate the confidentiality without offset MacSec capability.

func (*MKA) WithCapabilityIntegrityWithoutConfidentiality

func (m *MKA) WithCapabilityIntegrityWithoutConfidentiality() *MKA

WithCapabilityIntegrityWithoutConfidentiality sets the MKA protocol to indicate the integrity without confidentiality MacSec capability.

func (*MKA) WithCapabilityNotImplemented

func (m *MKA) WithCapabilityNotImplemented() *MKA

WithCapabilityNotImplemented sets the MKA protocol to not indicate any MacSec capability.

func (*MKA) WithCipherSuiteAES128

func (m *MKA) WithCipherSuiteAES128() *MKA

WithCipherSuiteAES128 sets the cipher suite to be GCM-AES-128.

func (*MKA) WithCipherSuiteAES256

func (m *MKA) WithCipherSuiteAES256() *MKA

WithCipherSuiteAES256 sets the cipher suite to be GCM-AES-256.

func (*MKA) WithCipherSuiteAESXPN128

func (m *MKA) WithCipherSuiteAESXPN128() *MKA

WithCipherSuiteAESXPN128 sets the cipher suite to be GCM-AES-XPN-128.

func (*MKA) WithCipherSuiteAESXPN256

func (m *MKA) WithCipherSuiteAESXPN256() *MKA

WithCipherSuiteAESXPN256 sets the cipher suite to be GCM-AES-XPN-256.

func (*MKA) WithConfidentialityOffset0

func (m *MKA) WithConfidentialityOffset0() *MKA

WithConfidentialityOffset0 sets the confidentiality offset to be 0.

func (*MKA) WithConfidentialityOffset30

func (m *MKA) WithConfidentialityOffset30() *MKA

WithConfidentialityOffset30 sets the confidentiality offset to be 30.

func (*MKA) WithConfidentialityOffset50

func (m *MKA) WithConfidentialityOffset50() *MKA

WithConfidentialityOffset50 sets the confidentiality offset to be 50.

func (*MKA) WithConfidentialityOffsetNoConfidentiality

func (m *MKA) WithConfidentialityOffsetNoConfidentiality() *MKA

WithConfidentialityOffsetNoConfidentiality sets the confidentiality offset to indicate no confidentiality.

func (*MKA) WithVersion

func (m *MKA) WithVersion(version uint32) *MKA

WithVersion specifies the MKA protocol version.

type Network

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

Network is a group of simulated device interfaces.

func NewNetwork

func NewNetwork(pb *opb.Network) *Network

NewNetwork constructs a new Network configuration. Tests should not call this directly; call Interface.AddNetwork instead.

func (*Network) BGP

func (n *Network) BGP() *BGPAttributes

BGP creates a BGP config for the network or returns the existing config. By default, the network will advertise IPv4 routes over the BGP V4 peer and advertise IPv6 routes over the V6 peer and have the following configuration:

Active: true
Origin: IGP
ASN set mode: AS-SEQ

func (*Network) EndpointPB

func (n *Network) EndpointPB() *opb.Flow_Endpoint

EndpointPB returns the Network config as an endpoint proto message.

func (*Network) Ethernet

func (n *Network) Ethernet() *NetworkEthernet

Ethernet creates an Ethernet config for the network or returns the existing config. The default count of MAC addresses in the network is 1.

func (*Network) IPv4

func (n *Network) IPv4() *NetworkIP

IPv4 creates an IPv4 config for the network or returns the existing config. The default count of IP addresses in the network is 1.

func (*Network) IPv6

func (n *Network) IPv6() *NetworkIP

IPv6 creates an IPv6 config for the network or returns the existing config. The default count of IP addresses in the network is 1.

func (*Network) ISIS

func (n *Network) ISIS() *IPReachabilityConfig

ISIS creates an ISIS configuration for the network or returns the existing config. The default config params are Active: true, Route Origin: Internal and Metric: 10

func (*Network) ImportedBGPRoutes

func (n *Network) ImportedBGPRoutes() *ImportedBGPRoutes

ImportedBGPRoutes creates a BGP route import configuration for the network or returns the existing config. The nexthop is overwritten by default.

type NetworkEthernet

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

NetworkEthernet is the Ethernet config of a network.

func (*NetworkEthernet) WithCount

func (e *NetworkEthernet) WithCount(count uint32) *NetworkEthernet

WithCount sets the count of MAC addressses.

func (*NetworkEthernet) WithMACAddress

func (e *NetworkEthernet) WithMACAddress(address string) *NetworkEthernet

WithMACAddress sets the first MAC address.

func (*NetworkEthernet) WithVLANID

func (e *NetworkEthernet) WithVLANID(id uint16) *NetworkEthernet

WithVLANID enables a VLAN with a 12-bit specified ID on the interface.

type NetworkIP

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

NetworkIP is the Network config of a network.

func (*NetworkIP) Address

func (i *NetworkIP) Address() string

Address returns the currently configured address.

func (*NetworkIP) Count

func (i *NetworkIP) Count() uint32

Count returns the currently configured address count.

func (*NetworkIP) WithAddress

func (i *NetworkIP) WithAddress(address string) *NetworkIP

WithAddress sets the first IP address in CIDR notation.

func (*NetworkIP) WithCount

func (i *NetworkIP) WithCount(count uint32) *NetworkIP

WithCount sets the count of IP addressses.

type RSVP

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

RSVP represents an RSVP config on an ATE. Must be constructed by calling NewRSVP().

func NewRSVP

func NewRSVP(pb *opb.RsvpConfig) *RSVP

NewRSVP returns a new RSVP configuration. Tests should not call this directly; call Interface.AddRSVP() instead.

func (*RSVP) AddLoopback

func (r *RSVP) AddLoopback() *RSVPLoopback

AddLoopback adds a loopback address for the RSVP instance.

func (*RSVP) EndpointPB

func (r *RSVP) EndpointPB() *opb.Flow_Endpoint

EndpointPB returns the RSVP config as an endpoint proto message.

func (*RSVP) WithBundleMessageSending

func (r *RSVP) WithBundleMessageSending(enable bool) *RSVP

WithBundleMessageSending enables or disables bundle messaging for the RSVP interface.

func (*RSVP) WithISISReachability

func (r *RSVP) WithISISReachability(isr string) *RSVP

WithISISReachability configures which IS-IS reachability config defines the routes available for LSPs.

func (*RSVP) WithRefreshReduction

func (r *RSVP) WithRefreshReduction(enable bool) *RSVP

WithRefreshReduction enables or disables refresh reduction for the RSVP interface.

type RSVPIngressLSP

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

RSVPIngressLSP respresents an ingress LSP on an RSVP configuration

func (*RSVPIngressLSP) AddERO

func (r *RSVPIngressLSP) AddERO() *RSVPIngressLSPERO

AddERO adds an ERO for the RSVP ingress LSP.

func (*RSVPIngressLSP) AddRRO

func (r *RSVPIngressLSP) AddRRO() *RSVPIngressLSPRRO

AddRRO adds an RRO for the RSVP ingress LSP.

func (*RSVPIngressLSP) WithBandwidthProtection

func (r *RSVPIngressLSP) WithBandwidthProtection(enable bool) *RSVPIngressLSP

WithBandwidthProtection enables or disables bandwidth protection for the RSVP ingress LSP.

func (*RSVPIngressLSP) WithFastReroute

func (r *RSVPIngressLSP) WithFastReroute(enable bool) *RSVPIngressLSP

WithFastReroute enables or disables fast reroute for the RSVP ingress LSP.

func (*RSVPIngressLSP) WithLSPID

func (r *RSVPIngressLSP) WithLSPID(id uint16) *RSVPIngressLSP

WithLSPID sets the LSP ID for the RSVP ingress LSP.

func (*RSVPIngressLSP) WithLocalProtection

func (r *RSVPIngressLSP) WithLocalProtection(enable bool) *RSVPIngressLSP

WithLocalProtection enables or disables local protection for the RSVP ingress LSP.

func (*RSVPIngressLSP) WithPathReoptimization

func (r *RSVPIngressLSP) WithPathReoptimization(enable bool) *RSVPIngressLSP

WithPathReoptimization enables or disables path re-optimization for the RSVP ingress LSP.

func (*RSVPIngressLSP) WithRemoteIP

func (r *RSVPIngressLSP) WithRemoteIP(ipv4CIDR string) *RSVPIngressLSP

WithRemoteIP configures the remote address for the RSVP ingress LSP.

func (*RSVPIngressLSP) WithTunnelID

func (r *RSVPIngressLSP) WithTunnelID(id uint16) *RSVPIngressLSP

WithTunnelID sets the tunnel ID for the RSVP ingress LSP.

type RSVPIngressLSPERO

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

RSVPIngressLSPERO represents an explicit route object for an RSVP ingress LSP.

func (*RSVPIngressLSPERO) WithIP

func (r *RSVPIngressLSPERO) WithIP(ipv4CIDR string) *RSVPIngressLSPERO

WithIP configures the address for the RSVP ingress LSP ERO.

type RSVPIngressLSPRRO

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

RSVPIngressLSPRRO represents a record route object for an RSVP ingress LSP.

func (*RSVPIngressLSPRRO) WithIP

func (r *RSVPIngressLSPRRO) WithIP(ipv4 string) *RSVPIngressLSPRRO

WithIP configures the address for the RSVP ingress LSP RRO.

type RSVPLoopback

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

RSVPLoopback represents a simulated loopback interface for RSVP configuration.

func (*RSVPLoopback) AddIngressLSP

func (r *RSVPLoopback) AddIngressLSP() *RSVPIngressLSP

AddIngressLSP adds an ingress LSP for the RSVP loopback.

func (*RSVPLoopback) WithLocalIP

func (r *RSVPLoopback) WithLocalIP(ipv4CIDR string) *RSVPLoopback

WithLocalIP configures the local loopback address for the RSVP loopback instance.

type RxSAKPool

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

RxSAKPool is a representation of an Rx SAK Pool in MACsec.

func (*RxSAKPool) WithSAK128

func (r *RxSAKPool) WithSAK128(sak string) *RxSAKPool

WithSAK128 specifies the 128-bit receive SAK in the Rx SAK pool.

func (*RxSAKPool) WithSAK256

func (r *RxSAKPool) WithSAK256(sak string) *RxSAKPool

WithSAK256 specifies the 256-bit receive SAK in the Rx SAK pool.

type SIDRange

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

SIDRange holds the SR range configuration.

func (*SIDRange) WithSIDCount

func (srr *SIDRange) WithSIDCount(c uint32) *SIDRange

WithSIDCount sets the count of the SID labels.

func (*SIDRange) WithSIDStartLabel

func (srr *SIDRange) WithSIDStartLabel(label uint32) *SIDRange

WithSIDStartLabel sets the SID start label.

type StringIncRange

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

StringIncRange is an range of strings that increments by a fixed step.

func NewStringIncRange

func NewStringIncRange(pb *opb.StringIncRange) *StringIncRange

NewStringIncRange returns a new StringIncRange. Tests should not call this method directly.

func (*StringIncRange) WithStart

func (r *StringIncRange) WithStart(start string) *StringIncRange

WithStart sets the start of the range.

func (*StringIncRange) WithStep

func (r *StringIncRange) WithStep(step string) *StringIncRange

WithStep sets the step between values in the range.

type UInt32IncRange

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

UInt32IncRange is an range of 32-bit integers that increments by a fixed step.

func NewUInt32IncRange

func NewUInt32IncRange(pb *opb.UInt32IncRange) *UInt32IncRange

NewUInt32IncRange returns a new UInt32IncRange. Tests should not call this method directly.

func (*UInt32IncRange) WithStart

func (r *UInt32IncRange) WithStart(start uint32) *UInt32IncRange

WithStart sets the start of the range.

func (*UInt32IncRange) WithStep

func (r *UInt32IncRange) WithStep(step uint32) *UInt32IncRange

WithStep sets the step between values in the range.

type UIntRange

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

UIntRange is a range of unsigned integers.

func NewUIntRange

func NewUIntRange(pb *opb.UIntRange) *UIntRange

NewUIntRange returns a new UIntRange. Tests should not call this method directly.

func (*UIntRange) WithCount

func (r *UIntRange) WithCount(count uint32) *UIntRange

WithCount sets the number of values in the range; must not be zero.

func (*UIntRange) WithMax

func (r *UIntRange) WithMax(max uint32) *UIntRange

WithMax sets the maximum value of the range.

func (*UIntRange) WithMin

func (r *UIntRange) WithMin(min uint32) *UIntRange

WithMin sets the minimum value of the range.

func (*UIntRange) WithRandom

func (r *UIntRange) WithRandom() *UIntRange

WithRandom sets the values in the range to be chosen randomly.

func (*UIntRange) WithStep

func (r *UIntRange) WithStep(step uint32) *UIntRange

WithStep sets the distance between adjacent values in the range; must not be zero.

Jump to

Keyboard shortcuts

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