Sponsor:

Your company here, and a link to your site. Click to find out more.

SSL_get_stream_id.3ossl - Man Page

get QUIC stream ID and stream type information

Synopsis

 #include <openssl/ssl.h>

 uint64_t SSL_get_stream_id(SSL *ssl);

 #define SSL_STREAM_TYPE_NONE
 #define SSL_STREAM_TYPE_BIDI
 #define SSL_STREAM_TYPE_READ
 #define SSL_STREAM_TYPE_WRITE
 int SSL_get_stream_type(SSL *ssl);

 int SSL_is_stream_local(SSL *ssl);

Description

The SSL_get_stream_id() function returns the QUIC stream ID for a QUIC stream SSL object, or for a QUIC connection SSL object which has a default stream attached.

The SSL_get_stream_type() function identifies what operations can be performed on the stream, and returns one of the following values:

SSL_STREAM_TYPE_NONE

The SSL object is a QUIC connection SSL object without a default stream attached.

SSL_STREAM_TYPE_BIDI

The SSL object is a non-QUIC SSL object, or is a QUIC stream object (or QUIC connection SSL object with a default stream attached), and that stream is a bidirectional QUIC stream.

SSL_STREAM_TYPE_READ

The SSL object is a QUIC stream object (or QUIC connection SSL object with a default stream attached), and that stream is a unidirectional QUIC stream which was initiated by the remote peer; thus, it can be read from, but not written to.

SSL_STREAM_TYPE_WRITE

The SSL object is a QUIC stream object (or QUIC connection SSL object with a default stream attached), and that stream is a unidirectional QUIC stream which was initiated by the local application; thus, it can be written to, but not read from.

The SSL_is_stream_local() function determines whether a stream was locally created.

Notes

While QUICv1 assigns specific meaning to the low two bits of a QUIC stream ID, QUIC stream IDs in future versions of QUIC are not required to have the same semantics. Do not determine stream properties using these bits. Instead, use SSL_get_stream_type() to determine the stream type and SSL_get_stream_is_local() to determine the stream initiator.

The SSL_get_stream_type() identifies the type of a QUIC stream based on its identity, and does not indicate whether an operation can currently be successfully performed on a stream. For example, you might locally initiate a unidirectional stream, write to it, and then conclude the stream using SSL_stream_conclude(3), meaning that it can no longer be written to, but SSL_get_stream_type() would still return SSL_STREAM_TYPE_WRITE. The value returned by SSL_get_stream_type() does not vary over the lifespan of a stream.

Return Values

SSL_get_stream_id() returns a QUIC stream ID, or UINT64_MAX if called on an SSL object which is not a QUIC SSL object, or if called on a QUIC connection SSL object without a default stream attached. Note that valid QUIC stream IDs are always below 2**62.

SSL_get_stream_type() returns one of the SSL_STREAM_TYPE values.

SSL_is_stream_local() returns 1 if called on a QUIC stream SSL object which represents a stream which was locally initiated. It returns 0 if called on a QUIC stream SSL object which represents a stream which was remotely initiated by a peer, and -1 if called on any other kind of SSL object.

See Also

SSL_new_stream(3), SSL_accept_stream(3)

History

These functions were added in OpenSSL 3.2.

Referenced By

openssl-quic.7ossl(7), SSL_new_stream.3ossl(3).

The man pages SSL_get_stream_type.3ossl(3), SSL_is_stream_local.3ossl(3), SSL_STREAM_TYPE_BIDI.3ossl(3), SSL_STREAM_TYPE_NONE.3ossl(3), SSL_STREAM_TYPE_READ.3ossl(3) and SSL_STREAM_TYPE_WRITE.3ossl(3) are aliases of SSL_get_stream_id.3ossl(3).

2024-04-04 3.2.1 OpenSSL