From e36ec6acbc347625e7fa1c6f63722292117884b5 Mon Sep 17 00:00:00 2001 From: Diogo Oliveira <14191454+dorDiogo@users.noreply.github.com> Date: Fri, 20 Jan 2023 17:08:45 -0800 Subject: isisd: Add support for isis hello padding sometimes New configuration to pad ISIS hello packets during adjacency formation only. Signed-off-by: Diogo Oliveira <14191454+dorDiogo@users.noreply.github.com> --- yang/frr-isisd.yang | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'yang') diff --git a/yang/frr-isisd.yang b/yang/frr-isisd.yang index ff3ba5d12..f2927339a 100644 --- a/yang/frr-isisd.yang +++ b/yang/frr-isisd.yang @@ -116,6 +116,26 @@ module frr-isisd { associated with an interface."; } + typedef hello-padding-type { + type enumeration { + enum "always" { + value 0; + description + "Add padding to all hello packets."; + } + enum "disabled" { + value 1; + description + "Do not add any padding to hello packets."; + } + enum "sometimes" { + value 2; + description + "Add padding to hello packets during adjacency formation only."; + } + } + } + typedef network-type { type enumeration { enum "unknown" { @@ -605,10 +625,10 @@ module frr-isisd { description "Parameters related to IS-IS hello PDUs."; leaf padding { - type boolean; - default "true"; + type hello-padding-type; + default "always"; description - "Add padding to IS-IS hello PDUs."; + "Type of padding for IS-IS hello packets."; } container interval { -- cgit v1.2.3 From 06fbbf293583f5ca647762c49c78ad27192f26dd Mon Sep 17 00:00:00 2001 From: Diogo Oliveira <14191454+dorDiogo@users.noreply.github.com> Date: Thu, 26 Jan 2023 09:29:51 -0800 Subject: isisd,tests,doc: Rename hello padding sometimes to hello padding during-adjacency-formation Signed-off-by: Diogo Oliveira <14191454+dorDiogo@users.noreply.github.com> --- doc/user/isisd.rst | 2 +- isisd/isis_circuit.c | 4 ++-- isisd/isis_circuit.h | 2 +- isisd/isis_cli.c | 6 +++--- isisd/isis_misc.c | 4 ++-- isisd/isis_pdu.c | 3 ++- isisd/isis_snmp.c | 3 ++- tests/topotests/isis_topo1/test_isis_topo1.py | 8 ++++---- yang/frr-isisd.yang | 2 +- 9 files changed, 18 insertions(+), 16 deletions(-) (limited to 'yang') diff --git a/doc/user/isisd.rst b/doc/user/isisd.rst index 84d6e7bcf..17e772b5f 100644 --- a/doc/user/isisd.rst +++ b/doc/user/isisd.rst @@ -206,7 +206,7 @@ ISIS interface Add padding to IS-IS hello packets. -.. clicmd:: isis hello padding sometimes +.. clicmd:: isis hello padding during-adjacency-formation Add padding to IS-IS hello packets during adjacency formation only. diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c index ebf9901c5..6d300236a 100644 --- a/isisd/isis_circuit.c +++ b/isisd/isis_circuit.c @@ -1327,9 +1327,9 @@ static int isis_interface_config_write(struct vty *vty) vty_out(vty, " no " PROTO_NAME " hello padding\n"); write++; break; - case ISIS_HELLO_PADDING_SOMETIMES: + case ISIS_HELLO_PADDING_DURING_ADJACENCY_FORMATION: vty_out(vty, PROTO_NAME - " hello padding sometimes\n"); + " hello padding during-adjacency-formation\n"); write++; break; case ISIS_HELLO_PADDING_ALWAYS: diff --git a/isisd/isis_circuit.h b/isisd/isis_circuit.h index 58aa28195..df977893e 100644 --- a/isisd/isis_circuit.h +++ b/isisd/isis_circuit.h @@ -69,7 +69,7 @@ struct isis_circuit_arg { enum isis_hello_padding { ISIS_HELLO_PADDING_ALWAYS, ISIS_HELLO_PADDING_DISABLED, - ISIS_HELLO_PADDING_SOMETIMES + ISIS_HELLO_PADDING_DURING_ADJACENCY_FORMATION }; struct isis_circuit { diff --git a/isisd/isis_cli.c b/isisd/isis_cli.c index f430ded74..69636e6ef 100644 --- a/isisd/isis_cli.c +++ b/isisd/isis_cli.c @@ -2240,7 +2240,7 @@ void cli_show_ip_isis_threeway_shake(struct vty *vty, * XPath: /frr-interface:lib/interface/frr-isisd:isis/hello/padding */ DEFPY_YANG(isis_hello_padding, isis_hello_padding_cmd, - "[no] isis hello padding [sometimes]$padding_type", + "[no] isis hello padding [during-adjacency-formation]$padding_type", NO_STR "IS-IS routing protocol\n" "Type of padding for IS-IS hello packets\n" @@ -2266,8 +2266,8 @@ void cli_show_ip_isis_hello_padding(struct vty *vty, if (hello_padding_type == ISIS_HELLO_PADDING_DISABLED) vty_out(vty, " no"); vty_out(vty, " isis hello padding"); - if (hello_padding_type == ISIS_HELLO_PADDING_SOMETIMES) - vty_out(vty, " sometimes"); + if (hello_padding_type == ISIS_HELLO_PADDING_DURING_ADJACENCY_FORMATION) + vty_out(vty, " during-adjacency-formation"); vty_out(vty, "\n"); } diff --git a/isisd/isis_misc.c b/isisd/isis_misc.c index 7c6d60036..95d24036e 100644 --- a/isisd/isis_misc.c +++ b/isisd/isis_misc.c @@ -299,8 +299,8 @@ const char *isis_hello_padding2string(int hello_padding_type) switch (hello_padding_type) { case ISIS_HELLO_PADDING_DISABLED: return "no"; - case ISIS_HELLO_PADDING_SOMETIMES: - return "sometimes"; + case ISIS_HELLO_PADDING_DURING_ADJACENCY_FORMATION: + return "during-adjacency-formation"; case ISIS_HELLO_PADDING_ALWAYS: return "yes"; } diff --git a/isisd/isis_pdu.c b/isisd/isis_pdu.c index 9ddc427c1..f659f3abc 100644 --- a/isisd/isis_pdu.c +++ b/isisd/isis_pdu.c @@ -1966,7 +1966,8 @@ int send_hello(struct isis_circuit *circuit, int level) bool should_pad_hello = circuit->pad_hellos == ISIS_HELLO_PADDING_ALWAYS || - (circuit->pad_hellos == ISIS_HELLO_PADDING_SOMETIMES && + (circuit->pad_hellos == + ISIS_HELLO_PADDING_DURING_ADJACENCY_FORMATION && circuit->upadjcount[0] + circuit->upadjcount[1] == 0); if (isis_pack_tlvs(tlvs, circuit->snd_stream, len_pointer, diff --git a/isisd/isis_snmp.c b/isisd/isis_snmp.c index b4ae06363..e0bcb180b 100644 --- a/isisd/isis_snmp.c +++ b/isisd/isis_snmp.c @@ -2162,7 +2162,8 @@ static uint8_t *isis_snmp_find_circ(struct variable *v, oid *name, * return false if lan hellos must be padded */ if (circuit->pad_hellos == ISIS_HELLO_PADDING_ALWAYS || - (circuit->pad_hellos == ISIS_HELLO_PADDING_SOMETIMES && + (circuit->pad_hellos == + ISIS_HELLO_PADDING_DURING_ADJACENCY_FORMATION && circuit->upadjcount[0] + circuit->upadjcount[1] == 0)) return SNMP_INTEGER(ISIS_SNMP_TRUTH_VALUE_FALSE); diff --git a/tests/topotests/isis_topo1/test_isis_topo1.py b/tests/topotests/isis_topo1/test_isis_topo1.py index 5e660ef9e..48e9d5336 100644 --- a/tests/topotests/isis_topo1/test_isis_topo1.py +++ b/tests/topotests/isis_topo1/test_isis_topo1.py @@ -572,9 +572,9 @@ def test_isis_advertise_passive_only(): assert result is True, result -def test_isis_hello_padding_sometimes(): +def test_isis_hello_padding_during_adjacency_formation(): """Check that IIH packets is only padded when adjacency is still being formed - when isis hello padding sometimes is configured + when isis hello padding during-adjacency-formation is configured """ tgen = get_topogen() net = get_topogen().net @@ -582,7 +582,7 @@ def test_isis_hello_padding_sometimes(): if tgen.routers_have_failure(): pytest.skip(tgen.errors) - logger.info("Testing isis hello padding sometimes behavior") + logger.info("Testing isis hello padding during-adjacency-formation behavior") r3 = tgen.gears["r3"] # Reduce hello-multiplier to make the adjacency go down faster. @@ -599,7 +599,7 @@ def test_isis_hello_padding_sometimes(): """ configure interface r1-eth0 - isis hello padding sometimes + isis hello padding during-adjacency-formation end debug isis adj-packets """ diff --git a/yang/frr-isisd.yang b/yang/frr-isisd.yang index f2927339a..c072be45d 100644 --- a/yang/frr-isisd.yang +++ b/yang/frr-isisd.yang @@ -128,7 +128,7 @@ module frr-isisd { description "Do not add any padding to hello packets."; } - enum "sometimes" { + enum "during-adjacency-formation" { value 2; description "Add padding to hello packets during adjacency formation only."; -- cgit v1.2.3