static void schedule(void) { int (*peer_run)(void) = bob_function; int res = TEST_CONTINUE; themis_status_t themis_status; /* alice starts */ testsuite_fail_unless(THEMIS_INVALID_PARAMETER == secure_comparator_begin_compare(NULL, shared_mem, ¤t_length), "secure_comparator_begin_compare: invalid context"); testsuite_fail_unless(THEMIS_BUFFER_TOO_SMALL == secure_comparator_begin_compare(alice, NULL, ¤t_length), "secure_comparator_begin_compare: get output size (NULL out buffer)"); current_length--; testsuite_fail_unless(THEMIS_BUFFER_TOO_SMALL == secure_comparator_begin_compare(alice, shared_mem, ¤t_length), "secure_comparator_begin_compare: get output size (small out buffer)"); themis_status = secure_comparator_begin_compare(alice, shared_mem, ¤t_length); if (THEMIS_SCOMPARE_SEND_OUTPUT_TO_PEER != themis_status) { testsuite_fail_if(true, "secure_comparator_begin_compare: failed"); return; } while (TEST_CONTINUE == res) { res = peer_run(); peer_run = (peer_run == alice_function) ? bob_function : alice_function; } testsuite_fail_if(res, "secure comparator: protocol exchange"); }
int main(int argc, char **argv) { bt_config_t config; bt_init(&config, argc, argv); DPRINTF(DEBUG_INIT, "peer.c main beginning\n"); struct itimerval tout_val; tout_val.it_interval.tv_sec = 0; tout_val.it_interval.tv_usec = 0; tout_val.it_value.tv_sec = 0; tout_val.it_value.tv_usec = 100000; // 100 ms setitimer(ITIMER_REAL, &tout_val,0); signal(SIGALRM,alarmHandler); /* set the Alarm signal capture */ signal(SIGINT,exitFunc); #ifdef TESTING config.identity = 1; // your group number here strcpy(config.chunk_file, "chunkfile"); strcpy(config.has_chunk_file, "haschunks"); #endif bt_parse_command_line(&config); #ifdef DEBUG if (debug & DEBUG_INIT) { bt_dump_config(&config); } #endif peer_run(&config); return 0; }
int main(int argc, char **argv) { bt_config_t config; paramInit(&config, argc, argv); DPRINTF(DEBUG_INIT, "peer.c main beginning\n"); #ifdef TESTING config.identity = 1; // your group number here strcpy(config.chunk_file, "chunkfile"); strcpy(config.has_chunk_file, "haschunks"); #endif bt_parse_command_line(&config); #ifdef DEBUG if (debug & DEBUG_INIT) { bt_dump_config(&config); } #endif peer_run(&config); return 0; }
int main(int argc, char **argv) { bt_init(&config, argc, argv); bt_parse_command_line(&config); // bt_dump_config(&config); peer_run(&config); return 0; }
int main(int argc, char **argv) { bt_config_t config; bt_init(&config, argc, argv); DPRINTF(DEBUG_INIT, "Starting peer.c ...\n"); config.identity = 1; strcpy(config.chunk_file, "chunkfile"); strcpy(config.has_chunk_file, "haschunks"); bt_parse_command_line(&config); bt_dump_config(&config); init(&config); peer_run(&config); return 0; }