From 05bcac416bcddaf05bd0437bd27a19933502baf2 Mon Sep 17 00:00:00 2001 From: "Enrico Loparco (eloparco)" Date: Fri, 18 Jun 2021 14:32:44 +0200 Subject: [HICN-709] Fix bugs in listener and connection tables and add unit tests Signed-off-by: Enrico Loparco (eloparco) Change-Id: Idf86a3c6a1dd50d29c1a245a00352a553a5fdb42 --- hicn-light/src/hicn/core/address.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'hicn-light/src/hicn/core/address.h') diff --git a/hicn-light/src/hicn/core/address.h b/hicn-light/src/hicn/core/address.h index 1cee29df3..f1f2ac1e0 100644 --- a/hicn-light/src/hicn/core/address.h +++ b/hicn-light/src/hicn/core/address.h @@ -61,6 +61,15 @@ int address_from_ip_port(address_t * address, int family, ip_address_t * addr, u })) #define ADDRESS4_LOCALHOST(port) ADDRESS4(INADDR_LOOPBACK, (port)) + +/** + * @brief Helper function to avoid macro expansion in c++ tests. Wrapper around 'ADDRESS4_LOCALHOST()'. + * + * @param port + * @return address_t + */ +address_t _ADDRESS4_LOCALHOST(uint16_t port); + #define ADDRESS4_ANY(port) ADDRESS4(INADDR_ANY, (port)) #define ADDRESS6(ip, port) (*(address_t*) &((struct sockaddr_in6) {\ @@ -94,4 +103,3 @@ extern const char * _address_family_str[]; int address_to_string(const address_t *address, char *buffer); #endif /* HICNLIGHT_ADDRESS_H */ - -- cgit 1.2.3-korg