Skip to main content

Module render

Module render 

Source
Expand description

Human-readable record rendering.

The text module renders one MrtRecord as a layered, indented text block — a full-fidelity transcript of the record: BGP4MP session context, withdrawn and announced prefixes, every path attribute, and RFC 7606 validation warnings. The format is designed around this crate’s own models (reusing the leaf Display implementations), not around any external tool’s output; it is inspired by bgpdump’s human-readable output.

The hex module encodes raw record bytes (as yielded by BgpkitParser::into_filtered_raw_record_iter) as single hex strings — the paste format for byte-level dissectors such as wirescope.

Rendering is a pure function of the record: no iterators, no I/O, no session state. RIB entries reference peers by their table index because the peer table lives in a separate, earlier record.

§Example

use bgpkit_parser::render::text::format_record;
use bgpkit_parser::BgpkitParser;

let parser = BgpkitParser::new("tests/fixtures/ripe/rrc00/2000.01/updates.20000102.2014.gz").unwrap();
for record in parser.into_record_iter() {
    println!("{}", format_record(&record));
}

Modules§

hex
Hex encoding of record bytes.
text
Layered text rendering of MRT records.