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>
20 lines
342 B
Protocol Buffer Text Format
20 lines
342 B
Protocol Buffer Text Format
router_id: "10.0.0.1"
|
|
local_asn: 65000
|
|
listen_endpoints {
|
|
address: "127.0.0.1"
|
|
port: 179
|
|
}
|
|
listen_endpoints {
|
|
address: "::1"
|
|
port: 179
|
|
}
|
|
local_route_policy {
|
|
allowed_prefixes: "10.100.0.0/16"
|
|
allowed_prefixes: "2001:db8:100::/48"
|
|
max_routes_per_owner: 4
|
|
}
|
|
http_endpoint {
|
|
address: "127.0.0.1"
|
|
port: 8080
|
|
}
|