Hi Philipp,

am I assuming correctly that you want to know on which IP address you received
an incoming request?

An API extension for the underlying UDP SOCK API is about to get merged [1],
that would allow just this. Still missing are implementations of that API (but
the pull requests for those are open and likely much less controversial than an
API extension) and an extension to gcoap to forward this info.

I assume this is something that will land sooner or later in RIOT, as the
ability to do virtual hosting based on IP address has some interesting use cases
(e.g. to provide some resources only on the link-local IPv6 address, while other
resources can also be provided to a wider audience).

Kind regards,
Marian

[1]: https://github.com/RIOT-OS/RIOT/pull/14703

On Thu, 03 Dec 2020 05:49:23 +0100
Philipp Blum <[email protected]> wrote:

> > Philipp Blum <[email protected]> wrote:  
> >> I need to get the IP address within gcoap. If available global, if not 
> >> ULA,
> >> if not ULA then link-local.  
> > 
> > In all generality, the address may depend upon which interface you are
> > connected to, and what the address of your correspondant is.  
> > Particularly
> > the Link-Local.
> > While many devices have only one interface, this is not universally 
> > true.
> > It may be better to have an API that takes this into account.  
> 
> True that. I don't mind getting multiple addresses. I also thought about 
> getting the destination address of the incoming packet or something like 
> this.
> When I think about it, it probably is even better to get all addresses. 
> Thanks for the input.
> Yes, an API for this would be very good. Do you know in what 
> modules/files I have to look into it, to get a better understanding 
> where to get this information from?
> _______________________________________________
> users mailing list
> [email protected]
> https://lists.riot-os.org/mailman/listinfo/users

Attachment: pgpIFLgUU_xdL.pgp
Description: OpenPGP digital signature

_______________________________________________
users mailing list
[email protected]
https://lists.riot-os.org/mailman/listinfo/users

Reply via email to