diff options
author | Emanuele Di Pascale <emanuele@voltanet.io> | 2018-12-10 14:30:40 +0100 |
---|---|---|
committer | Emanuele Di Pascale <emanuele@voltanet.io> | 2018-12-18 15:25:57 +0100 |
commit | cc50ddb273734df71eca219ef2837b5480d65946 (patch) | |
tree | c5632c6a9e16c3a82f74a6a2280fd7879b3a36dd /isisd/isis_circuit.c | |
parent | lib: add frr-isisd to the native models (diff) | |
download | frr-cc50ddb273734df71eca219ef2837b5480d65946.tar.xz frr-cc50ddb273734df71eca219ef2837b5480d65946.zip |
isisd: retrieve default values from the yang model
also fix a minor issue with isis_config_write where we were
not incrementing the write variable, which is used to append
a new line at the end of the vty string
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
Diffstat (limited to 'isisd/isis_circuit.c')
-rw-r--r-- | isisd/isis_circuit.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c index ad4f40467..81b4b397e 100644 --- a/isisd/isis_circuit.c +++ b/isisd/isis_circuit.c @@ -79,6 +79,47 @@ struct isis_circuit *isis_circuit_new() /* * Default values */ +#ifndef FABRICD + circuit->is_type = yang_get_default_enum( + "/frr-interface:lib/interface/frr-isisd:isis/circuit-type"); + circuit->flags = 0; + + circuit->pad_hellos = yang_get_default_bool( + "/frr-interface:lib/interface/frr-isisd:isis/hello/padding"); + circuit->hello_interval[0] = yang_get_default_uint32( + "/frr-interface:lib/interface/frr-isisd:isis/hello/interval/level-1"); + circuit->hello_interval[1] = yang_get_default_uint32( + "/frr-interface:lib/interface/frr-isisd:isis/hello/interval/level-2"); + circuit->hello_multiplier[0] = yang_get_default_uint32( + "/frr-interface:lib/interface/frr-isisd:isis/hello/multiplier/level-1"); + circuit->hello_multiplier[1] = yang_get_default_uint32( + "/frr-interface:lib/interface/frr-isisd:isis/hello/multiplier/level-2"); + circuit->csnp_interval[0] = yang_get_default_uint16( + "/frr-interface:lib/interface/frr-isisd:isis/csnp-interval/level-1"); + circuit->csnp_interval[1] = yang_get_default_uint16( + "/frr-interface:lib/interface/frr-isisd:isis/csnp-interval/level-2"); + circuit->psnp_interval[0] = yang_get_default_uint16( + "/frr-interface:lib/interface/frr-isisd:isis/psnp-interval/level-1"); + circuit->psnp_interval[1] = yang_get_default_uint16( + "/frr-interface:lib/interface/frr-isisd:isis/psnp-interval/level-2"); + circuit->priority[0] = yang_get_default_uint8( + "/frr-interface:lib/interface/frr-isisd:isis/priority/level-1"); + circuit->priority[1] = yang_get_default_uint8( + "/frr-interface:lib/interface/frr-isisd:isis/priority/level-2"); + circuit->metric[0] = yang_get_default_uint32( + "/frr-interface:lib/interface/frr-isisd:isis/metric/level-1"); + circuit->metric[1] = yang_get_default_uint32( + "/frr-interface:lib/interface/frr-isisd:isis/metric/level-2"); + circuit->te_metric[0] = yang_get_default_uint32( + "/frr-interface:lib/interface/frr-isisd:isis/metric/level-1"); + circuit->te_metric[1] = yang_get_default_uint32( + "/frr-interface:lib/interface/frr-isisd:isis/metric/level-2"); + + for (i = 0; i < 2; i++) { + circuit->level_arg[i].level = i + 1; + circuit->level_arg[i].circuit = circuit; + } +#else circuit->is_type = IS_LEVEL_1_AND_2; circuit->flags = 0; circuit->pad_hellos = 1; @@ -93,6 +134,7 @@ struct isis_circuit *isis_circuit_new() circuit->level_arg[i].level = i + 1; circuit->level_arg[i].circuit = circuit; } +#endif /* ifndef FABRICD */ circuit->mtc = mpls_te_circuit_new(); |