net/hosts: add module for static hostname definitions#21397
net/hosts: add module for static hostname definitions#21397Teufelchen1 merged 7 commits intoRIOT-OS:masterfrom
Conversation
Teufelchen1
left a comment
There was a problem hiding this comment.
Looks useful. I feel like the hassle with AF_INET and AF_UNSPEC are not worth it, as the implementation only supports v6 anyways and it looks unlikely to me, that this will change anytime soon. Hence I propose to change the API. Instead of: one function suits all but only ever does v6 and you don't know the resulting buffer size or type - let's have a: This queries the v6 hosts file, takes name, gives ipv6_addr_t back, xoxo.
What do you think, what are your longterm plans?
|
I would like to keep the API compatible with the other backends of Adding support for |
crasbe
left a comment
There was a problem hiding this comment.
Some small style/documentation comments.
|
@Teufelchen1 you still have an open change-request, is that still valid after Ben's answer? |
|
Thanks for the ping. Please proceed. |
|
I'm not familiar with the networking subsystem in RIOT, but the The |
|
Whats the status here? Rebase is done, @crasbe, can we merge? |
You didn't give an approval and I can't really judge the technical aspects of it. But from my side it's good, although my side is mostly style related 🤔 😅 |
Contribution description
Operating with hostnames instead of raw IP addresses can be more convenient in applications.
On Linux we have
/etc/hostswhere we can statically define hostname -> IP mappings.This module adds something similar to RIOT.
Testing procedure
Enable the
hostsmodule. The XFA is by default populated with alocalhostentry:Issues/PRs references