Skip to content

Commit

Permalink
ospf: use SmallVec to store packet destination addresses
Browse files Browse the repository at this point in the history
Remove the `DestinationAddrs` enum in favor of using `SmallVec` for
storing a list of destination addresses. This simplifies the code
at no performance cost, as `SmallVec<[I; 4]>` won't allocate memory
unless 5 or more addresses are present.

The unit tests data have been updated to reflect the data structure
change.

Signed-off-by: Renato Westphal <[email protected]>
  • Loading branch information
rwestphal committed Dec 6, 2023
1 parent 74abb31 commit f367e07
Show file tree
Hide file tree
Showing 122 changed files with 1,695 additions and 1,714 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ serde_json = "1.0"
sha1 = "0.10"
sha2 = "0.10"
similar = "2.0"
smallvec = { version = "1.11", features = ["serde"] }
socket2 = { version = "0.4", features = ["all"] }
tokio = { version = "1.0", features = ["full"] }
tonic = { version = "0.9", features = ["tls"] }
Expand Down
1 change: 1 addition & 0 deletions holo-ospf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ serde.workspace = true
serde_json.workspace = true
sha1.workspace = true
sha2.workspace = true
smallvec.workspace = true
socket2.workspace = true
tokio.workspace = true
tracing.workspace = true
Expand Down
11 changes: 5 additions & 6 deletions holo-ospf/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use holo_utils::{bfd, UnboundedSender};
use holo_yang::TryFromYang;
use ipnetwork::{Ipv4Network, Ipv6Network};
use ism::{Event, State};
use smallvec::smallvec;
use tokio::sync::mpsc;

use crate::area::Area;
Expand All @@ -32,7 +33,7 @@ use crate::error::{Error, InterfaceCfgError, IoError};
use crate::instance::{Instance, InstanceUpView};
use crate::lsdb::{LsaEntry, LsaOriginateEvent};
use crate::neighbor::{nsm, Neighbor, NeighborNetId};
use crate::network::{DestinationAddrs, MulticastAddr, SendDestination};
use crate::network::{MulticastAddr, SendDestination};
use crate::northbound::notification;
use crate::packet::auth::AuthMethod;
use crate::packet::lsa::{Lsa, LsaHdrVersion, LsaKey};
Expand Down Expand Up @@ -638,12 +639,10 @@ where
let ifindex = self.system.ifindex.unwrap();
let addrs = match self.config.if_type {
InterfaceType::PointToPoint | InterfaceType::Broadcast => {
let addr = MulticastAddr::AllSpfRtrs;
DestinationAddrs::Single(*V::multicast_addr(addr))
smallvec![*V::multicast_addr(MulticastAddr::AllSpfRtrs)]
}
InterfaceType::NonBroadcast | InterfaceType::PointToMultipoint => {
let addrs = self.config.static_nbrs.keys().copied().collect();
DestinationAddrs::Multiple(addrs)
self.config.static_nbrs.keys().copied().collect()
}
};
let dst = SendDestination::new(ifindex, addrs);
Expand All @@ -660,7 +659,7 @@ where
poll_interval: u16,
) {
let ifindex = self.system.ifindex.unwrap();
let dst = SendDestination::new(ifindex, DestinationAddrs::Single(addr));
let dst = SendDestination::new(ifindex, smallvec![addr]);
let task =
tasks::hello_interval(self, area, instance, dst, poll_interval);
self.state.tasks.nbma_poll_interval.insert(addr, task);
Expand Down
24 changes: 2 additions & 22 deletions holo-ospf/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use holo_utils::socket::{AsyncFd, Socket};
use holo_utils::{Sender, UnboundedReceiver};
use nix::sys::socket::{self, SockaddrLike};
use serde::Serialize;
use smallvec::SmallVec;
use tokio::sync::mpsc::error::SendError;

use crate::collections::{AreaId, InterfaceId};
Expand All @@ -35,13 +36,7 @@ pub const OSPF_IP_PROTO: i32 = 89;
#[derive(Clone, Debug, Eq, PartialEq, new, Serialize)]
pub struct SendDestination<I: IpAddrKind> {
pub ifindex: u32,
pub addrs: DestinationAddrs<I>,
}

#[derive(Clone, Debug, Eq, PartialEq, new, Serialize)]
pub enum DestinationAddrs<I: IpAddrKind> {
Single(I),
Multiple(Vec<I>),
pub addrs: SmallVec<[I; 4]>,
}

#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize)]
Expand Down Expand Up @@ -102,21 +97,6 @@ pub trait NetworkVersion<V: Version> {
fn validate_ip_hdr(buf: &mut Bytes) -> DecodeResult<()>;
}

// ===== impl DestinationAddrs =====

impl<I> DestinationAddrs<I>
where
I: IpAddrKind + 'static,
{
#[cfg(not(feature = "testing"))]
fn into_iter(self) -> Box<dyn Iterator<Item = I> + 'static + Send> {
match self {
DestinationAddrs::Single(addr) => Box::new(std::iter::once(addr)),
DestinationAddrs::Multiple(addrs) => Box::new(addrs.into_iter()),
}
}
}

