aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/cli.c
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2019-11-26 14:29:28 +0000
committerAlberto Compagno <acompagn+fdio@cisco.com>2019-11-26 14:29:28 +0000
commit9f68d804475a36965f641550b5a0134603776564 (patch)
treed8424f91fffdb283c3989846a8e1f706c2aa59bb /hicn-plugin/src/cli.c
parent3e949f72778dd076fffecd7da2fb83cbb1ccb428 (diff)
[HICN-414] Added udp punting on src port, or dst ports, or both
Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com> Change-Id: I86fa8d76b22a90aa87c6623206022057ac9f30f1
Diffstat (limited to 'hicn-plugin/src/cli.c')
-rw-r--r--hicn-plugin/src/cli.c14
1 files changed, 10 insertions, 4 deletions
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,