Store the routing table in the database (part of #122)
check / check (push) Canceled after 0s

A new routes table holds one row per prefix and origin AS: the peer set
as the bitset's bytes, and the two kept routes, each with its peer's
number, AS path and time in seconds. A new route_peers table holds each
peer's number and address.

WriteRouteChanges writes one TakeChanges result in a transaction.
ReadRouteTable reads both tables into a new routing table, through the
new Table.Load, which records no change. It fails on a row that names a
peer number missing from route_peers. Nothing uses them yet.

Model: opus-5-5
This commit was merged in pull request #186.
This commit is contained in:
2026-10-27 08:54:57 +01:00
parent 7a34a46c4d
commit eda37da369
7 changed files with 1010 additions and 8 deletions
+3 -1
View File
@@ -1,5 +1,7 @@
// Package database provides SQLite storage for BGP routing data including ASNs,
// prefixes, announcements, peerings, and live route tables.
// prefixes, announcements, peerings, and live route tables. Its routes table
// holds a copy of the whole routing table that internal/routetable keeps in
// memory.
package database
import (