Cleanups and filtering.
Some checks failed
Rust / build (push) Has been cancelled

This commit is contained in:
Rayhaan Jaufeerally
2024-07-25 09:57:05 +00:00
parent 8546c37dac
commit 0cd3a120d0
13 changed files with 262 additions and 194 deletions

View File

@ -12,11 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use std::{net::Ipv4Addr, sync::Arc};
use bgp_packet::nlri::NLRI;
use bgp_packet::path_attributes::PathAttribute;
use chrono::{DateTime, Utc};
use crate::rib_manager::PathData;
/// RouteInfo encapsulates information received about a particular BGP route.
#[derive(Clone, Debug)]
pub struct RouteInfo<A> {
@ -43,25 +47,12 @@ pub struct RouteInfo<A> {
/// RouteUpdate is a type which encapsulates a newly learned, modified, or removed set of prefixes.
#[derive(Debug)]
pub enum RouteUpdate {
Announce(RouteAnnounce),
Announce((Vec<NLRI>, Arc<PathData>)),
Withdraw(RouteWithdraw),
}
#[derive(Debug)]
pub struct RouteAnnounce {
pub peer: String,
pub prefixes: Vec<NLRI>,
pub local_pref: u32,
pub med: u32,
pub as_path: Vec<u32>,
pub nexthop: Vec<u8>,
pub path_attributes: Vec<PathAttribute>,
}
#[derive(Debug)]
pub struct RouteWithdraw {
pub peer: String,
pub peer_id: Ipv4Addr,
pub prefixes: Vec<NLRI>,
}