[riot-notifications] [RIOT-OS/RIOT] gnrc_sock_tcp: add gnrc sock tcp (#16494)

Simon Brummer notifications at github.com
Fri Aug 6 15:50:28 CEST 2021


@brummer-simon 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;

Infact I do not include any sock header within gnrc_tcp (at least my grep skills say so).

How about "typedef struct _sock_tl_ep gnrc_tcp_ep_t;" within gnrc_tcp?
  


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16494#discussion_r684251270
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210806/b50493e9/attachment.htm>


More information about the notifications mailing list