summaryrefslogtreecommitdiff
path: root/isisd/isis_circuit.c
diff options
context:
space:
mode:
Diffstat (limited to 'isisd/isis_circuit.c')
-rw-r--r--isisd/isis_circuit.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c
index dd5f921bef..ebf9901c52 100644
--- a/isisd/isis_circuit.c
+++ b/isisd/isis_circuit.c
@@ -107,7 +107,7 @@ struct isis_circuit *isis_circuit_new(struct interface *ifp, const char *tag)
"/frr-interface:lib/interface/frr-isisd:isis/circuit-type");
circuit->flags = 0;
- circuit->pad_hellos = yang_get_default_bool(
+ circuit->pad_hellos = yang_get_default_enum(
"/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");
@@ -145,7 +145,7 @@ struct isis_circuit *isis_circuit_new(struct interface *ifp, const char *tag)
#else
circuit->is_type_config = IS_LEVEL_1_AND_2;
circuit->flags = 0;
- circuit->pad_hellos = 1;
+ circuit->pad_hellos = ISIS_HELLO_PADDING_ALWAYS;
for (i = 0; i < 2; i++) {
circuit->hello_interval[i] = DEFAULT_HELLO_INTERVAL;
circuit->hello_multiplier[i] = DEFAULT_HELLO_MULTIPLIER;
@@ -1029,7 +1029,8 @@ void isis_circuit_print_json(struct isis_circuit *circuit,
circuit->hello_multiplier[0]);
json_object_string_add(
hold_json, "pad",
- (circuit->pad_hellos ? "yes" : "no"));
+ isis_hello_padding2string(
+ circuit->pad_hellos));
json_object_int_add(level_json, "cnsp-interval",
circuit->csnp_interval[0]);
json_object_int_add(level_json, "psnp-interval",
@@ -1137,11 +1138,11 @@ void isis_circuit_print_vty(struct isis_circuit *circuit, struct vty *vty,
vty_out(vty, ", Active neighbors: %u\n",
circuit->upadjcount[0]);
vty_out(vty,
- " Hello interval: %u, Holddown count: %u %s\n",
+ " Hello interval: %u, Holddown count: %u, Padding: %s\n",
circuit->hello_interval[0],
circuit->hello_multiplier[0],
- (circuit->pad_hellos ? "(pad)"
- : "(no-pad)"));
+ isis_hello_padding2string(
+ circuit->pad_hellos));
vty_out(vty,
" CNSP interval: %u, PSNP interval: %u\n",
circuit->csnp_interval[0],
@@ -1169,11 +1170,11 @@ void isis_circuit_print_vty(struct isis_circuit *circuit, struct vty *vty,
vty_out(vty, ", Active neighbors: %u\n",
circuit->upadjcount[1]);
vty_out(vty,
- " Hello interval: %u, Holddown count: %u %s\n",
+ " Hello interval: %u, Holddown count: %u, Padding: %s\n",
circuit->hello_interval[1],
circuit->hello_multiplier[1],
- (circuit->pad_hellos ? "(pad)"
- : "(no-pad)"));
+ isis_hello_padding2string(
+ circuit->pad_hellos));
vty_out(vty,
" CNSP interval: %u, PSNP interval: %u\n",
circuit->csnp_interval[1],
@@ -1319,11 +1320,20 @@ static int isis_interface_config_write(struct vty *vty)
}
}
- /* ISIS - Hello padding - Defaults to true so only
- * display if false */
- if (circuit->pad_hellos == 0) {
+ /* ISIS - Hello padding - Defaults to always so only
+ * display if not always */
+ switch (circuit->pad_hellos) {
+ case ISIS_HELLO_PADDING_DISABLED:
vty_out(vty, " no " PROTO_NAME " hello padding\n");
write++;
+ break;
+ case ISIS_HELLO_PADDING_SOMETIMES:
+ vty_out(vty, PROTO_NAME
+ " hello padding sometimes\n");
+ write++;
+ break;
+ case ISIS_HELLO_PADDING_ALWAYS:
+ break;
}
if (circuit->disable_threeway_adj) {