[CICN-16] Correct compilation error metis 01/17601/4 sb-forwarder/master
authorAngelo Mantellini <[email protected]>
Thu, 14 Feb 2019 10:06:29 +0000 (11:06 +0100)
committerAngelo Mantellini <[email protected]>
Thu, 14 Feb 2019 12:57:25 +0000 (13:57 +0100)
Change-Id: I5df7993240c57202f012203c82304eeda641826f
Signed-off-by: Angelo Mantellini <[email protected]>
metis/ccnx/forwarder/metis/config/metis_ConfigurationFile.c
metis/ccnx/forwarder/metis/content_store/metis_LRUContentStore.c
metis/ccnx/forwarder/metis/core/metis_Wldr.c
metis/ccnx/forwarder/metis/strategies/strategy_NexthopState.c
metis/ccnx/forwarder/metis/strategies/strategy_NexthopStateWithPD.c
metis/scripts/build-package.sh

index 59e4c5a..129d2dc 100644 (file)
@@ -25,6 +25,7 @@
 #include <parc/algol/parc_Object.h>
 #include <parc/algol/parc_ArrayList.h>
 #include <parc/algol/parc_List.h>
+#include <parc/assert/parc_Assert.h>
 #include <ccnx/forwarder/metis/config/metis_ConfigurationFile.h>
 #include <ccnx/forwarder/metis/config/metis_Configuration.h>
 #include <ccnx/forwarder/metis/config/metis_ControlState.h>
