]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Rename
authorHugo Landau <hlandau@openssl.org>
Mon, 16 Oct 2023 12:33:11 +0000 (13:33 +0100)
committerHugo Landau <hlandau@openssl.org>
Thu, 19 Oct 2023 07:28:59 +0000 (08:28 +0100)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22369)

demos/http3/ossl-nghttp3-demo.c
demos/http3/ossl-nghttp3.c
demos/http3/ossl-nghttp3.h

index 05d5e5b661fb0be384189bf12e23436f0d71a7d7..b1cbd1abf9d250b88aab218d1515547f11501c62 100644 (file)
@@ -80,7 +80,7 @@ int main(int argc, char **argv)
 {
     int ret = 1;
     SSL_CTX *ctx = NULL;
-    H3_CONN *conn = NULL;
+    OSSL_DEMO_H3_CONN *conn = NULL;
     nghttp3_nv nva[16];
     nghttp3_callbacks callbacks = {0};
     size_t num_nv = 0;
@@ -110,8 +110,8 @@ int main(int argc, char **argv)
     callbacks.end_stream    = on_end_stream;
 
     /* Create connection. */
-    if ((conn = H3_CONN_new_for_addr(ctx, addr, &callbacks,
-                                     NULL, NULL)) == NULL) {
+    if ((conn = OSSL_DEMO_H3_CONN_new_for_addr(ctx, addr, &callbacks,
+                                               NULL, NULL)) == NULL) {
         ERR_raise_data(ERR_LIB_USER, ERR_R_OPERATION_FAIL,
                        "cannot create HTTP/3 connection");
         goto err;
@@ -125,7 +125,7 @@ int main(int argc, char **argv)
     make_nv(&nva[num_nv++], "user-agent", "OpenSSL-Demo/nghttp3");
 
     /* Submit request. */
-    if (!H3_CONN_submit_request(conn, nva, num_nv, NULL, NULL)) {
+    if (!OSSL_DEMO_H3_CONN_submit_request(conn, nva, num_nv, NULL, NULL)) {
         ERR_raise_data(ERR_LIB_USER, ERR_R_OPERATION_FAIL,
                        "cannot submit HTTP/3 request");
         goto err;
@@ -133,7 +133,7 @@ int main(int argc, char **argv)
 
     /* Wait for request to complete. */
     while (!done)
-        if (!H3_CONN_handle_events(conn)) {
+        if (!OSSL_DEMO_H3_CONN_handle_events(conn)) {
             ERR_raise_data(ERR_LIB_USER, ERR_R_OPERATION_FAIL,
                            "cannot handle events");
             goto err;
@@ -144,7 +144,7 @@ err:
     if (ret != 0)
         ERR_print_errors_fp(stderr);
 
-    H3_CONN_free(conn);
+    OSSL_DEMO_H3_CONN_free(conn);
     SSL_CTX_free(ctx);
     return ret;
 }
index 26ee211f4c6c24ed43d70a37ecfeec9cf4da0b82..20d814c90e24d9a113df6334fd8dc67ac647b64a 100644 (file)
 #define ARRAY_LEN(x) (sizeof(x)/sizeof((x)[0]))
 
 enum {
-    H3_STREAM_TYPE_CTRL_SEND,
-    H3_STREAM_TYPE_QPACK_ENC_SEND,
-    H3_STREAM_TYPE_QPACK_DEC_SEND,
-    H3_STREAM_TYPE_REQ,
+    OSSL_DEMO_H3_STREAM_TYPE_CTRL_SEND,
+    OSSL_DEMO_H3_STREAM_TYPE_QPACK_ENC_SEND,
+    OSSL_DEMO_H3_STREAM_TYPE_QPACK_DEC_SEND,
+    OSSL_DEMO_H3_STREAM_TYPE_REQ,
 };
 
 #define BUF_SIZE    4096
 
-struct h3_stream_st {
+struct ossl_demo_h3_stream_st {
     uint64_t            id;             /* QUIC stream ID */
     SSL                 *s;             /* QUIC stream SSL object */
     int                 done_recv_fin;  /* Received FIN */
@@ -31,9 +31,9 @@ struct h3_stream_st {
     size_t              buf_cur, buf_total;
 };
 
-DEFINE_LHASH_OF_EX(H3_STREAM);
+DEFINE_LHASH_OF_EX(OSSL_DEMO_H3_STREAM);
 
-static void h3_stream_free(H3_STREAM *s)
+static void h3_stream_free(OSSL_DEMO_H3_STREAM *s)
 {
     if (s == NULL)
         return;
@@ -42,63 +42,68 @@ static void h3_stream_free(H3_STREAM *s)
     OPENSSL_free(s);
 }
 
-static unsigned long h3_stream_hash(const H3_STREAM *s)
+static unsigned long h3_stream_hash(const OSSL_DEMO_H3_STREAM *s)
 {
     return (unsigned long)s->id;
 }
 
-static int h3_stream_eq(const H3_STREAM *a, const H3_STREAM *b)
+static int h3_stream_eq(const OSSL_DEMO_H3_STREAM *a, const OSSL_DEMO_H3_STREAM *b)
 {
     if (a->id < b->id) return -1;
     if (a->id > b->id) return 1;
     return 0;
 }
 
-void *H3_STREAM_get_user_data(const H3_STREAM *s)
+void *OSSL_DEMO_H3_STREAM_get_user_data(const OSSL_DEMO_H3_STREAM *s)
 {
     return s->user_data;
 }
 
-struct h3_conn_st {
-    SSL                 *qconn;         /* QUIC connection SSL object */
-    BIO                 *qconn_bio;     /* BIO wrapping QCSO */
-    nghttp3_conn        *h3conn;        /* HTTP/3 connection object */
-    LHASH_OF(H3_STREAM) *streams;       /* map of stream IDs to H3_STREAMs */
-    void                *user_data;     /* opaque user data pointer */
-
-    int                 pump_res;
-    size_t              consumed_app_data;
+struct ossl_demo_h3_conn_st {
+    /* QUIC connection SSL object */
+    SSL                             *qconn;
+    /* BIO wrapping QCSO */
+    BIO                             *qconn_bio;
+    /* HTTP/3 connection object */
+    nghttp3_conn                    *h3conn;
+    /* map of stream IDs to OSSL_DEMO_H3_STREAMs */
+    LHASH_OF(OSSL_DEMO_H3_STREAM)   *streams;
+    /* opaque user data pointer */
+    void                            *user_data;
+
+    int                             pump_res;
+    size_t                          consumed_app_data;
 
     /* Forwarding callbacks */
-    nghttp3_recv_data           recv_data_cb;
-    nghttp3_stream_close        stream_close_cb;
-    nghttp3_stop_sending        stop_sending_cb;
-    nghttp3_reset_stream        reset_stream_cb;
-    nghttp3_deferred_consume    deferred_consume_cb;
+    nghttp3_recv_data               recv_data_cb;
+    nghttp3_stream_close            stream_close_cb;
+    nghttp3_stop_sending            stop_sending_cb;
+    nghttp3_reset_stream            reset_stream_cb;
+    nghttp3_deferred_consume        deferred_consume_cb;
 };
 
-void H3_CONN_free(H3_CONN *conn)
+void OSSL_DEMO_H3_CONN_free(OSSL_DEMO_H3_CONN *conn)
 {
     if (conn == NULL)
         return;
 
-    lh_H3_STREAM_doall(conn->streams, h3_stream_free);
+    lh_OSSL_DEMO_H3_STREAM_doall(conn->streams, h3_stream_free);
 
     nghttp3_conn_del(conn->h3conn);
     BIO_free_all(conn->qconn_bio);
-    lh_H3_STREAM_free(conn->streams);
+    lh_OSSL_DEMO_H3_STREAM_free(conn->streams);
     OPENSSL_free(conn);
 }
 
-static H3_STREAM *h3_conn_create_stream(H3_CONN *conn, int type)
+static OSSL_DEMO_H3_STREAM *h3_conn_create_stream(OSSL_DEMO_H3_CONN *conn, int type)
 {
-    H3_STREAM *s;
+    OSSL_DEMO_H3_STREAM *s;
     uint64_t flags = SSL_STREAM_FLAG_ADVANCE;
 
-    if ((s = OPENSSL_zalloc(sizeof(H3_STREAM))) == NULL)
+    if ((s = OPENSSL_zalloc(sizeof(OSSL_DEMO_H3_STREAM))) == NULL)
         return NULL;
 
-    if (type != H3_STREAM_TYPE_REQ)
+    if (type != OSSL_DEMO_H3_STREAM_TYPE_REQ)
         flags |= SSL_STREAM_FLAG_UNI;
 
     if ((s->s = SSL_new_stream(conn->qconn, flags)) == NULL) {
@@ -108,7 +113,7 @@ static H3_STREAM *h3_conn_create_stream(H3_CONN *conn, int type)
     }
 
     s->id   = SSL_get_stream_id(s->s);
-    lh_H3_STREAM_insert(conn->streams, s);
+    lh_OSSL_DEMO_H3_STREAM_insert(conn->streams, s);
     return s;
 
 err:
@@ -116,25 +121,25 @@ err:
     return NULL;
 }
 
-static H3_STREAM *h3_conn_accept_stream(H3_CONN *conn, SSL *qstream)
+static OSSL_DEMO_H3_STREAM *h3_conn_accept_stream(OSSL_DEMO_H3_CONN *conn, SSL *qstream)
 {
-    H3_STREAM *s;
+    OSSL_DEMO_H3_STREAM *s;
 
-    if ((s = OPENSSL_zalloc(sizeof(H3_STREAM))) == NULL)
+    if ((s = OPENSSL_zalloc(sizeof(OSSL_DEMO_H3_STREAM))) == NULL)
         return NULL;
 
     s->id   = SSL_get_stream_id(qstream);
     s->s    = qstream;
-    lh_H3_STREAM_insert(conn->streams, s);
+    lh_OSSL_DEMO_H3_STREAM_insert(conn->streams, s);
     return s;
 }
 
-static void h3_conn_remove_stream(H3_CONN *conn, H3_STREAM *s)
+static void h3_conn_remove_stream(OSSL_DEMO_H3_CONN *conn, OSSL_DEMO_H3_STREAM *s)
 {
     if (s == NULL)
         return;
 
-    lh_H3_STREAM_delete(conn->streams, s);
+    lh_OSSL_DEMO_H3_STREAM_delete(conn->streams, s);
     h3_stream_free(s);
 }
 
@@ -142,7 +147,7 @@ static int h3_conn_recv_data(nghttp3_conn *h3conn, int64_t stream_id,
                              const uint8_t *data, size_t datalen,
                              void *conn_user_data, void *stream_user_data)
 {
-    H3_CONN *conn = conn_user_data;
+    OSSL_DEMO_H3_CONN *conn = conn_user_data;
 
     conn->consumed_app_data += datalen;
     if (conn->recv_data_cb == NULL)
@@ -157,8 +162,8 @@ static int h3_conn_stream_close(nghttp3_conn *h3conn, int64_t stream_id,
                                 void *conn_user_data, void *stream_user_data)
 {
     int ret = 0;
-    H3_CONN *conn = conn_user_data;
-    H3_STREAM *stream = stream_user_data;
+    OSSL_DEMO_H3_CONN *conn = conn_user_data;
+    OSSL_DEMO_H3_STREAM *stream = stream_user_data;
 
     if (conn->stream_close_cb != NULL)
         ret = conn->stream_close_cb(h3conn, stream_id, app_error_code,
@@ -173,8 +178,8 @@ static int h3_conn_stop_sending(nghttp3_conn *h3conn, int64_t stream_id,
                                 void *conn_user_data, void *stream_user_data)
 {
     int ret = 0;
-    H3_CONN *conn = conn_user_data;
-    H3_STREAM *stream = stream_user_data;
+    OSSL_DEMO_H3_CONN *conn = conn_user_data;
+    OSSL_DEMO_H3_STREAM *stream = stream_user_data;
 
     if (conn->stop_sending_cb != NULL)
         ret = conn->stop_sending_cb(h3conn, stream_id, app_error_code,
@@ -190,8 +195,8 @@ static int h3_conn_reset_stream(nghttp3_conn *h3conn, int64_t stream_id,
                                 void *conn_user_data, void *stream_user_data)
 {
     int ret = 0;
-    H3_CONN *conn = conn_user_data;
-    H3_STREAM *stream = stream_user_data;
+    OSSL_DEMO_H3_CONN *conn = conn_user_data;
+    OSSL_DEMO_H3_STREAM *stream = stream_user_data;
     SSL_STREAM_RESET_ARGS args = {0};
 
     if (conn->reset_stream_cb != NULL)
@@ -213,7 +218,7 @@ static int h3_conn_deferred_consume(nghttp3_conn *h3conn, int64_t stream_id,
                                     void *conn_user_data, void *stream_user_data)
 {
     int ret = 0;
-    H3_CONN *conn = conn_user_data;
+    OSSL_DEMO_H3_CONN *conn = conn_user_data;
 
     if (conn->deferred_consume_cb != NULL)
         ret = conn->deferred_consume_cb(h3conn, stream_id, consumed,
@@ -223,14 +228,16 @@ static int h3_conn_deferred_consume(nghttp3_conn *h3conn, int64_t stream_id,
     return ret;
 }
 
-H3_CONN *H3_CONN_new_for_conn(BIO *qconn_bio,
-                              const nghttp3_callbacks *callbacks,
-                              const nghttp3_settings *settings,
-                              void *user_data)
+OSSL_DEMO_H3_CONN *OSSL_DEMO_H3_CONN_new_for_conn(BIO *qconn_bio,
+                                                  const nghttp3_callbacks *callbacks,
+                                                  const nghttp3_settings *settings,
+                                                  void *user_data)
 {
     int ec;
-    H3_CONN *conn;
-    H3_STREAM *s_ctl_send = NULL, *s_qpenc_send = NULL, *s_qpdec_send = NULL;
+    OSSL_DEMO_H3_CONN *conn;
+    OSSL_DEMO_H3_STREAM *s_ctl_send = NULL;
+    OSSL_DEMO_H3_STREAM *s_qpenc_send = NULL;
+    OSSL_DEMO_H3_STREAM *s_qpdec_send = NULL;
     nghttp3_settings dsettings = {0};
     nghttp3_callbacks intl_callbacks = {0};
     static const unsigned char alpn[] = {2, 'h', '3'};
@@ -241,7 +248,7 @@ H3_CONN *H3_CONN_new_for_conn(BIO *qconn_bio,
         return NULL;
     }
 
-    if ((conn = OPENSSL_zalloc(sizeof(H3_CONN))) == NULL)
+    if ((conn = OPENSSL_zalloc(sizeof(OSSL_DEMO_H3_CONN))) == NULL)
         return NULL;
 
     conn->qconn_bio = qconn_bio;
@@ -253,8 +260,8 @@ H3_CONN *H3_CONN_new_for_conn(BIO *qconn_bio,
         goto err;
     }
 
-    /* Create the map of stream IDs to H3_STREAM structures. */
-    if ((conn->streams = lh_H3_STREAM_new(h3_stream_hash, h3_stream_eq)) == NULL)
+    /* Create the map of stream IDs to OSSL_DEMO_H3_STREAM structures. */
+    if ((conn->streams = lh_OSSL_DEMO_H3_STREAM_new(h3_stream_hash, h3_stream_eq)) == NULL)
         goto err;
 
     /*
@@ -297,13 +304,16 @@ H3_CONN *H3_CONN_new_for_conn(BIO *qconn_bio,
      * side, which we handle subsequently as they come in (see SSL_accept_stream
      * in the event handling code below).
      */
-    if ((s_ctl_send = h3_conn_create_stream(conn, H3_STREAM_TYPE_CTRL_SEND)) == NULL)
+    if ((s_ctl_send
+            = h3_conn_create_stream(conn, OSSL_DEMO_H3_STREAM_TYPE_CTRL_SEND)) == NULL)
         goto err;
 
-    if ((s_qpenc_send = h3_conn_create_stream(conn, H3_STREAM_TYPE_QPACK_ENC_SEND)) == NULL)
+    if ((s_qpenc_send
+            = h3_conn_create_stream(conn, OSSL_DEMO_H3_STREAM_TYPE_QPACK_ENC_SEND)) == NULL)
         goto err;
 
-    if ((s_qpdec_send = h3_conn_create_stream(conn, H3_STREAM_TYPE_QPACK_DEC_SEND)) == NULL)
+    if ((s_qpdec_send
+            = h3_conn_create_stream(conn, OSSL_DEMO_H3_STREAM_TYPE_QPACK_DEC_SEND)) == NULL)
         goto err;
 
     if (settings == NULL) {
@@ -373,19 +383,19 @@ err:
     h3_stream_free(s_ctl_send);
     h3_stream_free(s_qpenc_send);
     h3_stream_free(s_qpdec_send);
-    lh_H3_STREAM_free(conn->streams);
+    lh_OSSL_DEMO_H3_STREAM_free(conn->streams);
     OPENSSL_free(conn);
     return NULL;
 }
 
-H3_CONN *H3_CONN_new_for_addr(SSL_CTX *ctx, const char *addr,
-                              const nghttp3_callbacks *callbacks,
-                              const nghttp3_settings *settings,
-                              void *user_data)
+OSSL_DEMO_H3_CONN *OSSL_DEMO_H3_CONN_new_for_addr(SSL_CTX *ctx, const char *addr,
+                                                  const nghttp3_callbacks *callbacks,
+                                                  const nghttp3_settings *settings,
+                                                  void *user_data)
 {
     BIO *qconn_bio = NULL;
     SSL *qconn = NULL;
-    H3_CONN *conn = NULL;
+    OSSL_DEMO_H3_CONN *conn = NULL;
     const char *bare_hostname;
 
     /* QUIC connection setup */
@@ -411,7 +421,8 @@ H3_CONN *H3_CONN_new_for_addr(SSL_CTX *ctx, const char *addr,
     if (SSL_set1_host(qconn, bare_hostname) <= 0)
         goto err;
 
-    conn = H3_CONN_new_for_conn(qconn_bio, callbacks, settings, user_data);
+    conn = OSSL_DEMO_H3_CONN_new_for_conn(qconn_bio, callbacks,
+                                          settings, user_data);
     if (conn == NULL)
         goto err;
 
@@ -422,26 +433,26 @@ err:
     return NULL;
 }
 
-int H3_CONN_connect(H3_CONN *conn)
+int OSSL_DEMO_H3_CONN_connect(OSSL_DEMO_H3_CONN *conn)
 {
-    return SSL_connect(H3_CONN_get0_connection(conn));
+    return SSL_connect(OSSL_DEMO_H3_CONN_get0_connection(conn));
 }
 
-void *H3_CONN_get_user_data(const H3_CONN *conn)
+void *OSSL_DEMO_H3_CONN_get_user_data(const OSSL_DEMO_H3_CONN *conn)
 {
     return conn->user_data;
 }
 
-SSL *H3_CONN_get0_connection(const H3_CONN *conn)
+SSL *OSSL_DEMO_H3_CONN_get0_connection(const OSSL_DEMO_H3_CONN *conn)
 {
     return conn->qconn;
 }
 
 /* Pumps received data to the HTTP/3 stack for a single stream. */
-static void h3_conn_pump_stream(H3_STREAM *s, void *conn_)
+static void h3_conn_pump_stream(OSSL_DEMO_H3_STREAM *s, void *conn_)
 {
     int ec;
-    H3_CONN *conn = conn_;
+    OSSL_DEMO_H3_CONN *conn = conn_;
     size_t num_bytes, consumed;
     uint64_t aec;
 
@@ -547,13 +558,13 @@ err:
     conn->pump_res = 0;
 }
 
-int H3_CONN_handle_events(H3_CONN *conn)
+int OSSL_DEMO_H3_CONN_handle_events(OSSL_DEMO_H3_CONN *conn)
 {
     int ec, fin;
     size_t i, num_vecs, written, total_written, total_len;
     int64_t stream_id;
     nghttp3_vec vecs[8] = {0};
-    H3_STREAM key, *s;
+    OSSL_DEMO_H3_STREAM key, *s;
     SSL *snew;
 
     if (conn == NULL)
@@ -573,7 +584,7 @@ int H3_CONN_handle_events(H3_CONN *conn)
             break;
 
         /*
-         * Each new incoming stream gets wrapped into an H3_STREAM object and
+         * Each new incoming stream gets wrapped into an OSSL_DEMO_H3_STREAM object and
          * added into our stream ID map.
          */
         if (h3_conn_accept_stream(conn, snew) == NULL) {
@@ -600,7 +611,7 @@ int H3_CONN_handle_events(H3_CONN *conn)
 
         /* For each of the vectors returned, pass it to OpenSSL QUIC. */
         key.id = stream_id;
-        if ((s = lh_H3_STREAM_retrieve(conn->streams, &key)) == NULL) {
+        if ((s = lh_OSSL_DEMO_H3_STREAM_retrieve(conn->streams, &key)) == NULL) {
             ERR_raise_data(ERR_LIB_USER, ERR_R_INTERNAL_ERROR,
                            "no stream for ID %zd", stream_id);
             return 0;
@@ -682,19 +693,20 @@ int H3_CONN_handle_events(H3_CONN *conn)
 
     /* 3. Pump incoming data from QUIC to HTTP/3 engine. */
     conn->pump_res = 1; /* cleared in below call if an error occurs */
-    lh_H3_STREAM_doall_arg(conn->streams, h3_conn_pump_stream, conn);
+    lh_OSSL_DEMO_H3_STREAM_doall_arg(conn->streams, h3_conn_pump_stream, conn);
     if (!conn->pump_res)
         return 0;
 
     return 1;
 }
 
-int H3_CONN_submit_request(H3_CONN *conn, const nghttp3_nv *nva, size_t nvlen,
-                           const nghttp3_data_reader *dr,
-                           void *user_data)
+int OSSL_DEMO_H3_CONN_submit_request(OSSL_DEMO_H3_CONN *conn,
+                                     const nghttp3_nv *nva, size_t nvlen,
+                                     const nghttp3_data_reader *dr,
+                                     void *user_data)
 {
     int ec;
-    H3_STREAM *s_req = NULL;
+    OSSL_DEMO_H3_STREAM *s_req = NULL;
 
     if (conn == NULL) {
         ERR_raise_data(ERR_LIB_USER, ERR_R_PASSED_NULL_PARAMETER,
@@ -703,7 +715,7 @@ int H3_CONN_submit_request(H3_CONN *conn, const nghttp3_nv *nva, size_t nvlen,
     }
 
     /* Each HTTP/3 request is represented by a stream. */
-    if ((s_req = h3_conn_create_stream(conn, H3_STREAM_TYPE_REQ)) == NULL)
+    if ((s_req = h3_conn_create_stream(conn, OSSL_DEMO_H3_STREAM_TYPE_REQ)) == NULL)
         goto err;
 
     s_req->user_data = user_data;
index 78c5ea9866f910af8e9fdc85d518711f560e1fd6..7926d866b121aae4f49cb9d936984c1d4aac59d3 100644 (file)
  */
 
 /* Represents an HTTP/3 connection to a server. */
-typedef struct h3_conn_st H3_CONN;
+typedef struct ossl_demo_h3_conn_st OSSL_DEMO_H3_CONN;
 
 /* Represents an HTTP/3 request, control or QPACK stream. */
-typedef struct h3_stream_st H3_STREAM;
+typedef struct ossl_demo_h3_stream_st OSSL_DEMO_H3_STREAM;
 
 /*
  * Creates a HTTP/3 connection using the given QUIC client connection BIO. The
@@ -39,66 +39,73 @@ typedef struct h3_stream_st H3_STREAM;
  * this QUIC binding are ignored.
  *
  * user_data is an application-provided opaque value which can be retrieved
- * using H3_CONN_get_user_data. Note that the user data value passed to the
- * callback functions specified in callbacks is a pointer to the H3_CONN, not
- * user_data.
+ * using OSSL_DEMO_H3_CONN_get_user_data. Note that the user data value passed
+ * to the callback functions specified in callbacks is a pointer to the
+ * OSSL_DEMO_H3_CONN, not user_data.
  *
  * Returns NULL on failure.
  */
-H3_CONN *H3_CONN_new_for_conn(BIO *qconn_bio,
-                              const nghttp3_callbacks *callbacks,
-                              const nghttp3_settings *settings,
-                              void *user_data);
+OSSL_DEMO_H3_CONN *OSSL_DEMO_H3_CONN_new_for_conn(BIO *qconn_bio,
+                                                  const nghttp3_callbacks *callbacks,
+                                                  const nghttp3_settings *settings,
+                                                  void *user_data);
 
 /*
- * Works identically to H3_CONN_new_for_conn except that it manages the creation
- * of a QUIC connection SSL object automatically using an address string. addr
- * should be a string such as "www.example.com:443". The created underlying QUIC
- * connection SSL object is owned by the H3_CONN and can be subsequently
- * retrieved using H3_CONN_get0_connection.
+ * Works identically to OSSL_DEMO_H3_CONN_new_for_conn except that it manages
+ * the creation of a QUIC connection SSL object automatically using an address
+ * string. addr should be a string such as "www.example.com:443". The created
+ * underlying QUIC connection SSL object is owned by the OSSL_DEMO_H3_CONN and
+ * can be subsequently retrieved using OSSL_DEMO_H3_CONN_get0_connection.
  *
  * Returns NULL on failure. ctx must be a SSL_CTX using a QUIC client
  * SSL_METHOD.
  */
-H3_CONN *H3_CONN_new_for_addr(SSL_CTX *ctx, const char *addr,
-                              const nghttp3_callbacks *callbacks,
-                              const nghttp3_settings *settings,
-                              void *user_data);
+OSSL_DEMO_H3_CONN *OSSL_DEMO_H3_CONN_new_for_addr(SSL_CTX *ctx,
+                                                  const char *addr,
+                                                  const nghttp3_callbacks *callbacks,
+                                                  const nghttp3_settings *settings,
+                                                  void *user_data);
 
-/* Equivalent to SSL_connect(H3_CONN_get0_connection(conn)). */
-int H3_CONN_connect(H3_CONN *conn);
+/* Equivalent to SSL_connect(OSSL_DEMO_H3_CONN_get0_connection(conn)). */
+int OSSL_DEMO_H3_CONN_connect(OSSL_DEMO_H3_CONN *conn);
 
 /*
- * Free the H3_CONN and any underlying QUIC connection SSL object and associated
- * streams.
+ * Free the OSSL_DEMO_H3_CONN and any underlying QUIC connection SSL object and
+ * associated streams.
  */
-void H3_CONN_free(H3_CONN *conn);
+void OSSL_DEMO_H3_CONN_free(OSSL_DEMO_H3_CONN *conn);
 
-/* Returns the user data value which was specified in H3_CONN_new_for_conn. */
-void *H3_CONN_get_user_data(const H3_CONN *conn);
+/*
+ * Returns the user data value which was specified in
+ * OSSL_DEMO_H3_CONN_new_for_conn.
+ */
+void *OSSL_DEMO_H3_CONN_get_user_data(const OSSL_DEMO_H3_CONN *conn);
 
 /* Returns the underlying QUIC connection SSL object. */
-SSL *H3_CONN_get0_connection(const H3_CONN *conn);
+SSL *OSSL_DEMO_H3_CONN_get0_connection(const OSSL_DEMO_H3_CONN *conn);
 
 /*
  * Handle any pending events on a given HTTP/3 connection. Returns 0 on error.
  */
-int H3_CONN_handle_events(H3_CONN *conn);
+int OSSL_DEMO_H3_CONN_handle_events(OSSL_DEMO_H3_CONN *conn);
 
 /*
  * Submits a new HTTP/3 request on the given connection. Returns 0 on error.
  *
  * This works analogously to nghttp3_conn_submit_request(). The stream user data
- * pointer passed to the callbacks is a H3_STREAM object pointer; to retrieve
- * the stream user data pointer passed to this function, use
- * H3_STREAM_get_user_data.
+ * pointer passed to the callbacks is a OSSL_DEMO_H3_STREAM object pointer; to
+ * retrieve the stream user data pointer passed to this function, use
+ * OSSL_DEMO_H3_STREAM_get_user_data.
  */
-int H3_CONN_submit_request(H3_CONN *conn,
+int OSSL_DEMO_H3_CONN_submit_request(OSSL_DEMO_H3_CONN *conn,
                            const nghttp3_nv *hdr, size_t hdrlen,
                            const nghttp3_data_reader *dr,
                            void *stream_user_data);
 
-/* Returns the user data value which was specified in H3_CONN_submit_request. */
-void *H3_STREAM_get_user_data(const H3_STREAM *stream);
+/*
+ * Returns the user data value which was specified in
+ * OSSL_DEMO_H3_CONN_submit_request.
+ */
+void *OSSL_DEMO_H3_STREAM_get_user_data(const OSSL_DEMO_H3_STREAM *stream);
 
 #endif