void do_create() { zrtp_test_channel_config_t config; int status = 0; config.is_autosecure = 1; config.is_preshared = 0; config.streams_count = 1; status = zrtp_test_channel_create(&config, &tmp_id); }
static void do_action() { switch (action_id) { case 0: { int status; zrtp_log_set_log_engine((zrtp_log_engine*)print_log_ce); status = zrtp_test_zrtp_init(); if (0 != status) { return; } zrtp_test_crypto(zrtp_global); { zrtp_test_channel_id_t id; zrtp_test_channel_config_t sconfig; sconfig.is_autosecure = 0; sconfig.is_preshared = 0; sconfig.streams_count = 1; status = zrtp_test_channel_create(&sconfig, &id); if (0 == status) { zrtp_test_channel_start(id); } } break; } case 1: { zrtp_thread_create(destroy_func, NULL); break; } case 2: { DeleteObject(font); if (log_file) fclose(log_file); #ifdef WIN32_PLATFORM_WFSP DestroyWindow(g_hWnd); #endif #ifdef WIN32_PLATFORM_PSPC SendMessage(g_hWnd, WM_CLOSE, 0, 0); #endif // WIN32_PLATFORM_PSPC break; } } action_id++; }
zrtp_status_t zrtp_test_channel_create2(zrtp_test_id_t left_session, zrtp_test_id_t right_session, unsigned stream_idx, zrtp_test_id_t *id) { zrtp_test_session_t *left = zrtp_test_session_by_id(left_session); zrtp_test_session_t *right = zrtp_test_session_by_id(right_session); if (!left || !right) return zrtp_status_bad_param; if (left->streams_count <= stream_idx || right->streams_count <= stream_idx) return zrtp_status_bad_param; return zrtp_test_channel_create(left->streams[stream_idx].id, right->streams[stream_idx].id, id); }
int main() { int status; status = zrtp_test_zrtp_init(); if (0 != status) { return status; } #if (ZRTP_TEST_ENABLE_CRYPTO_SELFTESTS == 1) zrtp_test_crypto(zrtp_global); #endif { zrtp_test_channel_id_t id; zrtp_test_channel_config_t sconfig; sconfig.is_autosecure = 0; sconfig.is_preshared = 0; sconfig.streams_count = 1; status = zrtp_test_channel_create(&sconfig, &id); if (0 == status) { zrtp_test_channel_start(id); } } while (1) { zrtp_sleep(1000); } do_quit(); return 0; }