apiutil

package
v0.0.0-...-4a05471 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNativeNlri

func GetNativeNlri(p *api.Path) (bgp.AddrPrefixInterface, error)

GetNativeNlri creates an address prefix from a path

func GetNativePathAttributes

func GetNativePathAttributes(p *api.Path) ([]bgp.PathAttributeInterface, error)

GetNativePathAttributes gets the path attributes from a path

func MarshalCapabilities

func MarshalCapabilities(values []bgp.ParameterCapabilityInterface) ([]*any.Any, error)

MarshalCapabilities serializes a list of capability interfaces

func MarshalCapability

func MarshalCapability(value bgp.ParameterCapabilityInterface) (*any.Any, error)

MarshalCapability serializes a capability interface

func MarshalFlowSpecRules

func MarshalFlowSpecRules(values []bgp.FlowSpecComponentInterface) []*any.Any

MarshalFlowSpecRules serializes flow spec rules

func MarshalNLRI

func MarshalNLRI(value bgp.AddrPrefixInterface) *any.Any

MarshalNLRI serializes something

func MarshalNLRIs

func MarshalNLRIs(values []bgp.AddrPrefixInterface) []*any.Any

MarshalNLRIs serializes something

func MarshalPathAttributes

func MarshalPathAttributes(attrList []bgp.PathAttributeInterface) []*any.Any

MarshalPathAttributes serializes a path attribute

func MarshalRD

func MarshalRD(rd bgp.RouteDistinguisherInterface) *any.Any

MarshalRD serializes a route distinguisher interface

func MarshalRT

func MarshalRT(rt bgp.ExtendedCommunityInterface) *any.Any

MarshalRT serializes extended communities

func MarshalRTs

func MarshalRTs(values []bgp.ExtendedCommunityInterface) []*any.Any

MarshalRTs serializes a list of extended communities

func NewAddPathCapability

func NewAddPathCapability(a *bgp.CapAddPath) *api.AddPathCapability

NewAddPathCapability creates a add path capability

func NewAggregatorAttributeFromNative

func NewAggregatorAttributeFromNative(a *bgp.PathAttributeAggregator) *api.AggregatorAttribute

NewAggregatorAttributeFromNative creates a new aggregator attribute

func NewAigpAttributeFromNative

func NewAigpAttributeFromNative(a *bgp.PathAttributeAigp) *api.AigpAttribute

NewAigpAttributeFromNative creates a new aigp path attribute

func NewAs4AggregatorAttributeFromNative

func NewAs4AggregatorAttributeFromNative(a *bgp.PathAttributeAs4Aggregator) *api.As4AggregatorAttribute

NewAs4AggregatorAttributeFromNative creates a new aggregator path attribute

func NewAs4PathAttributeFromNative

func NewAs4PathAttributeFromNative(a *bgp.PathAttributeAs4Path) *api.As4PathAttribute

NewAs4PathAttributeFromNative creates a new path attribute

func NewAsPathAttributeFromNative

func NewAsPathAttributeFromNative(a *bgp.PathAttributeAsPath) *api.AsPathAttribute

NewAsPathAttributeFromNative creates a new as path attribute

func NewAtomicAggregateAttributeFromNative

func NewAtomicAggregateAttributeFromNative(a *bgp.PathAttributeAtomicAggregate) *api.AtomicAggregateAttribute

NewAtomicAggregateAttributeFromNative creates a new atomic aggregate attribute

func NewCarryingLabelInfoCapability

func NewCarryingLabelInfoCapability(a *bgp.CapCarryingLabelInfo) *api.CarryingLabelInfoCapability

NewCarryingLabelInfoCapability creates a new capability

func NewClusterListAttributeFromNative

func NewClusterListAttributeFromNative(a *bgp.PathAttributeClusterList) *api.ClusterListAttribute

NewClusterListAttributeFromNative creates a new cluster list attribute

func NewCommunitiesAttributeFromNative

func NewCommunitiesAttributeFromNative(a *bgp.PathAttributeCommunities) *api.CommunitiesAttribute

NewCommunitiesAttributeFromNative creates a new communities attribute

func NewEnhancedRouteRefreshCapability

func NewEnhancedRouteRefreshCapability(a *bgp.CapEnhancedRouteRefresh) *api.EnhancedRouteRefreshCapability

NewEnhancedRouteRefreshCapability creates a new capability

