sys/net/netif: add convenience functions for getting/printing IPv6 addresses#18161
Merged
benpicco merged 6 commits intoRIOT-OS:masterfrom Jun 6, 2022
Merged
sys/net/netif: add convenience functions for getting/printing IPv6 addresses#18161benpicco merged 6 commits intoRIOT-OS:masterfrom
benpicco merged 6 commits intoRIOT-OS:masterfrom
Conversation
fjmolinas
reviewed
Jun 2, 2022
fjmolinas
reviewed
Jun 2, 2022
Contributor
fjmolinas
left a comment
There was a problem hiding this comment.
Small static chec nitpick, otherwise good to have this
fjmolinas
approved these changes
Jun 2, 2022
Contributor
fjmolinas
left a comment
There was a problem hiding this comment.
LGTM, if muedock is happy let's go with it!
Contributor
|
Please squash! |
Member
Author
|
Thanks for the quick review :) |
miri64
reviewed
Jun 2, 2022
benpicco
reviewed
Jun 2, 2022
Contributor
benpicco
left a comment
There was a problem hiding this comment.
examples/telnet_server would also benefit from this
Member
Author
|
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
benpicco
approved these changes
Jun 6, 2022
Member
Author
|
thx (: |
Member
|
This broke the release tests. Will provide a fix to Release-Specs ASAP. |
miri64
added a commit
to miri64/Release-Specs
that referenced
this pull request
Jun 20, 2022
The address output of `examples/nanocoap_server` was changed to JSON in RIOT-OS/RIOT#18161. This changes the parsing to account for that.
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contribution description
At a few places this was already either done by hand or via an ugly hack to call the shell handler if
ifconfigfrom 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_minimaland 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