-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -324,6 +324,18 @@ class NetworkInterface: public DNS { | |
*/ | ||
virtual nsapi_error_t add_dns_server(const SocketAddress &address, const char *interface_name); | ||
|
||
/** Get a domain name server from a list of servers to query | ||
* | ||
* Returns a DNS server address for a index. If returns error no more | ||
* DNS servers to read. | ||
* | ||
* @param index Index of the DNS server, starts from zero | ||
* @param address Destination for the host 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 commentThe 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 commentThe 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 commentThe 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. |
||
|
||
/** Register callback for status reporting. | ||
* | ||
* The specified status callback function will be called on status 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.
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 inbringup
. Andbringup
internally uses the sameset_ip_address
to set IPv6 address.