Skip to content

Commit

Permalink
update oneio, release 0.10.5
Browse files Browse the repository at this point in the history
  • Loading branch information
digizeph committed Mar 27, 2024
1 parent 2d5e722 commit 7dac747
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 34 deletions.
78 changes: 46 additions & 32 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,48 @@

All notable changes to this project will be documented in this file.

## v0.10.5 - 2024-03-26

### Highlights

* by default handles only `gzip` and `bzip2` files
* to support `xz` and `lz` files, use the optional feature `xz` and `lz`

## v0.10.4 - 2024-03-20

### Hot fix

* update `oneio` to `v0.16.4`
* add `http2` and `charset` feature flag to `reqwest`
* add `http2` and `charset` feature flag to `reqwest`

## v0.10.3 - 2024-03-20

### Highlights

* fixed an panic issue when sometimes merging AS path segments of 4-byte ASN path and 2-byte ASN path
* see issue [#156](https://github.com/bgpkit/bgpkit-parser/issues/156) for details
* see issue [#156](https://github.com/bgpkit/bgpkit-parser/issues/156) for details
* update `oneio` to `v0.16.3`
* gzip decompression depends on `flate2`'s `rust-backend` feature instead of `zlib-ng` which requires `cmake` to build
* gzip decompression depends on `flate2`'s `rust-backend` feature instead of `zlib-ng` which requires `cmake` to
build

## v0.10.2 - 2024-03-06

### Highlights

* added new `ip_version` filter type with values of `ipv4` or `ipv6`
* library users can use this filter to filter BGP messages by IP version
* CLI users can specify `-4` or `-6` to filter BGP messages by IP version
* library users can use this filter to filter BGP messages by IP version
* CLI users can specify `-4` or `-6` to filter BGP messages by IP version
* add new dependency security checkups using `cargo audit`
* all new releases will need to pass `cargo audit` checks before being published
* weekly `cargo audit` checks added to the CI pipeline
* all new releases will need to pass `cargo audit` checks before being published
* weekly `cargo audit` checks added to the CI pipeline

## v0.10.1 - 2024-02-23

### Highlights

* updating `oneio` to `v0.16.2`
* switching to `flate2` with `zlib-ng` for handling `gzip` files, which is significantly faster than the default pure-Rust implementation
* switching to `flate2` with `zlib-ng` for handling `gzip` files, which is significantly faster than the default
pure-Rust implementation

## v0.10.0 - 2024-02-12

Expand All @@ -45,38 +54,41 @@ Version 0.10.0 is a major release with a lot of changes and improvements.
#### MRT Encoding

`bgpkit-parser` now supports encoding MRT messages. The following MRT message types are supported:

- TableDumpV1
- TableDumpV2
- BGP4MP
It also supports encoding BMP messages into MRT files.
It also supports encoding BMP messages into MRT files.

Example of writing BgpElems into a file RIB dump file:

```rust
let mut encoder = bgpkit_parser::encoder::MrtRibEncoder::new();
for elem in parser {
encoder.process_elem(&elem);
encoder.process_elem( & elem);
}
let mut writer = oneio::get_writer("filtered.rib.gz").unwrap();
writer.write_all(encoder.export_bytes().as_ref()).unwrap();
drop(writer);
```

Another example of writing `BgpElem` to BGP updates bytes:

```rust
let mut encoder = bgpkit_parser::encoder::MrtUpdatesEncoder::new();
let mut elem = BgpElem::default();
let mut elem = BgpElem::default ();
elem.peer_ip = IpAddr::V4("10.0.0.1".parse().unwrap());
elem.peer_asn = Asn::from(65000);
elem.prefix.prefix = "10.250.0.0/24".parse().unwrap();
encoder.process_elem(&elem);
encoder.process_elem( & elem);
elem.prefix.prefix = "10.251.0.0/24".parse().unwrap();
encoder.process_elem(&elem);
encoder.process_elem( & elem);
let bytes = encoder.export_bytes();

let mut cursor = Cursor::new(bytes.clone());
while cursor.has_remaining() {
let parsed = parse_mrt_record(&mut cursor).unwrap();
dbg!(&parsed);
let parsed = parse_mrt_record( & mut cursor).unwrap();
dbg ! ( & parsed);
}
```

Expand All @@ -85,27 +97,27 @@ See `encoder` module for more details.
#### Better developer experiences

- added several utility functions to `BgpElem`
- `.is_announcement()`: check if the BGP element is an announcement
- `.get_as_path_opt()`: get the AS path if it exists and no AS set or confederated segments
- `.get_origin_asn_opt()`: get the origin ASN if it exists
- `.is_announcement()`: check if the BGP element is an announcement
- `.get_as_path_opt()`: get the AS path if it exists and no AS set or confederated segments
- `.get_origin_asn_opt()`: get the origin ASN if it exists
- full `serde` serialization support
- add `BgpElem` to PSV (pipe-separated values) conversion
- improved time-related filters parsing
- `ts_start` `start_ts` `ts_end` `end_ts` are all supported
- `ts_start` `start_ts` `ts_end` `end_ts` are all supported
- many quality of life improvements by [@jmeggitt](https://github.com/jmeggitt)
- https://github.com/bgpkit/bgpkit-parser/pull/122
- https://github.com/bgpkit/bgpkit-parser/pull/123
- https://github.com/bgpkit/bgpkit-parser/pull/122
- https://github.com/bgpkit/bgpkit-parser/pull/123

#### Improved testing coverage

- `bgpkit-parser` code test coverage is now at 92%.
- codecov.io coverage report is available at https://app.codecov.io/gh/bgpkit/bgpkit-parser
- codecov.io coverage report is available at https://app.codecov.io/gh/bgpkit/bgpkit-parser

#### TLS backend choice

- by default, `bgpkit-parser` now uses `rustls` as the default TLS backend
- `openssl` is still supported, but it is no longer the default
- `openssl` support can be enabled by using the `native-tls` feature flag and set default features to `false`
- `openssl` is still supported, but it is no longer the default
- `openssl` support can be enabled by using the `native-tls` feature flag and set default features to `false`

### Added RFCs support

Expand All @@ -115,29 +127,31 @@ See `encoder` module for more details.
- the supported RFCs list is documented at https://github.com/bgpkit/bgpkit-parser?tab=readme-ov-file#rfcs-support

[rfc4724]: https://www.rfc-editor.org/rfc/rfc4724

[rfc8671]: https://www.rfc-editor.org/rfc/rfc8671

[rfc9069]: https://www.rfc-editor.org/rfc/rfc9069

### Fixes

- fixed a bug where when multiple `AsSequences` are present, only the first one is parsed
- issue: https://github.com/bgpkit/bgpkit-parser/issues/140
- issue: https://github.com/bgpkit/bgpkit-parser/issues/140
- fixed a bug where the parser panics when messages are truncated
- https://github.com/bgpkit/bgpkit-parser/issues/149
- https://github.com/bgpkit/bgpkit-parser/issues/149

### Other changes

- Move pybgpkit to its own repository at https://github.com/bgpkit/pybgpkit
- CLI build feature changed from `build-binary` to `cli`
- add more ways to install compiled `bgpkit-parser` CLI
- homebrew on macOS: `brew install bgpkit/tap/bgpkit-parser`
- other platforms: `cargo binstall bgpkit-parser`
- homebrew on macOS: `brew install bgpkit/tap/bgpkit-parser`
- other platforms: `cargo binstall bgpkit-parser`

## v0.10.0-beta.3 - 2024-02-08

### Highlights

`Bytes::split_to` will panic if not enough bytes available.
`Bytes::split_to` will panic if not enough bytes available.
We added multiple safety checks to make sure enough bytes are available before calling `.split_to()` function.
If not enough bytes available, it will send out a `TruncatedMsg` error.
The current iterator will catch the error and skip the remainder of the message.
Expand All @@ -155,9 +169,9 @@ The current iterator will catch the error and skip the remainder of the message.
### Highlights

- switch to `rustls` as default TLS backend and remove unnecessary build dependencies and feature flags
- updated `oneio` to v0.16.0
- remove `openssl` and `vendored-openssl` dependency and feature flag for building CLI binary
- remove `ureq` dev-dependency
- updated `oneio` to v0.16.0
- remove `openssl` and `vendored-openssl` dependency and feature flag for building CLI binary
- remove `ureq` dev-dependency

### Release process changes

Expand Down
12 changes: 10 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bgpkit-parser"
version = "0.10.4"
version = "0.10.5"
authors = ["Mingwei Zhang <[email protected]>"]
edition = "2021"
license = "MIT"
Expand Down Expand Up @@ -34,7 +34,7 @@ bitflags = { version = "2.3.3", features = ["serde"], optional = true }
bytes = { version = "1.5.0", optional = true }
hex = { version = "0.4.3", optional = true } # bmp/openbmp parsing
log = { version = "0.4", optional = true }
oneio = { version = "0.16.4", default-features = false, features = ["lib-core"], optional = true }
oneio = { version = "0.16.7", default-features = false, features = ["remote", "gz", "bz"], optional = true }
regex = { version = "1", optional = true } # used in parser filter
chrono = { version = "0.4.24", optional = true } # parser filter
serde_json = { version = "1.0", optional = true } # RIS Live parsing
Expand Down Expand Up @@ -86,6 +86,14 @@ rustls = [
"oneio/rustls",
]

# optional compression algorithms support
xz = [
"oneio/xz"
]
lz = [
"oneio/lz"
]

[[bench]]
name = "internals"
harness = false
Expand Down

0 comments on commit 7dac747

Please sign in to comment.