Skip to content
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

Path attributes builder #48

Merged
merged 98 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
d16d5cc
WIP PathAttributesBuilder
DRiKE Feb 6, 2024
3adb585
Use type alias AttributesMap everywhere
DRiKE Feb 6, 2024
125948f
Add fn remove_attribute
DRiKE Feb 6, 2024
9636412
rough outline RouteWorkshop
density215 Feb 12, 2024
f082cbe
Serialize route
density215 Feb 13, 2024
d71103e
FlowSpecNlri generic over Octets
density215 Feb 13, 2024
43ebbaa
make_route
density215 Feb 13, 2024
03b009f
bytes::Bytes
density215 Feb 13, 2024
f025e45
clippy & rustfmt
density215 Feb 13, 2024
c637d37
bump minimal bytes version to something that works
density215 Feb 13, 2024
088fa8d
WorkshopAttribute
density215 Feb 13, 2024
49d6907
wrapped types for PathAttribute data fields & ConventionalNextHop var…
density215 Feb 14, 2024
c4f2ef4
merge impl macros
density215 Feb 14, 2024
68d8235
cleanup
density215 Feb 14, 2024
10bb67c
cleanup
density215 Feb 14, 2024
0b61d10
remove unused fn
density215 Feb 14, 2024
2df9a19
cleanup
density215 Feb 14, 2024
732a802
Use PaMap in update_builder
density215 Feb 14, 2024
14e9f21
use more attributes.set
density215 Feb 14, 2024
d77fb9b
remove AttrChangeSet
density215 Feb 15, 2024
8884944
varia
density215 Feb 15, 2024
2ef9caa
move add_attribute and FromAttribute trait
density215 Feb 16, 2024
4b05c9c
eliminate PathAttributeType in PaMap
density215 Feb 16, 2024
28bd7f7
single NLRI facilities
density215 Feb 22, 2024
adce9e2
Workshop without Options
density215 Feb 22, 2024
1de1ac6
impl traits on AfiSafiNlris
density215 Feb 22, 2024
bf0b4cf
remove weird single_first_nlri method
density215 Feb 26, 2024
9bc915e
clippy
density215 Feb 26, 2024
912a530
Set Partial flag when composing an UnimplementedPathAttribute
DRiKE Feb 26, 2024
17deeb6
Remove unnecessary layer in PathAttributes enum, impl Attribute on ty…
DRiKE Feb 26, 2024
74a94fe
Fix tests
DRiKE Feb 26, 2024
422c2dc
Cleanup
DRiKE Feb 26, 2024
c565171
Provide default fn impls in FromAttribute trait
DRiKE Feb 26, 2024
416814d
Get rid of Default impl for PathAttribute
DRiKE Feb 26, 2024
f2abf4b
Rename attributes_owned to into_attributes
DRiKE Feb 26, 2024
5e567a7
Return replaced value from PaMap.set/add_attribute
DRiKE Feb 26, 2024
f96a767
Cleanup in UpdateBuilder
DRiKE Feb 27, 2024
3d0eb2b
WIP new afisafi mod in bgp
DRiKE Feb 27, 2024
ce8920f
Make <Octs> optional in afisafi macro
DRiKE Feb 28, 2024
84c712a
Make MpReachNlriBuilder::new_for_nlri pub
DRiKE Feb 29, 2024
acdbb1e
Display impl for Origin
density215 Feb 29, 2024
5524cb3
WIP AfiSafiParse trait
DRiKE Feb 29, 2024
9d1dfac
pub the new communities
density215 Feb 29, 2024
8617b49
fix builders
density215 Feb 29, 2024
08b459f
NlriIter generic over AfiSafiParse
DRiKE Feb 29, 2024
580ef94
Merge remote-tracking branch 'refs/remotes/origin/path-attributes-bui…
DRiKE Feb 29, 2024
c7e6322
Test for generic iteration
DRiKE Feb 29, 2024
f0bf4c5
Test iterating over an Addpath Nlri
DRiKE Feb 29, 2024
d601004
Cleanup
DRiKE Feb 29, 2024
c7cb212
Cleanup / reordering
DRiKE Feb 29, 2024
98f5f85
Trying alternative Addpath approaches
DRiKE Feb 29, 2024
599fd1e
Introduce addpath! macro
DRiKE Feb 29, 2024
cb2ea70
Add (likely useless) next_with on NlriIter
DRiKE Mar 4, 2024
d05afe8
Get rid of BasicNlri in new afisafi module
DRiKE Mar 4, 2024
18673d5
Cleanup
DRiKE Mar 4, 2024
2a3e541
Call typeenum! macro from afisafi! macro to create Afi enum
DRiKE Mar 4, 2024
401b755
Fill in all AFI/SAFI combos in macro call, as a TODO list
DRiKE Mar 4, 2024
655958c
Reordering in new afisafi module
DRiKE Mar 4, 2024
25ef23d
Include Addpath variants in Nlri enum, impl Display addpath! macro
DRiKE Mar 5, 2024
0f74284
Add From<Addpath variants> for Nlri enum
DRiKE Mar 5, 2024
14c8fd7
Start reorganizing new afisafi stuff into bgp::nlri module
DRiKE Mar 5, 2024
c436c4b
Generate NlriIter constructors in macro
DRiKE Mar 5, 2024
7f3bb29
Add notes on why fn iter on Nlri structs in macro is currently not po…
DRiKE Mar 5, 2024
416ca6c
Add Ipv4MplsVpnUnicast
DRiKE Mar 5, 2024
063eac0
Add Ipv4RouteTarget, do not rely on old nlri.rs anymore
DRiKE Mar 5, 2024
b236e14
Add fn afi_safis on UpdateMessage
DRiKE Mar 5, 2024
4676217
Add FlowSpecNlri
DRiKE Mar 5, 2024
7f44f2b
Support conversion between (non-)Addpath variants
DRiKE Mar 5, 2024
82173c7
Add Ipv6{Multicast, MplsUnicast, MplsVpnUnicast, FlowSpec}
DRiKE Mar 5, 2024
5f3905d
Add L2VpnVpls
DRiKE Mar 6, 2024
6307b8b
Add L2VpnEvpn
DRiKE Mar 6, 2024
e84a6af
Adopt new AfiSafi / Nlri types throughout codebase
DRiKE Mar 19, 2024
b1f4717
Remove unnecessary type arguments
DRiKE Mar 21, 2024
b0d704b
Reintroduction of BasicNlri etc
DRiKE Mar 22, 2024
431debf
Switch over to inetnum crate
DRiKE Mar 22, 2024
22758a4
Fix tests
DRiKE Mar 22, 2024
e4190fa
Clippy
DRiKE Mar 22, 2024
15afa31
Comment out everything BasicNlri related
DRiKE Mar 22, 2024
7e0feec
Remove unused afisafi_nlri.rs from bgp::workshop
DRiKE Mar 22, 2024
accd569
Remove old, unused bgp::message::nlri module
DRiKE Mar 22, 2024
7539ee0
Remove unused {addr,asn} modules as we use the inetnum crate now
DRiKE Mar 22, 2024
0e37d92
Conditionally derive De/Serialize for all NLRI related types
DRiKE Mar 22, 2024
6606341
Add From impls for FlowSpecNlri
DRiKE Mar 22, 2024
c8b541c
Add fn {announcement,withdrawal}_fams() on UpdateMessage
DRiKE Mar 22, 2024
42e90d2
Fix docstring/doctests wrt change to inetnum
DRiKE Mar 25, 2024
349923e
Make some NLRI related pub
DRiKE Mar 25, 2024
42d269b
Mark Nlri as Eq
DRiKE Mar 25, 2024
98121c4
Remove pub fn iter_for_afi_safi
DRiKE Mar 25, 2024
af12707
Introduce enum NlriType
DRiKE Mar 25, 2024
99f4667
Use NlriType instead of AfiSafiType in Update(Builder) where applicable
DRiKE Mar 25, 2024
ca54e23
this can go now
density215 Mar 26, 2024
a996da4
Make NextHop live on RouteWorkshop
DRiKE Mar 26, 2024
9484e51
Merge remote-tracking branch 'refs/remotes/origin/path-attributes-bui…
DRiKE Mar 26, 2024
0b0bbf2
Cleanup after merge and add basic tests
DRiKE Mar 26, 2024
8786965
Leave the nexthop compability check on AfiSafiNlri for now
DRiKE Mar 26, 2024
d10f30d
Make Update::typed_withdrawals consistent with ~announcements, fix bu…
DRiKE Mar 26, 2024
de0f76e
Add PartialEq impls for all concrete NLRI and the Nlri enum
DRiKE Mar 26, 2024
a6b0399
Fix test
DRiKE Mar 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ keywords = ["routing", "bgp"]
license = "BSD-3-Clause"

