aboutsummaryrefslogtreecommitdiffstats
path: root/lib/includes/hicn/util/ip_address.h
diff options
context:
space:
mode:
authorAngelo Mantellini <angelo.mantellini@cisco.com>2020-03-31 11:10:00 +0000
committerGerrit Code Review <gerrit@fd.io>2020-03-31 11:10:00 +0000
commit23c3bb7400839b664096ad5e16a2346386109bda (patch)
treed1999acef9f91cd25db9b7c63fd2963cd7ba0e57 /lib/includes/hicn/util/ip_address.h
parentd46e59824bd3fc67abe7bd725965aa454942d640 (diff)
parent3718e549ee31ac764b327bbf3d6e51dd7e224b46 (diff)
Merge "[HICN-581] update hicn stack to support windows, again"
Diffstat (limited to 'lib/includes/hicn/util/ip_address.h')
-rw-r--r--lib/includes/hicn/util/ip_address.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/includes/hicn/util/ip_address.h b/lib/includes/hicn/util/ip_address.h
index d9dea8faa..4facd9ad0 100644
--- a/lib/includes/hicn/util/ip_address.h
+++ b/lib/includes/hicn/util/ip_address.h
@@ -20,22 +20,23 @@
#ifndef UTIL_IP_ADDRESS_H
#define UTIL_IP_ADDRESS_H
-#include <arpa/inet.h> // inet_ntop
+
#ifdef __APPLE__
#include <libkern/OSByteOrder.h>
#define __bswap_constant_32(x) OSSwapInt32(x)
#include <machine/endian.h>
#else
-#include <endian.h>
#ifdef __ANDROID__
#include <byteswap.h>
#endif
-#include <endian.h>
+
#endif
#include <errno.h>
-#include <netdb.h> // struct addrinfo
+
#ifndef _WIN32
-#include <netinet/in.h> // struct sockadd
+#include <netinet/in.h> // struct sockadd
+#include <arpa/inet.h> // inet_ntop
+#include <netdb.h> // struct addrinfo
#endif
#include <stdbool.h>
#include <stdlib.h>
@@ -45,8 +46,8 @@
#include "types.h"
#define bytes_to_bits(x) (x * 8)
-#define IPV6_ADDR_LEN 16 /* bytes */
-#define IPV4_ADDR_LEN 4 /* bytes */
+#define IPV6_ADDR_LEN 16 /* bytes */
+#define IPV4_ADDR_LEN 4 /* bytes */
#define IPV6_ADDR_LEN_BITS bytes_to_bits(IPV6_ADDR_LEN)
#define IPV4_ADDR_LEN_BITS bytes_to_bits(IPV4_ADDR_LEN)