Skip to content

Commit

Permalink
Add fn {announcement,withdrawal}_fams() on UpdateMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
DRiKE committed Mar 22, 2024
1 parent 6606341 commit c8b541c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/bgp/message/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,16 @@ impl<Octs: Octets> UpdateMessage<Octs> {
)
}

pub fn announcement_fams(&self) -> impl Iterator<Item = AfiSafi> {
let afi_safis = self.afi_safis();
[afi_safis.1, afi_safis.3].into_iter().flatten()
}

pub fn withdrawal_fams(&self) -> impl Iterator<Item = AfiSafi> {
let afi_safis = self.afi_safis();
[afi_safis.0, afi_safis.2].into_iter().flatten()
}

/// Returns an iterator over the conventional withdrawals.
///
/// The withdrawals are always IPv4 Unicast, but can contain Path IDs.
Expand Down

0 comments on commit c8b541c

Please sign in to comment.