aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-light/src
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2019-03-23 11:25:50 +0100
committerMauro Sardara <msardara@cisco.com>2019-03-23 10:29:09 +0000
commita2bdc00ea25f89185c1095a48a8f51cb2c1a20e6 (patch)
tree41756c289ed9ffed68998a12f2562a955b134296 /hicn-light/src
parente6d4612011483b267dc9f47c5d2b2444dd88f402 (diff)
[HICN-137] Install header file with API with hicn-light.
Change-Id: Idf5405b0086e74ad46dd407edb2598f363886ba3 Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'hicn-light/src')
-rw-r--r--hicn-light/src/CMakeLists.txt8
-rw-r--r--hicn-light/src/utils/CMakeLists.txt6
-rw-r--r--hicn-light/src/utils/commands.h87
3 files changed, 51 insertions, 50 deletions
diff --git a/hicn-light/src/CMakeLists.txt b/hicn-light/src/CMakeLists.txt
index 68ef851f1..c7a4b5efd 100644
--- a/hicn-light/src/CMakeLists.txt
+++ b/hicn-light/src/CMakeLists.txt
@@ -36,18 +36,14 @@ list(INSERT HICN_LIGHT_INCLUDE_DIRS 0
${CMAKE_CURRENT_SOURCE_DIR}/..
)
-if (INSTALL_HEADER)
- set(TO_INSTALL_HEADERS ${HEADER_FILES})
-endif()
-
build_library(${LIBHICN_LIGHT}
STATIC
SOURCES ${SOURCE_FILES}
- INSTALL_HEADERS ${TO_INSTALL_HEADERS}
+ INSTALL_HEADERS ${TO_INSTALL_HEADER_FILES}
LINK_LIBRARIES ${LIBRARIES}
DEPENDS ${DEPENDENCIES}
COMPONENT ${LIBHICN_LIGHT}
INCLUDE_DIRS ${HICN_LIGHT_INCLUDE_DIRS}
- INSTALL_ROOT_DIR hicn/hicn-light
+ INSTALL_ROOT_DIR hicn/light
DEFINITIONS ${COMPILER_DEFINITIONS}
)
diff --git a/hicn-light/src/utils/CMakeLists.txt b/hicn-light/src/utils/CMakeLists.txt
index 7d438d157..120061211 100644
--- a/hicn-light/src/utils/CMakeLists.txt
+++ b/hicn-light/src/utils/CMakeLists.txt
@@ -32,5 +32,11 @@ list(APPEND SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/utils.c
)
+set(TO_INSTALL_HEADER_FILES
+ ${TO_INSTALL_HEADER_FILES}
+ ${CMAKE_CURRENT_SOURCE_DIR}/commands.h
+ PARENT_SCOPE
+)
+
set(SOURCE_FILES ${SOURCE_FILES} PARENT_SCOPE)
set(HEADER_FILES ${HEADER_FILES} PARENT_SCOPE) \ No newline at end of file
diff --git a/hicn-light/src/utils/commands.h b/hicn-light/src/utils/commands.h
index d4147cbdd..9527e5064 100644
--- a/hicn-light/src/utils/commands.h
+++ b/hicn-light/src/utils/commands.h
@@ -27,7 +27,6 @@
#include <netinet/in.h>
#include <sys/socket.h>
#endif
-#include <src/config.h>
#include <stdint.h>
#include <stdlib.h>
@@ -41,7 +40,7 @@ union commandAddr {
};
typedef enum {
- REQUEST_LIGHT = 0xc0, //this is a command
+ REQUEST_LIGHT = 0xc0, // this is a command
RESPONSE_LIGHT,
ACK_LIGHT,
NACK_LIGHT,
@@ -287,47 +286,47 @@ typedef struct {
// REMINDER: when a new_command is added, the following switch has to be
// updated.
static inline int payloadLengthDaemon(command_id id) {
- switch (id){
- case ADD_LISTENER:
- return sizeof(add_listener_command);
- case ADD_CONNECTION:
- return sizeof(add_connection_command);
- case LIST_CONNECTIONS:
- return 0; // list connections: payload always 0
- case ADD_ROUTE:
- return sizeof(add_route_command);
- case LIST_ROUTES:
- return 0; // list routes: payload always 0
- case REMOVE_CONNECTION:
- return sizeof(remove_connection_command);
- case REMOVE_ROUTE:
- return sizeof(remove_route_command);
- case CACHE_STORE:
- return sizeof(cache_store_command);
- case CACHE_SERVE:
- return sizeof(cache_serve_command);
- case CACHE_CLEAR:
- return 0; // cache clear
- case SET_STRATEGY:
- return sizeof(set_strategy_command);
- case SET_WLDR:
- return sizeof(set_wldr_command);
- case ADD_PUNTING:
- return sizeof(add_punting_command);
- case LIST_LISTENERS:
- return 0; // list listeners: payload always 0
- case MAPME_ENABLE:
- return sizeof(mapme_activator_command);
- case MAPME_DISCOVERY:
- return sizeof(mapme_activator_command);
- case MAPME_TIMESCALE:
- return sizeof(mapme_timing_command);
- case MAPME_RETX:
- return sizeof(mapme_timing_command);
- case LAST_COMMAND_VALUE:
- return 0;
- default:
- return 0;
- }
+ switch (id) {
+ case ADD_LISTENER:
+ return sizeof(add_listener_command);
+ case ADD_CONNECTION:
+ return sizeof(add_connection_command);
+ case LIST_CONNECTIONS:
+ return 0; // list connections: payload always 0
+ case ADD_ROUTE:
+ return sizeof(add_route_command);
+ case LIST_ROUTES:
+ return 0; // list routes: payload always 0
+ case REMOVE_CONNECTION:
+ return sizeof(remove_connection_command);
+ case REMOVE_ROUTE:
+ return sizeof(remove_route_command);
+ case CACHE_STORE:
+ return sizeof(cache_store_command);
+ case CACHE_SERVE:
+ return sizeof(cache_serve_command);
+ case CACHE_CLEAR:
+ return 0; // cache clear
+ case SET_STRATEGY:
+ return sizeof(set_strategy_command);
+ case SET_WLDR:
+ return sizeof(set_wldr_command);
+ case ADD_PUNTING:
+ return sizeof(add_punting_command);
+ case LIST_LISTENERS:
+ return 0; // list listeners: payload always 0
+ case MAPME_ENABLE:
+ return sizeof(mapme_activator_command);
+ case MAPME_DISCOVERY:
+ return sizeof(mapme_activator_command);
+ case MAPME_TIMESCALE:
+ return sizeof(mapme_timing_command);
+ case MAPME_RETX:
+ return sizeof(mapme_timing_command);
+ case LAST_COMMAND_VALUE:
+ return 0;
+ default:
+ return 0;
+ }
}
#endif