=head1 NAME
SSL_get_stream_id, SSL_get_stream_type, SSL_STREAM_TYPE_NONE,
-SSL_STREAM_TYPE_READ, SSL_STREAM_TYPE_WRITE, SSL_STREAM_TYPE_BIDI - get QUIC
-stream ID and stream type information
+SSL_STREAM_TYPE_READ, SSL_STREAM_TYPE_WRITE, SSL_STREAM_TYPE_BIDI,
+SSL_is_stream_local - get QUIC stream ID and stream type information
=head1 SYNOPSIS
#define SSL_STREAM_TYPE_WRITE
int SSL_get_stream_type(SSL *ssl);
+ int SSL_is_stream_local(SSL *ssl);
+
=head1 DESCRIPTION
The SSL_get_stream_id() function returns the QUIC stream ID for a QUIC stream
=back
+The SSL_is_stream_local() function determines whether a stream was locally
+created.
+
=head1 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.
+SSL_get_stream_type() to determine the stream type and SSL_get_stream_origin()
+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
SSL_get_stream_type() returns one of the B<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.
+
=head1 SEE ALSO
L<SSL_new_stream(3)>, L<SSL_accept_stream(3)>
__owur SSL *ossl_quic_get0_connection(SSL *s);
__owur int ossl_quic_get_stream_type(SSL *s);
__owur uint64_t ossl_quic_get_stream_id(SSL *s);
+__owur int ossl_quic_is_stream_local(SSL *s);
__owur int ossl_quic_set_default_stream_mode(SSL *s, uint32_t mode);
__owur SSL *ossl_quic_detach_stream(SSL *s);
__owur int ossl_quic_attach_stream(SSL *conn, SSL *stream);
return id;
}
+/*
+ * SSL_is_stream_local
+ * -------------------
+ */
+QUIC_TAKES_LOCK
+int ossl_quic_is_stream_local(SSL *s)
+{
+ QCTX ctx;
+ int is_local;
+
+ if (!expect_quic_with_stream_lock(s, /*remote_init=*/-1, &ctx))
+ return -1;
+
+ is_local = ossl_quic_stream_is_local_init(ctx.xso->stream);
+ quic_unlock(ctx.qc);
+
+ return is_local;
+}
+
/*
* SSL_set_default_stream_mode
* ---------------------------