summaryrefslogtreecommitdiffstats
path: root/lib
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 /lib
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 'lib')
-rw-r--r--lib/includes/hicn/util/map.h2
-rw-r--r--lib/includes/hicn/util/set.h2
-rw-r--r--lib/src/CMakeLists.txt2
-rw-r--r--lib/src/name.c8
-rw-r--r--lib/src/policy.c8
-rw-r--r--lib/src/util/ip_address.c10
6 files changed, 16 insertions, 16 deletions
diff --git a/lib/includes/hicn/util/map.h b/lib/includes/hicn/util/map.h
index 1ac5812ef..01195865e 100644
--- a/lib/includes/hicn/util/map.h
+++ b/lib/includes/hicn/util/map.h
@@ -94,7 +94,7 @@ NAME ## _pair_snprintf(char * buf, size_t size, const NAME ## _pair_t * pair) {
if (rc < 0) \
return rc; \
rc = VALUE_SNPRINTF(buf+rc, BUFSIZE/2, (VAL_T)pair->value); \
- return rc; \
+ return (int)rc; \
} \
\
TYPEDEF_SET(NAME ## _pair_set, NAME ## _pair_t *, NAME ## _pair_cmp, NAME ## _pair_snprintf); \
diff --git a/lib/includes/hicn/util/set.h b/lib/includes/hicn/util/set.h
index b4673a673..bc2e3caac 100644
--- a/lib/includes/hicn/util/set.h
+++ b/lib/includes/hicn/util/set.h
@@ -232,7 +232,7 @@ NAME ## _get_array(const NAME ## _t * set, T ** element) \
twalk(set->root, NAME ## _add_node_to_array); \
NAME ## _array_pos = NULL; \
END: \
- return set->size; \
+ return (int)(set->size); \
}
#endif /* UTIL_SET_H */
diff --git a/lib/src/CMakeLists.txt b/lib/src/CMakeLists.txt
index f68e7a551..7eecaf775 100644
--- a/lib/src/CMakeLists.txt
+++ b/lib/src/CMakeLists.txt
@@ -35,7 +35,7 @@ set (COMPILER_DEFINITIONS "-DWITH_MAPME")
include(BuildMacros)
include(WindowsMacros)
-if (${CMAKE_SYSTEM_NAME} STREQUAL "Android")
+if (DISABLE_SHARED_LIBRARIES)
build_library(${LIBHICN}
STATIC
SOURCES ${LIBHICN_SOURCE_FILES} ${LIBHICN_HEADER_FILES} ${LIBHICN_HEADER_FILES_PROTOCOL} ${LIBHICN_HEADER_FILES_UTIL}
diff --git a/lib/src/name.c b/lib/src/name.c
index 6c7945a18..7c1f7582a 100644
--- a/lib/src/name.c
+++ b/lib/src/name.c
@@ -460,19 +460,19 @@ hicn_name_ntop (const hicn_name_t * src, char *dst, size_t len)
switch (src->type)
{
case HNT_CONTIGUOUS_V6:
- rc = inet_ntop (AF_INET6, src->buffer, dst, len);
+ rc = inet_ntop (AF_INET6, src->buffer, dst, (socklen_t)len);
seg_number = (u8 *) src->buffer + IPV6_ADDR_LEN;
break;
case HNT_CONTIGUOUS_V4:
- rc = inet_ntop (AF_INET, src->buffer, dst, len);
+ rc = inet_ntop (AF_INET, src->buffer, dst, (socklen_t)len);
seg_number = (u8 *) src->buffer + IPV4_ADDR_LEN;
break;
case HNT_IOV_V6:
- rc = inet_ntop (AF_INET6, src->iov.buffers[0].iov_base, dst, len);
+ rc = inet_ntop (AF_INET6, src->iov.buffers[0].iov_base, dst, (socklen_t)len);
seg_number = src->iov.buffers[1].iov_base;
break;
case HNT_IOV_V4:
- rc = inet_ntop (AF_INET, src->iov.buffers[0].iov_base, dst, len);
+ rc = inet_ntop (AF_INET, src->iov.buffers[0].iov_base, dst, (socklen_t)len);
seg_number = src->iov.buffers[1].iov_base;
break;
default:
diff --git a/lib/src/policy.c b/lib/src/policy.c
index edbb02bea..694f0ea5e 100644
--- a/lib/src/policy.c
+++ b/lib/src/policy.c
@@ -49,13 +49,13 @@ policy_tag_state_snprintf(char * s, size_t size, const policy_tag_state_t * tag_
return -1;
rc = snprintf(cur, s + size - cur, "%s%s", (tag_state->disabled == 1) ? "!" : "", policy_state_str[tag_state->state]);
- if (rc >= s + size - cur)
- return s + size - cur;
+ if (rc >= (int)(s + size - cur))
+ return (int)(s + size - cur);
if (rc < 0)
return rc;
cur += rc;
if (size != 0 && cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
- return cur - s;
+ return (int)(cur - s);
}
diff --git a/lib/src/util/ip_address.c b/lib/src/util/ip_address.c
index 49818de40..805b0b261 100644
--- a/lib/src/util/ip_address.c
+++ b/lib/src/util/ip_address.c
@@ -91,10 +91,10 @@ ip_address_ntop (const ip_address_t * ip_address, char *dst, const size_t len,
const char * s;
switch(family) {
case AF_INET:
- s = inet_ntop (AF_INET, ip_address->v4.buffer, dst, len);
+ s = inet_ntop (AF_INET, ip_address->v4.buffer, dst, (socklen_t)len);
break;
case AF_INET6:
- s = inet_ntop (AF_INET6, ip_address->v6.buffer, dst, len);
+ s = inet_ntop (AF_INET6, ip_address->v6.buffer, dst, (socklen_t)len);
break;
default:
return -1;
@@ -156,7 +156,7 @@ ip_address_snprintf(char * s, size_t size, const ip_address_t * ip_address, int
}
if (!rc)
return -1;
- return strlen(s);
+ return (int)strlen(s);
}
int
@@ -281,7 +281,7 @@ ip_prefix_ntop_short(const ip_prefix_t * ip_prefix, char *dst, size_t size)
return -1;
int rc = snprintf(dst, size, "%s", ip_s);
if (rc >= size)
- return size;
+ return (int)size;
return rc;
}
@@ -304,7 +304,7 @@ ip_prefix_ntop(const ip_prefix_t * ip_prefix, char *dst, size_t size)
return -1;
int rc = snprintf(dst, size, "%s/%d", ip_s, ip_prefix->len);
if (rc >= size)
- return size;
+ return (int)size;
return rc;
}