aboutsummaryrefslogtreecommitdiffstats
path: root/ctrl/libhicnctrl/src/modules/hicn_light
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2022-10-07 15:54:49 +0000
committerGerrit Code Review <gerrit@fd.io>2022-10-07 15:54:49 +0000
commit0b65acf82a4a1199220d4473d426a9da221e9629 (patch)
tree650f6fe445c636a923bf07b4b8d48c90c2b1a915 /ctrl/libhicnctrl/src/modules/hicn_light
parent03fb1444ad41d254469b4749382d1bf2b7cc48da (diff)
parenta61398ad90acdfa4ea0ac03f3d2b9bcbfd7a6dd3 (diff)
Merge "refactor(hicn-light): cleanup and optimizations to UDP socket face"
Diffstat (limited to 'ctrl/libhicnctrl/src/modules/hicn_light')
-rw-r--r--ctrl/libhicnctrl/src/modules/hicn_light/connection.c8
-rw-r--r--ctrl/libhicnctrl/src/modules/hicn_light/face.c12
-rw-r--r--ctrl/libhicnctrl/src/modules/hicn_light/face.h2
3 files changed, 7 insertions, 15 deletions
diff --git a/ctrl/libhicnctrl/src/modules/hicn_light/connection.c b/ctrl/libhicnctrl/src/modules/hicn_light/connection.c
index 83f7a2e27..d5648d794 100644
--- a/ctrl/libhicnctrl/src/modules/hicn_light/connection.c
+++ b/ctrl/libhicnctrl/src/modules/hicn_light/connection.c
@@ -95,22 +95,22 @@ static int hicnlight_connection_parse(const uint8_t *buffer, size_t size,
}
if (!IS_VALID_ADDRESS(item->local_address)) {
- ERROR("[hc_connection_parse] Invalid address received");
+ ERROR("[hc_connection_parse] Invalid local address received");
return -1;
}
if (!IS_VALID_PORT(ntohs(item->local_port))) {
- ERROR("[hc_connection_parse] Invalid port received");
+ ERROR("[hc_connection_parse] Invalid local port received");
return -1;
}
if (!IS_VALID_ADDRESS(item->remote_address)) {
- ERROR("[hc_connection_parse] Invalid address received");
+ ERROR("[hc_connection_parse] Invalid remote address received");
return -1;
}
if (!IS_VALID_PORT(ntohs(item->remote_port))) {
- ERROR("[hc_connection_parse] Invalid port received");
+ ERROR("[hc_connection_parse] Invalid remote port received");
return -1;
}
diff --git a/ctrl/libhicnctrl/src/modules/hicn_light/face.c b/ctrl/libhicnctrl/src/modules/hicn_light/face.c
index 46adf633d..4dcd96191 100644
--- a/ctrl/libhicnctrl/src/modules/hicn_light/face.c
+++ b/ctrl/libhicnctrl/src/modules/hicn_light/face.c
@@ -161,15 +161,5 @@ int hc_face_to_connection(const hc_face_t *face, hc_connection_t *connection,
}
int hc_face_to_listener(const hc_face_t *face, hc_listener_t *listener) {
- switch (face->type) {
- case FACE_TYPE_HICN_LISTENER:
- break;
- case FACE_TYPE_TCP_LISTENER:
- break;
- case FACE_TYPE_UDP_LISTENER:
- break;
- default:
- return -1;
- }
- return -1; /* XXX Not implemented */
+ return -99; /* XXX Not implemented */
}
diff --git a/ctrl/libhicnctrl/src/modules/hicn_light/face.h b/ctrl/libhicnctrl/src/modules/hicn_light/face.h
index 9e1cd48c2..6f202b4ce 100644
--- a/ctrl/libhicnctrl/src/modules/hicn_light/face.h
+++ b/ctrl/libhicnctrl/src/modules/hicn_light/face.h
@@ -4,6 +4,8 @@
#include <hicn/ctrl/objects/connection.h>
#include <hicn/ctrl/objects/face.h>
+int hc_connection_to_face(const hc_connection_t *connection, hc_face_t *face);
+
int hc_face_from_connection(const hc_connection_t *connection, hc_face_t *face);
int hc_face_to_connection(const hc_face_t *face, hc_connection_t *connection,