Skip to main content

Module text

Module text 

Source
Expand description

Layered text rendering of MRT records.

One record becomes one indented block: session context (TIME/TYPE/PEER/LOCAL), then the message body — UPDATE: sections for withdrawn/announced prefixes and every path attribute, OPEN: capabilities, session states, RIB entries, or the peer table. RFC 7606 validation findings appear under WARNINGS: when present.

The layout is our own (built from this crate’s Display vocabulary); inspired by bgpdump’s human-readable output, not byte-compatible with it.

Style::ansi adds terminal colors for labels, section headers, prefixes, and next hops; the plain blocks are unchanged by it, since styling is a post-pass over the rendered text rather than part of it.

Structs§

Style
ANSI styling for the text format.

Functions§

format_record
Render one MRT record as a layered text block.
format_record_with_hex
Render a record block with a trailing HEX: line carrying the raw bytes (e.g. from crate::render::hex::encode), so the block can be pasted straight into a byte-level dissector.
format_record_with_hex_and_style
Render a record block with a trailing HEX: line (see format_record_with_hex), styled for a terminal.
format_record_with_style
Render one MRT record as a layered text block, styled for a terminal.