diff options
author | Mauro Sardara <msardara@cisco.com> | 2019-05-13 14:44:51 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2019-05-13 14:44:51 +0000 |
commit | 8a4273ffe83b46bc018da58135427d40012282b8 (patch) | |
tree | 6b56b41dde64a8841ba7a741e8fa4c4b2fe56f2e /hicn-light/src | |
parent | bab3d0943eeaf8a042971cb3b80ce839c0767c51 (diff) | |
parent | 0a0e51426506985ae1e7cf8c581d109fdad7a725 (diff) |
Merge "[HICN-194] support for android environment"
Diffstat (limited to 'hicn-light/src')
-rw-r--r-- | hicn-light/src/hicn/api/api.c | 5 | ||||
-rw-r--r-- | hicn-light/src/hicn/api/ip_address.h | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/hicn-light/src/hicn/api/api.c b/hicn-light/src/hicn/api/api.c index 9b3882379..e139734f5 100644 --- a/hicn-light/src/hicn/api/api.c +++ b/hicn-light/src/hicn/api/api.c @@ -27,6 +27,11 @@ #include <stdio.h> // XXX debug +#ifndef bzero +#define bzero(b,len) (memset((b), '\0', (len)), (void) 0) +#endif + + #include <hicn/api/api.h> #include <hicn/api/commands.h> #include <hicn/api/ip_address.h> diff --git a/hicn-light/src/hicn/api/ip_address.h b/hicn-light/src/hicn/api/ip_address.h index b58981d85..f44fb1bc3 100644 --- a/hicn-light/src/hicn/api/ip_address.h +++ b/hicn-light/src/hicn/api/ip_address.h @@ -27,6 +27,9 @@ #include <machine/endian.h> #else #include <endian.h> +#ifdef __ANDROID__ +#include <byteswap.h> +#endif #endif #include <errno.h> #include <netdb.h> // struct addrinfo @@ -82,7 +85,11 @@ typedef union { /* No htonl() with const */ static const ip_address_t IPV4_LOOPBACK = { #if __BYTE_ORDER == __LITTLE_ENDIAN +#ifdef __ANDROID__ + .v4.as_inaddr.s_addr = bswap_32(INADDR_LOOPBACK), +#else .v4.as_inaddr.s_addr = __bswap_constant_32(INADDR_LOOPBACK), +#endif #else .v4.as_inaddr.s_addr = INADDR_LOOPBACK, #endif |