2 * Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
10 #include "internal/quic_cc.h"
12 typedef struct ossl_cc_dummy_st
{
16 static OSSL_CC_DATA
*dummy_new(OSSL_PARAM
*settings
, OSSL_PARAM
*options
,
17 OSSL_PARAM
*changeables
)
19 return OPENSSL_zalloc(sizeof(OSSL_CC_DUMMY
));
22 static void dummy_free(OSSL_CC_DATA
*cc
)
27 static void dummy_reset(OSSL_CC_DATA
*cc
, int flags
)
32 static int dummy_set_exemption(OSSL_CC_DATA
*cc
, int numpackets
)
37 static int dummy_get_exemption(OSSL_CC_DATA
*cc
)
42 static int dummy_can_send(OSSL_CC_DATA
*cc
)
47 static uint64_t dummy_get_send_allowance(OSSL_CC_DATA
*cc
,
48 OSSL_TIME time_since_last_send
,
54 static uint64_t dummy_get_bytes_in_flight_max(OSSL_CC_DATA
*cc
)
59 static OSSL_TIME
dummy_get_next_credit_time(OSSL_CC_DATA
*cc_data
)
61 return ossl_time_infinite();
64 static int dummy_on_data_sent(OSSL_CC_DATA
*cc
,
65 uint64_t num_retransmittable_bytes
)
70 static int dummy_on_data_invalidated(OSSL_CC_DATA
*cc
,
71 uint64_t num_retransmittable_bytes
)
76 static int dummy_on_data_acked(OSSL_CC_DATA
*cc
, OSSL_TIME time_now
,
77 uint64_t last_pn_acked
,
78 uint64_t num_retransmittable_bytes
)
83 static void dummy_on_data_lost(OSSL_CC_DATA
*cc
,
84 uint64_t largest_pn_lost
,
85 uint64_t largest_pn_sent
,
86 uint64_t num_retransmittable_bytes
,
87 int persistent_congestion
)
92 static int dummy_on_spurious_congestion_event(OSSL_CC_DATA
*cc
)
97 const OSSL_CC_METHOD ossl_cc_dummy_method
= {
105 dummy_get_send_allowance
,
106 dummy_get_bytes_in_flight_max
,
107 dummy_get_next_credit_time
,
109 dummy_on_data_invalidated
,
112 dummy_on_spurious_congestion_event
,