百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
C

corebgp

> 编程语言
开源

CoreBGP 是一款用 Go 编写的 BGP 库,它采用基于事件的可插拔模型来实现 BGP FSM。

185 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

CoreBGP 是一款用 Go 编写的 BGP 库,它采用基于事件的可插拔模型来实现 BGP FSM。

CoreBGP

CoreBGP is a BGP library written in Go that implements the BGP FSM with an event-driven, pluggable model. It exposes an API that empowers the user to:

  • send and validate OPEN message capabilities
  • handle "important" state transitions
  • handle incoming UPDATE messages
  • send outgoing UPDATE messages

CoreBGP provides optional, composable UPDATE message decoding facilities via UpdateDecoder. CoreBGP does not manage a routing table or send its own UPDATE messages. Those responsibilities are passed down to the user. Therefore, the intended user is someone who wants that responsibility.

See this blog post for the background and reasoning behind the development of CoreBGP.

Plugin

The primary building block of CoreBGP is a Plugin, defined by the following interface:

…

Here's an example Plugin that logs when a peer enters/leaves an established state and when an UPDATE message is received:

…

Plugins are attached to peers when they are added to the Server, which manages their lifetime:

go
routerID := netip.MustParseAddr("192.0.2.1")
srv, err := corebgp.NewServer(routerID)
if err != nil {
    log.Fatalf("error constructing server: %v", err)
}
p := &plugin{}
err = srv.AddPeer(corebgp.PeerConfig{
    RemoteAddress: netip.MustParseAddr("198.51.100.10"),
    LocalAS:       65001,
    RemoteAS:      65010,
}, p, corebgp.WithLocalAddress(routerID))
if err != nil {
    log.Fatalf("error adding peer: %v", err)
}

For more examples check out the examples directory and pkg.go.dev for the complete API.

Versioning

CoreBGP follows semver as closely as it can. Seeing as we are still major version zero (0.y.z), the public API should not be considered stable. You are encouraged to pin CoreBGP's version with your dependency management solution of choice.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Gobgpgogolangnetwork-programming

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言