Phase 2 of the teaching demo: everything the status page will need is now reachable over HTTP. - New crate crates/web (axum). JSON endpoints for status, peers, local routes (announce / withdraw), received routes, the exact UPDATE bytes a local route produces per session, and well-known community names. Communities are accepted as ASN:VALUE or by name (NO_EXPORT, BLACKHOLE, ...); large communities as A:B:C. Policy errors map to 403/409/422. - GET /api/events is a server-sent event stream merging session up/down, local route and Adj-RIB-In changes, with lag notifications. - GET /metricz serves Prometheus metrics; the server crate now counts messages sent/received by type and sessions established. - The runnable main moves from crates/server to bin/bgp so it can depend on both server and web without a cycle. `cargo run -- config.textpb`. - Config gains http_endpoint; unset disables the API. - Integration tests drive the API against a live server with a real BGP peer, including verifying the wire view matches the bytes the peer got. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
46 lines
1.4 KiB
TOML
46 lines
1.4 KiB
TOML
[workspace]
|
|
default-members = ["bin/bgp"]
|
|
members = ["bin/*", "crates/*"]
|
|
resolver = "3"
|
|
|
|
[workspace.package]
|
|
authors = ["Rayhaan Jaufeerally <rayhaan+git@rayhaan.ch>"]
|
|
description = "A Border Gateway Protocol implementation"
|
|
edition = "2024"
|
|
homepage = "https://rayhaan.ch"
|
|
license = "Apache-2.0"
|
|
name = "bgp"
|
|
repository = "https://git.rayhaan.net/rayhaan/bgp"
|
|
version = "0.0.2"
|
|
|
|
[workspace.dependencies]
|
|
# --- Our crates ---
|
|
bgp-packet = { path = "crates/packet" }
|
|
bgp-primitives = { path = "crates/primitives" }
|
|
bgp-rib = { path = "crates/rib" }
|
|
bgp-server = { path = "crates/server" }
|
|
bgp-web = { path = "crates/web" }
|
|
bgp-integration-tests = { path = "crates/integration-tests" }
|
|
|
|
# --- General ---
|
|
bitfield = "0.19.0"
|
|
bytes = "1.10.1"
|
|
eyre = "0.6.12"
|
|
nom = "8.0.0"
|
|
serde = { version = "1.0.219", features = ["derive"] }
|
|
serde_json = "1.0.140"
|
|
serde_repr = "0.1.20"
|
|
thiserror = "2.0.12"
|
|
tokio = { version = "1.44.2", features = ["full"] }
|
|
strum = { version = "0.27.1", features = ["derive"] }
|
|
tracing = "0.1.44"
|
|
tracing-subscriber = { version = "0.3.22", features = ["env-filter"] }
|
|
prometheus = "0.14.0"
|
|
protobuf = { package = "protobuf", version = "3.7.2" }
|
|
protobuf-codegen = { package = "protobuf-codegen", version = "3.7.2" }
|
|
clap = { version = "4.5.53", features = ["derive"] }
|
|
futures = "0.3"
|
|
axum = "0.8.9"
|
|
tokio-stream = { version = "0.1.19", features = ["sync"] }
|
|
reqwest = { version = "0.13.5", default-features = false, features = ["json"] }
|