Skip to content

v0.12.0

Latest

Choose a tag to compare

@github-actions github-actions released this 17 Oct 19:47
· 10 commits to main since this release
2559b99

Examples and benchmarking

  • Added a new runnable example: examples/parse_single_file_parallel.rs.
    • Parses RIB file using thread pool with batching and collecting. Two modes: worker-only parsing (default) or worker
      parsing + element conversion.
    • Includes bottleneck diagnostics, tunable parameters (batch size, workers, etc), benchmarking, and remote file
      downloading.

Breaking changes

  • change path_id from u32 to Option<u32> for proper null handling
    • NetworkPrefix::path_id field now properly represents absence with None instead of using 0
    • NetworkPrefix::new() and NetworkPrefix::encode() signatures updated accordingly
    • RibEntry now stores path_id for TABLE_DUMP_V2 messages with AddPath support
    • fixes issue #217

Minumum Supported Rust Version (MSRV)

We now set a minimum supported Rust version (MSRV) of 1.87.0.

Code improvements

New RFCs Supported

  • added BGP Flow-Spec parsing support following RFC 8955 and RFC 8956
  • added BGP Tunnel Encapsulation attribute parsing support following RFC 9012, RFC 5640, and RFC 8365
  • added MRT geo-location extensions support following RFC 6397
  • added comprehensive BGP Link-State parsing support following RFC 7752 and extensions
  • add support for RFC 8654 Extended Messages
  • implemented comprehensive BGP capabilities support for all IANA-defined capability codes with RFC support
  • added RFC 8950 support for IPv4 NLRI with IPv6 next-hops
  • added RFC 8950 Extended Next Hop capability parsing and encoding
  • added RFC 9069 validation warnings for BMP Local RIB peer types

Performance improvements

  • optimized BytesMut buffer allocation patterns for better memory efficiency
    • replaced BytesMut::with_capacity() + resize() with BytesMut::zeroed() for cleaner initialization
    • added capacity pre-allocation in ASN encoding to avoid reallocations
    • replaced unnecessary BytesMut allocations with direct slice references in MRT header parsing
    • added capacity pre-allocation in MRT record encoding for optimal buffer sizing
    • fixed non-canonical PartialOrd implementation for ASN type to follow Rust idioms

Iterator improvements

  • added fallible iterator implementations for explicit error handling
    • implemented FallibleRecordIterator that returns Result<MrtRecord, ParserErrorWithBytes>
    • implemented FallibleElemIterator that returns Result<BgpElem, ParserErrorWithBytes>
    • added into_fallible_record_iter() and into_fallible_elem_iter() methods on BgpkitParser
    • allows users to handle parsing errors explicitly instead of having them silently skipped
    • maintains full backward compatibility with existing error-skipping iterators
    • reorganized iterator implementations into structured iters module with default and fallible submodules
  • added raw MRT record iteration support for record-by-record processing (PR #239, credits to @ties)
    • added RawRecordIterator accessible via into_raw_record_iter() on BgpkitParser
    • separated MRT record reading from parsing for clearer error handling and improved throughput
    • moved RawRecordIterator into dedicated iters::raw module for better organization
    • added raw record parsing to scan_mrt example
    • added tests comparing into_raw_record_iter() with record_iter() behavior
  • optimized duplicate BGP attribute detection using a fixed-size boolean array to track seen attributes (PR #237, credits to @ties)
    • added boundary test cases for BGP attribute types

Bug fixes

  • fixed TABLE_DUMP_V2 parsing to properly store path_id when AddPath is enabled
    • previously path_id was read but discarded, now properly stored in RibEntry
  • fixed BGP OPEN message optional parameter parsing to support multiple capabilities per parameter
    • changed ParamValue::Capability to ParamValue::Capacities(Vec<Capability>) to properly handle RFC 5492 format
    • previously parser only read the first capability in each optional parameter, ignoring subsequent capabilities
    • now correctly parses all capabilities within each optional parameter
    • updated encoding logic to write all capabilities in the vector
  • fixed RFC 9072 Extended Optional Parameters Length validation
    • corrected extended parameter format validation (must have non-zero opt_params_len)
    • fixed capability length parsing to always use 1-byte length per RFC 5492, not variable length
    • ensures proper RFC 9072 compliance for extended OPEN message format
  • improved RFC 9069 validation for BMP Local RIB peer types
    • fixed multi-protocol capability check to specifically validate MULTIPROTOCOL_EXTENSIONS capability presence
    • previously checked for any capabilities, now correctly validates the required capability type
  • added CorruptedBgpMessage error type for better BMP parsing error handling
    • provides more specific error information when BGP messages within BMP are corrupted

Maintenance

  • updated dependencies
  • updated crate documentation and README
  • removed outdated documentation files