netutils: add netutils_get_ipv6()#16634
Conversation
ebdb2fa to
8e28ff4
Compare
|
Centralizing code is a good idea in general, but why put a hostname parser (more of an application layer thing) into |
|
tbh I didn't know where else to put it - maybe create a |
Does it have to be part of GNRC even? From what I can tell, the only GNRC-specific thing is |
I have the same concern. The whole snippet in I'm also think this is more a kind of "netutils" rather than |
|
The "auto-detect interface if there is only one interface and address is link-local" part is GNRC specific though |
But what prevents to make it stack independent? And why it wouldn't be possible to still implement it in a generic way? There's on-going work for using the It's true that it's not possible to write apps fully stack independent yet unfortunately, but removing |
|
~~Is there a stack intependent alternative for nvm |
Yes. Fetching interfaces, registering and setting/getting options is already implemented for GNRC and there's on-going work for LWIP. Same for OpenThread |
Just remember, that the part after the |
36104d0 to
22253a0
Compare
|
All the tests using ping now don't have ping anymore ;-) that's why I proposed to make precursor PR instead ;-) |
|
And the fuzzing applications might also need that, but not sure. I guess all apps that include |
|
I removed the changes to the ping command from this PR. |
22253a0 to
6633442
Compare
|
It's only a dependency if also |
Exactly, so this should be reflected in the dependency resolution ;-) (same goes for xtimer/ztimer but that can be done as a follow-up). |
|
(And it can then be removed from the example Makefiles btw. not sure why you try both in this PR then...) |
What's wrong with ifneq (,$(filter shell_commands,$(USEMODULE)))
…
ifneq (,$(filter gnrc_icmpv6_echo,$(USEMODULE)))
USEMODULE += netutils
endif
…
endif
Well the examples also use |
👍 |
Ah, sorry, did not see this was in the dependency resolution of |
|
However, please address the other concerns in my review as well. |
miri64
left a comment
There was a problem hiding this comment.
Final nits. Please squash immediately.
|
(also, a |
b18183a to
dead4fe
Compare
Contribution description
Parsing the IP address / hostname currently involves a lot of boilerplate and copy & paste.
Only the version in
gnrc_icmpv6_echohas support for DNS hostnames.To reduce code duplication and ensure feature parity, add a new
gnrc_netif_parse_hostname()helper function.Testing procedure
Run
examples/gnrc_networking. Thepingcommand should still work as before, but now also theudpcommand can resolve hostnames via DNS if thesock_dnsmodule is used.Issues/PRs references