Keep a trailing AS set out of the origin and the peerings (closes #75)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
A path ending in an AS set, such as [64496, 64497, [64498, 64499]], was flattened into the sequence, so the route was stored as originated by the last set member and the peering handler recorded peerings the path does not show. ASPath now keeps the sequence and a trailing set of several members apart; Origin() gives the last AS of the sequence, or 0 (no known origin) for such a set. The handlers use it; peerings come from the sequence only. The pages show origin 0 as no known origin, and the IP lookup asks no WHOIS lookup for it. Empty paths are unchanged. Model: opus-5-5
This commit was merged in pull request #91.
This commit is contained in:
@@ -87,15 +87,20 @@ func (h *PeeringHandler) QueueCapacity() int {
|
||||
// than minPathLengthForPeering are ignored as they cannot contain valid
|
||||
// peering information.
|
||||
func (h *PeeringHandler) HandleMessage(msg *ristypes.RISMessage) {
|
||||
// Peerings are between neighbours in the path's sequence only: the
|
||||
// members of an AS set that ends the path are not neighbours of each
|
||||
// other or of the AS before them.
|
||||
sequence := msg.Path.Sequence
|
||||
|
||||
// Skip if no AS path or only one AS
|
||||
if len(msg.Path) < minPathLengthForPeering {
|
||||
if len(sequence) < minPathLengthForPeering {
|
||||
return
|
||||
}
|
||||
|
||||
timestamp := msg.ParsedTimestamp
|
||||
|
||||
// Encode AS path as JSON for use as map key
|
||||
pathJSON, err := json.Marshal(msg.Path)
|
||||
pathJSON, err := json.Marshal(sequence)
|
||||
if err != nil {
|
||||
h.logger.Error("Failed to encode AS path", "error", err)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user