Skip to content

Commit fe7e196

Browse files
committed
isis: rename per-level configuration structs for clarity
* `LevelsCfg` -> `LevelsCfgWithDefault` * `LevelsOptCfg` -> `LevelsCfg` The IETF IS-IS YANG module defines some configiration options with default values that can be overridden per level (L1 and/or L2). These are now represented by the `LevelsCfgWithDefault` struct. For options without defaults but still configurable per level, the renamed `LevelsCfg` struct is used. Signed-off-by: Renato Westphal <[email protected]>
1 parent 390cc71 commit fe7e196

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

holo-isis/src/northbound/configuration.rs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ pub struct InstanceCfg {
105105
pub lsp_refresh: u16,
106106
pub purge_originator: bool,
107107
pub node_tags: BTreeSet<u32>,
108-
pub metric_type: LevelsCfg<MetricType>,
109-
pub default_metric: LevelsCfg<u32>,
110-
pub auth: LevelsOptCfg<AuthCfg>,
108+
pub metric_type: LevelsCfgWithDefault<MetricType>,
109+
pub default_metric: LevelsCfgWithDefault<u32>,
110+
pub auth: LevelsCfg<AuthCfg>,
111111
pub ipv4_router_id: Option<Ipv4Addr>,
112112
pub ipv6_router_id: Option<Ipv6Addr>,
113113
pub max_paths: u16,
@@ -131,7 +131,7 @@ pub struct InstanceCfg {
131131
#[derive(Debug)]
132132
pub struct InstanceMtCfg {
133133
pub enabled: bool,
134-
pub default_metric: LevelsCfg<u32>,
134+
pub default_metric: LevelsCfgWithDefault<u32>,
135135
}
136136

137137
#[derive(Debug)]
@@ -205,11 +205,11 @@ pub struct InterfaceCfg {
205205
pub hello_padding: bool,
206206
pub interface_type: InterfaceType,
207207
pub node_flag: bool,
208-
pub hello_auth: LevelsOptCfg<AuthCfg>,
209-
pub hello_interval: LevelsCfg<u16>,
210-
pub hello_multiplier: LevelsCfg<u16>,
211-
pub priority: LevelsCfg<u8>,
212-
pub metric: LevelsCfg<u32>,
208+
pub hello_auth: LevelsCfg<AuthCfg>,
209+
pub hello_interval: LevelsCfgWithDefault<u16>,
210+
pub hello_multiplier: LevelsCfgWithDefault<u16>,
211+
pub priority: LevelsCfgWithDefault<u8>,
212+
pub metric: LevelsCfgWithDefault<u32>,
213213
pub bfd_enabled: bool,
214214
pub bfd_params: bfd::ClientCfg,
215215
pub afs: BTreeSet<AddressFamily>,
@@ -220,7 +220,7 @@ pub struct InterfaceCfg {
220220
#[derive(Debug)]
221221
pub struct InterfaceMtCfg {
222222
pub enabled: bool,
223-
pub metric: LevelsCfg<u32>,
223+
pub metric: LevelsCfgWithDefault<u32>,
224224
}
225225

226226
#[derive(Clone, Copy, Debug)]
@@ -247,14 +247,14 @@ pub struct AuthCfg {
247247
}
248248

249249
#[derive(Debug)]
250-
pub struct LevelsCfg<T> {
250+
pub struct LevelsCfgWithDefault<T> {
251251
all: T,
252252
l1: Option<T>,
253253
l2: Option<T>,
254254
}
255255

256256
#[derive(Debug, Default)]
257-
pub struct LevelsOptCfg<T> {
257+
pub struct LevelsCfg<T> {
258258
pub all: T,
259259
pub l1: T,
260260
pub l2: T,
@@ -2382,7 +2382,7 @@ impl InterfaceCfg {
23822382
}
23832383
}
23842384

2385-
impl<T> LevelsCfg<T>
2385+
impl<T> LevelsCfgWithDefault<T>
23862386
where
23872387
T: Copy,
23882388
{
@@ -2464,13 +2464,13 @@ impl Default for InstanceCfg {
24642464
let lsp_refresh = isis::lsp_refresh::DFLT;
24652465
let purge_originator = isis::poi_tlv::DFLT;
24662466
let metric_type = isis::metric_type::value::DFLT;
2467-
let metric_type = LevelsCfg {
2467+
let metric_type = LevelsCfgWithDefault {
24682468
all: MetricType::try_from_yang(metric_type).unwrap(),
24692469
l1: None,
24702470
l2: None,
24712471
};
24722472
let default_metric = isis::default_metric::value::DFLT;
2473-
let default_metric = LevelsCfg {
2473+
let default_metric = LevelsCfgWithDefault {
24742474
all: default_metric,
24752475
l1: None,
24762476
l2: None,
@@ -2529,7 +2529,7 @@ impl Default for InstanceMtCfg {
25292529
let enabled = isis::topologies::topology::enabled::DFLT;
25302530
let default_metric =
25312531
isis::topologies::topology::default_metric::value::DFLT;
2532-
let default_metric = LevelsCfg {
2532+
let default_metric = LevelsCfgWithDefault {
25332533
all: default_metric,
25342534
l1: None,
25352535
l2: None,
@@ -2607,26 +2607,26 @@ impl Default for InterfaceCfg {
26072607
let node_flag = isis::interfaces::interface::node_flag::DFLT;
26082608
let hello_interval =
26092609
isis::interfaces::interface::hello_interval::value::DFLT;
2610-
let hello_interval = LevelsCfg {
2610+
let hello_interval = LevelsCfgWithDefault {
26112611
all: hello_interval,
26122612
l1: None,
26132613
l2: None,
26142614
};
26152615
let hello_multiplier =
26162616
isis::interfaces::interface::hello_multiplier::value::DFLT;
2617-
let hello_multiplier = LevelsCfg {
2617+
let hello_multiplier = LevelsCfgWithDefault {
26182618
all: hello_multiplier,
26192619
l1: None,
26202620
l2: None,
26212621
};
26222622
let priority = isis::interfaces::interface::priority::value::DFLT;
2623-
let priority = LevelsCfg {
2623+
let priority = LevelsCfgWithDefault {
26242624
all: priority,
26252625
l1: None,
26262626
l2: None,
26272627
};
26282628
let metric = isis::interfaces::interface::metric::value::DFLT;
2629-
let metric = LevelsCfg {
2629+
let metric = LevelsCfgWithDefault {
26302630
all: metric,
26312631
l1: None,
26322632
l2: None,
@@ -2661,7 +2661,7 @@ impl Default for InterfaceMtCfg {
26612661
let enabled =
26622662
isis::interfaces::interface::topologies::topology::enabled::DFLT;
26632663
let metric = isis::interfaces::interface::topologies::topology::metric::value::DFLT;
2664-
let metric = LevelsCfg {
2664+
let metric = LevelsCfgWithDefault {
26652665
all: metric,
26662666
l1: None,
26672667
l2: None,

0 commit comments

Comments
 (0)