Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[border agent] add UDP Proxy module for Thread commissioning #2717

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Irving-cl
Copy link
Contributor

This PR adds a UDP Proxy module in BorderAgent namespace to do Thread commissioning under NCP architecture.

This PR is one of sub-task to support Border Agent under NCP mode. The UDP Proxy will also be used to do Thread commisssioning under RCP architecture and repalce OT_PLATFORM_UDP.

Based on the OT border agent state changes (HandleBorderAgentStateChange), the module simply starts/stops listening on an UDP ephemeral port and if starts, sets a mapping between OT border agent UDP port and the port on host. And then it does bidrectional UDP forwarding:

  • Dependencies::UdpForward will be implemented as OT UDP forwarding to OT core.
  • SendToPeer will send a UDP packet to the remote peer using the local host port (that maps to OT border agent port) as the source port.

The module hasn't been integrated with the application and put in use. This PR adds a unit test for the module.

Copy link

codecov bot commented Feb 14, 2025

Codecov Report

Attention: Patch coverage is 69.10112% with 55 lines in your changes missing coverage. Please review.

Project coverage is 43.63%. Comparing base (2b41187) to head (ab1e9e1).
Report is 946 commits behind head on main.

Files with missing lines Patch % Lines
src/border_agent/udp_proxy.cpp 68.80% 30 Missing and 4 partials ⚠️
tests/gtest/test_border_agent_udp_proxy.cpp 67.69% 16 Missing and 5 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2717       +/-   ##
===========================================
- Coverage   55.77%   43.63%   -12.14%     
===========================================
  Files          87      111       +24     
  Lines        6890    13578     +6688     
  Branches        0      974      +974     
===========================================
+ Hits         3843     5925     +2082     
- Misses       3047     7337     +4290     
- Partials        0      316      +316     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Irving-cl Irving-cl force-pushed the border_agent_udp_proxy branch from d513312 to ab1e9e1 Compare February 14, 2025 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant