[nexus] add 1.4 PIC-TC-1 test for DHCPv6-PD and DNS (#12859)

This commit adds a new Nexus test that implements the test
specification in test-1-4-PIC-TC-1.md. The test verifies Border
Router functionality including:
- DHCPv6-PD client to obtain OMR prefix
- Advertising route to OMR prefix on AIL (Stub Router)
- DNS recursive resolver for public internet addresses
- Connectivity (ICMPv6, UDP, TCP/HTTP) to internet and local servers

New files:
- tests/nexus/test_1_4_PIC_TC_1.cpp: C++ test execution
- tests/nexus/verify_1_4_PIC_TC_1.py: Python pcap verification

Nexus platform enhancements:
- Enabled DHCPv6-PD client in openthread-core-nexus-config.h
- Implemented DHCPv6-PD platform APIs in nexus_infra_if.cpp
- Added RDNSS option to RA in nexus_infra_if.cpp
- Improved packet delivery on infrastructure interface in nexus_core.cpp
- Fixed upstream DNS query matching in nexus_dns.cpp
This commit is contained in:
Jonathan Hui
2026-04-09 15:29:35 -05:00
committed by GitHub
parent b3ab4df0e8
commit 05ad9803d8
10 changed files with 910 additions and 8 deletions
+20 -5
View File
@@ -172,7 +172,9 @@ size_t cbuf_pop(struct cbufhead* chdr, size_t numbytes) {
if (used_space < numbytes) {
numbytes = used_space;
}
chdr->r_index = (chdr->r_index + numbytes) % chdr->size;
if (chdr->size > 0) {
chdr->r_index = (chdr->r_index + numbytes) % chdr->size;
}
chdr->used -= numbytes;
return numbytes;
}
@@ -288,7 +290,7 @@ size_t cbuf_reass_write(struct cbufhead* chdr, size_t offset, const void* data,
size_t free_space = cbuf_free_space(chdr);
size_t start_index;
size_t bytes_to_end;
if (offset > free_space) {
if (chdr->size == 0 || offset > free_space) {
return 0;
} else if (offset + numbytes > free_space) {
numbytes = free_space - offset;
@@ -335,8 +337,14 @@ size_t cbuf_reass_merge(struct cbufhead* chdr, size_t numbytes, uint8_t* bitmap)
}
size_t cbuf_reass_count_set(struct cbufhead* chdr, size_t offset, uint8_t* bitmap, size_t limit) {
size_t bitmap_size = BITS_TO_BYTES(chdr->size);
size_t bitmap_size;
size_t until_end;
if (chdr->size == 0) {
return 0;
}
bitmap_size = BITS_TO_BYTES(chdr->size);
offset = (cbuf_get_w_index(chdr) + offset) % chdr->size;
until_end = bmp_countset(bitmap, bitmap_size, offset, limit);
if (until_end >= limit || until_end < (chdr->size - offset)) {
@@ -349,8 +357,15 @@ size_t cbuf_reass_count_set(struct cbufhead* chdr, size_t offset, uint8_t* bitma
}
int cbuf_reass_within_offset(struct cbufhead* chdr, size_t offset, size_t index) {
size_t range_start = cbuf_get_w_index(chdr);
size_t range_end = (range_start + offset) % chdr->size;
size_t range_start;
size_t range_end;
if (chdr->size == 0) {
return 0;
}
range_start = cbuf_get_w_index(chdr);
range_end = (range_start + offset) % chdr->size;
if (range_end >= range_start) {
return index >= range_start && index < range_end;
} else {