aboutsummaryrefslogtreecommitdiffstats
path: root/ctrl/libhicnctrl
diff options
context:
space:
mode:
authorJordan Augé <jordan.auge+fdio@cisco.com>2019-10-23 22:47:10 +0000
committerGerrit Code Review <gerrit@fd.io>2019-10-23 22:47:10 +0000
commitbfa10d1d349d52b00997db0118468c2cdbb8bf15 (patch)
tree703b0b8464d4ccbfc5b07de241c68ba25e3d8a27 /ctrl/libhicnctrl
parent3bb2c48270045fb050266e393c14da55c921d880 (diff)
parent4f195f8ce71793e84934d9cb7455dc38097c4749 (diff)
Merge "[HICN-351] Support for new RemoveListener API in libhicnctrl + added missing commands in CLI"
Diffstat (limited to 'ctrl/libhicnctrl')
-rw-r--r--ctrl/libhicnctrl/includes/hicn/ctrl/api.h2
-rw-r--r--ctrl/libhicnctrl/src/cli.c18
2 files changed, 10 insertions, 10 deletions
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;