iperf3测试IPsec offload

diff --git a/src/iperf_api.c b/src/iperf_api.c
index dd0abe8..ab6491d 100644
--- a/src/iperf_api.c
+++ b/src/iperf_api.c
@@ -2168,16 +2168,20 @@ iperf_exchange_results(struct iperf_test *test)
 {
     if (test->role == 'c') {
         /* Send results to server. */
+        printf("Send results to server\n");
 	if (send_results(test) < 0)
             return -1;
         /* Get server results. */
+        printf("Get server results\n");
         if (get_results(test) < 0)
             return -1;
     } else {
         /* Get client results. */
+        printf("Get client results\n");
         if (get_results(test) < 0)
             return -1;
         /* Send results to client. */
+        printf("Send results to client\n");
 	if (send_results(test) < 0)
             return -1;
     }
@@ -2525,6 +2529,7 @@ get_results(struct iperf_test *test)
     int retransmits;
     struct iperf_stream *sp;
 
+    printf("%s: ctrl_sck\n", __func__);
     j = JSON_read(test->ctrl_sck);
     if (j == NULL) {
 	i_errno = IERECVRESULTS;
@@ -2702,11 +2707,14 @@ JSON_write(int fd, cJSON *json)
 	if (Nwrite(fd, (char*) &nsize, sizeof(nsize), Ptcp) < 0)
 	    r = -1;
 	else {
+            printf("%s: fd: %d r: %d, hsize: %d, nsize: %d\n", __func__, fd, r, hsize, nsize);
 	    if (Nwrite(fd, str, hsize, Ptcp) < 0)
 		r = -1;
+            printf("%s: r: %d, hsize: %d, str: %s\n", __func__, r, hsize, str);
 	}
 	cJSON_free(str);
     }
+    printf("%s: r: %d\n", __func__, r);
     return r;
 }
 
@@ -2728,12 +2736,14 @@ JSON_read(int fd)
      */
     if (Nread(fd, (char*) &nsize, sizeof(nsize), Ptcp) >= 0) {
 	hsize = ntohl(nsize);
+        printf("%s: fd: %d, port: %d, hsize: %d\n", __func__, fd, Ptcp, hsize);
 	/* Allocate a buffer to hold the JSON */
 	strsize = hsize + 1;              /* +1 for trailing NULL */
 	if (strsize) {
 	str = (char *) calloc(sizeof(char), strsize);
 	if (str != NULL) {
 	    rc = Nread(fd, str, hsize, Ptcp);
+            printf("%s: rc: %d fd: %d, port: %d, str: %s\n", __func__, rc, fd, Ptcp, str);
 	    if (rc >= 0) {
 		/*
 		 * We should be reading in the number of bytes corresponding to the
diff --git a/src/iperf_client_api.c b/src/iperf_client_api.c
index 7ad4c93..7a8af94 100644
--- a/src/iperf_client_api.c
+++ b/src/iperf_client_api.c
@@ -299,6 +299,7 @@ iperf_handle_message_client(struct iperf_test *test)
         }
     }
 
+    printf("%s: state: %d\n", __func__, test->state);
     switch (test->state) {
         case PARAM_EXCHANGE:
             if (iperf_exchange_parameters(test) < 0)
@@ -397,9 +398,11 @@ iperf_connect(struct iperf_test *test)
     make_cookie(test->cookie);
 
     /* Create and connect the control channel */
-    if (test->ctrl_sck < 0)
+    if (test->ctrl_sck < 0) {
 	// Create the control channel using an ephemeral port
 	test->ctrl_sck = netdial(test->settings->domain, Ptcp, test->bind_address, test->bind_dev, 0, test->server_hostname, test->server_port, test->settings->connect_timeout);
+        printf("%s: netdial test->ctrl_sc
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值