Skip to content

Commit 7816f89

Browse files
committed
Merge branch 'feat/support_ipv6_only' into 'main'
feat: support ipv4-only and ipv6-only See merge request qa/idf-components/iperf-cmd!10
2 parents c42070f + caea973 commit 7816f89

File tree

15 files changed

+202
-55
lines changed

15 files changed

+202
-55
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ dist/
22
build/
33
build*/
44
sdkconfig
5+
sdkconfig.old
56
dependencies.lock
67
managed_components/
78
.mypy_cache/

.gitlab-ci.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,15 @@ build_iperf:
4646
- ESP_IMG: espressif/idf:release-v5.1
4747
- ESP_IMG: espressif/idf:release-v5.2
4848
- ESP_IMG: espressif/idf:latest
49+
artifacts:
50+
paths:
51+
- "**/build*/build_log.txt"
52+
- "**/build*/config/sdkconfig.json"
53+
when: always
54+
expire_in: 5 days
4955
script:
5056
- pip install idf-build-apps
51-
- idf-build-apps build -p apps/iperf --target=all --manifest-file=apps/.build-rules.yml --build-dir build_@t_@w --config 'sdkconfig.ci.*='
57+
- idf-build-apps build
5258
after_script:
5359
- ls apps/iperf
5460
tags:
@@ -63,9 +69,15 @@ build_iperf_v43:
6369
- when: on_success
6470
variables:
6571
LC_ALL: C.UTF-8
72+
artifacts:
73+
paths:
74+
- "**/build*/build_log.txt"
75+
- "**/build*/config/sdkconfig.json"
76+
when: always
77+
expire_in: 5 days
6678
script:
6779
- pip install idf-build-apps\<2 packaging\<22 idf-component-manager==1.4
68-
- idf-build-apps build -p apps/iperf --target all --build-dir build_@t_@w --config 'sdkconfig.ci.*='
80+
- idf-build-apps build
6981
after_script:
7082
- ls apps/iperf
7183
tags:

.idf_build_apps.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
paths = [
2+
"apps",
3+
]
4+
recursive = true
5+
target = "all"
6+
7+
manifest_file = [
8+
"apps/.build-rules.yml",
9+
]
10+
check_manifest_rules = true
11+
12+
config = [
13+
"sdkconfig.ci=default",
14+
"sdkconfig.ci.*=",
15+
"=default",
16+
]
17+
18+
build_dir = "build_@t_@w"
19+
build_log = "build_log.txt"
20+
verbose = 1
21+
22+
check_warnings = true

apps/.build-rules.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
apps/iperf:
22
disable:
33
- if: SOC_WIFI_SUPPORTED != 1
4-
- if: IDF_TARGET != "esp32" and CONFIG_NAME != "default"
4+
reason: This example app is using wifi connections
5+
# ipv6-only
6+
- if: CONFIG_NAME == "ipv6_only" and IDF_VERSION_MAJOR < 5
7+
reason: IDF do not support ipv6-only
8+
- if: CONFIG_NAME == "ipv6_only" and (IDF_VERSION_MAJOR == 5 and IDF_VERSION_MINOR < 1)
9+
reason: IDF do not support ipv6-only
10+
# build specific configuration for only one target
11+
- if: IDF_TARGET != "esp32" and CONFIG_NAME == "ipv4_only"
12+
- if: IDF_TARGET != "esp32c3" and CONFIG_NAME == "ipv6_only"

apps/iperf/main/iperf_main.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
*/
66
#include <errno.h>
77
#include <string.h>
8+
#include <sys/socket.h>
9+
10+
/* Build check: LWIP_IPV4/LWIP_IPV6 should be defined after include sys/socket.h */
11+
#if !(defined LWIP_IPV4) || !(defined LWIP_IPV6)
12+
#error "Both LWIP_IPV4 and LWIP_IPV6 should be defined!"
13+
#endif
14+
815
#include "esp_wifi.h"
916
#include "esp_log.h"
1017
#include "esp_err.h"

apps/iperf/sdkconfig.ci.default

Whitespace-only changes.

apps/iperf/sdkconfig.ci.ipv4_ipv6

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CONFIG_LWIP_IPV4=y
2+
CONFIG_LWIP_IPV6=y
3+
CONFIG_LWIP_IPV6_AUTOCONFIG=y

apps/iperf/sdkconfig.ci.ipv4_only

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
CONFIG_LWIP_IPV4=y
12
CONFIG_LWIP_IPV6=n

apps/iperf/sdkconfig.ci.ipv6_only

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CONFIG_LWIP_IPV4=n
2+
CONFIG_LWIP_IPV6=y
3+
CONFIG_LWIP_IPV6_AUTOCONFIG=y
File renamed without changes.

0 commit comments

Comments
 (0)