// ===== global functions =====

#[cfg(not(feature = "testing"))]
Expand Down
16 changes: 8 additions & 8 deletions holo-ospf/src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
// SPDX-License-Identifier: MIT
//

use smallvec::smallvec;

use crate::area::{Area, OptionsLocation};
use crate::collections::{Arena, NeighborIndex};
use crate::instance::InstanceUpView;
use crate::interface::{ism, Interface, InterfaceType};
use crate::lsdb;
use crate::neighbor::{nsm, Neighbor};
use crate::network::{DestinationAddrs, MulticastAddr, SendDestination};
use crate::network::{MulticastAddr, SendDestination};
use crate::packet::lsa::LsaHdrVersion;
use crate::packet::{
DbDescFlags, DbDescVersion, LsAckVersion, LsRequestVersion,
Expand Down Expand Up @@ -403,8 +405,7 @@ where
} else {
nbr.src
};
let addr = DestinationAddrs::Single(addr);
SendDestination::new(ifindex, addr)
SendDestination::new(ifindex, smallvec![addr])
}

// Returns a destination used to send a packet to all adjacent neighbors
Expand All @@ -427,23 +428,22 @@ where
} else {
MulticastAddr::AllDrRtrs
};
DestinationAddrs::Single(*V::multicast_addr(addr))
smallvec![*V::multicast_addr(addr)]
}
InterfaceType::NonBroadcast | InterfaceType::PointToMultipoint => {
// On non-broadcast networks, separate LS Update and delayed LS Ack
// packets must be sent, as unicasts, to each adjacent neighbor.
let addrs = iface
iface
.state
.neighbors
.iter(neighbors)
.filter(|nbr| nbr.state >= nsm::State::Exchange)
.map(|nbr| nbr.src)
.collect();
DestinationAddrs::Multiple(addrs)
.collect()
}
InterfaceType::PointToPoint => {
let addr = MulticastAddr::AllSpfRtrs;
DestinationAddrs::Single(*V::multicast_addr(addr))
smallvec![*V::multicast_addr(addr)]
}
};
SendDestination::new(ifindex, addrs)
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"NetTxPacket":{"packet":{"LsAck":{"hdr":{"pkt_type":"LsAck","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsa_hdrs":[{"options":"E","lsa_type":9,"lsa_id":"3.0.0.0","adv_rtr":"6.6.6.6","length":36}]}},"src":"10.0.7.4","dst":{"ifindex":7,"addrs":{"Single":"224.0.0.5"}}}}
{"NetTxPacket":{"packet":{"LsAck":{"hdr":{"pkt_type":"LsAck","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsa_hdrs":[{"options":"E","lsa_type":9,"lsa_id":"3.0.0.0","adv_rtr":"6.6.6.6","length":36}]}},"src":"10.0.7.4","dst":{"ifindex":7,"addrs":["224.0.0.5"]}}}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{"NetTxPacket":{"packet":{"LsUpdate":{"hdr":{"pkt_type":"LsUpdate","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsas":[{"hdr":{"options":"E","lsa_type":10,"lsa_id":"4.0.0.0","adv_rtr":"4.4.4.4","length":28},"body":{"OpaqueArea":{"RouterInfo":{"info_caps":"STUB_ROUTER","func_caps":null,"sr_algo":null,"srgb":[],"srlb":[],"msds":null,"srms_pref":null,"unknown_tlvs":[]}}}}]}},"src":"10.0.2.4","dst":{"ifindex":4,"addrs":{"Single":"224.0.0.5"}}}}
{"NetTxPacket":{"packet":{"LsUpdate":{"hdr":{"pkt_type":"LsUpdate","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsas":[{"hdr":{"options":"E","lsa_type":10,"lsa_id":"4.0.0.0","adv_rtr":"4.4.4.4","length":28},"body":{"OpaqueArea":{"RouterInfo":{"info_caps":"STUB_ROUTER","func_caps":null,"sr_algo":null,"srgb":[],"srlb":[],"msds":null,"srms_pref":null,"unknown_tlvs":[]}}}}]}},"src":"10.0.3.4","dst":{"ifindex":6,"addrs":{"Single":"224.0.0.5"}}}}
{"NetTxPacket":{"packet":{"LsUpdate":{"hdr":{"pkt_type":"LsUpdate","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsas":[{"hdr":{"options":"E","lsa_type":10,"lsa_id":"4.0.0.0","adv_rtr":"4.4.4.4","length":28},"body":{"OpaqueArea":{"RouterInfo":{"info_caps":"STUB_ROUTER","func_caps":null,"sr_algo":null,"srgb":[],"srlb":[],"msds":null,"srms_pref":null,"unknown_tlvs":[]}}}}]}},"src":"10.0.6.4","dst":{"ifindex":3,"addrs":{"Single":"224.0.0.5"}}}}
{"NetTxPacket":{"packet":{"LsUpdate":{"hdr":{"pkt_type":"LsUpdate","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsas":[{"hdr":{"options":"E","lsa_type":1,"lsa_id":"1.1.1.1","adv_rtr":"1.1.1.1","length":48},"body":{"Router":{"flags":"","links":[{"link_type":"TransitNetwork","link_id":"10.0.1.3","link_data":"10.0.1.1","metric":10},{"link_type":"StubNetwork","link_id":"1.1.1.1","link_data":"255.255.255.255","metric":0}]}}},{"hdr":{"options":"E","lsa_type":10,"lsa_id":"4.0.0.0","adv_rtr":"4.4.4.4","length":28},"body":{"OpaqueArea":{"RouterInfo":{"info_caps":"STUB_ROUTER","func_caps":null,"sr_algo":null,"srgb":[],"srlb":[],"msds":null,"srms_pref":null,"unknown_tlvs":[]}}}}]}},"src":"10.0.7.4","dst":{"ifindex":7,"addrs":{"Single":"224.0.0.5"}}}}
{"NetTxPacket":{"packet":{"LsUpdate":{"hdr":{"pkt_type":"LsUpdate","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsas":[{"hdr":{"options":"E","lsa_type":10,"lsa_id":"4.0.0.0","adv_rtr":"4.4.4.4","length":28},"body":{"OpaqueArea":{"RouterInfo":{"info_caps":"STUB_ROUTER","func_caps":null,"sr_algo":null,"srgb":[],"srlb":[],"msds":null,"srms_pref":null,"unknown_tlvs":[]}}}}]}},"src":"10.0.2.4","dst":{"ifindex":4,"addrs":["224.0.0.5"]}}}
{"NetTxPacket":{"packet":{"LsUpdate":{"hdr":{"pkt_type":"LsUpdate","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsas":[{"hdr":{"options":"E","lsa_type":10,"lsa_id":"4.0.0.0","adv_rtr":"4.4.4.4","length":28},"body":{"OpaqueArea":{"RouterInfo":{"info_caps":"STUB_ROUTER","func_caps":null,"sr_algo":null,"srgb":[],"srlb":[],"msds":null,"srms_pref":null,"unknown_tlvs":[]}}}}]}},"src":"10.0.3.4","dst":{"ifindex":6,"addrs":["224.0.0.5"]}}}
{"NetTxPacket":{"packet":{"LsUpdate":{"hdr":{"pkt_type":"LsUpdate","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsas":[{"hdr":{"options":"E","lsa_type":10,"lsa_id":"4.0.0.0","adv_rtr":"4.4.4.4","length":28},"body":{"OpaqueArea":{"RouterInfo":{"info_caps":"STUB_ROUTER","func_caps":null,"sr_algo":null,"srgb":[],"srlb":[],"msds":null,"srms_pref":null,"unknown_tlvs":[]}}}}]}},"src":"10.0.6.4","dst":{"ifindex":3,"addrs":["224.0.0.5"]}}}
{"NetTxPacket":{"packet":{"LsUpdate":{"hdr":{"pkt_type":"LsUpdate","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsas":[{"hdr":{"options":"E","lsa_type":1,"lsa_id":"1.1.1.1","adv_rtr":"1.1.1.1","length":48},"body":{"Router":{"flags":"","links":[{"link_type":"TransitNetwork","link_id":"10.0.1.3","link_data":"10.0.1.1","metric":10},{"link_type":"StubNetwork","link_id":"1.1.1.1","link_data":"255.255.255.255","metric":0}]}}},{"hdr":{"options":"E","lsa_type":10,"lsa_id":"4.0.0.0","adv_rtr":"4.4.4.4","length":28},"body":{"OpaqueArea":{"RouterInfo":{"info_caps":"STUB_ROUTER","func_caps":null,"sr_algo":null,"srgb":[],"srlb":[],"msds":null,"srms_pref":null,"unknown_tlvs":[]}}}}]}},"src":"10.0.7.4","dst":{"ifindex":7,"addrs":["224.0.0.5"]}}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"NetTxPacket":{"packet":{"LsAck":{"hdr":{"pkt_type":"LsAck","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsa_hdrs":[{"options":"E","lsa_type":9,"lsa_id":"3.0.0.0","adv_rtr":"6.6.6.6","length":36}]}},"src":"10.0.7.4","dst":{"ifindex":7,"addrs":{"Single":"224.0.0.5"}}}}
{"NetTxPacket":{"packet":{"LsAck":{"hdr":{"pkt_type":"LsAck","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsa_hdrs":[{"options":"E","lsa_type":9,"lsa_id":"3.0.0.0","adv_rtr":"6.6.6.6","length":36}]}},"src":"10.0.7.4","dst":{"ifindex":7,"addrs":["224.0.0.5"]}}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"NetTxPacket":{"packet":{"LsAck":{"hdr":{"pkt_type":"LsAck","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsa_hdrs":[{"options":"E","lsa_type":9,"lsa_id":"3.0.0.0","adv_rtr":"6.6.6.6","length":36}]}},"src":"10.0.7.4","dst":{"ifindex":7,"addrs":{"Single":"224.0.0.5"}}}}
{"NetTxPacket":{"packet":{"LsAck":{"hdr":{"pkt_type":"LsAck","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsa_hdrs":[{"options":"E","lsa_type":9,"lsa_id":"3.0.0.0","adv_rtr":"6.6.6.6","length":36}]}},"src":"10.0.7.4","dst":{"ifindex":7,"addrs":["224.0.0.5"]}}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"NetTxPacket":{"packet":{"LsAck":{"hdr":{"pkt_type":"LsAck","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsa_hdrs":[{"age":3600,"options":"E","lsa_type":9,"lsa_id":"3.0.0.0","adv_rtr":"6.6.6.6","length":36}]}},"src":"10.0.7.4","dst":{"ifindex":7,"addrs":{"Single":"224.0.0.5"}}}}
{"NetTxPacket":{"packet":{"LsAck":{"hdr":{"pkt_type":"LsAck","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsa_hdrs":[{"age":3600,"options":"E","lsa_type":9,"lsa_id":"3.0.0.0","adv_rtr":"6.6.6.6","length":36}]}},"src":"10.0.7.4","dst":{"ifindex":7,"addrs":["224.0.0.5"]}}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"NetTxPacket":{"packet":{"LsAck":{"hdr":{"pkt_type":"LsAck","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsa_hdrs":[{"options":"E","lsa_type":9,"lsa_id":"3.0.0.0","adv_rtr":"6.6.6.6","length":36}]}},"src":"10.0.7.4","dst":{"ifindex":7,"addrs":{"Single":"224.0.0.5"}}}}
{"NetTxPacket":{"packet":{"LsAck":{"hdr":{"pkt_type":"LsAck","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsa_hdrs":[{"options":"E","lsa_type":9,"lsa_id":"3.0.0.0","adv_rtr":"6.6.6.6","length":36}]}},"src":"10.0.7.4","dst":{"ifindex":7,"addrs":["224.0.0.5"]}}}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{"NetTxPacket":{"packet":{"LsUpdate":{"hdr":{"pkt_type":"LsUpdate","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsas":[{"hdr":{"options":"E","lsa_type":1,"lsa_id":"4.4.4.4","adv_rtr":"4.4.4.4","length":120},"body":{"Router":{"flags":"","links":[{"link_type":"PointToPoint","link_id":"2.2.2.2","link_data":"10.0.2.4","metric":10},{"link_type":"StubNetwork","link_id":"10.0.2.0","link_data":"255.255.255.0","metric":10},{"link_type":"PointToPoint","link_id":"2.2.2.2","link_data":"10.0.3.4","metric":10},{"link_type":"StubNetwork","link_id":"10.0.3.0","link_data":"255.255.255.0","metric":10},{"link_type":"PointToPoint","link_id":"5.5.5.5","link_data":"10.0.6.4","metric":10},{"link_type":"StubNetwork","link_id":"10.0.6.0","link_data":"255.255.255.0","metric":10},{"link_type":"StubNetwork","link_id":"10.0.7.0","link_data":"255.255.255.0","metric":10},{"link_type":"StubNetwork","link_id":"4.4.4.4","link_data":"255.255.255.255","metric":0}]}}}]}},"src":"10.0.2.4","dst":{"ifindex":4,"addrs":{"Single":"224.0.0.5"}}}}
{"NetTxPacket":{"packet":{"LsUpdate":{"hdr":{"pkt_type":"LsUpdate","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsas":[{"hdr":{"options":"E","lsa_type":1,"lsa_id":"4.4.4.4","adv_rtr":"4.4.4.4","length":120},"body":{"Router":{"flags":"","links":[{"link_type":"PointToPoint","link_id":"2.2.2.2","link_data":"10.0.2.4","metric":10},{"link_type":"StubNetwork","link_id":"10.0.2.0","link_data":"255.255.255.0","metric":10},{"link_type":"PointToPoint","link_id":"2.2.2.2","link_data":"10.0.3.4","metric":10},{"link_type":"StubNetwork","link_id":"10.0.3.0","link_data":"255.255.255.0","metric":10},{"link_type":"PointToPoint","link_id":"5.5.5.5","link_data":"10.0.6.4","metric":10},{"link_type":"StubNetwork","link_id":"10.0.6.0","link_data":"255.255.255.0","metric":10},{"link_type":"StubNetwork","link_id":"10.0.7.0","link_data":"255.255.255.0","metric":10},{"link_type":"StubNetwork","link_id":"4.4.4.4","link_data":"255.255.255.255","metric":0}]}}}]}},"src":"10.0.3.4","dst":{"ifindex":6,"addrs":{"Single":"224.0.0.5"}}}}
{"NetTxPacket":{"packet":{"LsUpdate":{"hdr":{"pkt_type":"LsUpdate","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsas":[{"hdr":{"options":"E","lsa_type":1,"lsa_id":"4.4.4.4","adv_rtr":"4.4.4.4","length":120},"body":{"Router":{"flags":"","links":[{"link_type":"PointToPoint","link_id":"2.2.2.2","link_data":"10.0.2.4","metric":10},{"link_type":"StubNetwork","link_id":"10.0.2.0","link_data":"255.255.255.0","metric":10},{"link_type":"PointToPoint","link_id":"2.2.2.2","link_data":"10.0.3.4","metric":10},{"link_type":"StubNetwork","link_id":"10.0.3.0","link_data":"255.255.255.0","metric":10},{"link_type":"PointToPoint","link_id":"5.5.5.5","link_data":"10.0.6.4","metric":10},{"link_type":"StubNetwork","link_id":"10.0.6.0","link_data":"255.255.255.0","metric":10},{"link_type":"StubNetwork","link_id":"10.0.7.0","link_data":"255.255.255.0","metric":10},{"link_type":"StubNetwork","link_id":"4.4.4.4","link_data":"255.255.255.255","metric":0}]}}}]}},"src":"10.0.6.4","dst":{"ifindex":3,"addrs":{"Single":"224.0.0.5"}}}}
{"NetTxPacket":{"packet":{"LsUpdate":{"hdr":{"pkt_type":"LsUpdate","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsas":[{"hdr":{"options":"E","lsa_type":1,"lsa_id":"4.4.4.4","adv_rtr":"4.4.4.4","length":120},"body":{"Router":{"flags":"","links":[{"link_type":"PointToPoint","link_id":"2.2.2.2","link_data":"10.0.2.4","metric":10},{"link_type":"StubNetwork","link_id":"10.0.2.0","link_data":"255.255.255.0","metric":10},{"link_type":"PointToPoint","link_id":"2.2.2.2","link_data":"10.0.3.4","metric":10},{"link_type":"StubNetwork","link_id":"10.0.3.0","link_data":"255.255.255.0","metric":10},{"link_type":"PointToPoint","link_id":"5.5.5.5","link_data":"10.0.6.4","metric":10},{"link_type":"StubNetwork","link_id":"10.0.6.0","link_data":"255.255.255.0","metric":10},{"link_type":"StubNetwork","link_id":"10.0.7.0","link_data":"255.255.255.0","metric":10},{"link_type":"StubNetwork","link_id":"4.4.4.4","link_data":"255.255.255.255","metric":0}]}}}]}},"src":"10.0.2.4","dst":{"ifindex":4,"addrs":["224.0.0.5"]}}}
{"NetTxPacket":{"packet":{"LsUpdate":{"hdr":{"pkt_type":"LsUpdate","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsas":[{"hdr":{"options":"E","lsa_type":1,"lsa_id":"4.4.4.4","adv_rtr":"4.4.4.4","length":120},"body":{"Router":{"flags":"","links":[{"link_type":"PointToPoint","link_id":"2.2.2.2","link_data":"10.0.2.4","metric":10},{"link_type":"StubNetwork","link_id":"10.0.2.0","link_data":"255.255.255.0","metric":10},{"link_type":"PointToPoint","link_id":"2.2.2.2","link_data":"10.0.3.4","metric":10},{"link_type":"StubNetwork","link_id":"10.0.3.0","link_data":"255.255.255.0","metric":10},{"link_type":"PointToPoint","link_id":"5.5.5.5","link_data":"10.0.6.4","metric":10},{"link_type":"StubNetwork","link_id":"10.0.6.0","link_data":"255.255.255.0","metric":10},{"link_type":"StubNetwork","link_id":"10.0.7.0","link_data":"255.255.255.0","metric":10},{"link_type":"StubNetwork","link_id":"4.4.4.4","link_data":"255.255.255.255","metric":0}]}}}]}},"src":"10.0.3.4","dst":{"ifindex":6,"addrs":["224.0.0.5"]}}}
{"NetTxPacket":{"packet":{"LsUpdate":{"hdr":{"pkt_type":"LsUpdate","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsas":[{"hdr":{"options":"E","lsa_type":1,"lsa_id":"4.4.4.4","adv_rtr":"4.4.4.4","length":120},"body":{"Router":{"flags":"","links":[{"link_type":"PointToPoint","link_id":"2.2.2.2","link_data":"10.0.2.4","metric":10},{"link_type":"StubNetwork","link_id":"10.0.2.0","link_data":"255.255.255.0","metric":10},{"link_type":"PointToPoint","link_id":"2.2.2.2","link_data":"10.0.3.4","metric":10},{"link_type":"StubNetwork","link_id":"10.0.3.0","link_data":"255.255.255.0","metric":10},{"link_type":"PointToPoint","link_id":"5.5.5.5","link_data":"10.0.6.4","metric":10},{"link_type":"StubNetwork","link_id":"10.0.6.0","link_data":"255.255.255.0","metric":10},{"link_type":"StubNetwork","link_id":"10.0.7.0","link_data":"255.255.255.0","metric":10},{"link_type":"StubNetwork","link_id":"4.4.4.4","link_data":"255.255.255.255","metric":0}]}}}]}},"src":"10.0.6.4","dst":{"ifindex":3,"addrs":["224.0.0.5"]}}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"NetTxPacket":{"packet":{"LsAck":{"hdr":{"pkt_type":"LsAck","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsa_hdrs":[{"options":"E","lsa_type":9,"lsa_id":"3.0.0.0","adv_rtr":"6.6.6.6","length":36}]}},"src":"10.0.7.4","dst":{"ifindex":7,"addrs":{"Single":"224.0.0.5"}}}}
{"NetTxPacket":{"packet":{"LsAck":{"hdr":{"pkt_type":"LsAck","router_id":"4.4.4.4","area_id":"0.0.0.0"},"lsa_hdrs":[{"options":"E","lsa_type":9,"lsa_id":"3.0.0.0","adv_rtr":"6.6.6.6","length":36}]}},"src":"10.0.7.4","dst":{"ifindex":7,"addrs":["224.0.0.5"]}}}
Loading

0 comments on commit f367e07

Please sign in to comment.