diff options
author | Jordan Augé <jordan.auge+fdio@cisco.com> | 2019-11-07 16:42:01 +0100 |
---|---|---|
committer | Jordan Augé <jordan.auge+fdio@cisco.com> | 2019-11-08 01:36:45 +0100 |
commit | 1bf749aa3e4b0ccc40057b2587af5211926a1431 (patch) | |
tree | 1e59105d64e7dc13f4f1cd4ae8437bb8bb932292 /lib/includes | |
parent | a30d495f6e91f3bed0420bf76c19315fe0de8801 (diff) |
[HICN-385] fix route removal in hicnctrl, code uniformization in hicn-light control api
Change-Id: Id097368dcde993775f206623195cc5aa57b4fe12
Signed-off-by: Jordan Augé <jordan.auge+fdio@cisco.com>
Diffstat (limited to 'lib/includes')
-rw-r--r-- | lib/includes/hicn/util/ip_address.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/includes/hicn/util/ip_address.h b/lib/includes/hicn/util/ip_address.h index e39d08585..33c0d9ab5 100644 --- a/lib/includes/hicn/util/ip_address.h +++ b/lib/includes/hicn/util/ip_address.h @@ -69,6 +69,7 @@ typedef union { u32 pad[3]; union { struct in_addr as_inaddr; + u8 buffer[4]; u8 as_u8[4]; u16 as_u16[2]; u32 as_u32; @@ -76,16 +77,19 @@ typedef union { }; union { struct in6_addr as_in6addr; + u8 buffer[16]; u8 as_u8[16]; u16 as_u16[8]; u32 as_u32[4]; u64 as_u64[2]; } v6; +#if 0 /* removed as prone to error due to IPv4 padding */ u8 buffer[IP_MAX_ADDR_LEN]; u8 as_u8[IP_MAX_ADDR_LEN]; u16 as_u16[IP_MAX_ADDR_LEN >> 1]; u32 as_u32[IP_MAX_ADDR_LEN >> 2]; u64 as_u64[IP_MAX_ADDR_LEN >> 3]; +#endif } ip_address_t; #define MAXSZ_IP4_ADDRESS_ INET_ADDRSTRLEN - 1 @@ -125,6 +129,7 @@ extern const ip_address_t IP_ADDRESS_EMPTY; int ip_address_get_family (const char * ip_address); int ip_address_len (int family); +const u8 * ip_address_get_buffer(const ip_address_t * ip_address, int family); int ip_address_ntop (const ip_address_t * ip_address, char *dst, const size_t len, int family); int ip_address_pton (const char *ip_address_str, ip_address_t * ip_address); |