-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adopt new AfiSafi / Nlri types throughout codebase
This commit adapts the codebase to use the types and traits introduced in this branch. With that, several other concepts required changes, or became deprecated and were removed. The new types/traits include: - trait AfiSafi, describing something that is characterized by a certain AFI+SAFI combination; - trait AfiSafiNlri, an NLRI characterized by a certain AFI+SAFI combination; - enum AfiSafiType, describing all AFI+SAFI combinations we support; - enum Nlri<Octs>, now holding more explicit variants of dedicated types, a la Ipv4UnicastNlri, Ipv6UnicastNlri, etc. For ADD-PATH, dedicated types are generated: Ipv4UnicastAddpathNlri, etc; - On UpdateMessage, `fn typed_announcements()` provides an iterator generic over tpyes implementing AfiSafiParse, thus yielding NLRI of these dedicated types instead of enum variants (which is still available via the `fn announcements()); - UpdateBuilder is now generic over types that implement NlriCompose, making the adding/removing of announcements and withdrawals more straightforward. New generic helper methods include `fn add_announcements_from_pdu`. Other changes: - enum Safi is removed, as an SAFI by itself does not mean anything useful. We keep enum Afi and the new enum AfiSafiType. (The name `AfiSafi` is now used for the new trait); - the UpdateMessage does not hold an entire SessionConfig anymore, but a trimmed down version of the new type PduParseInfo. The SessionConfig is only used in the very first call to `from_octets()` or `parse()`; - MpReachNlri and MpUnreachNlri are not part of the PathAttribute enum anymore, we start treating them differently. Partly because with the new builders being generic, it would mean the enum PathAttribute must carry generic type info, and PaMap as well. All while we most often do not include the MP* attributes in those maps anyway; - the new bgp::nlri modules replaces everyhing that was in bgp::message::nlri Open issues / questions and other remarks: - on UpdateMessage, we had several methods to specifically get unicast announcements. We need to figure out if those are still wanted; - we need to figure out what the Workshop should look like. We can probably get rid of the afisafi_nlri module to a large extent; - the UpdateBuilder now puts all withdrawals and announcements in MP attributes, so nothing goes into the conventional sections in the PDU. Related tests are ignored for now. We need to figure out to what extent we like to support those conventional sections in the builder.
- Loading branch information
Showing
20 changed files
with
2,235 additions
and
1,465 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.