Skip to content

Commit bd2cc5b

Browse files
committed
fixup! DTLS: Introduce custom I/O callbacks API and structure
1 parent c2377fd commit bd2cc5b

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

doc/dox_comments/header_files/wolfio.h

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,3 +618,51 @@ void wolfSSL_SSLDisableRead(WOLFSSL *ssl);
618618
\sa wolfSSL_SSLEnableRead
619619
*/
620620
void wolfSSL_SSLEnableRead(WOLFSSL *ssl);
621+
622+
/*!
623+
\brief Set a custom DTLS recvfrom callback for a WOLFSSL session.
624+
625+
This function allows you to specify a custom callback function for receiving
626+
datagrams (DTLS) using the `recvfrom`-style interface. The callback must match
627+
the WolfSSLRecvFrom function pointer type and is expected to behave like the
628+
POSIX `recvfrom()` function, including its return values and error handling.
629+
630+
\param ssl A pointer to a WOLFSSL structure, created using wolfSSL_new().
631+
\param recvFrom The custom callback function to use for DTLS datagram receive.
632+
633+
_Example_
634+
\code
635+
wolfSSL_SetRecvFrom(ssl, my_recvfrom_cb);
636+
\endcode
637+
638+
\sa WolfSSLRecvFrom
639+
\sa wolfSSL_SetSendTo
640+
\sa EmbedReceiveFrom
641+
\sa wolfSSL_CTX_SetIORecv
642+
\sa wolfSSL_SSLSetIORecv
643+
*/
644+
WOLFSSL_API void wolfSSL_SetRecvFrom(WOLFSSL* ssl, WolfSSLRecvFrom recvFrom);
645+
646+
/*!
647+
\brief Set a custom DTLS sendto callback for a WOLFSSL session.
648+
649+
This function allows you to specify a custom callback function for sending
650+
datagrams (DTLS) using the `sendto`-style interface. The callback must match
651+
the WolfSSLSento function pointer type and is expected to behave like the
652+
POSIX `sendto()` function, including its return values and error handling.
653+
654+
\param ssl A pointer to a WOLFSSL structure, created using wolfSSL_new().
655+
\param sendTo The custom callback function to use for DTLS datagram send.
656+
657+
_Example_
658+
\code
659+
wolfSSL_SetSendTo(ssl, my_sendto_cb);
660+
\endcode
661+
662+
\sa WolfSSLSento
663+
\sa wolfSSL_SetRecvFrom
664+
\sa EmbedSendTo
665+
\sa wolfSSL_CTX_SetIOSend
666+
\sa wolfSSL_SSLSetIOSend
667+
*/
668+
WOLFSSL_API void wolfSSL_SetSendTo(WOLFSSL* ssl, WolfSSLSento sendTo);

0 commit comments

Comments
 (0)