Lines Matching refs:test

68     if (sp->test->state == TEST_RUNNING) {  in iperf_sctp_recv()
73 if (sp->test->debug) in iperf_sctp_recv()
74 printf("Late receive, state = %d\n", sp->test->state); in iperf_sctp_recv()
116 iperf_sctp_accept(struct iperf_test * test) in iperf_sctp_accept() argument
126 s = accept(test->listener, (struct sockaddr *) &addr, &len); in iperf_sctp_accept()
138 if (strncmp(test->cookie, cookie, COOKIE_SIZE) != 0) { in iperf_sctp_accept()
160 iperf_sctp_listen(struct iperf_test *test) in iperf_sctp_listen() argument
167 close(test->listener); in iperf_sctp_listen()
169 snprintf(portstr, 6, "%d", test->server_port); in iperf_sctp_listen()
176 if (test->settings->domain == AF_UNSPEC && !test->bind_address) { in iperf_sctp_listen()
179 hints.ai_family = test->settings->domain; in iperf_sctp_listen()
183 if ((gerror = getaddrinfo(test->bind_address, portstr, &hints, &res)) != 0) { in iperf_sctp_listen()
194 if ((opt = test->settings->socket_bufsize)) { in iperf_sctp_listen()
214 if (test->bind_dev) { in iperf_sctp_listen()
217 test->bind_dev, IFNAMSIZ) < 0) in iperf_sctp_listen()
230 if (res->ai_family == AF_INET6 && (test->settings->domain == AF_UNSPEC || in iperf_sctp_listen()
231 test->settings->domain == AF_INET6)) { in iperf_sctp_listen()
232 if (test->settings->domain == AF_UNSPEC) in iperf_sctp_listen()
259 if (!TAILQ_EMPTY(&test->xbind_addrs)) { in iperf_sctp_listen()
260 if (iperf_sctp_bindx(test, s, IPERF_SCTP_SERVER)) { in iperf_sctp_listen()
282 test->listener = s; in iperf_sctp_listen()
297 iperf_sctp_connect(struct iperf_test *test) in iperf_sctp_connect() argument
304 if (test->bind_address) { in iperf_sctp_connect()
306 hints.ai_family = test->settings->domain; in iperf_sctp_connect()
308 if ((gerror = getaddrinfo(test->bind_address, NULL, &hints, &local_res)) != 0) { in iperf_sctp_connect()
315 hints.ai_family = test->settings->domain; in iperf_sctp_connect()
317 snprintf(portstr, sizeof(portstr), "%d", test->server_port); in iperf_sctp_connect()
318 if ((gerror = getaddrinfo(test->server_hostname, portstr, &hints, &server_res)) != 0) { in iperf_sctp_connect()
319 if (test->bind_address) in iperf_sctp_connect()
333 if ((opt = test->settings->socket_bufsize)) { in iperf_sctp_connect()
353 if (test->bind_dev) { in iperf_sctp_connect()
356 test->bind_dev, IFNAMSIZ) < 0) in iperf_sctp_connect()
373 if (test->bind_address) { in iperf_sctp_connect()
376 lcladdr->sin_port = htons(test->bind_port); in iperf_sctp_connect()
390 else if (test->bind_port) { in iperf_sctp_connect()
398 lcladdr->sin_port = htons(test->bind_port); in iperf_sctp_connect()
406 lcladdr->sin6_port = htons(test->bind_port); in iperf_sctp_connect()
430 if (test->no_delay != 0) { in iperf_sctp_connect()
442 if ((test->settings->mss >= 512 && test->settings->mss <= 131072)) { in iperf_sctp_connect()
463 av.assoc_value = test->settings->mss; in iperf_sctp_connect()
474 opt = test->settings->mss; in iperf_sctp_connect()
492 if (test->settings->num_ostreams > 0) { in iperf_sctp_connect()
496 initmsg.sinit_num_ostreams = test->settings->num_ostreams; in iperf_sctp_connect()
509 if (!TAILQ_EMPTY(&test->xbind_addrs)) { in iperf_sctp_connect()
510 if (iperf_sctp_bindx(test, s, IPERF_SCTP_CLIENT)) { in iperf_sctp_connect()
528 if (Nwrite(s, test->cookie, COOKIE_SIZE, Psctp) < 0) { in iperf_sctp_connect()
566 iperf_sctp_init(struct iperf_test *test) in iperf_sctp_init() argument
583 iperf_sctp_bindx(struct iperf_test *test, int s, int is_server) in iperf_sctp_bindx() argument
599 domain = test->settings->domain; in iperf_sctp_bindx()
603 if (TAILQ_EMPTY(&test->xbind_addrs)) in iperf_sctp_bindx()
612 snprintf(portstr, 6, "%d", test->server_port); in iperf_sctp_bindx()
626 xbe0 = TAILQ_FIRST(&test->xbind_addrs); in iperf_sctp_bindx()
627 TAILQ_REMOVE(&test->xbind_addrs, xbe0, link); in iperf_sctp_bindx()
648 if (TAILQ_EMPTY(&test->xbind_addrs)) in iperf_sctp_bindx()
670 TAILQ_FOREACH(xbe, &test->xbind_addrs, link) { in iperf_sctp_bindx()
695 TAILQ_FOREACH(xbe, &test->xbind_addrs, link) { in iperf_sctp_bindx()
721 TAILQ_INSERT_HEAD(&test->xbind_addrs, xbe0, link); in iperf_sctp_bindx()
723 TAILQ_FOREACH(xbe, &test->xbind_addrs, link) { in iperf_sctp_bindx()