table

package
v0.0.0-...-2820c43 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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 NewAdjRib

func NewAdjRib() *AdjRib

func (*AdjRib) DropAllIn

func (adj *AdjRib) DropAllIn(rf bgp.RouteFamily)

func (*AdjRib) GetInCount

func (adj *AdjRib) GetInCount(rf bgp.RouteFamily) int

func (*AdjRib) GetInPathList

func (adj *AdjRib) GetInPathList(rf bgp.RouteFamily) []Path

func (*AdjRib) GetOutCount

func (adj *AdjRib) GetOutCount(rf bgp.RouteFamily) int

func (*AdjRib) GetOutPathList

func (adj *AdjRib) GetOutPathList(rf bgp.RouteFamily) []Path

func (*AdjRib) UpdateIn

func (adj *AdjRib) UpdateIn(pathList []Path)

func (*AdjRib) UpdateOut

func (adj *AdjRib) UpdateOut(pathList []Path)

type Destination

type Destination interface {
	Calculate(localAsn uint32) (Path, string, error)

	String() string

	MarshalJSON() ([]byte, error)
	// contains filtered or unexported methods
}

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 IPv4Path

type IPv4Path struct {
	*PathDefault
}

* Definition of inherited Path interface

func NewIPv4Path

func NewIPv4Path(source *PeerInfo, nlri bgp.AddrPrefixInterface, isWithdraw bool, attrs []bgp.PathAttributeInterface, medSetByTargetNeighbor bool, now time.Time) *IPv4Path

type IPv4Table

type IPv4Table struct {
	*TableDefault
}

func NewIPv4Table

func NewIPv4Table(scope_id int) *IPv4Table

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 NewIPv6Path(source *PeerInfo, nlri bgp.AddrPrefixInterface, isWithdraw bool, attrs []bgp.PathAttributeInterface, medSetByTargetNeighbor bool, now time.Time) *IPv6Path

func (*IPv6Path) MarshalJSON

func (ipv6p *IPv6Path) MarshalJSON() ([]byte, error)

func (*IPv6Path) String

func (ipv6p *IPv6Path) String() string

return IPv6Path's string representation

type IPv6Table

type IPv6Table struct {
	*TableDefault
}

func NewIPv6Table

func NewIPv6Table(scope_id int) *IPv6Table

type Path

type Path interface {
	String() string

	GetRouteFamily() bgp.RouteFamily

	IsWithdraw() bool

	MarshalJSON() ([]byte, error)
	// contains filtered or unexported methods
}

func CreatePath

func CreatePath(source *PeerInfo, nlri bgp.AddrPrefixInterface, attrs []bgp.PathAttributeInterface, isWithdraw bool, now time.Time) Path

create Path object based on route family

type PathDefault

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

func NewPathDefault

func NewPathDefault(rf bgp.RouteFamily, source *PeerInfo, nlri bgp.AddrPrefixInterface, nexthop net.IP, isWithdraw bool, pattrs []bgp.PathAttributeInterface, medSetByTargetNeighbor bool, now time.Time) *PathDefault

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 PeerInfo

type PeerInfo struct {
	AS      uint32
	ID      net.IP
	LocalID net.IP
	RF      bgp.RouteFamily
	Address net.IP
}

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

Jump to

Keyboard shortcuts

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