Skip to content

Commit

Permalink
ospf: update to [email protected]
Browse files Browse the repository at this point in the history
This is a big update, as the "ietf-ospf-sr" and "ietf-ospfv3-sr"
were merged into one. The new module version also includes smaller
changes such as a different type for the "algorithm" leafs.

Signed-off-by: Renato Westphal <[email protected]>
  • Loading branch information
rwestphal committed Jul 13, 2023
1 parent 9136085 commit cc448c3
Show file tree
Hide file tree
Showing 11 changed files with 1,506 additions and 1,480 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,9 @@ Holo supports the following IETF RFCs and Internet drafts:
| ietf-ip@2018-01-09 | 17.39% | 0.00% | - | - | [13.33%](http://westphal.com.br/holo/ietf-ip.html) |
| ietf-key-chain@2017-04-18 | 100.00% | 100.00% | - | - | [100.00%](http://westphal.com.br/holo/ietf-key-chain.html) |
| ietf-mpls-ldp@2022-03-14 | 86.96% | 92.31% | 100.00% | 100.00% | [92.38%](http://westphal.com.br/holo/ietf-mpls-ldp.html) |
| ietf-ospf-sr@2023-01-01 | 16.67% | 56.52% | - | - | [53.33%](http://westphal.com.br/holo/ietf-ospf-sr.html) |
| ietf-ospf@2019-10-17 | 75.90% | 59.36% | 100.00% | 31.18% | [58.52%](http://westphal.com.br/holo/ietf-ospf.html) |
| ietf-ospf-sr@2023-07-09 | 25.00% | 53.95% | - | - | [52.81%](http://westphal.com.br/holo/ietf-ospf-sr.html) |
| ietf-ospf@2022-10-19 | 75.90% | 59.36% | 100.00% | 31.18% | [58.52%](http://westphal.com.br/holo/ietf-ospf.html) |
| ietf-ospfv3-extended-lsa@2023-06-29 | 50.00% | 84.41% | - | - | [84.04%](http://westphal.com.br/holo/ietf-ospfv3-extended-lsa.html) |
| ietf-ospfv3-sr@2022-10-21 | - | 51.63% | - | - | [51.63%](http://westphal.com.br/holo/ietf-ospfv3-sr.html) |
| ietf-rip@2020-02-20 | 27.91% | 93.33% | 100.00% | - | [55.41%](http://westphal.com.br/holo/ietf-rip.html) |
| ietf-routing@2018-03-13 | 50.00% | 0.00% | - | - | [23.08%](http://westphal.com.br/holo/ietf-routing.html) |
| ietf-segment-routing-mpls@2021-05-26 | 62.50% | 0.00% | - | 23.53% | [32.76%](http://westphal.com.br/holo/ietf-segment-routing-mpls.html) |
Expand Down
1 change: 0 additions & 1 deletion holo-ospf/src/northbound/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ where
"ietf-ospf",
"ietf-ospf-sr",
"ietf-ospfv3-extended-lsa",
"ietf-ospfv3-sr",
"holo-ospf",
"holo-ospf-dev",
]
Expand Down
24 changes: 12 additions & 12 deletions holo-ospf/src/northbound/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1164,9 +1164,9 @@ fn load_callbacks_ospfv2() -> Callbacks<Instance<Ospfv2>> {
None
}
})
.get_element_u8(|_instance, args| {
.get_element_string(|_instance, args| {
let algo = args.list_entry.as_sr_algo().unwrap();
Some(algo.to_u8().unwrap())
Some(algo.to_yang())
})
.path(ospf::database::as_scope_lsa_type::as_scope_lsas::as_scope_lsa::ospfv2::body::opaque::ri_opaque::sid_range_tlvs::sid_range_tlv::PATH)
.get_iterate(|_instance, args| {
Expand Down Expand Up @@ -1731,9 +1731,9 @@ fn load_callbacks_ospfv2() -> Callbacks<Instance<Ospfv2>> {
None
}
})
.get_element_u8(|_instance, args| {
.get_element_string(|_instance, args| {
let algo = args.list_entry.as_sr_algo().unwrap();
Some(algo.to_u8().unwrap())
Some(algo.to_yang())
})
.path(ospf::areas::area::database::area_scope_lsa_type::area_scope_lsas::area_scope_lsa::ospfv2::body::opaque::ri_opaque::sid_range_tlvs::sid_range_tlv::PATH)
.get_iterate(|_instance, args| {
Expand Down Expand Up @@ -1885,9 +1885,9 @@ fn load_callbacks_ospfv2() -> Callbacks<Instance<Ospfv2>> {
Some(0)
})
.path(ospf::areas::area::database::area_scope_lsa_type::area_scope_lsas::area_scope_lsa::ospfv2::body::opaque::extended_prefix_opaque::extended_prefix_tlv::prefix_sid_sub_tlvs::prefix_sid_sub_tlv::algorithm::PATH)
.get_element_u8(|_instance, args| {
.get_element_string(|_instance, args| {
let prefix_sid = args.list_entry.as_ospfv2_prefix_sid().unwrap();
Some(prefix_sid.algo as u8)
Some(prefix_sid.algo.to_yang())
})
.path(ospf::areas::area::database::area_scope_lsa_type::area_scope_lsas::area_scope_lsa::ospfv2::body::opaque::extended_prefix_opaque::extended_prefix_tlv::prefix_sid_sub_tlvs::prefix_sid_sub_tlv::sid::PATH)
.get_element_u32(|_instance, args| {
Expand Down Expand Up @@ -2369,9 +2369,9 @@ fn load_callbacks_ospfv2() -> Callbacks<Instance<Ospfv2>> {
None
}
})
.get_element_u8(|_instance, args| {
.get_element_string(|_instance, args| {
let algo = args.list_entry.as_sr_algo().unwrap();
Some(algo.to_u8().unwrap())
Some(algo.to_yang())
})
.path(ospf::areas::area::interfaces::interface::database::link_scope_lsa_type::link_scope_lsas::link_scope_lsa::ospfv2::body::opaque::ri_opaque::sid_range_tlvs::sid_range_tlv::PATH)
.get_iterate(|_instance, args| {
Expand Down Expand Up @@ -2828,9 +2828,9 @@ fn load_callbacks_ospfv3() -> Callbacks<Instance<Ospfv3>> {
None
}
})
.get_element_u8(|_instance, args| {
.get_element_string(|_instance, args| {
let algo = args.list_entry.as_sr_algo().unwrap();
Some(algo.to_u8().unwrap())
Some(algo.to_yang())
})
.path(ospf::database::as_scope_lsa_type::as_scope_lsas::as_scope_lsa::ospfv3::body::router_information::sid_range_tlvs::sid_range_tlv::PATH)
.get_iterate(|_instance, args| {
Expand Down Expand Up @@ -3466,9 +3466,9 @@ fn load_callbacks_ospfv3() -> Callbacks<Instance<Ospfv3>> {
None
}
})
.get_element_u8(|_instance, args| {
.get_element_string(|_instance, args| {
let algo = args.list_entry.as_sr_algo().unwrap();
Some(algo.to_u8().unwrap())
Some(algo.to_yang())
})
.path(ospf::areas::area::database::area_scope_lsa_type::area_scope_lsas::area_scope_lsa::ospfv3::body::router_information::sid_range_tlvs::sid_range_tlv::PATH)
.get_iterate(|_instance, args| {
Expand Down
1 change: 1 addition & 0 deletions holo-ospf/tests/packet/ospfv3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,7 @@ static EXT_INTRA_AREA_PREFIX_LSA1: Lazy<(Vec<u8>, Lsa<Ospfv3>)> =
IgpAlgoType::Spf => {
PrefixSid {
flags: PrefixSidFlags::empty(),
algo: IgpAlgoType::Spf,
sid: Sid::Index(20),
}
}
Expand Down
1 change: 0 additions & 1 deletion holo-tools/yang-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ cargo run --bin yang_coverage --\
-m ietf-ospf\
-m ietf-ospf-sr\
-m ietf-ospfv3-extended-lsa\
-m ietf-ospfv3-sr\
-m ietf-rip
8 changes: 6 additions & 2 deletions holo-utils/src/sr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,13 @@ pub struct SrCfgLabelRange {
impl ToYang for IgpAlgoType {
fn to_yang(&self) -> String {
match self {
IgpAlgoType::Spf => "prefix-sid-algorithm-shortest-path".to_owned(),
IgpAlgoType::Spf => {
"ietf-segment-routing-common:prefix-sid-algorithm-shortest-path"
.to_owned()
}
IgpAlgoType::StrictSpf => {
"prefix-sid-algorithm-strict-spf".to_owned()
"ietf-segment-routing-common:prefix-sid-algorithm-strict-spf"
.to_owned()
}
}
}
Expand Down
Loading

0 comments on commit cc448c3

Please sign in to comment.