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.
- Parses RIB file using thread pool with batching and collecting. Two modes: worker-only parsing (default) or worker
Breaking changes
- change
path_idfromu32toOption<u32>for proper null handlingNetworkPrefix::path_idfield now properly represents absence withNoneinstead of using0NetworkPrefix::new()andNetworkPrefix::encode()signatures updated accordinglyRibEntrynow storespath_idfor 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()withBytesMut::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
- replaced
Iterator improvements
- added fallible iterator implementations for explicit error handling
- implemented
FallibleRecordIteratorthat returnsResult<MrtRecord, ParserErrorWithBytes> - implemented
FallibleElemIteratorthat returnsResult<BgpElem, ParserErrorWithBytes> - added
into_fallible_record_iter()andinto_fallible_elem_iter()methods onBgpkitParser - 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
itersmodule withdefaultandfalliblesubmodules
- implemented
- added raw MRT record iteration support for record-by-record processing (PR #239, credits to @ties)
- added
RawRecordIteratoraccessible viainto_raw_record_iter()onBgpkitParser - separated MRT record reading from parsing for clearer error handling and improved throughput
- moved
RawRecordIteratorinto dedicatediters::rawmodule for better organization - added raw record parsing to
scan_mrtexample - added tests comparing
into_raw_record_iter()withrecord_iter()behavior
- added
- 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
- previously path_id was read but discarded, now properly stored in
- fixed BGP OPEN message optional parameter parsing to support multiple capabilities per parameter
- changed
ParamValue::CapabilitytoParamValue::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
- changed
- 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
CorruptedBgpMessageerror 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