-
Notifications
You must be signed in to change notification settings - Fork 2k
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
sys/net/netif: add convenience functions for getting/printing IPv6 addresses #18161
Conversation
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.
Small static chec nitpick, otherwise good to have this
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.
LGTM, if muedock is happy let's go with it!
Please squash! |
Thanks for the quick review :) |
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.
examples/telnet_server
would also benefit from this
I take this of from the CI queue now and let this wait for #18162 - once this is in it can use fmt when used anyway as before. Especially for newlib users there is quite a bit of memory to be safed when not using printf. |
Also use `IS_USED(MODULE_FMT)` rather than the preprocessor and rely on the optimizer to eliminate the dead branch.
- add `netif_get_ipv6()` to query IPv6 (as a slim convenience wrapper for `netif_get_opt()`) - add `netifs_get_ipv6()` to query IPv6 addresses of all netifs - add `netif_print_ipv6()` to print the IPv6 address(es) of a single netif - add `netifs_print_ipv6()` to print the IPv6 address(es) of all netifs
thx (: |
This broke the release tests. Will provide a fix to Release-Specs ASAP. |
The address output of `examples/nanocoap_server` was changed to JSON in RIOT-OS/RIOT#18161. This changes the parsing to account for that.
Contribution description
At a few places this was already either done by hand or via an ugly hack to call the shell handler if
ifconfig
from C, so apparently there is a use for it. In addition, the hack of calling a single shell handler doesn't work well with XFA, as XFA items are not subject to link time garbage collection.Testing procedure
Run
examples/gnrc_minimal
and it should still print all IPv6 address (but now as JSON, because that's what cool kids do now).Issues/PRs references
Needed for #18152