1
0

wolfio.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577
  1. /*!
  2. \brief This function is the receive embedded callback.
  3. \return Success This function returns the number of bytes read.
  4. \return WOLFSSL_CBIO_ERR_WANT_READ returned with a “Would block” message
  5. if the last error was SOCKET_EWOULDBLCOK or SOCKET_EAGAIN.
  6. \return WOLFSSL_CBIO_ERR_TIMEOUT returned with a “Socket timeout” message.
  7. \return WOLFSSL_CBIO_ERR_CONN_RST returned with a “Connection reset”
  8. message if the last error was SOCKET_ECONNRESET.
  9. \return WOLFSSL_CBIO_ERR_ISR returned with a “Socket interrupted” message
  10. if the last error was SOCKET_EINTR.
  11. \return WOLFSSL_CBIO_ERR_WANT_READ returned with a “Connection refused”
  12. message if the last error was SOCKET_ECONNREFUSED.
  13. \return WOLFSSL_CBIO_ERR_CONN_CLOSE returned with a “Connection aborted”
  14. message if the last error was SOCKET_ECONNABORTED.
  15. \return WOLFSSL_CBIO_ERR_GENERAL returned with a “General error” message
  16. if the last error was not specified.
  17. \param ssl a pointer to a WOLFSSL structure, created using wolfSSL_new().
  18. \param buf a char pointer representation of the buffer.
  19. \param sz the size of the buffer.
  20. \param ctx a void pointer to user registered context. In the default case
  21. the ctx is a socket descriptor pointer.
  22. _Example_
  23. \code
  24. WOLFSSL_CTX* ctx = wolfSSL_CTX_new( protocol method );
  25. WOLFSSL* ssl = wolfSSL_new(ctx);
  26. char* buf;
  27. int sz;
  28. void* ctx;
  29. int bytesRead = EmbedReceive(ssl, buf, sz, ctx);
  30. if(bytesRead <= 0){
  31. // There were no bytes read. Failure case.
  32. }
  33. \endcode
  34. \sa EmbedSend
  35. \sa wolfSSL_CTX_SetIORecv
  36. \sa wolfSSL_SSLSetIORecv
  37. */
  38. int EmbedReceive(WOLFSSL* ssl, char* buf, int sz, void* ctx);
  39. /*!
  40. \brief This function is the send embedded callback.
  41. \return Success This function returns the number of bytes sent.
  42. \return WOLFSSL_CBIO_ERR_WANT_WRITE returned with a “Would block” message
  43. if the last error was SOCKET_EWOULDBLOCK or SOCKET_EAGAIN.
  44. \return WOLFSSL_CBIO_ERR_CONN_RST returned with a “Connection reset”
  45. message if the last error was SOCKET_ECONNRESET.
  46. \return WOLFSSL_CBIO_ERR_ISR returned with a “Socket interrupted” message
  47. if the last error was SOCKET_EINTR.
  48. \return WOLFSSL_CBIO_ERR_CONN_CLOSE returned with a “Socket EPIPE” message
  49. if the last error was SOCKET_EPIPE.
  50. \return WOLFSSL_CBIO_ERR_GENERAL returned with a “General error” message
  51. if the last error was not specified.
  52. \param ssl a pointer to a WOLFSSL structure, created using wolfSSL_new().
  53. \param buf a char pointer representing the buffer.
  54. \param sz the size of the buffer.
  55. \param ctx a void pointer to user registered context.
  56. _Example_
  57. \code
  58. WOLFSSL* ssl = wolfSSL_new(ctx);
  59. char* buf;
  60. int sz;
  61. void* ctx;
  62. int dSent = EmbedSend(ssl, buf, sz, ctx);
  63. if(dSent <= 0){
  64. // No byes sent. Failure case.
  65. }
  66. \endcode
  67. \sa EmbedReceive
  68. \sa wolfSSL_CTX_SetIOSend
  69. \sa wolfSSL_SSLSetIOSend
  70. */
  71. int EmbedSend(WOLFSSL* ssl, char* buf, int sz, void* ctx);
  72. /*!
  73. \brief This function is the receive embedded callback.
  74. \return Success This function returns the nb bytes read if the execution
  75. was successful.
  76. \return WOLFSSL_CBIO_ERR_WANT_READ if the connection refused or if a
  77. ‘would block’ error was thrown in the function.
  78. \return WOLFSSL_CBIO_ERR_TIMEOUT returned if the socket timed out.
  79. \return WOLFSSL_CBIO_ERR_CONN_RST returned if the connection reset.
  80. \return WOLFSSL_CBIO_ERR_ISR returned if the socket was interrupted.
  81. \return WOLFSSL_CBIO_ERR_GENERAL returned if there was a general error.
  82. \param ssl a pointer to a WOLFSSL structure, created using wolfSSL_new().
  83. \param buf a constant char pointer to the buffer.
  84. \param sz an int type representing the size of the buffer.
  85. \param ctx a void pointer to the WOLFSSL_CTX context.
  86. _Example_
  87. \code
  88. WOLFSSL_CTX* ctx = wolfSSL_CTX_new( protocol method );
  89. WOLFSSL* ssl = WOLFSSL_new(ctx);
  90. char* buf;
  91. int sz = sizeof(buf)/sizeof(char);
  92. (void*)ctx;
  93. int nb = EmbedReceiveFrom(ssl, buf, sz, ctx);
  94. if(nb > 0){
  95. // nb is the number of bytes written and is positive
  96. }
  97. \endcode
  98. \sa EmbedSendTo
  99. \sa wolfSSL_CTX_SetIORecv
  100. \sa wolfSSL_SSLSetIORecv
  101. \sa wolfSSL_dtls_get_current_timeout
  102. */
  103. int EmbedReceiveFrom(WOLFSSL* ssl, char* buf, int sz, void*);
  104. /*!
  105. \brief This function is the send embedded callback.
  106. \return Success This function returns the number of bytes sent.
  107. \return WOLFSSL_CBIO_ERR_WANT_WRITE returned with a “Would Block” message
  108. if the last error was either SOCKET_EWOULDBLOCK or SOCKET_EAGAIN error.
  109. \return WOLFSSL_CBIO_ERR_CONN_RST returned with a “Connection reset”
  110. message if the last error was SOCKET_ECONNRESET.
  111. \return WOLFSSL_CBIO_ERR_ISR returned with a “Socket interrupted” message
  112. if the last error was SOCKET_EINTR.
  113. \return WOLFSSL_CBIO_ERR_CONN_CLOSE returned with a “Socket EPIPE” message
  114. if the last error was WOLFSSL_CBIO_ERR_CONN_CLOSE.
  115. \return WOLFSSL_CBIO_ERR_GENERAL returned with a “General error” message
  116. if the last error was not specified.
  117. \param ssl a pointer to a WOLFSSL structure, created using wolfSSL_new().
  118. \param buf a char pointer representing the buffer.
  119. \param sz the size of the buffer.
  120. \param ctx a void pointer to the user registered context. The default case
  121. is a WOLFSSL_DTLS_CTX structure.
  122. _Example_
  123. \code
  124. WOLFSSL* ssl;
  125. char* buf;
  126. int sz;
  127. void* ctx;
  128. int sEmbed = EmbedSendto(ssl, buf, sz, ctx);
  129. if(sEmbed <= 0){
  130. // No bytes sent. Failure case.
  131. }
  132. \endcode
  133. \sa EmbedReceiveFrom
  134. \sa wolfSSL_CTX_SetIOSend
  135. \sa wolfSSL_SSLSetIOSend
  136. */
  137. int EmbedSendTo(WOLFSSL* ssl, char* buf, int sz, void* ctx);
  138. /*!
  139. \brief This function is the DTLS Generate Cookie callback.
  140. \return Success This function returns the number of bytes copied
  141. into the buffer.
  142. \return GEN_COOKIE_E returned if the getpeername failed in
  143. EmbedGenerateCookie.
  144. \param ssl a pointer to a WOLFSSL structure, created using wolfSSL_new().
  145. \param buf byte pointer representing the buffer. It is the destination
  146. from XMEMCPY().
  147. \param sz the size of the buffer.
  148. \param ctx a void pointer to user registered context.
  149. _Example_
  150. \code
  151. WOLFSSL_CTX* ctx = wolfSSL_CTX_new( method );
  152. WOLFSSL* ssl = wolfSSL_new(ctx);
  153. byte buffer[BUFFER_SIZE];
  154. int sz = sizeof(buffer)/sizeof(byte);
  155. void* ctx;
  156. int ret = EmbedGenerateCookie(ssl, buffer, sz, ctx);
  157. if(ret > 0){
  158. // EmbedGenerateCookie code block for success
  159. }
  160. \endcode
  161. \sa wolfSSL_CTX_SetGenCookie
  162. */
  163. int EmbedGenerateCookie(WOLFSSL* ssl, unsigned char* buf,
  164. int sz, void*);
  165. /*!
  166. \brief This function frees the response buffer.
  167. \return none No returns.
  168. \param ctx a void pointer to heap hint.
  169. \param resp a byte pointer representing the response.
  170. _Example_
  171. \code
  172. void* ctx;
  173. byte* resp; // Response buffer.
  174. EmbedOcspRespFree(ctx, resp);
  175. \endcode
  176. \sa wolfSSL_CertManagerSetOCSP_Cb
  177. \sa wolfSSL_CertManagerEnableOCSPStapling
  178. \sa wolfSSL_CertManagerEnableOCSP
  179. */
  180. void EmbedOcspRespFree(void* ctx, byte* resp);
  181. /*!
  182. \brief This function registers a receive callback for wolfSSL to get input
  183. data. By default, wolfSSL uses EmbedReceive() as the callback which uses
  184. the system’s TCP recv() function. The user can register a function to get
  185. input from memory, some other network module, or from anywhere. Please see
  186. the EmbedReceive() function in src/io.c as a guide for how the function
  187. should work and for error codes. In particular, IO_ERR_WANT_READ should
  188. be returned for non blocking receive when no data is ready.
  189. \return none no Returns.
  190. \param ctx pointer to the SSL context, created with wolfSSL_CTX_new().
  191. \param callback function to be registered as the receive callback for the
  192. wolfSSL context, ctx. The signature of this function must follow that as
  193. shown above in the Synopsis section.
  194. _Example_
  195. \code
  196. WOLFSSL_CTX* ctx = 0;
  197. // Receive callback prototype
  198. int MyEmbedReceive(WOLFSSL* ssl, char* buf, int sz, void* ctx);
  199. // Register the custom receive callback with wolfSSL
  200. wolfSSL_CTX_SetIORecv(ctx, MyEmbedReceive);
  201. int MyEmbedReceive(WOLFSSL* ssl, char* buf, int sz, void* ctx)
  202. {
  203. // custom EmbedReceive function
  204. }
  205. \endcode
  206. \sa wolfSSL_CTX_SetIOSend
  207. \sa wolfSSL_SetIOReadCtx
  208. \sa wolfSSL_SetIOWriteCtx
  209. */
  210. void wolfSSL_CTX_SetIORecv(WOLFSSL_CTX* ctx, CallbackIORecv CBIORecv);
  211. /*!
  212. \brief This function registers a context for the SSL session’s receive
  213. callback function. By default, wolfSSL sets the file descriptor passed to
  214. wolfSSL_set_fd() as the context when wolfSSL is using the system’s TCP
  215. library. If you’ve registered your own receive callback you may want to set
  216. a specific context for the session. For example, if you’re using memory
  217. buffers the context may be a pointer to a structure describing where and
  218. how to access the memory buffers.
  219. \return none No returns.
  220. \param ssl pointer to the SSL session, created with wolfSSL_new().
  221. \param rctx pointer to the context to be registered with the SSL session’s
  222. (ssl) receive callback function.
  223. _Example_
  224. \code
  225. int sockfd;
  226. WOLFSSL* ssl = 0;
  227. ...
  228. // Manually setting the socket fd as the receive CTX, for example
  229. wolfSSL_SetIOReadCtx(ssl, &sockfd);
  230. ...
  231. \endcode
  232. \sa wolfSSL_CTX_SetIORecv
  233. \sa wolfSSL_CTX_SetIOSend
  234. \sa wolfSSL_SetIOWriteCtx
  235. */
  236. void wolfSSL_SetIOReadCtx( WOLFSSL* ssl, void *ctx);
  237. /*!
  238. \brief This function registers a context for the SSL session’s send
  239. callback function. By default, wolfSSL sets the file descriptor passed to
  240. wolfSSL_set_fd() as the context when wolfSSL is using the system’s TCP
  241. library. If you’ve registered your own send callback you may want to set a
  242. specific context for the session. For example, if you’re using memory
  243. buffers the context may be a pointer to a structure describing where and
  244. how to access the memory buffers.
  245. \return none No returns.
  246. \param ssl pointer to the SSL session, created with wolfSSL_new().
  247. \param wctx pointer to the context to be registered with the SSL session’s
  248. (ssl) send callback function.
  249. _Example_
  250. \code
  251. int sockfd;
  252. WOLFSSL* ssl = 0;
  253. ...
  254. // Manually setting the socket fd as the send CTX, for example
  255. wolfSSL_SetIOWriteCtx(ssl, &sockfd);
  256. ...
  257. \endcode
  258. \sa wolfSSL_CTX_SetIORecv
  259. \sa wolfSSL_CTX_SetIOSend
  260. \sa wolfSSL_SetIOReadCtx
  261. */
  262. void wolfSSL_SetIOWriteCtx(WOLFSSL* ssl, void *ctx);
  263. /*!
  264. \ingroup IO
  265. \brief This function returns the IOCB_ReadCtx member of the WOLFSSL struct.
  266. \return pointer This function returns a void pointer to the IOCB_ReadCtx
  267. member of the WOLFSSL structure.
  268. \return NULL returned if the WOLFSSL struct is NULL.
  269. \param ssl a pointer to a WOLFSSL structure, created using wolfSSL_new().
  270. _Example_
  271. \code
  272. WOLFSSL* ssl = wolfSSL_new(ctx);
  273. void* ioRead;
  274. ...
  275. ioRead = wolfSSL_GetIOReadCtx(ssl);
  276. if(ioRead == NULL){
  277. // Failure case. The ssl object was NULL.
  278. }
  279. \endcode
  280. \sa wolfSSL_GetIOWriteCtx
  281. \sa wolfSSL_SetIOReadFlags
  282. \sa wolfSSL_SetIOWriteCtx
  283. \sa wolfSSL_SetIOReadCtx
  284. \sa wolfSSL_CTX_SetIOSend
  285. */
  286. void* wolfSSL_GetIOReadCtx( WOLFSSL* ssl);
  287. /*!
  288. \ingroup IO
  289. \brief This function returns the IOCB_WriteCtx member of the WOLFSSL structure.
  290. \return pointer This function returns a void pointer to the IOCB_WriteCtx
  291. member of the WOLFSSL structure.
  292. \return NULL returned if the WOLFSSL struct is NULL.
  293. \param ssl a pointer to a WOLFSSL structure, created using wolfSSL_new().
  294. _Example_
  295. \code
  296. WOLFSSL* ssl;
  297. void* ioWrite;
  298. ...
  299. ioWrite = wolfSSL_GetIOWriteCtx(ssl);
  300. if(ioWrite == NULL){
  301. // The function returned NULL.
  302. }
  303. \endcode
  304. \sa wolfSSL_GetIOReadCtx
  305. \sa wolfSSL_SetIOWriteCtx
  306. \sa wolfSSL_SetIOReadCtx
  307. \sa wolfSSL_CTX_SetIOSend
  308. */
  309. void* wolfSSL_GetIOWriteCtx(WOLFSSL* ssl);
  310. /*!
  311. \brief This function sets the flags for the receive callback to use for
  312. the given SSL session. The receive callback could be either the default
  313. wolfSSL EmbedReceive callback, or a custom callback specified by the user
  314. (see wolfSSL_CTX_SetIORecv). The default flag value is set internally by
  315. wolfSSL to the value of 0. The default wolfSSL receive callback uses the
  316. recv() function to receive data from the socket. From the recv() man page:
  317. “The flags argument to a recv() function is formed by or'ing one or more
  318. of the values: MSG_OOB process out-of-band data, MSG_PEEK peek at incoming
  319. message, MSG_WAITALL wait for full request or error. The MSG_OOB flag
  320. requests receipt of out-of-band data that would not be received in the
  321. normal data stream. Some protocols place expedited data at the head of
  322. the normal data queue, and thus this flag cannot be used with such
  323. protocols. The MSG_PEEK flag causes the receive operation to return
  324. data from the beginning of the receive queue without removing that data
  325. from the queue. Thus, a subsequent receive call will return the same data.
  326. The MSG_WAITALL flag requests that the operation block until the full
  327. request is satisfied. However, the call may still return less data than
  328. requested if a signal is caught, an error or disconnect occurs, or the next
  329. data to be received is of a different type than that returned.”
  330. \return none No returns.
  331. \param ssl pointer to the SSL session, created with wolfSSL_new().
  332. \param flags value of the I/O read flags for the specified SSL
  333. session (ssl).
  334. _Example_
  335. \code
  336. WOLFSSL* ssl = 0;
  337. ...
  338. // Manually setting recv flags to 0
  339. wolfSSL_SetIOReadFlags(ssl, 0);
  340. ...
  341. \endcode
  342. \sa wolfSSL_CTX_SetIORecv
  343. \sa wolfSSL_CTX_SetIOSend
  344. \sa wolfSSL_SetIOReadCtx
  345. */
  346. void wolfSSL_SetIOReadFlags( WOLFSSL* ssl, int flags);
  347. /*!
  348. \brief This function sets the flags for the send callback to use for the
  349. given SSL session. The send callback could be either the default wolfSSL
  350. EmbedSend callback, or a custom callback specified by the user (see
  351. wolfSSL_CTX_SetIOSend). The default flag value is set internally by wolfSSL
  352. to the value of 0. The default wolfSSL send callback uses the send()
  353. function to send data from the socket. From the send() man page: “The
  354. flags parameter may include one or more of the following:
  355. #define MSG_OOB 0x1 // process out-of-band data,
  356. #define MSG_DONTROUTE 0x4 // bypass routing, use direct interface.
  357. The flag MSG_OOB is used to send ``out-of-band'' data on sockets that
  358. support this notion (e.g. SOCK_STREAM); the underlying protocol must also
  359. support ``out-of-band'' data. MSG_DONTROUTE is usually used only by
  360. diagnostic or routing programs.”
  361. \return none No returns.
  362. \param ssl pointer to the SSL session, created with wolfSSL_new().
  363. \param flags value of the I/O send flags for the specified SSL session (ssl).
  364. _Example_
  365. \code
  366. WOLFSSL* ssl = 0;
  367. ...
  368. // Manually setting send flags to 0
  369. wolfSSL_SetIOWriteFlags(ssl, 0);
  370. ...
  371. \endcode
  372. \sa wolfSSL_CTX_SetIORecv
  373. \sa wolfSSL_CTX_SetIOSend
  374. \sa wolfSSL_SetIOReadCtx
  375. */
  376. void wolfSSL_SetIOWriteFlags(WOLFSSL* ssl, int flags);
  377. /*!
  378. \ingroup IO
  379. \brief This function sets the nxSocket and nxWait members of the nxCtx
  380. struct within the WOLFSSL structure.
  381. \return none No returns.
  382. \param ssl a pointer to a WOLFSSL structure, created using wolfSSL_new().
  383. \param nxSocket a pointer to type NX_TCP_SOCKET that is set to the
  384. nxSocket member of the nxCTX structure.
  385. \param waitOption a ULONG type that is set to the nxWait member of
  386. the nxCtx structure.
  387. _Example_
  388. \code
  389. WOLFSSL* ssl = wolfSSL_new(ctx);
  390. NX_TCP_SOCKET* nxSocket;
  391. ULONG waitOption;
  392. if(ssl != NULL || nxSocket != NULL || waitOption <= 0){
  393. wolfSSL_SetIO_NetX(ssl, nxSocket, waitOption);
  394. } else {
  395. // You need to pass in good parameters.
  396. }
  397. \endcode
  398. \sa set_fd
  399. \sa NetX_Send
  400. \sa NetX_Receive
  401. */
  402. void wolfSSL_SetIO_NetX(WOLFSSL* ssl, NX_TCP_SOCKET* nxsocket,
  403. ULONG waitoption);
  404. /*!
  405. \brief This function sets the callback for the CBIOCookie member of the
  406. WOLFSSL_CTX structure. The CallbackGenCookie type is a function pointer
  407. and has the signature: int (*CallbackGenCookie)(WOLFSSL* ssl, unsigned
  408. char* buf, int sz, void* ctx);
  409. \return none No returns.
  410. \param ssl a pointer to a WOLFSSL structure, created using wolfSSL_new().
  411. \param cb a CallbackGenCookie type function pointer with the signature
  412. of CallbackGenCookie.
  413. _Example_
  414. \code
  415. WOLFSSL_CTX* ctx = wolfSSL_CTX_new( method );
  416. WOLFSSL* ssl = wolfSSL_new(ctx);
  417. int SetGenCookieCB(WOLFSSL* ssl, unsigned char* buf, int sz, void* ctx){
  418. // Callback function body.
  419. }
  420. wolfSSL_CTX_SetGenCookie(ssl->ctx, SetGenCookieCB);
  421. \endcode
  422. \sa CallbackGenCookie
  423. */
  424. void wolfSSL_CTX_SetGenCookie(WOLFSSL_CTX* ctx, CallbackGenCookie cb);
  425. /*!
  426. \ingroup Setup
  427. \brief This function returns the IOCB_CookieCtx member of the
  428. WOLFSSL structure.
  429. \return pointer The function returns a void pointer value stored in
  430. the IOCB_CookieCtx.
  431. \return NULL if the WOLFSSL struct is NULL
  432. \param ssl a pointer to a WOLFSSL structure, created using wolfSSL_new().
  433. _Example_
  434. \code
  435. WOLFSSL_CTX* ctx = wolfSSL_CTX_new( method );
  436. WOLFSSL* ssl = wolfSSL_new(ctx);
  437. void* cookie;
  438. ...
  439. cookie = wolfSSL_GetCookieCtx(ssl);
  440. if(cookie != NULL){
  441. // You have the cookie
  442. }
  443. \endcode
  444. \sa wolfSSL_SetCookieCtx
  445. \sa wolfSSL_CTX_SetGenCookie
  446. */
  447. void* wolfSSL_GetCookieCtx(WOLFSSL* ssl);
  448. /*!
  449. \ingroup Setup
  450. \brief This function sets up the ISO-TP context if wolfSSL, for use when
  451. wolfSSL is compiled with WOLFSSL_ISOTP
  452. \return 0 on success, WOLFSSL_CBIO_ERR_GENERAL on failure
  453. \param ssl the wolfSSL context
  454. \param ctx a user created ISOTP context which this function initializes
  455. \param recv_fn a user CAN bus receive callback
  456. \param send_fn a user CAN bus send callback
  457. \param delay_fn a user microsecond granularity delay function
  458. \param receive_delay a set amount of microseconds to delay each CAN bus
  459. packet
  460. \param receive_buffer a user supplied buffer to receive data, recommended
  461. that is allocated to ISOTP_DEFAULT_BUFFER_SIZE bytes
  462. \param receive_buffer_size - The size of receive_buffer
  463. \param arg an arbitrary pointer sent to recv_fn and send_fn
  464. _Example_
  465. \code
  466. struct can_info can_con_info;
  467. isotp_wolfssl_ctx isotp_ctx;
  468. char *receive_buffer = malloc(ISOTP_DEFAULT_BUFFER_SIZE);
  469. WOLFSSL_CTX* ctx = wolfSSL_CTX_new(method);
  470. WOLFSSL* ssl = wolfSSL_new(ctx);
  471. ...
  472. wolfSSL_SetIO_ISOTP(ssl, &isotp_ctx, can_receive, can_send, can_delay, 0,
  473. receive_buffer, ISOTP_DEFAULT_BUFFER_SIZE, &can_con_info);
  474. \endcode
  475. */
  476. int wolfSSL_SetIO_ISOTP(WOLFSSL *ssl, isotp_wolfssl_ctx *ctx,
  477. can_recv_fn recv_fn, can_send_fn send_fn, can_delay_fn delay_fn,
  478. word32 receive_delay, char *receive_buffer, int receive_buffer_size,
  479. void *arg);