@@ -105,9 +105,9 @@ pub struct InstanceCfg {
105
105
pub lsp_refresh : u16 ,
106
106
pub purge_originator : bool ,
107
107
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 > ,
111
111
pub ipv4_router_id : Option < Ipv4Addr > ,
112
112
pub ipv6_router_id : Option < Ipv6Addr > ,
113
113
pub max_paths : u16 ,
@@ -131,7 +131,7 @@ pub struct InstanceCfg {
131
131
#[ derive( Debug ) ]
132
132
pub struct InstanceMtCfg {
133
133
pub enabled : bool ,
134
- pub default_metric : LevelsCfg < u32 > ,
134
+ pub default_metric : LevelsCfgWithDefault < u32 > ,
135
135
}
136
136
137
137
#[ derive( Debug ) ]
@@ -205,11 +205,11 @@ pub struct InterfaceCfg {
205
205
pub hello_padding : bool ,
206
206
pub interface_type : InterfaceType ,
207
207
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 > ,
213
213
pub bfd_enabled : bool ,
214
214
pub bfd_params : bfd:: ClientCfg ,
215
215
pub afs : BTreeSet < AddressFamily > ,
@@ -220,7 +220,7 @@ pub struct InterfaceCfg {
220
220
#[ derive( Debug ) ]
221
221
pub struct InterfaceMtCfg {
222
222
pub enabled : bool ,
223
- pub metric : LevelsCfg < u32 > ,
223
+ pub metric : LevelsCfgWithDefault < u32 > ,
224
224
}
225
225
226
226
#[ derive( Clone , Copy , Debug ) ]
@@ -247,14 +247,14 @@ pub struct AuthCfg {
247
247
}
248
248
249
249
#[ derive( Debug ) ]
250
- pub struct LevelsCfg < T > {
250
+ pub struct LevelsCfgWithDefault < T > {
251
251
all : T ,
252
252
l1 : Option < T > ,
253
253
l2 : Option < T > ,
254
254
}
255
255
256
256
#[ derive( Debug , Default ) ]
257
- pub struct LevelsOptCfg < T > {
257
+ pub struct LevelsCfg < T > {
258
258
pub all : T ,
259
259
pub l1 : T ,
260
260
pub l2 : T ,
@@ -2382,7 +2382,7 @@ impl InterfaceCfg {
2382
2382
}
2383
2383
}
2384
2384
2385
- impl < T > LevelsCfg < T >
2385
+ impl < T > LevelsCfgWithDefault < T >
2386
2386
where
2387
2387
T : Copy ,
2388
2388
{
@@ -2464,13 +2464,13 @@ impl Default for InstanceCfg {
2464
2464
let lsp_refresh = isis:: lsp_refresh:: DFLT ;
2465
2465
let purge_originator = isis:: poi_tlv:: DFLT ;
2466
2466
let metric_type = isis:: metric_type:: value:: DFLT ;
2467
- let metric_type = LevelsCfg {
2467
+ let metric_type = LevelsCfgWithDefault {
2468
2468
all : MetricType :: try_from_yang ( metric_type) . unwrap ( ) ,
2469
2469
l1 : None ,
2470
2470
l2 : None ,
2471
2471
} ;
2472
2472
let default_metric = isis:: default_metric:: value:: DFLT ;
2473
- let default_metric = LevelsCfg {
2473
+ let default_metric = LevelsCfgWithDefault {
2474
2474
all : default_metric,
2475
2475
l1 : None ,
2476
2476
l2 : None ,
@@ -2529,7 +2529,7 @@ impl Default for InstanceMtCfg {
2529
2529
let enabled = isis:: topologies:: topology:: enabled:: DFLT ;
2530
2530
let default_metric =
2531
2531
isis:: topologies:: topology:: default_metric:: value:: DFLT ;
2532
- let default_metric = LevelsCfg {
2532
+ let default_metric = LevelsCfgWithDefault {
2533
2533
all : default_metric,
2534
2534
l1 : None ,
2535
2535
l2 : None ,
@@ -2607,26 +2607,26 @@ impl Default for InterfaceCfg {
2607
2607
let node_flag = isis:: interfaces:: interface:: node_flag:: DFLT ;
2608
2608
let hello_interval =
2609
2609
isis:: interfaces:: interface:: hello_interval:: value:: DFLT ;
2610
- let hello_interval = LevelsCfg {
2610
+ let hello_interval = LevelsCfgWithDefault {
2611
2611
all : hello_interval,
2612
2612
l1 : None ,
2613
2613
l2 : None ,
2614
2614
} ;
2615
2615
let hello_multiplier =
2616
2616
isis:: interfaces:: interface:: hello_multiplier:: value:: DFLT ;
2617
- let hello_multiplier = LevelsCfg {
2617
+ let hello_multiplier = LevelsCfgWithDefault {
2618
2618
all : hello_multiplier,
2619
2619
l1 : None ,
2620
2620
l2 : None ,
2621
2621
} ;
2622
2622
let priority = isis:: interfaces:: interface:: priority:: value:: DFLT ;
2623
- let priority = LevelsCfg {
2623
+ let priority = LevelsCfgWithDefault {
2624
2624
all : priority,
2625
2625
l1 : None ,
2626
2626
l2 : None ,
2627
2627
} ;
2628
2628
let metric = isis:: interfaces:: interface:: metric:: value:: DFLT ;
2629
- let metric = LevelsCfg {
2629
+ let metric = LevelsCfgWithDefault {
2630
2630
all : metric,
2631
2631
l1 : None ,
2632
2632
l2 : None ,
@@ -2661,7 +2661,7 @@ impl Default for InterfaceMtCfg {
2661
2661
let enabled =
2662
2662
isis:: interfaces:: interface:: topologies:: topology:: enabled:: DFLT ;
2663
2663
let metric = isis:: interfaces:: interface:: topologies:: topology:: metric:: value:: DFLT ;
2664
- let metric = LevelsCfg {
2664
+ let metric = LevelsCfgWithDefault {
2665
2665
all : metric,
2666
2666
l1 : None ,
2667
2667
l2 : None ,
0 commit comments