apiutil

package
v3.25.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNativeNlri

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

func GetNativePathAttributes

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

func MarshalCapabilities

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

func MarshalCapability

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

func MarshalFlowSpecRules

func MarshalFlowSpecRules(values []bgp.FlowSpecComponentInterface) ([]*apb.Any, error)

func MarshalLsBgpPeerSegmentSid added in v3.11.0

func MarshalLsBgpPeerSegmentSid(n *bgp.LsBgpPeerSegmentSID) (*api.LsBgpPeerSegmentSID, error)

func MarshalLsLinkDescriptor

func MarshalLsLinkDescriptor(n *bgp.LsLinkDescriptor) (*api.LsLinkDescriptor, error)

func MarshalLsLinkNLRI

func MarshalLsLinkNLRI(n *bgp.LsLinkNLRI) (*apb.Any, error)

func MarshalLsNodeDescriptor

func MarshalLsNodeDescriptor(d *bgp.LsNodeDescriptor) (*api.LsNodeDescriptor, error)

func MarshalLsNodeNLRI

func MarshalLsNodeNLRI(n *bgp.LsNodeNLRI) (*apb.Any, error)

func MarshalLsPrefixDescriptor

func MarshalLsPrefixDescriptor(d *bgp.LsPrefixDescriptor) (*api.LsPrefixDescriptor, error)

func MarshalLsPrefixV4NLRI

func MarshalLsPrefixV4NLRI(n *bgp.LsPrefixV4NLRI) (*apb.Any, error)

func MarshalLsPrefixV6NLRI

func MarshalLsPrefixV6NLRI(n *bgp.LsPrefixV6NLRI) (*apb.Any, error)

func MarshalNLRI

func MarshalNLRI(value bgp.AddrPrefixInterface) (*apb.Any, error)

func MarshalNLRIs

func MarshalNLRIs(values []bgp.AddrPrefixInterface) ([]*apb.Any, error)

func MarshalPathAttributes

func MarshalPathAttributes(attrList []bgp.PathAttributeInterface) ([]*apb.Any, error)

func MarshalRD

func MarshalRD(rd bgp.RouteDistinguisherInterface) (*apb.Any, error)

func MarshalRT

func MarshalRT(rt bgp.ExtendedCommunityInterface) (*apb.Any, error)

func MarshalRTs

func MarshalRTs(values []bgp.ExtendedCommunityInterface) ([]*apb.Any, error)

func MarshalSRBSID

func MarshalSRBSID(bsid *bgp.TunnelEncapSubTLVSRBSID) (*apb.Any, error)

MarshalSRBSID marshals SR Policy Binding SID Sub TLV structure

func MarshalSRSegments

func MarshalSRSegments(segs []bgp.TunnelEncapSubTLVInterface) ([]*apb.Any, error)

MarshalSRSegments marshals a slice of SR Policy Segment List

func MarshalSRv6SubSubTLVs

func MarshalSRv6SubSubTLVs(tlvs []bgp.PrefixSIDTLVInterface) (map[uint32]*api.SRv6TLV, error)

func MarshalSRv6SubTLVs

func MarshalSRv6SubTLVs(tlvs []bgp.PrefixSIDTLVInterface) (map[uint32]*api.SRv6TLV, error)

func MarshalSRv6TLVs

func MarshalSRv6TLVs(tlvs []bgp.PrefixSIDTLVInterface) ([]*apb.Any, error)

func NewAddPathCapability

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

func NewAggregatorAttributeFromNative

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

func NewAigpAttributeFromNative

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

func NewAs4PathAttributeFromNative

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

func NewAsPathAttributeFromNative

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

func NewClusterListAttributeFromNative

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

func NewCommunitiesAttributeFromNative

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

func NewFQDNCapability

func NewFQDNCapability(a *bgp.CapFQDN) *api.FqdnCapability

func NewLocalPrefAttributeFromNative

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

func NewLsAttributeFromNative

func NewLsAttributeFromNative(a *bgp.PathAttributeLs) (*api.LsAttribute, error)

func NewMpReachNLRIAttributeFromNative

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

func NewMultiProtocolCapability

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

func NewNextHopAttributeFromNative

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

func NewOriginAttributeFromNative

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

func NewPath

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

func NewPmsiTunnelAttributeFromNative

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

func NewPrefixSIDAttributeFromNative

func NewPrefixSIDAttributeFromNative(a *bgp.PathAttributePrefixSID) (*api.PrefixSID, error)

func NewRouteRefreshCapability

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

func NewSoftwareVersionCapability added in v3.11.0

func NewSoftwareVersionCapability(a *bgp.CapSoftwareVersion) *api.SoftwareVersionCapability

func NewTunnelEncapAttributeFromNative

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

func NewUnknownAttributeFromNative

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

func NewUnknownCapability

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

func ToApiFamily

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

func ToRouteFamily

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

func UnmarshalAttribute

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

func UnmarshalCapabilities

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

func UnmarshalFlowSpecRules

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

func UnmarshalLsAttribute added in v3.11.0

func UnmarshalLsAttribute(a *api.LsAttribute) (*bgp.LsAttribute, error)

func UnmarshalLsBgpPeerSegmentSid added in v3.11.0

func UnmarshalLsBgpPeerSegmentSid(a *api.LsBgpPeerSegmentSID) (*bgp.LsBgpPeerSegmentSID, error)

func UnmarshalLsLinkDescriptor added in v3.11.0

func UnmarshalLsLinkDescriptor(ld *api.LsLinkDescriptor) (*bgp.LsLinkDescriptor, error)

func UnmarshalLsNodeDescriptor added in v3.11.0

func UnmarshalLsNodeDescriptor(nd *api.LsNodeDescriptor) (*bgp.LsNodeDescriptor, error)

func UnmarshalLsPrefixDescriptor added in v3.11.0

func UnmarshalLsPrefixDescriptor(*api.LsPrefixDescriptor) (*bgp.LsPrefixDescriptor, error)

func UnmarshalNLRI

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

func UnmarshalNLRIs

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

func UnmarshalPathAttributes

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

func UnmarshalPrefixDescriptor added in v3.11.0

func UnmarshalPrefixDescriptor(pd *api.LsPrefixDescriptor) (*bgp.LsPrefixDescriptor, error)

func UnmarshalPrefixSID

func UnmarshalPrefixSID(psid *api.PrefixSID) (*bgp.PathAttributePrefixSID, error)

func UnmarshalRD

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

func UnmarshalRT

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

func UnmarshalRTs

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

func UnmarshalSRBSID

func UnmarshalSRBSID(bsid *apb.Any) (bgp.TunnelEncapSubTLVInterface, error)

UnmarshalSRBSID unmarshals SR Policy Binding SID Sub TLV and returns native TunnelEncapSubTLVInterface interface

func UnmarshalSRSegments

func UnmarshalSRSegments(s []*apb.Any) ([]bgp.TunnelEncapSubTLVInterface, error)

UnmarshalSRSegments unmarshals SR Policy Segments slice of structs

func UnmarshalSubSubTLVs

func UnmarshalSubSubTLVs(stlvs map[uint32]*api.SRv6TLV) (uint16, []bgp.PrefixSIDTLVInterface, error)

func UnmarshalSubTLVs

func UnmarshalSubTLVs(stlvs map[uint32]*api.SRv6TLV) (uint16, []bgp.PrefixSIDTLVInterface, error)

Types

type Destination

type Destination struct {
	Paths []*Path
}

func NewDestination

func NewDestination(dst *api.Destination) *Destination

func (*Destination) MarshalJSON

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

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"`
}

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