[dependencies]
inetnum = { version = "0.1.0", features = ["arbitrary", "serde"] }
arbitrary = { version = "1", optional = true, features = ["derive"] }
bytes = { version = "1", optional = true }
bytes = { version = "1.2", optional = true }
chrono = { version = "0.4.20", optional = true, default-features = false }
const-str = { version = "0.5", optional = true, features = ["case"] }
log = { version = "0.4.4", optional = true }
octseq = { version = "0.4.0", optional = true, features = ["bytes"] }
paste = { version = "1" }
serde = { version = "1.0.165", optional = true, features = ["derive"] }
tokio = { version = ">=1.24.2", optional = true, features = ["sync", "rt"] }

Expand Down
9 changes: 8 additions & 1 deletion fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 7 additions & 12 deletions fuzz/fuzz_targets/parse_update_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,18 @@ use routecore::bgp::message::{UpdateMessage, SessionConfig};
use routecore::bgp::message::update_builder::UpdateBuilder;

fuzz_target!(|data: (&[u8], SessionConfig)| {
if let Ok(upd) = UpdateMessage::from_octets(data.0, data.1) {
if let Ok(upd) = UpdateMessage::from_octets(data.0, &data.1) {
if let Ok(pas) = upd.path_attributes() {
for pa in pas.into_iter() {
if let Ok(pa) = pa {
let _ = pa.to_owned();
}
let _ = pa.unwrap().to_owned();
}
}
/*
if let Ok(builder) = UpdateBuilder::from_update_message(
&upd,
data.1,
target,
) {
let _ = builder.into_message(); //.unwrap();
if let Ok(iter) = upd.announcements() {
iter.count();
}
if let Ok(iter) = upd.withdrawals() {
iter.count();
}
*/
}
});

Expand Down
Loading
Loading