123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 |
- #ifndef OSSL_QUIC_CC_H
- # define OSSL_QUIC_CC_H
- #include "openssl/params.h"
- #include "internal/time.h"
- #include "internal/quic_predef.h"
- # ifndef OPENSSL_NO_QUIC
- typedef struct ossl_cc_ack_info_st {
-
- OSSL_TIME tx_time;
-
- size_t tx_size;
- } OSSL_CC_ACK_INFO;
- typedef struct ossl_cc_loss_info_st {
-
- OSSL_TIME tx_time;
-
- size_t tx_size;
- } OSSL_CC_LOSS_INFO;
- typedef struct ossl_cc_ecn_info_st {
-
- OSSL_TIME largest_acked_time;
- } OSSL_CC_ECN_INFO;
- #define OSSL_CC_OPTION_MAX_DGRAM_PAYLOAD_LEN "max_dgram_payload_len"
- #define OSSL_CC_OPTION_CUR_CWND_SIZE "cur_cwnd_size"
- #define OSSL_CC_OPTION_MIN_CWND_SIZE "min_cwnd_size"
- #define OSSL_CC_OPTION_CUR_BYTES_IN_FLIGHT "bytes_in_flight"
- #define OSSL_CC_OPTION_CUR_STATE "cur_state"
- #define OSSL_CC_LOST_FLAG_PERSISTENT_CONGESTION (1U << 0)
- struct ossl_cc_method_st {
-
- OSSL_CC_DATA *(*new)(OSSL_TIME (*now_cb)(void *arg),
- void *now_cb_arg);
- void (*free)(OSSL_CC_DATA *ccdata);
-
- void (*reset)(OSSL_CC_DATA *ccdata);
-
- int (*set_input_params)(OSSL_CC_DATA *ccdata,
- const OSSL_PARAM *params);
-
- int (*bind_diagnostics)(OSSL_CC_DATA *ccdata,
- OSSL_PARAM *params);
-
- int (*unbind_diagnostics)(OSSL_CC_DATA *ccdata,
- OSSL_PARAM *params);
-
- uint64_t (*get_tx_allowance)(OSSL_CC_DATA *ccdata);
-
- OSSL_TIME (*get_wakeup_deadline)(OSSL_CC_DATA *ccdata);
-
- int (*on_data_sent)(OSSL_CC_DATA *ccdata,
- uint64_t num_bytes);
-
- int (*on_data_acked)(OSSL_CC_DATA *ccdata,
- const OSSL_CC_ACK_INFO *info);
-
- int (*on_data_lost)(OSSL_CC_DATA *ccdata,
- const OSSL_CC_LOSS_INFO *info);
-
- int (*on_data_lost_finished)(OSSL_CC_DATA *ccdata, uint32_t flags);
-
- int (*on_data_invalidated)(OSSL_CC_DATA *ccdata,
- uint64_t num_bytes);
-
- int (*on_ecn)(OSSL_CC_DATA *ccdata,
- const OSSL_CC_ECN_INFO *info);
- };
- extern const OSSL_CC_METHOD ossl_cc_dummy_method;
- extern const OSSL_CC_METHOD ossl_cc_newreno_method;
- # endif
- #endif
|