Adds real-time local BGP RIB data as a complement to external APIs (RIPE Stat, bgproutes.io) which have rate limits and 15min+ delays. - bio-rd-client.js: gRPC client for bio-routing/bio-rd RIS service - LPM, Get, GetLonger, GetRouters, DumpRIB, ObserveRIB methods - IPv4/IPv6 encoding as uint64 pair (bio.net format) - Full BGP path decode: AS paths, communities, large communities - Graceful fallback if RIS unavailable (null/empty returns) - protos/: bio-rd proto definitions (ris, bgp, session, route, net) - server.js: three new endpoints + WebSocket stream - GET /api/rib/prefix — LPM + more-specifics via GetLonger - GET /api/rib/routers — list BMP-monitored routers - GET /api/rib/dump — full RIB dump with ASN filter + limit - WS /ws/rib — live ObserveRIB stream (add/withdraw events) - package.json: @grpc/grpc-js + @grpc/proto-loader dependencies
81 lines
1.8 KiB
Protocol Buffer
81 lines
1.8 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package bio.route;
|
|
|
|
import "net/api/net.proto";
|
|
option go_package = "github.com/bio-routing/bio-rd/route/api";
|
|
|
|
message Route {
|
|
bio.net.Prefix pfx = 1;
|
|
repeated Path paths = 2;
|
|
}
|
|
|
|
message Path {
|
|
enum Type {
|
|
Static = 0;
|
|
BGP = 1;
|
|
}
|
|
enum HiddenReason {
|
|
HiddenReasonNone = 0;
|
|
HiddenReasonNextHopUnreachable = 1;
|
|
HiddenReasonFilteredByPolicy = 2;
|
|
HiddenReasonASLoop = 3;
|
|
HiddenReasonOurOriginatorID = 4;
|
|
HiddenReasonClusterLoop = 5;
|
|
HiddenReasonOTCMismatch = 6;
|
|
}
|
|
Type type = 1;
|
|
StaticPath static_path = 2;
|
|
BGPPath bgp_path = 3;
|
|
HiddenReason hidden_reason = 4;
|
|
uint32 time_learned = 5;
|
|
GRPPath grp_path = 6;
|
|
}
|
|
|
|
message StaticPath {
|
|
bio.net.IP next_hop = 1;
|
|
}
|
|
|
|
message GRPPath {
|
|
bio.net.IP next_hop = 1;
|
|
map<string,string> meta_data = 2;
|
|
}
|
|
|
|
message BGPPath {
|
|
uint32 path_identifier = 1;
|
|
bio.net.IP next_hop = 2;
|
|
uint32 local_pref = 3;
|
|
repeated ASPathSegment as_path = 4;
|
|
uint32 origin = 5;
|
|
uint32 med = 6;
|
|
bool ebgp = 7;
|
|
uint32 bgp_identifier = 8;
|
|
bio.net.IP source = 9;
|
|
repeated uint32 communities = 10;
|
|
repeated LargeCommunity large_communities = 11;
|
|
uint32 originator_id = 12;
|
|
repeated uint32 cluster_list = 13;
|
|
repeated UnknownPathAttribute unknown_attributes = 14;
|
|
bool bmp_post_policy = 15;
|
|
uint32 only_to_customer = 16;
|
|
}
|
|
|
|
message ASPathSegment {
|
|
bool as_sequence = 1;
|
|
repeated uint32 asns = 2;
|
|
}
|
|
|
|
message LargeCommunity {
|
|
uint32 global_administrator = 1;
|
|
uint32 data_part1 = 2;
|
|
uint32 data_part2 = 3;
|
|
}
|
|
|
|
message UnknownPathAttribute {
|
|
bool optional = 1;
|
|
bool transitive = 2;
|
|
bool partial = 3;
|
|
uint32 type_code = 4;
|
|
bytes value = 5;
|
|
}
|