-
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
CoAP: add remote and local endpoint data to coap_pkt_t #16827
CoAP: add remote and local endpoint data to coap_pkt_t #16827
Conversation
69e14d7
to
65877a2
Compare
@@ -91,7 +90,7 @@ static void _on_register(const gcoap_request_memo_t *memo, coap_pkt_t* pdu, | |||
/* read the location header and save the RD details on success */ | |||
if (coap_get_location_path(pdu, (uint8_t *)_rd_loc, | |||
sizeof(_rd_loc)) > 0) { | |||
memcpy(&_rd_remote, remote, sizeof(_rd_remote)); | |||
memcpy(&_rd_remote, pdu->remote, sizeof(_rd_remote)); |
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.
Maybe it makes sense to have a dedicated function for this. This function could assert()
that the endpoint indeed of a UDP flavor, once multiple protocols are supported.
At a first glance this looks similar to #13621. Did things change enough in the mean time to reconsider adding this? |
That was closed in favor of another PR that was closed in the meantime. However, the feature was added by exposing the remote addr as an additional argument. The same could be done here, which is what @fabian18 first did - but that is an API change (PR still open). I take it that you prefer that version? |
I think we should at least wait for the outcome of tomorrow's CoAP API breakout session at the summit, before we can conclude on this definitively. |
I'm just passing by and noticed similarities, I haven't looked good enough at all the options to have a good opinion or preference. |
(see https://hackmd.io/o_y0nKfGRSqrkg-YTCf97g for some initial notes) |
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.
Blocking until breakout session during the summit concludes
I think the conclusion was that longterm we move to another API, but short-term we move out the |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
Contribution description
This is an alternative attempt to expose local and remote IP addresses and ports to the
CoAP
request/response handlers. TheCoAP
PDU now contains pointers to local and remote endpoint data.Testing procedure
examples/gcoap
:Issues/PRs references
Replaces #16429
Trying to solve #15686