SSL_get_stream_id.pod 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. =pod
  2. =head1 NAME
  3. SSL_get_stream_id, SSL_get_stream_type, SSL_STREAM_TYPE_NONE,
  4. SSL_STREAM_TYPE_READ, SSL_STREAM_TYPE_WRITE, SSL_STREAM_TYPE_BIDI,
  5. SSL_is_stream_local - get QUIC stream ID and stream type information
  6. =head1 SYNOPSIS
  7. #include <openssl/ssl.h>
  8. uint64_t SSL_get_stream_id(SSL *ssl);
  9. #define SSL_STREAM_TYPE_NONE
  10. #define SSL_STREAM_TYPE_BIDI
  11. #define SSL_STREAM_TYPE_READ
  12. #define SSL_STREAM_TYPE_WRITE
  13. int SSL_get_stream_type(SSL *ssl);
  14. int SSL_is_stream_local(SSL *ssl);
  15. =head1 DESCRIPTION
  16. The SSL_get_stream_id() function returns the QUIC stream ID for a QUIC stream
  17. SSL object, or for a QUIC connection SSL object which has a default stream
  18. attached.
  19. The SSL_get_stream_type() function identifies what operations can be performed
  20. on the stream, and returns one of the following values:
  21. =over 4
  22. =item B<SSL_STREAM_TYPE_NONE>
  23. The SSL object is a QUIC connection SSL object without a default stream
  24. attached.
  25. =item B<SSL_STREAM_TYPE_BIDI>
  26. The SSL object is a non-QUIC SSL object, or is a QUIC stream object (or QUIC
  27. connection SSL object with a default stream attached), and that stream is a
  28. bidirectional QUIC stream.
  29. =item B<SSL_STREAM_TYPE_READ>
  30. The SSL object is a QUIC stream object (or QUIC connection SSL object with a
  31. default stream attached), and that stream is a unidirectional QUIC stream which
  32. was initiated by the remote peer; thus, it can be read from, but not written to.
  33. =item B<SSL_STREAM_TYPE_WRITE>
  34. The SSL object is a QUIC stream object (or QUIC connection SSL object with a
  35. default stream attached), and that stream is a unidirectional QUIC stream which
  36. was initiated by the local application; thus, it can be written to, but not read
  37. from.
  38. =back
  39. The SSL_is_stream_local() function determines whether a stream was locally
  40. created.
  41. =head1 NOTES
  42. While QUICv1 assigns specific meaning to the low two bits of a QUIC stream ID,
  43. QUIC stream IDs in future versions of QUIC are not required to have the same
  44. semantics. Do not determine stream properties using these bits. Instead, use
  45. SSL_get_stream_type() to determine the stream type and SSL_get_stream_is_local()
  46. to determine the stream initiator.
  47. The SSL_get_stream_type() identifies the type of a QUIC stream based on its
  48. identity, and does not indicate whether an operation can currently be
  49. successfully performed on a stream. For example, you might locally initiate a
  50. unidirectional stream, write to it, and then conclude the stream using
  51. L<SSL_stream_conclude(3)>, meaning that it can no longer be written to, but
  52. SSL_get_stream_type() would still return B<SSL_STREAM_TYPE_WRITE>. The value
  53. returned by SSL_get_stream_type() does not vary over the lifespan of a stream.
  54. =head1 RETURN VALUES
  55. SSL_get_stream_id() returns a QUIC stream ID, or B<UINT64_MAX> if called on an
  56. SSL object which is not a QUIC SSL object, or if called on a QUIC connection SSL
  57. object without a default stream attached. Note that valid QUIC stream IDs are
  58. always below 2**62.
  59. SSL_get_stream_type() returns one of the B<SSL_STREAM_TYPE> values.
  60. SSL_is_stream_local() returns 1 if called on a QUIC stream SSL object which
  61. represents a stream which was locally initiated. It returns 0 if called on a
  62. QUIC stream SSL object which represents a stream which was remotely initiated by
  63. a peer, and -1 if called on any other kind of SSL object.
  64. =head1 SEE ALSO
  65. L<SSL_new_stream(3)>, L<SSL_accept_stream(3)>
  66. =head1 HISTORY
  67. These functions were added in OpenSSL 3.2.
  68. =head1 COPYRIGHT
  69. Copyright 2002-2023 The OpenSSL Project Authors. All Rights Reserved.
  70. Licensed under the Apache License 2.0 (the "License"). You may not use
  71. this file except in compliance with the License. You can obtain a copy
  72. in the file LICENSE in the source distribution or at
  73. L<https://www.openssl.org/source/license.html>.
  74. =cut