Documentation
¶
Index ¶
- Variables
- func CanAdvertisePodCIDR(ipam string) bool
- type Advertisement
- type Afi
- type BGPGlobal
- type Family
- type GetBGPResponse
- type GetPeerStateResponse
- type GetRoutesRequest
- type GetRoutesResponse
- type NeighborRequest
- type Path
- type PathRequest
- type PathResponse
- type Route
- type RouteSelectionOptions
- type Router
- type Safi
- type ServerParameters
- type SessionState
- type TableType
Constants ¶
This section is empty.
Variables ¶
var ( // CommonPaths contains common path structure values appearing in the agent code CommonPaths = []struct { Name string Path Path }{ { Name: "IPv4 unicast advertisement", Path: Path{ NLRI: prefixV4, PathAttributes: []bgp.PathAttributeInterface{ originAttribute, nextHopAttribute, }, }, }, { Name: "IPv6 unicast advertisement", Path: Path{ NLRI: prefixV6, PathAttributes: []bgp.PathAttributeInterface{ originAttribute, mpReachNLRIAttribute, }, }, }, } )
Functions ¶
func CanAdvertisePodCIDR ¶ added in v1.14.9
CanAdvertisePodCIDR returns true if the provided IPAM mode is supported for advertising PodCIDR
Types ¶
type Advertisement ¶ added in v1.14.0
type Advertisement struct {
Prefix netip.Prefix
GoBGPPathUUID []byte // path identifier in underlying implementation
}
Advertisement is a container object which associates a netip.Prefix
The `Prefix` field makes comparing this Advertisement with another Prefix encoded prefixes simple.
The `GoBGPPathUUID` field is a gobgp.AddPathResponse.Uuid object which can be forwarded to gobgp's WithdrawPath method, making withdrawing an advertised route simple.
type BGPGlobal ¶
type BGPGlobal struct {
ASN uint32
RouterID string
ListenPort int32 // When -1 gobgp won't listen on tcp:179
RouteSelectionOptions *RouteSelectionOptions
}
BGPGlobal contains high level BGP configuration for given instance.
type Family ¶
Family holds Address Family Indicator (AFI) and Subsequent Address Family Indicator for Multi-Protocol BGP
type GetBGPResponse ¶
type GetBGPResponse struct {
Global BGPGlobal
}
GetBGPResponse contains BGP global parameters
type GetPeerStateResponse ¶
GetPeerStateResponse contains state of peers configured in given instance
type GetRoutesRequest ¶
type GetRoutesRequest struct {
// TableType specifies a table type to retrieve
TableType TableType
// Family specifies an address family of the table
Family Family
// Neighbor specifies which neighbor's table to retrieve. Must be
// specified when TableTypeAdjRIBIn/Out is specified in TableType.
Neighbor netip.Addr
}
GetRoutesRequest contains parameters for retrieving routes from the RIB of underlying router
type GetRoutesResponse ¶
type GetRoutesResponse struct {
Routes []*Route
}
GetRoutesResponse contains routes retrieved from the RIB of underlying router
type NeighborRequest ¶
type NeighborRequest struct {
Neighbor *v2alpha1api.CiliumBGPNeighbor
VR *v2alpha1api.CiliumBGPVirtualRouter
}
NeighborRequest contains neighbor parameters used when enabling or disabling peer
type Path ¶
type Path struct {
// read/write
NLRI bgp.AddrPrefixInterface
PathAttributes []bgp.PathAttributeInterface
// readonly
AgeNanoseconds int64 // time duration in nanoseconds since the Path was created
Best bool
GoBGPPathUUID []byte // path identifier in underlying implementation
}
Path is an object representing a single routing Path. It is an analogue of GoBGP's Path object, but only contains minimal fields required for Cilium usecases.
type PathRequest ¶
type PathRequest struct {
Advert Advertisement
}
PathRequest contains parameters for advertising or withdrawing routes
type PathResponse ¶
type PathResponse struct {
Advert Advertisement
}
PathResponse contains response after advertising the route, underlying implementation will set UUID
type RouteSelectionOptions ¶
type RouteSelectionOptions struct {
// AdvertiseInactiveRoutes when set will advertise route even if it is not present in RIB
AdvertiseInactiveRoutes bool
}
RouteSelectionOptions contains generic BGP route selection tuning parameters
type Router ¶
type Router interface {
Stop()
// AddNeighbor configures BGP peer
AddNeighbor(ctx context.Context, n NeighborRequest) error
// UpdateNeighbor updates BGP peer
UpdateNeighbor(ctx context.Context, n NeighborRequest) error
// RemoveNeighbor removes BGP peer
RemoveNeighbor(ctx context.Context, n NeighborRequest) error
// AdvertisePath advertises BGP route to all configured peers
AdvertisePath(ctx context.Context, p PathRequest) (PathResponse, error)
// WithdrawPath removes BGP route from all peers
WithdrawPath(ctx context.Context, p PathRequest) error
// GetPeerState returns status of BGP peers
GetPeerState(ctx context.Context) (GetPeerStateResponse, error)
// GetRoutes retrieves routes from the RIB of underlying router
GetRoutes(ctx context.Context, r *GetRoutesRequest) (*GetRoutesResponse, error)
// GetBGP returns configured BGP global parameters
GetBGP(ctx context.Context) (GetBGPResponse, error)
}
Router is vendor-agnostic cilium bgp configuration layer. Parameters of this layer are standard BGP RFC complaint and not specific to any underlying implementation.
type Safi ¶
type Safi uint32
Safi is subsequent address family identifier
const ( SafiUnknown Safi = 0 SafiUnicast Safi = 1 SafiMulticast Safi = 2 SafiMplsLabel Safi = 4 SafiEncapsulation Safi = 7 SafiVpls Safi = 65 SafiEvpn Safi = 70 SafiLs Safi = 71 SafiSrPolicy Safi = 73 SafiMup Safi = 85 SafiMplsVpn Safi = 128 SafiMplsVpnMulticast Safi = 129 SafiRouteTargetConstraints Safi = 132 SafiFlowSpecUnicast Safi = 133 SafiFlowSpecVpn Safi = 134 SafiKeyValue Safi = 241 )
type ServerParameters ¶
type ServerParameters struct {
Global BGPGlobal
}
ServerParameters contains information for underlying bgp implementation layer to initializing BGP process.
type SessionState ¶
type SessionState uint32
SessionState as defined in rfc4271#section-8.2.2
const ( SessionUnknown SessionState = iota SessionIdle SessionConnect SessionActive SessionOpenSent SessionOpenConfirm SessionEstablished )
func (SessionState) String ¶
func (s SessionState) String() string