-
Notifications
You must be signed in to change notification settings - Fork 3k
Netsocket: Introduce set_ip_address and get_dns_server APIs #12606
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
Netsocket: Introduce set_ip_address and get_dns_server APIs #12606
Conversation
@kivaisan, thank you for your changes. |
Fixed astyle. |
@AnttiKauppila @mikaleppanen Could you please review this? |
|
||
int conv_ip = 1; | ||
|
||
#if LWIP_IPV4 |
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.
If both LWIP_IPV4 & 6 are enabled, can you still set IPv6 address? inet_aton returns NULL in case of wrong format? Maybe a comment would be needed here to make it clear?
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.
Yes you can. In one of our projects we set up static IPv4 address using set_ip_address
API and then give link-local IPv6 address in bringup
. And bringup
internally uses the same set_ip_address
to set IPv6 address.
* @param interface_name Network interface name | ||
* @return NSAPI_ERROR_OK on success, negative error code on failure | ||
*/ | ||
virtual nsapi_error_t get_dns_server(int index, SocketAddress *address, const char *interface_name = NULL); |
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.
Looking at the file, it was already changed to contain "override" rather than "virtual", please review the other methods and update this one as well
cc @kjbracey-arm was the design Mbed OS guidance updated and team as well to follow the latest changes?
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.
This is a base class declaration so this needs to be virtual.
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.
Correct, I had to opened a different file , can;t find it now.
CI started |
Test run: FAILEDSummary: 1 of 4 test jobs failed Failed test jobs:
|
Looks possibly CI related so restarting |
Test run: FAILEDSummary: 1 of 3 test jobs failed Failed test jobs:
|
Build seems to fail to EMW3166 ARMC6 WICED binary. @tymoteuszblochmobica was it just recently updated or is it missing something as GCC_ARM build succeeds(?) ? |
@tymoteuszblochmobica Please review |
@kivaisan Is there anyone else besides @tymoteuszblochmobica who could help to progress here? |
Pull request has been modified.
This PR cannot be merged due to conflicts. Please rebase to resolve them. |
set_ip_address API can be used to set a static IPv4 address or IPv6 link-local address to network stack. This is needed for example in cellular use cases where device gets multiple IP addresses from cellular context.
With get_dns_server DNS servers can be queried from NetworkInterface object
I rebuilt WICED binaries and included them in this PR and it fixes the build issue with EMW3166. |
CI started |
Test run: SUCCESSSummary: 6 of 6 test jobs passed |
Summary of changes
set_ip_address
API can be used to set a static IPv4 address or IPv6 link-local address to network stack. This is needed for example in cellular use cases where device gets multiple IP addresses from cellular context.With
get_dns_server
DNS servers can be queried from NetworkInterface objectImpact of changes
Migration actions required
Documentation
Pull request type
Test results
Reviewers
@ARMmbed/mbed-os-ipcore