func NewEthernetSegmentIdentifierFromNative

func NewEthernetSegmentIdentifierFromNative(a *bgp.EthernetSegmentIdentifier) *api.EthernetSegmentIdentifier

NewEthernetSegmentIdentifierFromNative creates a new ethernet segment identifier

func NewExtendedCommunitiesAttributeFromNative

func NewExtendedCommunitiesAttributeFromNative(a *bgp.PathAttributeExtendedCommunities) *api.ExtendedCommunitiesAttribute

NewExtendedCommunitiesAttributeFromNative creates an extended communities path attribute

func NewExtendedNexthopCapability

func NewExtendedNexthopCapability(a *bgp.CapExtendedNexthop) *api.ExtendedNexthopCapability

NewExtendedNexthopCapability creates a new extended capability

func NewFourOctetASNumberCapability

func NewFourOctetASNumberCapability(a *bgp.CapFourOctetASNumber) *api.FourOctetASNumberCapability

NewFourOctetASNumberCapability creates new 32bit ASN capabiliy

func NewGracefulRestartCapability

func NewGracefulRestartCapability(a *bgp.CapGracefulRestart) *api.GracefulRestartCapability

NewGracefulRestartCapability creates a new graceful resetart capabilty

func NewIP6ExtendedCommunitiesAttributeFromNative

func NewIP6ExtendedCommunitiesAttributeFromNative(a *bgp.PathAttributeIP6ExtendedCommunities) *api.IP6ExtendedCommunitiesAttribute

NewIP6ExtendedCommunitiesAttributeFromNative creates a new IPv6 extended communities attribute

func NewLargeCommunitiesAttributeFromNative

func NewLargeCommunitiesAttributeFromNative(a *bgp.PathAttributeLargeCommunities) *api.LargeCommunitiesAttribute

NewLargeCommunitiesAttributeFromNative creates a new large communities attribute

func NewLocalPrefAttributeFromNative

func NewLocalPrefAttributeFromNative(a *bgp.PathAttributeLocalPref) *api.LocalPrefAttribute

NewLocalPrefAttributeFromNative creates a new local pref attribute

func NewLongLivedGracefulRestartCapability

func NewLongLivedGracefulRestartCapability(a *bgp.CapLongLivedGracefulRestart) *api.LongLivedGracefulRestartCapability

NewLongLivedGracefulRestartCapability creates a new capability

func NewMpReachNLRIAttributeFromNative

func NewMpReachNLRIAttributeFromNative(a *bgp.PathAttributeMpReachNLRI) *api.MpReachNLRIAttribute

NewMpReachNLRIAttributeFromNative creates a new path attribute

func NewMpUnreachNLRIAttributeFromNative

func NewMpUnreachNLRIAttributeFromNative(a *bgp.PathAttributeMpUnreachNLRI) *api.MpUnreachNLRIAttribute

NewMpUnreachNLRIAttributeFromNative creates a new path attribute

func NewMultiExitDiscAttributeFromNative

func NewMultiExitDiscAttributeFromNative(a *bgp.PathAttributeMultiExitDisc) *api.MultiExitDiscAttribute

NewMultiExitDiscAttributeFromNative creates a new multi exit attribute

func NewMultiProtocolCapability

func NewMultiProtocolCapability(a *bgp.CapMultiProtocol) *api.MultiProtocolCapability

NewMultiProtocolCapability creates a new multi protocol capability

func NewNextHopAttributeFromNative

func NewNextHopAttributeFromNative(a *bgp.PathAttributeNextHop) *api.NextHopAttribute

NewNextHopAttributeFromNative creates a new next hop attribute

func NewOriginAttributeFromNative

func NewOriginAttributeFromNative(a *bgp.PathAttributeOrigin) *api.OriginAttribute

NewOriginAttributeFromNative creates a new origin attribute

func NewOriginatorIDAttributeFromNative

func NewOriginatorIDAttributeFromNative(a *bgp.PathAttributeOriginatorId) *api.OriginatorIdAttribute

NewOriginatorIDAttributeFromNative creates a new origin ID attribute

func NewPath

func NewPath(nlri bgp.AddrPrefixInterface, isWithdraw bool, attrs []bgp.PathAttributeInterface, age time.Time) *api.Path

NewPath creates a new path

func NewPmsiTunnelAttributeFromNative

