//
// This function must be named "athenaTransportLinkModule" <module name> "_Init" so that
// athenaTransportLinkAdapter can locate it to invoke initialization when it's loaded.  It's
// named uniquely (as opposed to _init()) so that it can also be statically linked into Athena.
//
PARCArrayList *
athenaTransportLinkModuleTEMPLATE_Init()
{
    // Template module for establishing point to point tunnel connections.
    AthenaTransportLinkModule *athenaTransportLinkModule;
    PARCArrayList *moduleInstanceList = parcArrayList_Create(NULL);
    assertNotNull(moduleInstanceList, "parcArrayList_Create failed to create module list");

    athenaTransportLinkModule = athenaTransportLinkModule_Create("TEMPLATE",
                                                                 _TemplateOpen,
                                                                 _TemplatePoll);
    assertNotNull(athenaTransportLinkModule, "parcMemory_AllocateAndClear failed allocate Template athenaTransportLinkModule");
    bool result = parcArrayList_Add(moduleInstanceList, athenaTransportLinkModule);
    assertTrue(result == true, "parcArrayList_Add failed");

    return moduleInstanceList;
}
PARCArrayList *
athenaTransportLinkModuleUDP_Init()
{
    // Module for providing UDP tunnel connections.
    AthenaTransportLinkModule *athenaTransportLinkModule;
    PARCArrayList *moduleList = parcArrayList_Create(NULL);
    assertNotNull(moduleList, "parcArrayList_Create failed to create module list");

    athenaTransportLinkModule = athenaTransportLinkModule_Create("UDP",
                                                                 _UDPOpen,
                                                                 _UDPPoll);
    assertNotNull(athenaTransportLinkModule, "parcMemory_AllocateAndClear failed allocate UDP athenaTransportLinkModule");
    bool result = parcArrayList_Add(moduleList, athenaTransportLinkModule);
    assertTrue(result == true, "parcArrayList_Add failed");

    return moduleList;
}
PARCArrayList *
athenaTransportLinkModuleETH_Init()
{
    // Module for providing Ethernet links.
    AthenaTransportLinkModule *athenaTransportLinkModule;
    PARCArrayList *moduleList = parcArrayList_Create(NULL);
    assertNotNull(moduleList, "parcArrayList_Create failed to create module list");

    athenaTransportLinkModule = athenaTransportLinkModule_Create("ETH",
                                                                 _ETHOpen,
                                                                 _ETHPoll);
    assertNotNull(athenaTransportLinkModule, "parcMemory_AllocateAndClear failed allocate ETH athenaTransportLinkModule");
    bool result = parcArrayList_Add(moduleList, athenaTransportLinkModule);
    assertTrue(result == true, "parcArrayList_Add failed");

    return moduleList;
}