static CCNxTransportConfig * _createParams(const char *local_name, const char *keystore_name, const char *keystore_passwd) { assertNotNull(local_name, "Got null local name\n"); assertNotNull(keystore_name, "Got null keystore name\n"); assertNotNull(keystore_passwd, "Got null keystore passwd\n"); CCNxStackConfig *stackConfig = apiConnector_ProtocolStackConfig( tlvCodec_ProtocolStackConfig( localForwarder_ProtocolStackConfig( protocolStack_ComponentsConfigArgs(ccnxStackConfig_Create(), apiConnector_GetName(), tlvCodec_GetName(), localForwarder_GetName(), NULL)))); CCNxConnectionConfig *connConfig = apiConnector_ConnectionConfig( localForwarder_ConnectionConfig(ccnxConnectionConfig_Create(), local_name)); connConfig = tlvCodec_ConnectionConfig(connConfig); publicKeySigner_ConnectionConfig(connConfig, keystore_name, keystore_passwd); CCNxTransportConfig *result = ccnxTransportConfig_Create(stackConfig, connConfig); ccnxStackConfig_Release(&stackConfig); return result; }
CCNxConnectionConfig * tlvCodec_ConnectionConfig(CCNxConnectionConfig *connectionConfig) { PARCJSONValue *value = parcJSONValue_CreateFromNULL(); CCNxConnectionConfig *result = ccnxConnectionConfig_Add(connectionConfig, tlvCodec_GetName(), value); parcJSONValue_Release(&value); return result; }
/** * Generates: * * { "CODEC_TLV" : { } } */ CCNxStackConfig * tlvCodec_ProtocolStackConfig(CCNxStackConfig *stackConfig) { PARCJSONValue *value = parcJSONValue_CreateFromNULL(); CCNxStackConfig *result = ccnxStackConfig_Add(stackConfig, tlvCodec_GetName(), value); parcJSONValue_Release(&value); return result; }
LONGBOW_TEST_CASE(Global, tlvCodec_ConnectionConfig) { TestData *data = longBowTestCase_GetClipBoardData(testCase); testRtaConfiguration_ConnectionJsonKey(tlvCodec_ConnectionConfig(data->connConfig), tlvCodec_GetName()); PARCJSON *json = ccnxConnectionConfig_GetJson(data->connConfig); assertNotNull(json, "Expected a non-NULL connectionConfig."); }
static void _ccnxPortalProtocol_RTAMetis(CCNxConnectionConfig *connConfig, CCNxStackConfig *stackConfig, PARCArrayList *listOfComponentNames) { uint16_t metisPort = ccnxPortal_MetisPort; char *metisPortEnv = getenv("METIS_PORT"); if (metisPortEnv != NULL) { metisPort = (uint16_t) atoi(metisPortEnv); } parcArrayList_Add(listOfComponentNames, (char *) tlvCodec_GetName()); tlvCodec_ProtocolStackConfig(stackConfig); tlvCodec_ConnectionConfig(connConfig); parcArrayList_Add(listOfComponentNames, (char *) metisForwarder_GetName()); metisForwarder_ProtocolStackConfig(stackConfig); metisForwarder_ConnectionConfig(connConfig, metisPort); }
static void _ccnxPortalProtocol_RTALoopback(CCNxConnectionConfig *connConfig, CCNxStackConfig *stackConfig, PARCArrayList *listOfComponentNames) { char *bentPipeNameEnv = getenv("BENT_PIPE_NAME"); if (bentPipeNameEnv != NULL) { } else { printf("The BENT_PIPE_NAME environment variable needs to the name of a 'fifo' file. Try /tmp/test_ccnx_Portal\n"); } parcArrayList_Add(listOfComponentNames, (char *) tlvCodec_GetName()); tlvCodec_ProtocolStackConfig(stackConfig); tlvCodec_ConnectionConfig(connConfig); parcArrayList_Add(listOfComponentNames, (char *) localForwarder_GetName()); localForwarder_ProtocolStackConfig(stackConfig); localForwarder_ConnectionConfig(connConfig, bentPipeNameEnv); }
static CCNxTransportConfig * codecTlv_CreateParams(const char *keystore_filename, const char *keystore_password) { assertNotNull(keystore_filename, "Got null keystore name\n"); assertNotNull(keystore_password, "Got null keystore passwd\n"); CCNxStackConfig *stackConfig = ccnxStackConfig_Create(); apiConnector_ProtocolStackConfig(stackConfig); testingUpper_ProtocolStackConfig(stackConfig); tlvCodec_ProtocolStackConfig(stackConfig); testingLower_ProtocolStackConfig(stackConfig); protocolStack_ComponentsConfigArgs(stackConfig, apiConnector_GetName(), testingUpper_GetName(), tlvCodec_GetName(), testingLower_GetName(), NULL); CCNxConnectionConfig *connConfig = apiConnector_ConnectionConfig(ccnxConnectionConfig_Create()); testingUpper_ConnectionConfig(connConfig); tlvCodec_ConnectionConfig(connConfig); testingLower_ConnectionConfig(connConfig); unlink(keystore_filename); bool success = parcPublicKeySignerPkcs12Store_CreateFile(keystore_filename, keystore_password, "alice", 1024, 30); assertTrue(success, "parcPublicKeySignerPkcs12Store_CreateFile() failed."); publicKeySignerPkcs12Store_ConnectionConfig(connConfig, keystore_filename, keystore_password); CCNxTransportConfig *result = ccnxTransportConfig_Create(stackConfig, connConfig); ccnxStackConfig_Release(&stackConfig); return result; }
LONGBOW_TEST_CASE(Global, Codec_Tlv_ProtocolStackConfig_JsonKey) { TestData *data = longBowTestCase_GetClipBoardData(testCase); testRtaConfiguration_ProtocolStackJsonKey(tlvCodec_ProtocolStackConfig(data->stackConfig), tlvCodec_GetName()); }
LONGBOW_TEST_CASE(Global, Codec_Tlv_ConnectionConfig_JsonKey) { TestData *data = longBowTestCase_GetClipBoardData(testCase); testRtaConfiguration_ConnectionJsonKey(tlvCodec_ConnectionConfig(data->connConfig), tlvCodec_GetName()); }