Documentation ¶
Overview ¶
Package bgp contains a BGP implementation (using GoBGP) whose API is OpenConfig.
Index ¶
- func InitialConfig(ctx context.Context, applied *oc.NetworkInstance_Protocol_Bgp, ...) (*bgpconfig.BgpConfigSet, error)
- func NewGoBGPTask() *reconciler.BuiltReconciler
- func NewGoBGPTaskDecl(zapiURL string) *reconciler.BuiltReconciler
- func ReadConfigFile(configFile, configType string) (*bgpconfig.BgpConfigSet, error)
- func UpdateConfig(ctx context.Context, applied *oc.NetworkInstance_Protocol_Bgp, ...) (*bgpconfig.BgpConfigSet, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitialConfig ¶
func InitialConfig(ctx context.Context, applied *oc.NetworkInstance_Protocol_Bgp, bgpServer *server.BgpServer, newConfig *bgpconfig.BgpConfigSet, isGracefulRestart bool) (*bgpconfig.BgpConfigSet, error)
InitialConfig applies initial configuration to a pristine gobgp instance. It can only be called once for an instance. Subsequent changes to the configuration can be applied using UpdateConfig. The BgpConfigSet can be obtained by calling ReadConfigFile. If graceful restart behavior is desired, pass true for isGracefulRestart. Otherwise, pass false.
- applied is the OpenConfig applied configuration. It is supplied as an argument in order for its state to be updated as the gRPC API calls are made. GoBGP's config/state is not as rigorous as OpenConfig config/state separation.
func NewGoBGPTask ¶
func NewGoBGPTask() *reconciler.BuiltReconciler
NewGoBGPTask creates a new GoBGP task.
func NewGoBGPTaskDecl ¶
func NewGoBGPTaskDecl(zapiURL string) *reconciler.BuiltReconciler
NewGoBGPTaskDecl creates a new GoBGP task using the declarative configuration style.
func ReadConfigFile ¶
func ReadConfigFile(configFile, configType string) (*bgpconfig.BgpConfigSet, error)
ReadConfigFile parses a config file into a BgpConfigSet which can be applied using InitialConfig and UpdateConfig.
func UpdateConfig ¶
func UpdateConfig(ctx context.Context, applied *oc.NetworkInstance_Protocol_Bgp, bgpServer *server.BgpServer, c, newConfig *bgpconfig.BgpConfigSet) (*bgpconfig.BgpConfigSet, error)
UpdateConfig updates the configuration of a running gobgp instance. InitialConfig must have been called once before this can be called for subsequent changes to bgpconfig. The differences are that this call 1) does not hangle graceful restart and 2) requires a BgpConfigSet for the previous configuration so that it can compute the delta between it and the new bgpconfig. The new BgpConfigSet can be obtained using ReadConfigFile.
- applied is the OpenConfig applied configuration. It is supplied as an argument in order for its state to be updated as the gRPC API calls are made. GoBGP's config/state is not as rigorous as OpenConfig config/state separation.
Types ¶
This section is empty.