From 4f195f8ce71793e84934d9cb7455dc38097c4749 Mon Sep 17 00:00:00 2001 From: Jordan Augé Date: Thu, 24 Oct 2019 00:46:10 +0200 Subject: [HICN-351] Support for new RemoveListener API in libhicnctrl + added missing commands in CLI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I2a5d04d6fab06344e5b89ea52d76c7a3f016004c Signed-off-by: Jordan Augé --- ctrl/libhicnctrl/includes/hicn/ctrl/api.h | 2 +- ctrl/libhicnctrl/src/cli.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'ctrl') diff --git a/ctrl/libhicnctrl/includes/hicn/ctrl/api.h b/ctrl/libhicnctrl/includes/hicn/ctrl/api.h index 4a458c0ef..62cf98927 100644 --- a/ctrl/libhicnctrl/includes/hicn/ctrl/api.h +++ b/ctrl/libhicnctrl/includes/hicn/ctrl/api.h @@ -571,7 +571,7 @@ int hc_face_list_async(hc_sock_t * s); //, hc_data_t ** pdata); #define MAX_FACE_ID 255 #define MAXSZ_FACE_ID_ 3 #define MAXSZ_FACE_ID MAXSZ_FACE_ID_ + NULLTERM -#define MAXSZ_FACE_NAME_ NAME_LEN +#define MAXSZ_FACE_NAME_ SYMBOLIC_NAME_LEN #define MAXSZ_FACE_NAME MAXSZ_FACE_NAME_ + NULLTERM #define MAXSZ_HC_FACE_ MAXSZ_FACE_ID_ + MAXSZ_FACE_NAME_ + MAXSZ_FACE_ + 5 diff --git a/ctrl/libhicnctrl/src/cli.c b/ctrl/libhicnctrl/src/cli.c index edaa93057..81400f8ee 100644 --- a/ctrl/libhicnctrl/src/cli.c +++ b/ctrl/libhicnctrl/src/cli.c @@ -219,7 +219,7 @@ parse_options(int argc, char *argv[], hc_command_t * command) goto ERR_PARAM; } /* NAME will be autogenerated (and currently not used) */ - //snprintf(command->face.name, NAME_LEN, "%s", argv[optind++]); + //snprintf(command->face.name, SYMBOLIC_NAME_LEN, "%s", argv[optind++]); command->face.face.type = face_type_from_str(argv[optind++]); if (command->face.face.type == FACE_TYPE_UNDEFINED) goto ERR_PARAM; @@ -253,9 +253,9 @@ parse_options(int argc, char *argv[], hc_command_t * command) /* Id or name */ if (is_number(argv[optind])) { command->face.id = atoi(argv[optind++]); - snprintf(command->face.name, NAME_LEN, "%s", argv[optind++]); + snprintf(command->face.name, SYMBOLIC_NAME_LEN, "%s", argv[optind++]); //} else if (is_symbolic_name(argv[optind])) { - // snprintf(command->face.name, NAME_LEN, "%s", argv[optind++]); + // snprintf(command->face.name, SYMBOLIC_NAME_LEN, "%s", argv[optind++]); } else { fprintf(stderr, "Invalid argument\n"); goto ERR_PARAM; @@ -319,7 +319,7 @@ parse_options(int argc, char *argv[], hc_command_t * command) fprintf(stderr, "%s -l NAME TYPE LOCAL_ADDRESS LOCAL_PORT [INTERFACE_NAME]\n", argv[0]); goto ERR_PARAM; } - snprintf(command->listener.name, NAME_LEN, "%s", argv[optind++]); + snprintf(command->listener.name, SYMBOLIC_NAME_LEN, "%s", argv[optind++]); command->listener.type = connection_type_from_str(argv[optind++]); if (command->listener.type == CONNECTION_TYPE_UNDEFINED) goto ERR_PARAM; @@ -347,9 +347,9 @@ parse_options(int argc, char *argv[], hc_command_t * command) /* Id or name */ if (is_number(argv[optind])) { command->listener.id = atoi(argv[optind++]); - snprintf(command->listener.name, NAME_LEN, "%s", argv[optind++]); + snprintf(command->listener.name, SYMBOLIC_NAME_LEN, "%s", argv[optind++]); } else if (is_symbolic_name(argv[optind])) { - snprintf(command->listener.name, NAME_LEN, "%s", argv[optind++]); + snprintf(command->listener.name, SYMBOLIC_NAME_LEN, "%s", argv[optind++]); } else { fprintf(stderr, "Invalid argument\n"); goto ERR_PARAM; @@ -385,7 +385,7 @@ parse_options(int argc, char *argv[], hc_command_t * command) fprintf(stderr, "%s -c NAME TYPE LOCAL_ADDRESS LOCAL_PORT REMOTE_ADDRESS REMOTE_PORT [INTERFACE_NAME]\n", argv[0]); goto ERR_PARAM; } - snprintf(command->connection.name, NAME_LEN, "%s", argv[optind++]); + snprintf(command->connection.name, SYMBOLIC_NAME_LEN, "%s", argv[optind++]); command->connection.type = connection_type_from_str(argv[optind++]); if (command->connection.type == CONNECTION_TYPE_UNDEFINED) goto ERR_PARAM; @@ -416,9 +416,9 @@ parse_options(int argc, char *argv[], hc_command_t * command) /* Id or name */ if (is_number(argv[optind])) { command->connection.id = atoi(argv[optind++]); - snprintf(command->connection.name, NAME_LEN, "%s", argv[optind++]); + snprintf(command->connection.name, SYMBOLIC_NAME_LEN, "%s", argv[optind++]); } else if (is_symbolic_name(argv[optind])) { - snprintf(command->connection.name, NAME_LEN, "%s", argv[optind++]); + snprintf(command->connection.name, SYMBOLIC_NAME_LEN, "%s", argv[optind++]); } else { fprintf(stderr, "Invalid argument\n"); goto ERR_PARAM; -- cgit 1.2.3-korg