-
-
Notifications
You must be signed in to change notification settings - Fork 4
Add SmallAsnSet. #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SmallAsnSet. #22
Conversation
|
|
||
| //------------ SmallAsnSet -------------------------------------------------- | ||
|
|
||
| /// A relatively small set of ASNs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even with AsPath moving to its own module, maybe we should stick a sentence in here somewhere clarifying that this has nothing to do with the concept of AS_SET?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually had that when it was called AsnSet, but removed it when renaming to SmallAsnSet because I thought it is somewhat clear that it is a different thing?
(Also, obviously, this whole thing severely lacks in documentation.)
Breaking Changes * The minimum required Rust version is now 1.63. ([#25]) New * Added new `asn::SmallAsnSet` which, as, the name suggests, is supposed to hold a relatively small set of ASNs. ([#22] via [#25]) * Added implementations for the `arbitrary::Arbitrary` trait to ASN and IP resource types. ([#24] via [#25]) [#22]: #22 [#24]: #24 [#25]: #25
Breaking changes * Extensive moving and refactoring of code, With the focus of _routecore_ heavily shifting towards BGP and BMP related functionality, we decided to copy over the few types used by dependants to those dependants and remove their depedency on _routecore_. This also means we could drop code from _routecore_, and get rid of certain dependencies and feature flags. In addition to that, there has been extensive renaming throughout the code base, though not all of the touched code was ever properly released before. All in all, the 0.4.0 release should be considered breaking and not backwards compatible. New * Parsing of BGP and BMP messages. ([#14]) The newly added feature flags `bgp` and `bmp` enable parsing capabilities for these messages using the [OctSeq](https://github.com/NLnetLabs/octseq) crate. This allows parsing of raw wireformat representations in multiple data types, including [bytes::Bytes](https://docs.rs/bytes/latest/bytes/struct.Bytes.html). The parsing and the resulting types `bgp::Message` and `bmp::Message` are mostly non-allocating and provide (lazy) iterators to the actual data (e.g. Path Attributes or NLRI in a BGP UPDATE PDU), to enable use in high throughput scenarios. * Composing of BGP messages. Creating BGP messages is supported to a certain extent, note that the API is still limited. For BGP OPENs, the Optional Parameters are limited to only the Capability type, and more specifically, only the Four Octet capability (RFC6793), MultiProtocol (RFC4760) and AddPath (RFC7911) can be set. For BGP UPDATEs, the builder (`bgp::message::update_builder`) includes methods to add announcements, withdrawals and next hop information for conventional IPv4 Unicast and MultiProtocol address families. Mandatory path attributes and standard communities have dedicated methods, but arbitrary PathAttributes can be added as well. Depending on the resulting total size, the builder results in multiple PDUs to adhere to the protocol. BGP NOTIFICATIONs and KEEPALIVEs can be created as well, so all message types needed for setting up a BGP session are supported. Note that actually setting up and maintaining a BGP session is (currently) not part of `routecore`. * Added new `asn::SmallAsnSet` which, as, the name suggests, is supposed to hold a relatively small set of ASNs. ([#22]) * Added implementations for the `arbitrary::Arbitrary` trait to ASN and IP resource types. ([#24]) * Reworked AsPath Most of the code related to the BGP path attribute AS_PATH has been overhauled and moved away from `asn` into `bgp::aspath`. The main struct is now generic over `Octets` that represent the wireformat of the path attribute, moving away from the 'sentinel ASN'-approach. It also introduces `HopPath`, a representation that is more convenient to reason about than the wireformat. `HopPath` replaces `AsPathBuilder`. ([#23]) * Added `fn contains` to check whether an `std::net::IpAddr` lies within a `addr::Prefix`. ([#35]) * Better parsing and creation of BGP NOTIFICATION messages. ([#35]) Other changes * Changed the minimal supported Rust version to 1.71. * Changed Rust edition from 2018 to 2021. [#14]: #14 [#22]: #22 [#23]: #23 [#24]: #24 [#35]: #35
## 0.4.0 Released 2024-01-18. Breaking changes * Extensive moving and refactoring of code With the focus of _routecore_ heavily shifting towards BGP and BMP related functionality, we decided to copy over the few types used by dependants to those dependants and remove their depedency on _routecore_. This also means we could drop code from _routecore_, and get rid of certain dependencies and feature flags. In addition to that, there has been extensive renaming throughout the code base, though not all of the touched code was ever properly released before. All in all, the 0.4.0 release should be considered breaking and not backwards compatible. New * Parsing of BGP and BMP messages. ([#14]) The newly added feature flags `bgp` and `bmp` enable parsing capabilities for raw wireformat representations of these messages in multiple data types, including [bytes::Bytes](https://docs.rs/bytes/latest/bytes/struct.Bytes.html). The parsing and the resulting types `bgp::Message` and `bmp::Message` are mostly non-allocating and provide (lazy) iterators to the actual data (e.g. Path Attributes or NLRI in a BGP UPDATE PDU), to enable use in high throughput scenarios. * Composing of BGP messages. Creating BGP messages is supported to a certain extent, note that the API is still limited. For BGP OPENs, the Optional Parameters are limited to only the Capability type, and more specifically, only the Four Octet capability (RFC6793), MultiProtocol (RFC4760) and AddPath (RFC7911) can be set. For BGP UPDATEs, the builder (`bgp::message::update_builder`) includes methods to add announcements, withdrawals and next hop information for conventional IPv4 Unicast and MultiProtocol address families. Mandatory path attributes and standard communities have dedicated methods, but arbitrary PathAttributes can be added as well. Depending on the resulting total size, the builder results in multiple PDUs to adhere to the protocol. BGP NOTIFICATIONs and KEEPALIVEs can be created as well, so all message types needed for setting up a BGP session are supported. Note that actually setting up and maintaining a BGP session is (currently) not part of `routecore`. * Added new `asn::SmallAsnSet` which, as, the name suggests, is supposed to hold a relatively small set of ASNs. ([#22]) * Added implementations for the `arbitrary::Arbitrary` trait to ASN and IP resource types. ([#24]) * Reworked AsPath Most of the code related to the BGP path attribute AS_PATH has been overhauled and moved away from `asn` into `bgp::aspath`. The main struct is now generic over `Octets` that represent the wireformat of the path attribute, moving away from the 'sentinel ASN'-approach. It also introduces `HopPath`, a representation that is more convenient to reason about than the wireformat. `HopPath` replaces `AsPathBuilder`. ([#23]) * Added `fn contains` to check whether an `std::net::IpAddr` lies within a `addr::Prefix`. ([#35]) * Better parsing and creation of BGP NOTIFICATION messages. ([#35]) Other changes * Changed the minimal supported Rust version to 1.71. * Changed Rust edition from 2018 to 2021. [#14]: #14 [#22]: #22 [#23]: #23 [#24]: #24 [#35]: #35
This PR adds a new type
asn::SmallAsnSetwhich, as the name suggests, contains a relatively small set of ASNs. Its main purpose is to be used for the provider ASN set in ASPA objects.