aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-light/src/hicn/core
diff options
context:
space:
mode:
authorJordan Augé <jordan.auge+fdio@cisco.com>2022-09-30 12:29:05 +0200
committerJordan Augé <jordan.auge+fdio@cisco.com>2022-10-07 17:30:19 +0200
commita61398ad90acdfa4ea0ac03f3d2b9bcbfd7a6dd3 (patch)
tree64cc24594bf2a010691371e16881586830b4b760 /hicn-light/src/hicn/core
parent3476dd9ddecc87d9212c3bf56a5be52079e27def (diff)
refactor(hicn-light): cleanup and optimizations to UDP socket face
Ticket: HICN-771 Change-Id: Ie84dc2f61888c3fdd7b3728b2a13cacbac503d1a Signed-off-by: Jordan Augé <jordan.auge+fdio@cisco.com>
Diffstat (limited to 'hicn-light/src/hicn/core')
-rw-r--r--hicn-light/src/hicn/core/connection.c11
-rw-r--r--hicn-light/src/hicn/core/fib.c2
-rw-r--r--hicn-light/src/hicn/core/msgbuf.h1
3 files changed, 11 insertions, 3 deletions
diff --git a/hicn-light/src/hicn/core/connection.c b/hicn-light/src/hicn/core/connection.c
index 69edc7265..40802368f 100644
--- a/hicn-light/src/hicn/core/connection.c
+++ b/hicn-light/src/hicn/core/connection.c
@@ -37,7 +37,8 @@ connection_t *connection_create(face_type_t type, const char *name,
assert(pair);
assert(forwarder);
- face_type_t listener_type;
+ /* initialized so that gcc-9 does not complain */
+ face_type_t listener_type = FACE_TYPE_UNDEFINED;
switch (type) {
case FACE_TYPE_UDP:
listener_type = FACE_TYPE_UDP_LISTENER;
@@ -45,7 +46,13 @@ connection_t *connection_create(face_type_t type, const char *name,
case FACE_TYPE_TCP:
listener_type = FACE_TYPE_TCP_LISTENER;
break;
- default:
+ case FACE_TYPE_HICN:
+ return NULL; /* Not implemented */
+ case FACE_TYPE_HICN_LISTENER:
+ case FACE_TYPE_UDP_LISTENER:
+ case FACE_TYPE_TCP_LISTENER:
+ case FACE_TYPE_UNDEFINED:
+ case FACE_TYPE_N:
return NULL;
}
diff --git a/hicn-light/src/hicn/core/fib.c b/hicn-light/src/hicn/core/fib.c
index b3b5d4036..2e8492457 100644
--- a/hicn-light/src/hicn/core/fib.c
+++ b/hicn-light/src/hicn/core/fib.c
@@ -360,7 +360,7 @@ END:
#if 0
fib_dump(fib);
#endif
- ; /* required for clang */
+ ; /* required by clang */
}
/*
diff --git a/hicn-light/src/hicn/core/msgbuf.h b/hicn-light/src/hicn/core/msgbuf.h
index 26fd47540..ee9337225 100644
--- a/hicn-light/src/hicn/core/msgbuf.h
+++ b/hicn-light/src/hicn/core/msgbuf.h
@@ -76,6 +76,7 @@ static inline const hicn_name_t *msgbuf_get_name(const msgbuf_t *msgbuf) {
}
#define msgbuf_get_connection_id(M) ((M)->connection_id)
+#define msgbuf_set_connection_id(M, ID) (M)->connection_id = (ID)
#define msgbuf_get_packet(M) ((M)->packet)
#define msgbuf_get_command_type(M) ((M)->command.type)
#if WITH_WLDR