diff options
author | Hugo Landau <hlandau@openssl.org> | 2023-11-08 16:57:55 +0000 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2023-12-06 10:40:11 +0000 |
commit | 1f2958536eff61984b4746410cd3e4fe8f0383dd (patch) | |
tree | bedf9638ea2c8c32545ed7733d646f8998bc7def /ssl | |
parent | 766603a9a5297c804e04a82e041097c404e0f24b (diff) |
QUIC LCIDM: Add debug calls
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22673)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/quic/quic_lcidm.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/ssl/quic/quic_lcidm.c b/ssl/quic/quic_lcidm.c index af61292e57..a79eab8781 100644 --- a/ssl/quic/quic_lcidm.c +++ b/ssl/quic/quic_lcidm.c @@ -473,3 +473,41 @@ int ossl_quic_lcidm_lookup(QUIC_LCIDM *lcidm, return 1; } + +int ossl_quic_lcidm_debug_remove(QUIC_LCIDM *lcidm, + const QUIC_CONN_ID *lcid) +{ + QUIC_LCID key, *lcid_obj; + + key.cid = *lcid; + if ((lcid_obj = lh_QUIC_LCID_retrieve(lcidm->lcids, &key)) == NULL) + return 0; + + lcidm_delete_conn_lcid(lcidm, lcid_obj); + return 1; +} + +int ossl_quic_lcidm_debug_add(QUIC_LCIDM *lcidm, void *opaque, + const QUIC_CONN_ID *lcid, + uint64_t seq_num) +{ + QUIC_LCIDM_CONN *conn; + QUIC_LCID key, *lcid_obj; + + if (lcid == NULL || lcid->id_len > QUIC_MAX_CONN_ID_LEN) + return 0; + + if ((conn = lcidm_upsert_conn(lcidm, opaque)) == NULL) + return 0; + + key.cid = *lcid; + if (lh_QUIC_LCID_retrieve(lcidm->lcids, &key) != NULL) + return 0; + + if ((lcid_obj = lcidm_conn_new_lcid(lcidm, conn, lcid)) == NULL) + return 0; + + lcid_obj->seq_num = seq_num; + lcid_obj->type = LCID_TYPE_NCID; + return 1; +} |