@@ -216,7 +216,7 @@ void ngtcp2_debug_log(void* user_data, const char* fmt, ...) {
216216 va_end (ap);
217217}
218218
219- template <typename Opt, PreferredAddress::Policy Opt::*member>
219+ template <typename Opt, PreferredAddress::Policy Opt::* member>
220220bool SetOption (Environment* env,
221221 Opt* options,
222222 const Local<Object>& object,
@@ -231,7 +231,7 @@ bool SetOption(Environment* env,
231231 return true ;
232232}
233233
234- template <typename Opt, TLSContext::Options Opt::*member>
234+ template <typename Opt, TLSContext::Options Opt::* member>
235235bool SetOption (Environment* env,
236236 Opt* options,
237237 const Local<Object>& object,
@@ -246,7 +246,7 @@ bool SetOption(Environment* env,
246246 return true ;
247247}
248248
249- template <typename Opt, TransportParams::Options Opt::*member>
249+ template <typename Opt, TransportParams::Options Opt::* member>
250250bool SetOption (Environment* env,
251251 Opt* options,
252252 const Local<Object>& object,
@@ -261,7 +261,7 @@ bool SetOption(Environment* env,
261261 return true ;
262262}
263263
264- template <typename Opt, ngtcp2_cc_algo Opt::*member>
264+ template <typename Opt, ngtcp2_cc_algo Opt::* member>
265265bool SetOption (Environment* env,
266266 Opt* options,
267267 const Local<Object>& object,
@@ -626,9 +626,9 @@ struct Session::Impl final : public MemoryRetainer {
626626 ngtcp2_conn_get_scid (*session_, nullptr ));
627627 ngtcp2_conn_get_scid (*session_, cids.out ());
628628
629- MaybeStackBuffer<ngtcp2_cid_token , 10 > tokens (
630- ngtcp2_conn_get_active_dcid (*session_, nullptr ));
631- ngtcp2_conn_get_active_dcid (*session_, tokens.out ());
629+ MaybeStackBuffer<ngtcp2_cid_token2 , 10 > tokens (
630+ ngtcp2_conn_get_active_dcid2 (*session_, nullptr ));
631+ ngtcp2_conn_get_active_dcid2 (*session_, tokens.out ());
632632
633633 endpoint->DisassociateCID (config_.dcid );
634634 endpoint->DisassociateCID (config_.preferred_address_cid );
@@ -640,7 +640,7 @@ struct Session::Impl final : public MemoryRetainer {
640640 for (size_t n = 0 ; n < tokens.length (); n++) {
641641 if (tokens[n].token_present ) {
642642 endpoint->DisassociateStatelessResetToken (
643- StatelessResetToken (tokens[n].token ));
643+ StatelessResetToken (& tokens[n].token ));
644644 }
645645 }
646646
@@ -874,7 +874,7 @@ struct Session::Impl final : public MemoryRetainer {
874874 ngtcp2_connection_id_status_type type,
875875 uint64_t seq,
876876 const ngtcp2_cid* cid,
877- const uint8_t * token,
877+ const ngtcp2_stateless_reset_token * token,
878878 void * user_data) {
879879 NGTCP2_CALLBACK_SCOPE (session)
880880 std::optional<StatelessResetToken> maybe_reset_token;
@@ -946,7 +946,7 @@ struct Session::Impl final : public MemoryRetainer {
946946
947947 static int on_get_new_cid (ngtcp2_conn* conn,
948948 ngtcp2_cid* cid,
949- uint8_t * token,
949+ ngtcp2_stateless_reset_token * token,
950950 size_t cidlen,
951951 void * user_data) {
952952 NGTCP2_CALLBACK_SCOPE (session)
@@ -1043,7 +1043,7 @@ struct Session::Impl final : public MemoryRetainer {
10431043 }
10441044
10451045 static int on_receive_stateless_reset (ngtcp2_conn* conn,
1046- const ngtcp2_pkt_stateless_reset * sr,
1046+ const ngtcp2_pkt_stateless_reset2 * sr,
10471047 void * user_data) {
10481048 NGTCP2_CALLBACK_SCOPE (session)
10491049 session->impl_ ->state_ ->stateless_reset = 1 ;
@@ -1212,12 +1212,12 @@ struct Session::Impl final : public MemoryRetainer {
12121212 on_acknowledge_stream_data_offset,
12131213 nullptr ,
12141214 on_stream_close,
1215- on_receive_stateless_reset,
1215+ nullptr , // recv_stateless_reset (deprecated, use v2 below)
12161216 ngtcp2_crypto_recv_retry_cb,
12171217 on_extend_max_streams_bidi,
12181218 on_extend_max_streams_uni,
12191219 on_rand,
1220- on_get_new_cid,
1220+ nullptr , // get_new_connection_id (deprecated, use v2 below)
12211221 on_remove_connection_id,
12221222 ngtcp2_crypto_update_key_cb,
12231223 on_path_validation,
@@ -1226,7 +1226,7 @@ struct Session::Impl final : public MemoryRetainer {
12261226 on_extend_max_remote_streams_bidi,
12271227 on_extend_max_remote_streams_uni,
12281228 on_extend_max_stream_data,
1229- on_cid_status,
1229+ nullptr , // dcid_status (deprecated, use v2 below)
12301230 on_handshake_confirmed,
12311231 on_receive_new_token,
12321232 ngtcp2_crypto_delete_crypto_aead_ctx_cb,
@@ -1241,9 +1241,9 @@ struct Session::Impl final : public MemoryRetainer {
12411241 nullptr ,
12421242 on_early_data_rejected,
12431243 on_begin_path_validation,
1244- nullptr ,
1245- nullptr ,
1246- nullptr ,
1244+ on_receive_stateless_reset ,
1245+ on_get_new_cid ,
1246+ on_cid_status ,
12471247 nullptr };
12481248
12491249 static constexpr ngtcp2_callbacks SERVER = {
@@ -1259,12 +1259,12 @@ struct Session::Impl final : public MemoryRetainer {
12591259 on_acknowledge_stream_data_offset,
12601260 nullptr ,
12611261 on_stream_close,
1262- on_receive_stateless_reset,
1262+ nullptr , // recv_stateless_reset (deprecated, use v2 below)
12631263 nullptr ,
12641264 on_extend_max_streams_bidi,
12651265 on_extend_max_streams_uni,
12661266 on_rand,
1267- on_get_new_cid,
1267+ nullptr , // get_new_connection_id (deprecated, use v2 below)
12681268 on_remove_connection_id,
12691269 ngtcp2_crypto_update_key_cb,
12701270 on_path_validation,
@@ -1273,7 +1273,7 @@ struct Session::Impl final : public MemoryRetainer {
12731273 on_extend_max_remote_streams_bidi,
12741274 on_extend_max_remote_streams_uni,
12751275 on_extend_max_stream_data,
1276- on_cid_status,
1276+ nullptr , // dcid_status (deprecated, use v2 below)
12771277 nullptr ,
12781278 nullptr ,
12791279 ngtcp2_crypto_delete_crypto_aead_ctx_cb,
@@ -1288,9 +1288,9 @@ struct Session::Impl final : public MemoryRetainer {
12881288 on_receive_tx_key,
12891289 on_early_data_rejected,
12901290 on_begin_path_validation,
1291- nullptr ,
1292- nullptr ,
1293- nullptr ,
1291+ on_receive_stateless_reset ,
1292+ on_get_new_cid ,
1293+ on_cid_status ,
12941294 nullptr };
12951295};
12961296
@@ -2497,7 +2497,7 @@ void Session::DatagramReceived(const uint8_t* data,
24972497
24982498void Session::GenerateNewConnectionId (ngtcp2_cid* cid,
24992499 size_t len,
2500- uint8_t * token) {
2500+ ngtcp2_stateless_reset_token * token) {
25012501 DCHECK (!is_destroyed ());
25022502 CID cid_ = impl_->config_ .options .cid_factory ->GenerateInto (cid, len);
25032503 Debug (this , " Generated new connection id %s" , cid_);
0 commit comments