[riot-notifications] [RIOT-OS/RIOT] gnrc_sock_tcp: add gnrc sock tcp (#16494)
notifications at github.com
Fri Aug 6 15:19:28 CEST 2021
@benpicco commented on this pull request.
> + return gnrc_tcp_get_local(tcb, local);
+int sock_tcp_get_remote(sock_tcp_t *sock, sock_tcp_ep_t *ep)
+ /* Asserts defined by API. */
+ assert(sock != NULL);
+ assert(ep != NULL);
+ /* Asserts to protect GNRC_TCP. */
+ assert(sizeof(sock_tcp_t) == sizeof(gnrc_tcp_tcb_t));
+ assert(sizeof(sock_tcp_ep_t) == sizeof(gnrc_tcp_ep_t));
+ /* NOTE: GNRC_TCP and GNRC_SOCK_TCP types must have the same memory representation. */
+ gnrc_tcp_tcb_t *tcb = (gnrc_tcp_tcb_t *) sock;
+ gnrc_tcp_ep_t *remote = (gnrc_tcp_ep_t *) ep;
I don't see how implicitly relying that those two structs are the same is any better than including a generic header file :fearful:
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications