示例#1
0
文件: athena.c 项目: chris-wood/ghost
Athena *
athena_Create(size_t contentStoreSizeInMB)
{
    Athena *athena = parcObject_CreateAndClearInstance(Athena);

    athena->athenaName = ccnxName_CreateFromURI(CCNxNameAthena_Forwarder);
    assertNotNull(athena->athenaName, "Failed to create forwarder name (%s)", CCNxNameAthena_Forwarder);

    athena->athenaFIB = athenaFIB_Create();
    assertNotNull(athena->athenaFIB, "Failed to create FIB");

    athena->athenaPIT = athenaPIT_Create();
    assertNotNull(athena->athenaPIT, "Failed to create PIT");

    AthenaLRUContentStoreConfig storeConfig;
    storeConfig.capacityInMB = contentStoreSizeInMB;

    athena->athenaContentStore = athenaContentStore_Create(&AthenaContentStore_LRUImplementation, &storeConfig);
    assertNotNull(athena->athenaContentStore, "Failed to create Content Store");

    athena->athenaTransportLinkAdapter = athenaTransportLinkAdapter_Create(_removeLink, athena);
    assertNotNull(athena->athenaTransportLinkAdapter, "Failed to create Transport Link Adapter");

    athena->log = _athena_logger_create();
    athena->athenaState = Athena_Running;

    return athena;
}
示例#2
0
LONGBOW_TEST_CASE(Global, athenaFIB_Create)
{
    AthenaFIB *fib = athenaFIB_Create();
    assertNotNull(fib, "Expected athenaFIB_Create to return a non-NULL value");

    athenaFIB_Release(&fib);
    assertNull(fib, "Expected athenaFIB_Release to NULL the pointer");
}