From bb428fc90f2623bdf35c53e62bf2aaeba2d1e0b7 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Fri, 22 Feb 2019 18:09:48 +0100 Subject: [HICN-83] Added cmake flag "-DENABLE_PUNTING=[ON|OFF]" for enabling/disabling punting in hicnLightDaemon. Change-Id: I14f5e1ce21f2c2381359fa6184671d3cbe43b808 Signed-off-by: Mauro Sardara --- hicn-light/src/config/configurationListeners.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'hicn-light/src/config/configurationListeners.c') diff --git a/hicn-light/src/config/configurationListeners.c b/hicn-light/src/config/configurationListeners.c index 6539e8c9f..3024d7bba 100644 --- a/hicn-light/src/config/configurationListeners.c +++ b/hicn-light/src/config/configurationListeners.c @@ -42,7 +42,7 @@ static bool _setupHicnListenerOnInet4(Forwarder *forwarder, const char *symbolic, Address *address) { bool success = false; -#if !defined(__APPLE__) && !defined(_WIN32) +#if !defined(__APPLE__) && !defined(_WIN32) && defined(PUNTING) ListenerOps *ops = hicnListener_CreateInet(forwarder, (char *)symbolic, address); if (ops != NULL) { @@ -57,7 +57,7 @@ static bool _setupHicnListenerOnInet4(Forwarder *forwarder, static bool _setupHicnListenerOnInet6(Forwarder *forwarder, const char *symbolic, Address *address) { bool success = false; -#if !defined(__APPLE__) && !defined(_WIN32) +#if !defined(__APPLE__) && !defined(_WIN32) && defined(PUNTING) ListenerOps *ops = hicnListener_CreateInet6(forwarder, (char *)symbolic, address); if (ops != NULL) { @@ -81,7 +81,7 @@ bool configurationListeners_Remove(const Configuration *config) { bool _AddPuntingInet(const Configuration *config, Punting *punting, unsigned ingressId) { -#if !defined(__APPLE__) && !defined(_WIN32) +#if !defined(__APPLE__) && !defined(_WIN32) && defined(PUNTING) struct sockaddr *addr = parcNetwork_SockAddress("0.0.0.0", 1234); if (addr == NULL) { printf("Error creating address\n"); @@ -141,7 +141,7 @@ bool _AddPuntingInet(const Configuration *config, Punting *punting, bool _AddPuntingInet6(const Configuration *config, Punting *punting, unsigned ingressId) { -#if !defined(__APPLE__) && !defined(_WIN32) +#if !defined(__APPLE__) && !defined(_WIN32) && defined(PUNTING) struct sockaddr *addr = parcNetwork_SockAddress("0::0", 1234); if (addr == NULL) { printf("Error creating address\n"); @@ -231,7 +231,6 @@ static bool _setupTcpListenerOnInet(Forwarder *forwarder, ipv4_addr_t *addr4, static bool _setupUdpListenerOnInet(Forwarder *forwarder, ipv4_addr_t *addr4, uint16_t *port) { - bool success = false; struct sockaddr_in addr; @@ -537,6 +536,6 @@ void configurationListeners_SetutpLocalIPv4(const Configuration *config, uint16_t port) { Forwarder *forwarder = configuration_GetForwarder(config); in_addr_t addr = inet_addr("127.0.0.1"); - _setupUdpListenerOnInet(forwarder, (ipv4_addr_t *) &(addr), &port); - _setupTcpListenerOnInet(forwarder, (ipv4_addr_t *) &(addr), &port); + _setupUdpListenerOnInet(forwarder, (ipv4_addr_t *)&(addr), &port); + _setupTcpListenerOnInet(forwarder, (ipv4_addr_t *)&(addr), &port); } -- cgit 1.2.3-korg