Skip to main content

parse_text_dump_with_timestamp

Function parse_text_dump_with_timestamp 

Source
pub fn parse_text_dump_with_timestamp<R: BufRead>(
    reader: R,
    timestamp: f64,
) -> Result<Vec<BgpElem>>
Expand description

Parse a complete Cisco sh ip bgp text dump into BgpElems.

All parsed elements share the given timestamp; use infer_timestamp_from_path to derive one from a PCH or route-views file name when available.

Internally this uses TextDumpElemIterator and collects the results. For streaming (constant-memory) usage, construct the iterator directly.

Route-views style snapshots omit the BGP table version / local AS preamble. The parser falls back to the unspecified sentinels rather than rejecting the dump: 0.0.0.0 and AS0 carry no peer identity.

Lines that do not parse as route entries (banner text, the trailing Displayed ... summary, malformed rows) are skipped silently.