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
posix: add networking apis #70635
posix: add networking apis #70635
Conversation
b169e65
to
0003e5f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Chris, looks very good 🙇♂️
0003e5f
to
d04d934
Compare
Had to add a cast to
|
The log subsystem defines LOG_ERR as a macro, which conflicts with the standard POSIX LOG_ERR log level (3). Reorder includes to avoid errors. Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
d04d934
to
902473f
Compare
Add a Kconfig option for POSIX_NETWORKING and implement inet_addr(). Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
826c27d
to
064b91c
Compare
This is running fine locally with Am I missing something obvious for CI to pass? *** Booting Zephyr OS build v3.6.0-1560-g064b91cf8792 ***
Running TESTSUITE net
===================================================================
START - test_if_freenameindex
PASS - test_if_freenameindex in 0.001 seconds
===================================================================
START - test_if_indextoname
1 interfaces
interface 1: eth0
PASS - test_if_indextoname in 0.001 seconds
===================================================================
START - test_if_nameindex
1 interfaces
interface 1: eth0
PASS - test_if_nameindex in 0.001 seconds
===================================================================
START - test_if_nametoindex
1 interfaces
interface 1: eth0
PASS - test_if_nametoindex in 0.001 seconds
===================================================================
START - test_inet_addr
PASS - test_inet_addr in 0.001 seconds
===================================================================
START - test_inet_ntoa
PASS - test_inet_ntoa in 0.001 seconds
===================================================================
TESTSUITE net succeeded
------ TESTSUITE SUMMARY START ------
SUITE PASS - 100.00% [net]: pass = 6, fail = 0, skip = 0, total = 6 duration = 0.006 seconds
- PASS - [net.test_if_freenameindex] duration = 0.001 seconds
- PASS - [net.test_if_indextoname] duration = 0.001 seconds
- PASS - [net.test_if_nameindex] duration = 0.001 seconds
- PASS - [net.test_if_nametoindex] duration = 0.001 seconds
- PASS - [net.test_inet_addr] duration = 0.001 seconds
- PASS - [net.test_inet_ntoa] duration = 0.001 seconds
------ TESTSUITE SUMMARY END ------
===================================================================
PROJECT EXECUTION SUCCESSFUL |
eb414ef
to
aeddf53
Compare
Add a testsuite for posix networking apis with an initial test for inet_addr(). Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
Add an implementation of inet_ntoa(). Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
Add tests for inet_ntoa() Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
Implement if_indextoname(), if_freenameindex(), if_nameindex(), and if_nametoindex() by wrapping around networking subystem calls. Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
Uncomment net/if.h tests in tests/posix/headers since we now have an implementation and can check for the existence of structures, functions, etc. Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
Add tests for if_indextoname(), if_freenameindex(), if_nameindex(), and if_nametoindex(). Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
Add trivial function implementations for those declared in netdb.h . Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
Uncomment netdb.h tests now that we have an implementation and can check for the existence of e.g. hostent, netent, protoent, and servent structure fields, as well as associated accessor functions. Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
Add a trivial implementation of sockatmark(). Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
Uncomment the check for sockatmark() to ensure that the function is declared in sys/socket.h, as a stub implementation was added in the previous commit. Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
Mark the POSIX_NETWORKING Option Group as supported. The POSIX_NETWORKING Option Group is required for PSE53 Conformance. Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
aeddf53
to
18fb6b0
Compare
Add implementations (some fully supported, some stubs) for the remaining POSIX networking API calls
With this, and with existing network subsystem API, we have mostly complete support for the
POSIX_NETWORKING
Option Group, as described in Section E.1 of IEEE 1003.1-2017.The
POSIX_NETWORKING
Option Group is required by PSE53 and PSE54 Application Environment Profiles.