aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-light
diff options
context:
space:
mode:
Diffstat (limited to 'hicn-light')
-rw-r--r--hicn-light/src/hicn/command_line/controller/CMakeLists.txt5
-rw-r--r--hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c1
-rw-r--r--hicn-light/src/hicn/command_line/daemon/CMakeLists.txt4
-rw-r--r--hicn-light/src/hicn/config/commandOps.c1
-rw-r--r--hicn-light/src/hicn/config/configurationListeners.c2
-rw-r--r--hicn-light/src/hicn/config/controlSetStrategy.c2
-rw-r--r--hicn-light/src/hicn/core/mapme.c22
-rw-r--r--hicn-light/src/hicn/core/nameBitvector.c6
-rw-r--r--hicn-light/src/hicn/io/udpConnection.c2
-rw-r--r--hicn-light/src/hicn/processor/fibEntry.c72
10 files changed, 73 insertions, 44 deletions
diff --git a/hicn-light/src/hicn/command_line/controller/CMakeLists.txt b/hicn-light/src/hicn/command_line/controller/CMakeLists.txt
index 949cace28..68caa7dc8 100644
--- a/hicn-light/src/hicn/command_line/controller/CMakeLists.txt
+++ b/hicn-light/src/hicn/command_line/controller/CMakeLists.txt
@@ -14,6 +14,11 @@
list(APPEND CONTROLLER_SRC
hicnLightControl_main.c
)
+
+if (WIN32)
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:\"LIBCMT\"" )
+endif()
+
if (NOT DISABLE_EXECUTABLES)
build_executable(${HICN_LIGHT_CONTROL}
SOURCES ${CONTROLLER_SRC}
diff --git a/hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c b/hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c
index 31b9674ca..e6a97c4e2 100644
--- a/hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c
+++ b/hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c
@@ -16,6 +16,7 @@
#include <hicn/hicn-light/config.h>
#include <hicn/utils/utils.h>
+
#ifndef _WIN32
#include <arpa/inet.h>
#include <getopt.h>
diff --git a/hicn-light/src/hicn/command_line/daemon/CMakeLists.txt b/hicn-light/src/hicn/command_line/daemon/CMakeLists.txt
index 1ab8a4e6f..ce62b51e2 100644
--- a/hicn-light/src/hicn/command_line/daemon/CMakeLists.txt
+++ b/hicn-light/src/hicn/command_line/daemon/CMakeLists.txt
@@ -14,6 +14,10 @@
list(APPEND DAEMON_SRC
hicnLightDaemon_main.c
)
+if (WIN32)
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:\"LIBCMT\"" )
+endif()
+
if (NOT DISABLE_EXECUTABLES)
build_executable(${HICN_LIGHT_DAEMON}
SOURCES ${DAEMON_SRC}
diff --git a/hicn-light/src/hicn/config/commandOps.c b/hicn-light/src/hicn/config/commandOps.c
index dd8e148d0..b00e48e2a 100644
--- a/hicn-light/src/hicn/config/commandOps.c
+++ b/hicn-light/src/hicn/config/commandOps.c
@@ -13,6 +13,7 @@
* limitations under the License.
*/
+
#include <hicn/hicn-light/config.h>
#include <stdbool.h>
#include <stdint.h>
diff --git a/hicn-light/src/hicn/config/configurationListeners.c b/hicn-light/src/hicn/config/configurationListeners.c
index b862b98f4..31a0c4776 100644
--- a/hicn-light/src/hicn/config/configurationListeners.c
+++ b/hicn-light/src/hicn/config/configurationListeners.c
@@ -598,7 +598,7 @@ void configurationListeners_SetupAll(const Configuration *config, uint16_t port,
// Do not start on link address
char listenerName[SYMBOLIC_NAME_LEN];
-#ifdef __ANDROID__
+#if defined(__ANDROID__) || defined(_WIN32)
snprintf(listenerName, SYMBOLIC_NAME_LEN, "local_%zu", i);
#else
snprintf(listenerName, SYMBOLIC_NAME_LEN, "local_%ld", i);
diff --git a/hicn-light/src/hicn/config/controlSetStrategy.c b/hicn-light/src/hicn/config/controlSetStrategy.c
index 3229c1864..fe0ba84a0 100644
--- a/hicn-light/src/hicn/config/controlSetStrategy.c
+++ b/hicn-light/src/hicn/config/controlSetStrategy.c
@@ -228,7 +228,7 @@ static CommandReturn _controlSetStrategy_Execute(CommandParser *parser,
if(parcList_Size(args) > 4){
uint32_t index = 4; //first realted prefix
uint32_t addr_index = 0;
- setStrategyCommand->related_prefixes = parcList_Size(args) - 4;
+ setStrategyCommand->related_prefixes = (uint8_t)parcList_Size(args) - 4;
while(index < parcList_Size(args)){
const char *str = parcList_GetAtIndex(args, index);
char *rel_addr = (char *)malloc(sizeof(char) * (strlen(str) + 1));
diff --git a/hicn-light/src/hicn/core/mapme.c b/hicn-light/src/hicn/core/mapme.c
index 2a64833a8..3a1c9777b 100644
--- a/hicn-light/src/hicn/core/mapme.c
+++ b/hicn-light/src/hicn/core/mapme.c
@@ -536,13 +536,31 @@ mapme_send_updates(const MapMe * mapme, FibEntry * fibEntry, const NumberSet * n
const Name *name = fibEntry_GetPrefix(fibEntry);
char *name_str = name_ToString(name);
bool clear_tfib = true;
+
+ INFO(mapme, "[MAP-Me] Candidate next hops changed");
for (size_t j = 0; j < numberSet_Length(nexthops); j++) {
unsigned nexthop_id = numberSet_GetItem(nexthops, j);
- INFO(mapme, "[MAP-Me] sending IU/IN for name %s on connection %d", name_str,
- nexthop_id);
+
+ /* We extract the nexthop type based on tags */
+ const char * nexthop_type;
+ ConnectionTable * table = forwarder_GetConnectionTable(mapme->forwarder);
+ const Connection * conn = connectionTable_FindById(table, nexthop_id);
+ if (connection_HasTag(conn, POLICY_TAG_WIRED)) {
+ nexthop_type = "WIRED";
+ } else if (connection_HasTag(conn, POLICY_TAG_WIFI)) {
+ nexthop_type = "WIFI";
+ } else if (connection_HasTag(conn, POLICY_TAG_CELLULAR)) {
+ nexthop_type = "CELLULAR";
+ } else {
+ nexthop_type = "UNKNOWN";
+ }
+
+ INFO(mapme, "[MAP-Me] sending IU/IN for name %s on connection %d - %s (%s)", name_str,
+ nexthop_id, connection_GetInterfaceName(conn), nexthop_type);
mapme_setFacePending(mapme, name, fibEntry, nexthop_id, true, true, clear_tfib, 0);
clear_tfib = false;
}
+ INFO(mapme, "[MAP-Me] Done sending MAP-Me update");
free(name_str);
}
diff --git a/hicn-light/src/hicn/core/nameBitvector.c b/hicn-light/src/hicn/core/nameBitvector.c
index cc13bf610..653560750 100644
--- a/hicn-light/src/hicn/core/nameBitvector.c
+++ b/hicn-light/src/hicn/core/nameBitvector.c
@@ -243,13 +243,13 @@ uint32_t nameBitvector_lpm(const NameBitvector *a,
prefix_len = (uint32_t)(BV_SIZE - (_diff_bit_log2(diff) + 1));
//printf("if 1 diff = %lu plen = %d\n", diff, prefix_len);
}else{
- prefix_len = BV_SIZE;
+ prefix_len = (uint32_t)BV_SIZE;
diff = a->bits[1] ^ b->bits[1];
if(diff){
- prefix_len += (BV_SIZE - (_diff_bit_log2(diff) + 1));
+ prefix_len += (uint32_t)(BV_SIZE - (_diff_bit_log2(diff) + 1));
//printf("if 2 diff = %lu plen = %d\n", diff, prefix_len);
}else{
- prefix_len += BV_SIZE;
+ prefix_len += (uint32_t)BV_SIZE;
}
}
diff --git a/hicn-light/src/hicn/io/udpConnection.c b/hicn-light/src/hicn/io/udpConnection.c
index cd3ccc84a..2747b7ef4 100644
--- a/hicn-light/src/hicn/io/udpConnection.c
+++ b/hicn-light/src/hicn/io/udpConnection.c
@@ -335,7 +335,7 @@ static bool _sendIOVBuffer(IoOperations *ops, struct iovec *message,
dataBuf[i].len = (ULONG)message[i].iov_len;
}
- int rc = WSASendTo(udpConnState->udpListenerSocket, dataBuf, size,
+ int rc = WSASendTo(udpConnState->udpListenerSocket, dataBuf, (DWORD)size,
&BytesSent, 0, (SOCKADDR *)udpConnState->peerAddress,
udpConnState->peerAddressLength, NULL, NULL);
free(dataBuf);
diff --git a/hicn-light/src/hicn/processor/fibEntry.c b/hicn-light/src/hicn/processor/fibEntry.c
index 30bcc1f9a..00e8dfa11 100644
--- a/hicn-light/src/hicn/processor/fibEntry.c
+++ b/hicn-light/src/hicn/processor/fibEntry.c
@@ -631,38 +631,38 @@ void fibEntry_ReceiveObjectMessage(const FibEntry *fibEntry,
continue;
if (connection_HasTag(conn, POLICY_TAG_WIRED)) {
fibEntry->policy_counters.wired.num_packets++;
- fibEntry->policy_counters.wired.num_bytes += msg_size;
- fibEntry->policy.stats.wired.latency = \
+ fibEntry->policy_counters.wired.num_bytes += (uint32_t)msg_size;
+ fibEntry->policy.stats.wired.latency = (float) (\
ALPHA * fibEntry->policy.stats.wired.latency + \
- (1 - ALPHA) * (double)rtt;
+ (1 - ALPHA) * (double)rtt);
fibEntry->policy_counters.wired.latency_idle = 0;
}
if (connection_HasTag(conn, POLICY_TAG_WIFI)) {
fibEntry->policy_counters.wifi.num_packets++;
- fibEntry->policy_counters.wifi.num_bytes += msg_size;
- fibEntry->policy.stats.wifi.latency = \
+ fibEntry->policy_counters.wifi.num_bytes += (uint32_t)msg_size;
+ fibEntry->policy.stats.wifi.latency = (float)(\
ALPHA * fibEntry->policy.stats.wifi.latency + \
- (1 - ALPHA) * (double)rtt;
+ (1 - ALPHA) * (double)rtt);
fibEntry->policy_counters.wifi.latency_idle = 0;
}
if (connection_HasTag(conn, POLICY_TAG_CELLULAR)) {
fibEntry->policy_counters.cellular.num_packets++;
- fibEntry->policy_counters.cellular.num_bytes += msg_size;
- fibEntry->policy.stats.cellular.latency = \
+ fibEntry->policy_counters.cellular.num_bytes += (uint32_t)msg_size;
+ fibEntry->policy.stats.cellular.latency = (float)(\
ALPHA * fibEntry->policy.stats.cellular.latency + \
- (1 - ALPHA) * (double)rtt;
+ (1 - ALPHA) * (double)rtt);
fibEntry->policy_counters.cellular.latency_idle = 0;
}
}
- fibEntry->policy.stats.all.latency = \
+ fibEntry->policy.stats.all.latency = (float)(\
ALPHA * fibEntry->policy.stats.all.latency + \
- (1 - ALPHA) * (double)rtt;
+ (1 - ALPHA) * (double)rtt);
fibEntry->policy_counters.all.latency_idle = 0;
fibEntry->policy_counters.all.num_packets++;
- fibEntry->policy_counters.all.num_bytes += msg_size;
+ fibEntry->policy_counters.all.num_bytes += (uint32_t)msg_size;
#endif /* WITH_POLICY */
@@ -716,17 +716,17 @@ void fibEntry_UpdateStats(FibEntry *fibEntry, uint64_t now) {
/* a) throughput */
if (fibEntry->policy_counters.wired.num_bytes > 0) {
- throughput = fibEntry->policy_counters.wired.num_bytes / \
- (now - fibEntry->policy_counters.last_update) ;
+ throughput = (float)(fibEntry->policy_counters.wired.num_bytes / \
+ (now - fibEntry->policy_counters.last_update)) ;
throughput = throughput * 8 / 1024;
if (throughput < 0)
throughput = 0;
} else {
throughput = 0;
}
- fibEntry->policy.stats.wired.throughput = \
+ fibEntry->policy.stats.wired.throughput = (float)(\
ALPHA * fibEntry->policy.stats.wired.throughput + \
- (1-ALPHA) * throughput;
+ (1-ALPHA) * throughput);
/* b) loss rate */
if ((fibEntry->policy_counters.wired.num_losses > 0) && \
@@ -737,9 +737,9 @@ void fibEntry_UpdateStats(FibEntry *fibEntry, uint64_t now) {
} else {
loss_rate = 0;
}
- fibEntry->policy.stats.wired.loss_rate = \
+ fibEntry->policy.stats.wired.loss_rate = (float)(\
ALPHA * fibEntry->policy.stats.wired.loss_rate + \
- (1-ALPHA) * loss_rate;
+ (1-ALPHA) * loss_rate);
/* Latency */
fibEntry->policy_counters.wired.latency_idle++;
@@ -763,17 +763,17 @@ void fibEntry_UpdateStats(FibEntry *fibEntry, uint64_t now) {
/* a) throughput */
if (fibEntry->policy_counters.wifi.num_bytes > 0) {
- throughput = fibEntry->policy_counters.wifi.num_bytes / \
- (now - fibEntry->policy_counters.last_update);
+ throughput = (float)(fibEntry->policy_counters.wifi.num_bytes / \
+ (now - fibEntry->policy_counters.last_update));
throughput = throughput * 8 / 1024;
if (throughput < 0)
throughput = 0;
} else {
throughput = 0;
}
- fibEntry->policy.stats.wifi.throughput = \
+ fibEntry->policy.stats.wifi.throughput = (float)( \
ALPHA * fibEntry->policy.stats.wifi.throughput + \
- (1-ALPHA) * throughput;
+ (1-ALPHA) * throughput);
/* b) loss rate */
if ((fibEntry->policy_counters.wifi.num_losses > 0) && \
@@ -784,9 +784,9 @@ void fibEntry_UpdateStats(FibEntry *fibEntry, uint64_t now) {
} else {
loss_rate = 0;
}
- fibEntry->policy.stats.wifi.loss_rate = \
+ fibEntry->policy.stats.wifi.loss_rate = (float)(\
ALPHA * fibEntry->policy.stats.wifi.loss_rate + \
- (1-ALPHA) * loss_rate;
+ (1-ALPHA) * loss_rate);
fibEntry->policy_counters.wifi.num_bytes = 0;
fibEntry->policy_counters.wifi.num_losses = 0;
@@ -796,17 +796,17 @@ void fibEntry_UpdateStats(FibEntry *fibEntry, uint64_t now) {
/* a) throughput */
if (fibEntry->policy_counters.cellular.num_bytes > 0) {
- throughput = fibEntry->policy_counters.cellular.num_bytes / \
- (now - fibEntry->policy_counters.last_update) ;
+ throughput = (float)(fibEntry->policy_counters.cellular.num_bytes / \
+ (now - fibEntry->policy_counters.last_update)) ;
throughput = throughput * 8 / 1024;
if (throughput < 0)
throughput = 0;
} else {
throughput = 0;
}
- fibEntry->policy.stats.cellular.throughput = \
+ fibEntry->policy.stats.cellular.throughput = (float)( \
ALPHA * fibEntry->policy.stats.cellular.throughput + \
- (1-ALPHA) * throughput;
+ (1-ALPHA) * throughput);
/* b) loss rate */
if ((fibEntry->policy_counters.cellular.num_losses > 0) && \
@@ -817,9 +817,9 @@ void fibEntry_UpdateStats(FibEntry *fibEntry, uint64_t now) {
} else {
loss_rate = 0;
}
- fibEntry->policy.stats.cellular.loss_rate = \
+ fibEntry->policy.stats.cellular.loss_rate = (float)( \
ALPHA * fibEntry->policy.stats.cellular.loss_rate + \
- (1-ALPHA) * loss_rate;
+ (1-ALPHA) * loss_rate);
fibEntry->policy_counters.cellular.num_bytes = 0;
fibEntry->policy_counters.cellular.num_losses = 0;
@@ -829,17 +829,17 @@ void fibEntry_UpdateStats(FibEntry *fibEntry, uint64_t now) {
/* a) throughput */
if (fibEntry->policy_counters.all.num_bytes > 0) {
- throughput = fibEntry->policy_counters.all.num_bytes / \
- (now - fibEntry->policy_counters.last_update);
+ throughput = (float)( fibEntry->policy_counters.all.num_bytes / \
+ (now - fibEntry->policy_counters.last_update));
throughput = throughput * 8 / 1024;
if (throughput < 0)
throughput = 0;
} else {
throughput = 0;
}
- fibEntry->policy.stats.all.throughput = \
+ fibEntry->policy.stats.all.throughput = (float)(\
ALPHA * fibEntry->policy.stats.all.throughput + \
- (1-ALPHA) * throughput;
+ (1-ALPHA) * throughput);
/* b) loss rate */
if ((fibEntry->policy_counters.all.num_losses > 0) && \
@@ -850,9 +850,9 @@ void fibEntry_UpdateStats(FibEntry *fibEntry, uint64_t now) {
} else {
loss_rate = 0;
}
- fibEntry->policy.stats.all.loss_rate = \
+ fibEntry->policy.stats.all.loss_rate = (float)(\
ALPHA * fibEntry->policy.stats.all.loss_rate + \
- (1-ALPHA) * loss_rate;
+ (1-ALPHA) * loss_rate);
fibEntry->policy_counters.all.num_bytes = 0;
fibEntry->policy_counters.all.num_losses = 0;