@@ -200,6 +200,8 @@ static int parse_ipv4_addr(const struct shell *sh, char *host, char *port,
200
200
return 0 ;
201
201
}
202
202
203
+ #ifdef CONFIG_NET_ZPERF_SERVER
204
+
203
205
static int zperf_bind_host (const struct shell * sh ,
204
206
size_t argc , char * argv [],
205
207
struct zperf_download_params * param )
@@ -233,6 +235,8 @@ static int zperf_bind_host(const struct shell *sh,
233
235
return 0 ;
234
236
}
235
237
238
+ #endif
239
+
236
240
static int cmd_setip (const struct shell * sh , size_t argc , char * argv [])
237
241
{
238
242
int start = 0 ;
@@ -311,6 +315,8 @@ static int cmd_setip(const struct shell *sh, size_t argc, char *argv[])
311
315
return 0 ;
312
316
}
313
317
318
+ #ifdef CONFIG_NET_ZPERF_SERVER
319
+
314
320
static void udp_session_cb (enum zperf_status status ,
315
321
struct zperf_results * result ,
316
322
void * user_data )
@@ -475,6 +481,8 @@ static int cmd_udp_download(const struct shell *sh, size_t argc,
475
481
}
476
482
}
477
483
484
+ #endif
485
+
478
486
static void shell_udp_upload_print_stats (const struct shell * sh ,
479
487
struct zperf_results * results )
480
488
{
@@ -1291,6 +1299,8 @@ static int cmd_connectap(const struct shell *sh, size_t argc, char *argv[])
1291
1299
return 0 ;
1292
1300
}
1293
1301
1302
+ #ifdef CONFIG_NET_ZPERF_SERVER
1303
+
1294
1304
static void tcp_session_cb (enum zperf_status status ,
1295
1305
struct zperf_results * result ,
1296
1306
void * user_data )
@@ -1395,6 +1405,8 @@ static int cmd_tcp_download(const struct shell *sh, size_t argc,
1395
1405
}
1396
1406
}
1397
1407
1408
+ #endif
1409
+
1398
1410
static int cmd_version (const struct shell * sh , size_t argc , char * argv [])
1399
1411
{
1400
1412
shell_fprintf (sh , SHELL_NORMAL , "Version: %s\nConfig: %s\n" ,
@@ -1454,11 +1466,15 @@ void zperf_shell_init(void)
1454
1466
}
1455
1467
}
1456
1468
1469
+ #ifdef CONFIG_NET_ZPERF_SERVER
1470
+
1457
1471
SHELL_STATIC_SUBCMD_SET_CREATE (zperf_cmd_tcp_download ,
1458
1472
SHELL_CMD (stop , NULL , "Stop TCP server\n" , cmd_tcp_download_stop ),
1459
1473
SHELL_SUBCMD_SET_END
1460
1474
);
1461
1475
1476
+ #endif
1477
+
1462
1478
SHELL_STATIC_SUBCMD_SET_CREATE (zperf_cmd_tcp ,
1463
1479
SHELL_CMD (upload , NULL ,
1464
1480
"[<options>] <dest ip> <dest port> <duration> <packet size>[K]\n"
@@ -1510,18 +1526,22 @@ SHELL_STATIC_SUBCMD_SET_CREATE(zperf_cmd_tcp,
1510
1526
#endif
1511
1527
,
1512
1528
cmd_tcp_upload2 ),
1529
+ #ifdef CONFIG_NET_ZPERF_SERVER
1513
1530
SHELL_CMD (download , & zperf_cmd_tcp_download ,
1514
1531
"[<port>]: Server port to listen on/connect to\n"
1515
1532
"[<host>]: Bind to <host>, an interface address\n"
1516
1533
"Example: tcp download 5001 192.168.0.1\n" ,
1517
1534
cmd_tcp_download ),
1535
+ #endif
1518
1536
SHELL_SUBCMD_SET_END
1519
1537
);
1520
1538
1539
+ #ifdef CONFIG_NET_ZPERF_SERVER
1521
1540
SHELL_STATIC_SUBCMD_SET_CREATE (zperf_cmd_udp_download ,
1522
1541
SHELL_CMD (stop , NULL , "Stop UDP server\n" , cmd_udp_download_stop ),
1523
1542
SHELL_SUBCMD_SET_END
1524
1543
);
1544
+ #endif
1525
1545
1526
1546
SHELL_STATIC_SUBCMD_SET_CREATE (zperf_cmd_udp ,
1527
1547
SHELL_CMD (upload , NULL ,
@@ -1577,6 +1597,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(zperf_cmd_udp,
1577
1597
#endif
1578
1598
,
1579
1599
cmd_udp_upload2 ),
1600
+ #ifdef CONFIG_NET_ZPERF_SERVER
1580
1601
SHELL_CMD (download , & zperf_cmd_udp_download ,
1581
1602
"[<options>] command options (optional): [-I eth0]\n"
1582
1603
"[<port>]: Server port to listen on/connect to\n"
@@ -1585,6 +1606,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(zperf_cmd_udp,
1585
1606
"-I <interface name>: Specify host interface name\n"
1586
1607
"Example: udp download 5001 192.168.0.1\n" ,
1587
1608
cmd_udp_download ),
1609
+ #endif
1588
1610
SHELL_SUBCMD_SET_END
1589
1611
);
1590
1612
0 commit comments