From 9f68d804475a36965f641550b5a0134603776564 Mon Sep 17 00:00:00 2001 From: Alberto Compagno Date: Tue, 26 Nov 2019 14:29:28 +0000 Subject: [HICN-414] Added udp punting on src port, or dst ports, or both Signed-off-by: Alberto Compagno Change-Id: I86fa8d76b22a90aa87c6623206022057ac9f30f1 --- hicn-plugin/src/cli.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'hicn-plugin/src/cli.c') diff --git a/hicn-plugin/src/cli.c b/hicn-plugin/src/cli.c index c8d8b5bf6..fd1c68169 100644 --- a/hicn-plugin/src/cli.c +++ b/hicn-plugin/src/cli.c @@ -535,8 +535,10 @@ hicn_cli_punting_command_fn (vlib_main_t * vm, unformat_input_t * main_input, int ret = 0; vnet_main_t *vnm = NULL; u8 type = HICN_PUNT_IP_TYPE; - u32 src_port = 0, dst_port = 0; + u32 src_port = HICN_PUNT_INVALID_PORT, dst_port = HICN_PUNT_INVALID_PORT; vnm = vnet_get_main (); + u8 sport = 0; + u8 dport = 0; fib_prefix_t prefix; unformat_input_t _line_input, *line_input = &_line_input; @@ -579,9 +581,13 @@ hicn_cli_punting_command_fn (vlib_main_t * vm, unformat_input_t * main_input, } if (unformat (line_input, "src_port %u", &src_port)) - ; + { + sport = 1; + } if (unformat (line_input, "dst_port %u", &dst_port)) - ; + { + dport = 1; + } } else { @@ -614,7 +620,7 @@ hicn_cli_punting_command_fn (vlib_main_t * vm, unformat_input_t * main_input, { if (type == HICN_PUNT_UDP4_TYPE || type == HICN_PUNT_UDP6_TYPE) { - if (src_port != 0 && dst_port != 0) + if (sport != 0 || dport != 0) ret = hicn_punt_interest_data_for_udp (vm, &prefix, sw_if_index, type, -- cgit 1.2.3-korg