@@ -206,8 +207,8 @@ parcObject_ImplementRelease(metisConfigurationFile, MetisConfigurationFile);
 MetisConfigurationFile *
 metisConfigurationFile_Create(MetisForwarder *metis, const char *filename)
 {
-    assertNotNull(metis, "Parameter metis must be non-null");
-    assertNotNull(filename, "Parameter filename must be non-null");
+    parcAssertNotNull(metis, "Parameter metis must be non-null");
+    parcAssertNotNull(filename, "Parameter filename must be non-null");
 
     MetisConfigurationFile *configFile = parcObject_CreateInstance(MetisConfigurationFile);
 
@@ -215,7 +216,7 @@ metisConfigurationFile_Create(MetisForwarder *metis, const char *filename)
         configFile->linesRead = 0;
         configFile->metis = metis;
         configFile->filename = parcMemory_StringDuplicate(filename, strlen(filename));
-        assertNotNull(configFile->filename, "Could not copy string '%s'", filename);
+        parcAssertNotNull(configFile->filename, "Could not copy string '%s'", filename);
 
         // setup the control state for the command parser
         configFile->controlState = metisControlState_Create(configFile, _writeRead);
@@ -252,7 +253,7 @@ metisConfigurationFile_Create(MetisForwarder *metis, const char *filename)
 bool
 metisConfigurationFile_Process(MetisConfigurationFile *configFile)
 {
-    assertNotNull(configFile, "Parameter configFile must be non-null");
+    parcAssertNotNull(configFile, "Parameter configFile must be non-null");
 
     // default to a "true" return value and only set to false if we encounter an error.
     bool success = true;
index 8209588..727b2b2 100644 (file)
@@ -20,6 +20,7 @@
 #include <parc/algol/parc_Object.h>
 #include <parc/algol/parc_HashCodeTable.h>
 #include <parc/algol/parc_DisplayIndented.h>
+#include <parc/assert/parc_Assert.h>
 
 #include <ccnx/forwarder/metis/core/metis_Logger.h>
 
@@ -299,10 +300,10 @@ _metisLRUContentStore_PutContent(MetisContentStoreInterface *storeImpl, MetisMes
 {
     bool result = false;
     _MetisLRUContentStore *store = (_MetisLRUContentStore *) metisContentStoreInterface_GetPrivateData(storeImpl);
-    assertNotNull(store, "Parameter store must be non-null");
-    assertNotNull(content, "Parameter objectMessage must be non-null");
+    parcAssertNotNull(store, "Parameter store must be non-null");
+    parcAssertNotNull(content, "Parameter objectMessage must be non-null");
 
-    assertTrue(metisMessage_GetType(content) == MetisMessagePacketType_ContentObject,
+    parcAssertTrue(metisMessage_GetType(content) == MetisMessagePacketType_ContentObject,
                "Parameter objectMessage must be a Content Object");
 
     if (store->objectCapacity == 0) {
@@ -383,9 +384,9 @@ _metisLRUContentStore_MatchInterest(MetisContentStoreInterface *storeImpl, Metis
 
     _MetisLRUContentStore *store = (_MetisLRUContentStore *) metisContentStoreInterface_GetPrivateData(storeImpl);
 
-    assertNotNull(store, "Parameter store must be non-null");
-    assertNotNull(interest, "Parameter interestMessage must be non-null");
-    assertTrue(metisMessage_GetType(interest) == MetisMessagePacketType_Interest,
+    parcAssertNotNull(store, "Parameter store must be non-null");
+    parcAssertNotNull(interest, "Parameter interestMessage must be non-null");
+    parcAssertTrue(metisMessage_GetType(interest) == MetisMessagePacketType_Interest,
                "Parameter interestMessage must be an Interest");
 
     // This will do the most restrictive lookup.
@@ -491,7 +492,7 @@ metisLRUContentStore_Create(MetisContentStoreConfig *config, MetisLogger *logger
 {
     MetisContentStoreInterface *storeImpl = NULL;
 
-    assertNotNull(logger, "MetisLRUContentStore requires a non-NULL logger");
+    parcAssertNotNull(logger, "MetisLRUContentStore requires a non-NULL logger");
 
     storeImpl = parcObject_CreateAndClearInstance(MetisContentStoreInterface);
 
index 6249bf0..61029fa 100644 (file)
@@ -20,6 +20,7 @@
 #include <ccnx/forwarder/metis/core/metis_Wldr.h>
 #include <ccnx/forwarder/metis/core/metis_Forwarder.h>
 #include <parc/logging/parc_LogReporterTextStdout.h>
+#include <parc/assert/parc_Assert.h>
 
 struct metis_wldr_buffer {
     MetisMessage *message;
@@ -38,12 +39,12 @@ MetisWldr *
 metisWldr_Init()
 {
     MetisWldr *wldr = parcMemory_AllocateAndClear(sizeof(MetisWldr));
-    assertNotNull(wldr, "parcMemory_AllocateAndClear(%zu) returned NULL", sizeof(MetisWldr));
+    parcAssertNotNull(wldr, "parcMemory_AllocateAndClear(%zu) returned NULL", sizeof(MetisWldr));
     wldr->expected_label = 1;
     wldr->next_label = 1;
     for (int i = 0; i < BUFFER_SIZE; i++) {
         MetisWldrBuffer *entry = parcMemory_AllocateAndClear(sizeof(MetisWldrBuffer));
-        assertNotNull(entry, "WldrBuffer init: parcMemory_AllocateAndClear(%zu) returned NULL", sizeof(MetisWldrBuffer));
+        parcAssertNotNull(entry, "WldrBuffer init: parcMemory_AllocateAndClear(%zu) returned NULL", sizeof(MetisWldrBuffer));
         entry->message = NULL;
         entry->rtx_counter = 0;
         wldr->buffer[i] = entry;
@@ -112,7 +113,7 @@ _metisWldr_SendWldrNotificaiton(MetisWldr *wldr, const MetisConnection *conn, Me
     MetisMessage *notification = metisMessage_Slice(message, 0, metisMessage_Length(message), 0, NULL);
     metisMessage_SetWldrNotification(notification, expected_lbl, received_lbl);
     //printf("------------send notification %u, %u\n",expected_lbl, received_lbl);
-    assertNotNull(notification, "Got null from Slice");
+    parcAssertNotNull(notification, "Got null from Slice");
     metisConnection_ReSend(conn, notification);
 }
 
index 839ece0..7f39bb2 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <parc/algol/parc_Memory.h>
 #include <parc/algol/parc_Object.h>
+#include <parc/assert/parc_Assert.h>
 #include <parc/algol/parc_DisplayIndented.h>
 
 #include <ccnx/forwarder/metis/strategies/strategy_NexthopState.h>
@@ -52,7 +53,7 @@ parcObject_Override(StrategyNexthopState, PARCObject,
 void
 strategyNexthopState_AssertValid(const StrategyNexthopState *instance)
 {
-    assertTrue(strategyNexthopState_IsValid(instance),
+    parcAssertTrue(strategyNexthopState_IsValid(instance),
                "StrategyNexthopState is not valid.");
 }
 
@@ -188,7 +189,7 @@ char *
 strategyNexthopState_ToString(const StrategyNexthopState *x)
 {
     //this is not implemented
-    trapNotImplemented("strategyNexthopState_ToString is not implemented");
+    parcTrapNotImplemented("strategyNexthopState_ToString is not implemented");
     return NULL;
 }
 
index e93c5b6..2e35968 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <parc/algol/parc_Memory.h>
 #include <parc/algol/parc_Object.h>
+#include <parc/assert/parc_Assert.h>
 #include <parc/algol/parc_DisplayIndented.h>
 
 #include <ccnx/forwarder/metis/strategies/strategy_NexthopStateWithPD.h>
@@ -55,7 +56,7 @@ parcObject_Override(StrategyNexthopStateWithPD, PARCObject,
 void
 strategyNexthopStateWithPD_AssertValid(const StrategyNexthopStateWithPD *instance)
 {
-    assertTrue(strategyNexthopStateWithPD_IsValid(instance),
+    parcAssertTrue(strategyNexthopStateWithPD_IsValid(instance),
                "StrategyNexthopStateWithPD is not valid.");
 }
 
@@ -201,7 +202,7 @@ char *
 strategyNexthopStateWithPD_ToString(const StrategyNexthopStateWithPD *x)
 {
     //this is not implemented
-    trapNotImplemented("strategyNexthopStateWithPD_ToString is not implemented");
+    parcTrapNotImplemented("strategyNexthopStateWithPD_ToString is not implemented");
     return NULL;
 }
 
index f6413e3..b50c1ea 100644 (file)
@@ -83,18 +83,22 @@ update_fdio_repo() {
             REPO_VPP_URL="${NEXUS_PROXY}/content/repositories/fd.io.stable.1701.ubuntu.xenial.main/"
             REPO=${REPO_NAME:-"master.ubuntu.xenial.main"}
             REPO_CICN_URL="${NEXUS_PROXY}/content/repositories/fd.io.${REPO}"
+            echo "deb ${REPO_VPP_URL} ./" | sudo tee /etc/apt/sources.list.d/99fd.io.list
+            echo "deb ${REPO_CICN_URL} ./" | sudo tee /etc/apt/sources.list.d/99fd.io.master.list
         elif [ "$DISTRIB_CODENAME" == "trusty" ]; then
             REPO_VPP_URL="${NEXUS_PROXY}/content/repositories/fd.io.stable.1701.ubuntu.trusty.main/"
             REPO=${REPO_NAME:-"master.ubuntu.trusty.main"}
             REPO_CICN_URL="${NEXUS_PROXY}/content/repositories/fd.io.${REPO}"
+            echo "deb ${REPO_VPP_URL} ./" | sudo tee /etc/apt/sources.list.d/99fd.io.list
+            echo "deb ${REPO_CICN_URL} ./" | sudo tee /etc/apt/sources.list.d/99fd.io.master.list
+        elif [ "$DISTRIB_CODENAME" == "bionic" ]; then
+            curl -s https://packagecloud.io/install/repositories/fdio/release/script.deb.sh | sudo bash
+            curl -s https://packagecloud.io/install/repositories/fdio/master/script.deb.sh | sudo bash
         else
             echo "Distribution $DISTRIB_CODENAME is not supported"
             exit -1
         fi
 
-        echo "deb ${REPO_VPP_URL} ./" | sudo tee /etc/apt/sources.list.d/99fd.io.list
-        echo "deb ${REPO_CICN_URL} ./" | sudo tee /etc/apt/sources.list.d/99fd.io.master.list
-
     elif [ "$DISTRIB_ID" == "CentOS" ]; then
         REPO_VPP_URL="${NEXUS_PROXY}/content/repositories/fd.io.centos7/"
         REPO=${REPO_NAME:-"master.centos7"}