table

package
v1.3.0-rc Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	POLICY_DOWN    = PolicyState("down")
	POLICY_UP      = PolicyState("up")
	POLICY_ACTIVE  = PolicyState("active")
	POLICY_UNKNOWN = PolicyState("unknown")
)
View Source
const (
	BEHAVIOR_RESERVED uint16 = 0x0000
	BEHAVIOR_END      uint16 = 0x0001
	BEHAVIOR_END_X    uint16 = 0x0005
	BEHAVIOR_UN       uint16 = 0x0030
	BEHAVIOR_UA       uint16 = 0x0039
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LsLink struct {
	LocalNode  *LsNode    // Primary key, in MP_REACH_NLRI Attr
	RemoteNode *LsNode    // Primary key, in MP_REACH_NLRI Attr
	LocalIP    netip.Addr // In MP_REACH_NLRI Attr
	RemoteIP   netip.Addr // In MP_REACH_NLRI Attr
	Metrics    []*Metric  // In BGP-LS Attr
	AdjSid     uint32     // In BGP-LS Attr
}
func NewLsLink(localNode *LsNode, remoteNode *LsNode) *LsLink

func (*LsLink) Metric

func (l *LsLink) Metric(metricType MetricType) (uint32, error)

func (*LsLink) UpdateTed

func (l *LsLink) UpdateTed(ted *LsTed)

type LsNode

type LsNode struct {
	Asn        uint32 // primary key, in MP_REACH_NLRI Attr
	RouterID   string // primary key, in MP_REACH_NLRI Attr
	IsisAreaID string // in BGP-LS Attr
	Hostname   string // in BGP-LS Attr
	SrgbBegin  uint32 // in BGP-LS Attr
	SrgbEnd    uint32 // in BGP-LS Attr
	Links      []*LsLink
	Prefixes   []*LsPrefixV4
}

func NewLsNode

func NewLsNode(asn uint32, nodeID string) *LsNode
func (n *LsNode) AddLink(link *LsLink)

func (*LsNode) LoopbackAddr

func (n *LsNode) LoopbackAddr() (netip.Addr, error)

func (*LsNode) NodeSegment added in v1.2.0

func (n *LsNode) NodeSegment() (Segment, error)

func (*LsNode) UpdateTed

func (n *LsNode) UpdateTed(ted *LsTed)

type LsPrefixV4

type LsPrefixV4 struct {
	LocalNode *LsNode      // primary key, in MP_REACH_NLRI Attr
	Prefix    netip.Prefix // in MP_REACH_NLRI Attr
	SidIndex  uint32       // in BGP-LS Attr (only for Lo Address Prefix)
}

func NewLsPrefixV4

func NewLsPrefixV4(localNode *LsNode) *LsPrefixV4

func (*LsPrefixV4) UpdateTed

func (lp *LsPrefixV4) UpdateTed(ted *LsTed)

type LsTed

type LsTed struct {
	ID    int
	Nodes map[uint32]map[string]*LsNode // { ASN1: {"NodeID1": node1, "NodeID2": node2}, ASN2: {"NodeID3": node3, "NodeID4": node4}}
}

func (*LsTed) Print added in v1.2.1

func (ted *LsTed) Print()

func (*LsTed) Update

func (ted *LsTed) Update(tedElems []TedElem)

type Metric

type Metric struct {
	Type  MetricType
	Value uint32
}

func NewMetric

func NewMetric(metricType MetricType, value uint32) *Metric

type MetricType

type MetricType int
const (
	IGP_METRIC MetricType = iota
	TE_METRIC
	DELAY_METRIC
	HOPCOUNT_METRIC
)

func (MetricType) String

func (m MetricType) String() string

type PolicyDiff added in v1.3.0

type PolicyDiff struct {
	Name        *string
	Color       *uint32
	Preference  *uint32
	SegmentList []Segment
	LspID       uint16
	State       PolicyState
}

SR Policy parameter that can be changed

type PolicyState added in v1.3.0

type PolicyState string

sr-policy state

type SRPolicy added in v1.2.0

type SRPolicy struct {
	PlspID      uint32
	Name        string
	SegmentList []Segment
	SrcAddr     netip.Addr
	DstAddr     netip.Addr
	Color       uint32
	Preference  uint32
	LspID       uint16
	State       PolicyState
}

func NewSRPolicy added in v1.3.0

func NewSRPolicy(
	plspId uint32,
	name string,
	segmentList []Segment,
	srcAddr netip.Addr,
	dstAddr netip.Addr,
	color uint32,
	preference uint32,
	lspID uint16,
	state PolicyState,
) *SRPolicy

func (*SRPolicy) Update added in v1.3.0

func (p *SRPolicy) Update(df PolicyDiff)

type Segment added in v1.2.0

type Segment interface {
	SidString() string
}

func NewSegment added in v1.2.0

func NewSegment(sid string) (Segment, error)

type SegmentSRMPLS added in v1.2.0

type SegmentSRMPLS struct {
	Sid uint32
}

func NewSegmentSRMPLS added in v1.2.0

func NewSegmentSRMPLS(sid uint32) SegmentSRMPLS

func (SegmentSRMPLS) SidString added in v1.2.0

func (seg SegmentSRMPLS) SidString() string

type SegmentSRv6 added in v1.2.0

type SegmentSRv6 struct {
	Sid        netip.Addr
	LocalAddr  netip.Addr
	RemoteAddr netip.Addr
	Structure  []uint8
	USid       bool
}

func NewSegmentSRv6 added in v1.2.0

func NewSegmentSRv6(sid netip.Addr) SegmentSRv6

func (SegmentSRv6) Behavior added in v1.3.0

func (seg SegmentSRv6) Behavior() uint16

func (SegmentSRv6) SidString added in v1.2.0

func (seg SegmentSRv6) SidString() string

type TedElem

type TedElem interface {
	UpdateTed(ted *LsTed)
}

Jump to

Keyboard shortcuts

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