func NewPmsiTunnelAttributeFromNative(a *bgp.PathAttributePmsiTunnel) *api.PmsiTunnelAttribute

NewPmsiTunnelAttributeFromNative creates a new tunnel path attribute

func NewRouteRefreshCapability

func NewRouteRefreshCapability(a *bgp.CapRouteRefresh) *api.RouteRefreshCapability

NewRouteRefreshCapability creates a new capability

func NewRouteRefreshCiscoCapability

func NewRouteRefreshCiscoCapability(a *bgp.CapRouteRefreshCisco) *api.RouteRefreshCiscoCapability

NewRouteRefreshCiscoCapability creates a new capability

func NewTunnelEncapAttributeFromNative

func NewTunnelEncapAttributeFromNative(a *bgp.PathAttributeTunnelEncap) *api.TunnelEncapAttribute

NewTunnelEncapAttributeFromNative creates a new tunnel path attribute

func NewUnknownAttributeFromNative

func NewUnknownAttributeFromNative(a *bgp.PathAttributeUnknown) *api.UnknownAttribute

NewUnknownAttributeFromNative creates a new unknown path attribute

func NewUnknownCapability

func NewUnknownCapability(a *bgp.CapUnknown) *api.UnknownCapability

NewUnknownCapability creates a new unknown capability

func ToAPIFamily

func ToAPIFamily(afi uint16, safi uint8) *api.Family

ToAPIFamily makes an API Family from a route family

func ToRouteFamily

func ToRouteFamily(f *api.Family) bgp.RouteFamily

ToRouteFamily makes an route family from an API family

func UnmarshalAttribute

func UnmarshalAttribute(an *any.Any) (bgp.PathAttributeInterface, error)

UnmarshalAttribute unmarshals an attribute

func UnmarshalCapabilities

func UnmarshalCapabilities(values []*any.Any) ([]bgp.ParameterCapabilityInterface, error)

UnmarshalCapabilities deserializes a list of capabilities

func UnmarshalFlowSpecRules

func UnmarshalFlowSpecRules(values []*any.Any) ([]bgp.FlowSpecComponentInterface, error)

UnmarshalFlowSpecRules deserializes flow spec rules

func UnmarshalNLRI

func UnmarshalNLRI(rf bgp.RouteFamily, an *any.Any) (bgp.AddrPrefixInterface, error)

UnmarshalNLRI deserializes something

func UnmarshalNLRIs

func UnmarshalNLRIs(rf bgp.RouteFamily, values []*any.Any) ([]bgp.AddrPrefixInterface, error)

UnmarshalNLRIs deserializes NLRIs (whatever this is)

func UnmarshalPathAttributes

func UnmarshalPathAttributes(values []*any.Any) ([]bgp.PathAttributeInterface, error)

UnmarshalPathAttributes deserializes a path attribute

func UnmarshalRD

func UnmarshalRD(a *any.Any) (bgp.RouteDistinguisherInterface, error)

UnmarshalRD deserializes anything into a route distinguisher interface

func UnmarshalRT

func UnmarshalRT(a *any.Any) (bgp.ExtendedCommunityInterface, error)

UnmarshalRT deserializes extended communities

func UnmarshalRTs

func UnmarshalRTs(values []*any.Any) ([]bgp.ExtendedCommunityInterface, error)

UnmarshalRTs deserializes a list of extended communities

Types

type Destination

type Destination struct {
	Paths []*Path
}

Destination contains a list of paths

func NewDestination

func NewDestination(dst *api.Destination) *Destination

NewDestination creates a new destination

func (*Destination) MarshalJSON

func (d *Destination) MarshalJSON() ([]byte, error)

MarshalJSON serializes a destination

type Path

type Path struct {
	Nlri       bgp.AddrPrefixInterface      `json:"nlri"`
	Age        int64                        `json:"age"`
	Best       bool                         `json:"best"`
	Attrs      []bgp.PathAttributeInterface `json:"attrs"`
	Stale      bool                         `json:"stale"`
	Withdrawal bool                         `json:"withdrawal,omitempty"`
	SourceID   net.IP                       `json:"source-id,omitempty"`
	NeighborIP net.IP                       `json:"neighbor-ip,omitempty"`
}

Path structure: This is a workaround. This for the json format compatibility. Once we update senario tests, we can remove this.

Jump to

Keyboard shortcuts

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