aboutsummaryrefslogtreecommitdiffstats
path: root/ctrl/facemgr
diff options
context:
space:
mode:
authorAngelo Mantellini <angelo.mantellini@cisco.com>2020-01-30 10:44:19 +0100
committerAngelo Mantellini <angelo.mantellini@cisco.com>2020-02-03 10:18:52 +0000
commit55f2219ab98b039f256671c5e584a61ab52bfed0 (patch)
treed97fbf6a57dfdb4335bba979f27bd18f4999c492 /ctrl/facemgr
parentbe54ac541c9700eaa9085bc8b4ee21b7a5f7e30a (diff)
[HICN-489] Add iOS support to hicn stack
Signed-off-by: Angelo Mantellini <angelo.mantellini@cisco.com> Change-Id: I8fa8c4eaa3218eb4be46f713b15ab789c6930aa0
Diffstat (limited to 'ctrl/facemgr')
-rw-r--r--ctrl/facemgr/CMakeLists.txt2
-rw-r--r--ctrl/facemgr/src/CMakeLists.txt4
-rw-r--r--ctrl/facemgr/src/api.c2
-rw-r--r--ctrl/facemgr/src/cfg.c2
-rw-r--r--ctrl/facemgr/src/facelet.c86
5 files changed, 48 insertions, 48 deletions
diff --git a/ctrl/facemgr/CMakeLists.txt b/ctrl/facemgr/CMakeLists.txt
index db40eade3..a1cd48bbd 100644
--- a/ctrl/facemgr/CMakeLists.txt
+++ b/ctrl/facemgr/CMakeLists.txt
@@ -69,7 +69,7 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
find_package_wrapper(Libhicn REQUIRED)
find_package_wrapper(Libhicnctrl REQUIRED)
else()
- if (${CMAKE_SYSTEM_NAME} STREQUAL "Android")
+ if (DISABLE_SHARED_LIBRARIES)
set(HICN_LIBRARIES ${LIBHICN_STATIC} log)
set(LIBHICNCTRL_LIBRARIES ${LIBHICNCTRL_STATIC})
list(APPEND DEPENDENCIES
diff --git a/ctrl/facemgr/src/CMakeLists.txt b/ctrl/facemgr/src/CMakeLists.txt
index e675c7785..4bcad475d 100644
--- a/ctrl/facemgr/src/CMakeLists.txt
+++ b/ctrl/facemgr/src/CMakeLists.txt
@@ -97,7 +97,7 @@ if(WITH_EXAMPLE_UPDOWN)
)
endif()
-if (${CMAKE_SYSTEM_NAME} STREQUAL "Android")
+if (DISABLE_SHARED_LIBRARIES)
build_library(${LIBFACEMGR}
STATIC
SOURCES ${SOURCE_FILES}
@@ -123,7 +123,7 @@ else ()
)
endif ()
-if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Android" AND NOT COMPILE_FOR_IOS)
+if(NOT DISABLE_EXECUTABLES)
list(APPEND DAEMON_SRC
main.c
)
diff --git a/ctrl/facemgr/src/api.c b/ctrl/facemgr/src/api.c
index a6f8dbc84..24d629d28 100644
--- a/ctrl/facemgr/src/api.c
+++ b/ctrl/facemgr/src/api.c
@@ -2454,7 +2454,7 @@ facemgr_list_facelets_json(const facemgr_t * facemgr, char ** buffer)
END:
free(facelet_array);
- return cur - s;
+ return (int)(cur - s);
ERR:
free(facelet_array);
diff --git a/ctrl/facemgr/src/cfg.c b/ctrl/facemgr/src/cfg.c
index 398076d02..df73acd1b 100644
--- a/ctrl/facemgr/src/cfg.c
+++ b/ctrl/facemgr/src/cfg.c
@@ -1210,5 +1210,5 @@ int facemgr_cfg_get_static_facelet_array(const facemgr_cfg_t * cfg, facelet_t **
ERROR("[facemgr_cfg_get_static_facelet_array] Error getting array elements");
return -1;
}
- return facelet_array_len(cfg->static_facelets);
+ return (int)facelet_array_len(cfg->static_facelets);
}
diff --git a/ctrl/facemgr/src/facelet.c b/ctrl/facemgr/src/facelet.c
index d33455b4d..0cf44d4dc 100644
--- a/ctrl/facemgr/src/facelet.c
+++ b/ctrl/facemgr/src/facelet.c
@@ -1041,7 +1041,7 @@ facelet_snprintf(char * s, size_t size, const facelet_t * facelet)
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
/* Netdevice */
if (facelet_has_netdevice(facelet)) {
@@ -1051,14 +1051,14 @@ facelet_snprintf(char * s, size_t size, const facelet_t * facelet)
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
rc = snprintf(cur, s + size - cur, "/%d", facelet->netdevice.index);
if (rc < 0)
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
} else {
rc = snprintf(cur, s + size - cur, " netdevice=*/*");
@@ -1066,7 +1066,7 @@ facelet_snprintf(char * s, size_t size, const facelet_t * facelet)
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
}
/* Netdevice type */
@@ -1077,7 +1077,7 @@ facelet_snprintf(char * s, size_t size, const facelet_t * facelet)
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
}
/* Local ip address */
@@ -1087,7 +1087,7 @@ facelet_snprintf(char * s, size_t size, const facelet_t * facelet)
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
rc = ip_address_snprintf(cur, s + size - cur, &facelet->local_addr,
facelet->family);
@@ -1095,7 +1095,7 @@ facelet_snprintf(char * s, size_t size, const facelet_t * facelet)
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
}
/* Local port */
@@ -1106,7 +1106,7 @@ facelet_snprintf(char * s, size_t size, const facelet_t * facelet)
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
}
/* Remote ip address */
@@ -1116,7 +1116,7 @@ facelet_snprintf(char * s, size_t size, const facelet_t * facelet)
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
rc = ip_address_snprintf(cur, s + size - cur, &facelet->remote_addr,
facelet->family);
@@ -1124,7 +1124,7 @@ facelet_snprintf(char * s, size_t size, const facelet_t * facelet)
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
}
/* Remote port */
@@ -1135,7 +1135,7 @@ facelet_snprintf(char * s, size_t size, const facelet_t * facelet)
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
}
/* Admin state */
@@ -1146,7 +1146,7 @@ facelet_snprintf(char * s, size_t size, const facelet_t * facelet)
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
}
/* State */
@@ -1157,7 +1157,7 @@ facelet_snprintf(char * s, size_t size, const facelet_t * facelet)
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
}
#ifdef WITH_POLICY
@@ -1168,7 +1168,7 @@ facelet_snprintf(char * s, size_t size, const facelet_t * facelet)
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
}
#endif /* WITH_POLICY */
@@ -1180,7 +1180,7 @@ facelet_snprintf(char * s, size_t size, const facelet_t * facelet)
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
}
/* Routes */
@@ -1189,7 +1189,7 @@ facelet_snprintf(char * s, size_t size, const facelet_t * facelet)
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
hicn_route_t ** route_array;
int n = route_set_get_array(facelet->routes, &route_array);
@@ -1198,19 +1198,19 @@ facelet_snprintf(char * s, size_t size, const facelet_t * facelet)
} else {
for (unsigned i = 0; i < n; i++) {
hicn_route_t * route = route_array[i];
- rc = hicn_route_snprintf(cur, s + size - cur, route);
+ rc = (int)hicn_route_snprintf(cur, s + size - cur, route);
if (rc < 0)
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
rc = snprintf(cur, s + size - cur, ", ");
if (rc < 0)
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
}
}
free(route_array);
@@ -1220,9 +1220,9 @@ facelet_snprintf(char * s, size_t size, const facelet_t * facelet)
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
- return cur - s;
+ return (int)(cur - s);
}
int facelet_snprintf_json(char * s, size_t size, const facelet_t * facelet, int indent)
@@ -1238,7 +1238,7 @@ int facelet_snprintf_json(char * s, size_t size, const facelet_t * facelet, int
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
/* id */
rc = snprintf(cur, s + size - cur, "%*s%s: %d,\n", 4 * (indent+1), "", "\"id\"",
@@ -1247,7 +1247,7 @@ int facelet_snprintf_json(char * s, size_t size, const facelet_t * facelet, int
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
/* Status */
rc = snprintf(cur, s + size - cur, "%*s%s: \"%s\",\n", 4 * (indent+1), "", "\"status\"",
@@ -1256,7 +1256,7 @@ int facelet_snprintf_json(char * s, size_t size, const facelet_t * facelet, int
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
/* Family */
rc = snprintf(cur, s + size - cur, "%*s%s: \"%s\",\n", 4 * (indent+1), "", "\"family\"",
@@ -1268,7 +1268,7 @@ int facelet_snprintf_json(char * s, size_t size, const facelet_t * facelet, int
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
/* Netdevice */
if (facelet_has_netdevice(facelet)) {
@@ -1279,7 +1279,7 @@ int facelet_snprintf_json(char * s, size_t size, const facelet_t * facelet, int
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
} else {
rc = snprintf(cur, s + size - cur, "%*s%s: \"%s\",\n", 4 * (indent+1), "",
@@ -1288,7 +1288,7 @@ int facelet_snprintf_json(char * s, size_t size, const facelet_t * facelet, int
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
}
/* Netdevice type */
@@ -1300,7 +1300,7 @@ int facelet_snprintf_json(char * s, size_t size, const facelet_t * facelet, int
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
}
/* Local ip address */
@@ -1311,7 +1311,7 @@ int facelet_snprintf_json(char * s, size_t size, const facelet_t * facelet, int
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
rc = ip_address_snprintf(cur, s + size - cur, &facelet->local_addr,
facelet->family);
@@ -1319,14 +1319,14 @@ int facelet_snprintf_json(char * s, size_t size, const facelet_t * facelet, int
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
rc = snprintf(cur, s + size - cur, "\",\n");
if (rc < 0)
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
}
/* Local port */
@@ -1338,7 +1338,7 @@ int facelet_snprintf_json(char * s, size_t size, const facelet_t * facelet, int
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
}
/* Remote ip address */
@@ -1349,7 +1349,7 @@ int facelet_snprintf_json(char * s, size_t size, const facelet_t * facelet, int
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
rc = ip_address_snprintf(cur, s + size - cur, &facelet->remote_addr,
facelet->family);
@@ -1357,14 +1357,14 @@ int facelet_snprintf_json(char * s, size_t size, const facelet_t * facelet, int
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
rc = snprintf(cur, s + size - cur, "\",\n");
if (rc < 0)
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
}
/* Remote port */
@@ -1376,7 +1376,7 @@ int facelet_snprintf_json(char * s, size_t size, const facelet_t * facelet, int
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
}
/* Admin state */
@@ -1388,7 +1388,7 @@ int facelet_snprintf_json(char * s, size_t size, const facelet_t * facelet, int
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
}
/* State */
@@ -1400,7 +1400,7 @@ int facelet_snprintf_json(char * s, size_t size, const facelet_t * facelet, int
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
}
#ifdef WITH_POLICY
@@ -1412,7 +1412,7 @@ int facelet_snprintf_json(char * s, size_t size, const facelet_t * facelet, int
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
}
#endif /* WITH_POLICY */
@@ -1424,7 +1424,7 @@ int facelet_snprintf_json(char * s, size_t size, const facelet_t * facelet, int
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
}
/* Status error */
@@ -1435,7 +1435,7 @@ int facelet_snprintf_json(char * s, size_t size, const facelet_t * facelet, int
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
/* Routes */
// TODO
@@ -1445,7 +1445,7 @@ int facelet_snprintf_json(char * s, size_t size, const facelet_t * facelet, int
return rc;
cur += rc;
if (cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
- return cur - s;
+ return (int)(cur - s);
}