Documentation ¶
Index ¶
- Constants
- func CreateUpdateMsgFromPaths(pathList []Path) []*bgp.BGPMessage
- func UpdatePathAttrs2ByteAs(msg *bgp.BGPUpdate) error
- func UpdatePathAttrs4ByteAs(msg *bgp.BGPUpdate) error
- type AdjRib
- func (adj *AdjRib) DropAllIn(rf bgp.RouteFamily)
- func (adj *AdjRib) GetInCount(rf bgp.RouteFamily) int
- func (adj *AdjRib) GetInPathList(rf bgp.RouteFamily) []Path
- func (adj *AdjRib) GetOutCount(rf bgp.RouteFamily) int
- func (adj *AdjRib) GetOutPathList(rf bgp.RouteFamily) []Path
- func (adj *AdjRib) UpdateIn(pathList []Path)
- func (adj *AdjRib) UpdateOut(pathList []Path)
- type Destination
- type DestinationDefault
- type IPv4Destination
- type IPv4Path
- type IPv4Table
- type IPv6Destination
- type IPv6Path
- type IPv6Table
- type Path
- type PathDefault
- type PeerInfo
- type ProcessMessage
- type ReceivedRoute
- type Table
- type TableDefault
- type TableManager
Constants ¶
View Source
const ( BPR_UNKNOWN = "Unknown" BPR_ONLY_PATH = "Only Path" BPR_REACHABLE_NEXT_HOP = "Reachable Next Hop" BPR_HIGHEST_WEIGHT = "Highest Weight" BPR_LOCAL_PREF = "Local Pref" BPR_LOCAL_ORIGIN = "Local Origin" BPR_ASPATH = "AS Path" BPR_ORIGIN = "Origin" BPR_MED = "MED" BPR_ASN = "ASN" BPR_IGP_COST = "IGP Cost" BPR_ROUTER_ID = "Router ID" )
Variables ¶
This section is empty.
Functions ¶
func CreateUpdateMsgFromPaths ¶
func CreateUpdateMsgFromPaths(pathList []Path) []*bgp.BGPMessage
func UpdatePathAttrs2ByteAs ¶
func UpdatePathAttrs2ByteAs(msg *bgp.BGPUpdate) error
func UpdatePathAttrs4ByteAs ¶
func UpdatePathAttrs4ByteAs(msg *bgp.BGPUpdate) error
Types ¶
type AdjRib ¶
type AdjRib struct {
// contains filtered or unexported fields
}
func (*AdjRib) GetInCount ¶
func (*AdjRib) GetInPathList ¶
func (*AdjRib) GetOutCount ¶
func (*AdjRib) GetOutPathList ¶
type Destination ¶
type DestinationDefault ¶
type DestinationDefault struct { ROUTE_FAMILY bgp.RouteFamily // contains filtered or unexported fields }
func NewDestinationDefault ¶
func NewDestinationDefault(nlri bgp.AddrPrefixInterface) *DestinationDefault
func (*DestinationDefault) Calculate ¶
func (dest *DestinationDefault) Calculate(localAsn uint32) (Path, string, error)
Calculates best-path among known paths for this destination.
Returns: - Best path
Modifies destination's state related to stored paths. Removes withdrawn paths from known paths. Also, adds new paths to known paths.
func (*DestinationDefault) MarshalJSON ¶
func (dd *DestinationDefault) MarshalJSON() ([]byte, error)
func (*DestinationDefault) String ¶
func (dest *DestinationDefault) String() string
return Destination's string representation
type IPv4Destination ¶
type IPv4Destination struct {
*DestinationDefault
}
func NewIPv4Destination ¶
func NewIPv4Destination(nlri bgp.AddrPrefixInterface) *IPv4Destination
func (*IPv4Destination) String ¶
func (ipv4d *IPv4Destination) String() string
type IPv6Destination ¶
type IPv6Destination struct {
*DestinationDefault
}
func NewIPv6Destination ¶
func NewIPv6Destination(nlri bgp.AddrPrefixInterface) *IPv6Destination
func (*IPv6Destination) MarshalJSON ¶
func (ipv6d *IPv6Destination) MarshalJSON() ([]byte, error)
func (*IPv6Destination) String ¶
func (ipv6d *IPv6Destination) String() string
type IPv6Path ¶
type IPv6Path struct {
*PathDefault
}
func NewIPv6Path ¶
func (*IPv6Path) MarshalJSON ¶
type Path ¶
type PathDefault ¶
type PathDefault struct {
// contains filtered or unexported fields
}
func NewPathDefault ¶
func (*PathDefault) GetRouteFamily ¶
func (pd *PathDefault) GetRouteFamily() bgp.RouteFamily
func (*PathDefault) IsWithdraw ¶
func (pd *PathDefault) IsWithdraw() bool
func (*PathDefault) MarshalJSON ¶
func (pd *PathDefault) MarshalJSON() ([]byte, error)
func (*PathDefault) String ¶
func (pi *PathDefault) String() string
return Path's string representation
type ProcessMessage ¶
type ProcessMessage struct {
// contains filtered or unexported fields
}
func NewProcessMessage ¶
func NewProcessMessage(m *bgp.BGPMessage, peerInfo *PeerInfo) *ProcessMessage
func (*ProcessMessage) ToPathList ¶
func (p *ProcessMessage) ToPathList() []Path
type ReceivedRoute ¶
type ReceivedRoute struct {
// contains filtered or unexported fields
}
func NewReceivedRoute ¶
func NewReceivedRoute(path Path, filtered bool) *ReceivedRoute
func (*ReceivedRoute) String ¶
func (rr *ReceivedRoute) String() string
type Table ¶
type Table interface { DeleteDestByPeer(*PeerInfo) []Destination MarshalJSON() ([]byte, error) // contains filtered or unexported methods }
type TableDefault ¶
type TableDefault struct { ROUTE_FAMILY bgp.RouteFamily // contains filtered or unexported fields }
func NewTableDefault ¶
func NewTableDefault(scope_id int) *TableDefault
func (*TableDefault) DeleteDestByPeer ¶
func (td *TableDefault) DeleteDestByPeer(peerInfo *PeerInfo) []Destination
func (*TableDefault) GetRoutefamily ¶
func (td *TableDefault) GetRoutefamily() bgp.RouteFamily
func (*TableDefault) MarshalJSON ¶
func (td *TableDefault) MarshalJSON() ([]byte, error)
type TableManager ¶
type TableManager struct { Tables map[bgp.RouteFamily]Table // contains filtered or unexported fields }
func NewTableManager ¶
func NewTableManager(owner string) *TableManager
func (*TableManager) DeletePathsforPeer ¶
func (manager *TableManager) DeletePathsforPeer(peerInfo *PeerInfo) ([]Path, []Path, error)
func (*TableManager) ProcessPaths ¶
func (manager *TableManager) ProcessPaths(pathList []Path) ([]Path, []Path, error)
func (*TableManager) ProcessUpdate ¶
func (manager *TableManager) ProcessUpdate(fromPeer *PeerInfo, message *bgp.BGPMessage) ([]Path, []Path, error)
process BGPUpdate message this function processes only BGPUpdate
Click to show internal directories.
Click to hide internal directories.