SSL_get_stream_id.3ossl 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. .\" -*- mode: troff; coding: utf-8 -*-
  2. .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
  3. .\"
  4. .\" Standard preamble:
  5. .\" ========================================================================
  6. .de Sp \" Vertical space (when we can't use .PP)
  7. .if t .sp .5v
  8. .if n .sp
  9. ..
  10. .de Vb \" Begin verbatim text
  11. .ft CW
  12. .nf
  13. .ne \\$1
  14. ..
  15. .de Ve \" End verbatim text
  16. .ft R
  17. .fi
  18. ..
  19. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
  20. .ie n \{\
  21. . ds C` ""
  22. . ds C' ""
  23. 'br\}
  24. .el\{\
  25. . ds C`
  26. . ds C'
  27. 'br\}
  28. .\"
  29. .\" Escape single quotes in literal strings from groff's Unicode transform.
  30. .ie \n(.g .ds Aq \(aq
  31. .el .ds Aq '
  32. .\"
  33. .\" If the F register is >0, we'll generate index entries on stderr for
  34. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  35. .\" entries marked with X<> in POD. Of course, you'll have to process the
  36. .\" output yourself in some meaningful fashion.
  37. .\"
  38. .\" Avoid warning from groff about undefined register 'F'.
  39. .de IX
  40. ..
  41. .nr rF 0
  42. .if \n(.g .if rF .nr rF 1
  43. .if (\n(rF:(\n(.g==0)) \{\
  44. . if \nF \{\
  45. . de IX
  46. . tm Index:\\$1\t\\n%\t"\\$2"
  47. ..
  48. . if !\nF==2 \{\
  49. . nr % 0
  50. . nr F 2
  51. . \}
  52. . \}
  53. .\}
  54. .rr rF
  55. .\" ========================================================================
  56. .\"
  57. .IX Title "SSL_GET_STREAM_ID 3ossl"
  58. .TH SSL_GET_STREAM_ID 3ossl 2025-01-17 3.4.0 OpenSSL
  59. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  60. .\" way too many mistakes in technical documents.
  61. .if n .ad l
  62. .nh
  63. .SH NAME
  64. SSL_get_stream_id, SSL_get_stream_type, SSL_STREAM_TYPE_NONE,
  65. SSL_STREAM_TYPE_READ, SSL_STREAM_TYPE_WRITE, SSL_STREAM_TYPE_BIDI,
  66. SSL_is_stream_local \- get QUIC stream ID and stream type information
  67. .SH SYNOPSIS
  68. .IX Header "SYNOPSIS"
  69. .Vb 1
  70. \& #include <openssl/ssl.h>
  71. \&
  72. \& uint64_t SSL_get_stream_id(SSL *ssl);
  73. \&
  74. \& #define SSL_STREAM_TYPE_NONE
  75. \& #define SSL_STREAM_TYPE_BIDI
  76. \& #define SSL_STREAM_TYPE_READ
  77. \& #define SSL_STREAM_TYPE_WRITE
  78. \& int SSL_get_stream_type(SSL *ssl);
  79. \&
  80. \& int SSL_is_stream_local(SSL *ssl);
  81. .Ve
  82. .SH DESCRIPTION
  83. .IX Header "DESCRIPTION"
  84. The \fBSSL_get_stream_id()\fR function returns the QUIC stream ID for a QUIC stream
  85. SSL object, or for a QUIC connection SSL object which has a default stream
  86. attached.
  87. .PP
  88. The \fBSSL_get_stream_type()\fR function identifies what operations can be performed
  89. on the stream, and returns one of the following values:
  90. .IP \fBSSL_STREAM_TYPE_NONE\fR 4
  91. .IX Item "SSL_STREAM_TYPE_NONE"
  92. The SSL object is a QUIC connection SSL object without a default stream
  93. attached.
  94. .IP \fBSSL_STREAM_TYPE_BIDI\fR 4
  95. .IX Item "SSL_STREAM_TYPE_BIDI"
  96. The SSL object is a non-QUIC SSL object, or is a QUIC stream object (or QUIC
  97. connection SSL object with a default stream attached), and that stream is a
  98. bidirectional QUIC stream.
  99. .IP \fBSSL_STREAM_TYPE_READ\fR 4
  100. .IX Item "SSL_STREAM_TYPE_READ"
  101. The SSL object is a QUIC stream object (or QUIC connection SSL object with a
  102. default stream attached), and that stream is a unidirectional QUIC stream which
  103. was initiated by the remote peer; thus, it can be read from, but not written to.
  104. .IP \fBSSL_STREAM_TYPE_WRITE\fR 4
  105. .IX Item "SSL_STREAM_TYPE_WRITE"
  106. The SSL object is a QUIC stream object (or QUIC connection SSL object with a
  107. default stream attached), and that stream is a unidirectional QUIC stream which
  108. was initiated by the local application; thus, it can be written to, but not read
  109. from.
  110. .PP
  111. The \fBSSL_is_stream_local()\fR function determines whether a stream was locally
  112. created.
  113. .SH NOTES
  114. .IX Header "NOTES"
  115. While QUICv1 assigns specific meaning to the low two bits of a QUIC stream ID,
  116. QUIC stream IDs in future versions of QUIC are not required to have the same
  117. semantics. Do not determine stream properties using these bits. Instead, use
  118. \&\fBSSL_get_stream_type()\fR to determine the stream type and \fBSSL_get_stream_is_local()\fR
  119. to determine the stream initiator.
  120. .PP
  121. The \fBSSL_get_stream_type()\fR identifies the type of a QUIC stream based on its
  122. identity, and does not indicate whether an operation can currently be
  123. successfully performed on a stream. For example, you might locally initiate a
  124. unidirectional stream, write to it, and then conclude the stream using
  125. \&\fBSSL_stream_conclude\fR\|(3), meaning that it can no longer be written to, but
  126. \&\fBSSL_get_stream_type()\fR would still return \fBSSL_STREAM_TYPE_WRITE\fR. The value
  127. returned by \fBSSL_get_stream_type()\fR does not vary over the lifespan of a stream.
  128. .SH "RETURN VALUES"
  129. .IX Header "RETURN VALUES"
  130. \&\fBSSL_get_stream_id()\fR returns a QUIC stream ID, or \fBUINT64_MAX\fR if called on an
  131. SSL object which is not a QUIC SSL object, or if called on a QUIC connection SSL
  132. object without a default stream attached. Note that valid QUIC stream IDs are
  133. always below 2**62.
  134. .PP
  135. \&\fBSSL_get_stream_type()\fR returns one of the \fBSSL_STREAM_TYPE\fR values.
  136. .PP
  137. \&\fBSSL_is_stream_local()\fR returns 1 if called on a QUIC stream SSL object which
  138. represents a stream which was locally initiated. It returns 0 if called on a
  139. QUIC stream SSL object which represents a stream which was remotely initiated by
  140. a peer, and \-1 if called on any other kind of SSL object.
  141. .SH "SEE ALSO"
  142. .IX Header "SEE ALSO"
  143. \&\fBSSL_new_stream\fR\|(3), \fBSSL_accept_stream\fR\|(3)
  144. .SH HISTORY
  145. .IX Header "HISTORY"
  146. These functions were added in OpenSSL 3.2.
  147. .SH COPYRIGHT
  148. .IX Header "COPYRIGHT"
  149. Copyright 2002\-2023 The OpenSSL Project Authors. All Rights Reserved.
  150. .PP
  151. Licensed under the Apache License 2.0 (the "License"). You may not use
  152. this file except in compliance with the License. You can obtain a copy
  153. in the file LICENSE in the source distribution or at
  154. <https://www.openssl.org/source/license.html>.