123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296 |
- #ifndef OSSL_QUIC_ACKM_H
- # define OSSL_QUIC_ACKM_H
- # include "internal/quic_statm.h"
- # include "internal/quic_cc.h"
- # include "internal/quic_types.h"
- # include "internal/quic_wire.h"
- # include "internal/quic_predef.h"
- # include "internal/time.h"
- # include "internal/list.h"
- # ifndef OPENSSL_NO_QUIC
- OSSL_ACKM *ossl_ackm_new(OSSL_TIME (*now)(void *arg),
- void *now_arg,
- OSSL_STATM *statm,
- const OSSL_CC_METHOD *cc_method,
- OSSL_CC_DATA *cc_data);
- void ossl_ackm_free(OSSL_ACKM *ackm);
- void ossl_ackm_set_loss_detection_deadline_callback(OSSL_ACKM *ackm,
- void (*fn)(OSSL_TIME deadline,
- void *arg),
- void *arg);
- void ossl_ackm_set_ack_deadline_callback(OSSL_ACKM *ackm,
- void (*fn)(OSSL_TIME deadline,
- int pkt_space,
- void *arg),
- void *arg);
- void ossl_ackm_set_rx_max_ack_delay(OSSL_ACKM *ackm, OSSL_TIME rx_max_ack_delay);
- void ossl_ackm_set_tx_max_ack_delay(OSSL_ACKM *ackm, OSSL_TIME tx_max_ack_delay);
- typedef struct ossl_ackm_tx_pkt_st OSSL_ACKM_TX_PKT;
- struct ossl_ackm_tx_pkt_st {
-
- QUIC_PN pkt_num;
-
- size_t num_bytes;
-
- OSSL_TIME time;
-
- QUIC_PN largest_acked;
-
- unsigned int pkt_space :2;
-
- unsigned int is_inflight :1;
-
- unsigned int is_ack_eliciting :1;
-
- unsigned int is_pto_probe :1;
-
- unsigned int is_mtu_probe :1;
-
- void (*on_lost)(void *arg);
-
- void (*on_acked)(void *arg);
-
- void (*on_discarded)(void *arg);
- void *cb_arg;
-
- OSSL_LIST_MEMBER(tx_history, OSSL_ACKM_TX_PKT);
- struct ossl_ackm_tx_pkt_st *anext;
- struct ossl_ackm_tx_pkt_st *lnext;
- };
- int ossl_ackm_on_tx_packet(OSSL_ACKM *ackm, OSSL_ACKM_TX_PKT *pkt);
- int ossl_ackm_on_rx_datagram(OSSL_ACKM *ackm, size_t num_bytes);
- # define OSSL_ACKM_ECN_NONE 0
- # define OSSL_ACKM_ECN_ECT1 1
- # define OSSL_ACKM_ECN_ECT0 2
- # define OSSL_ACKM_ECN_ECNCE 3
- typedef struct ossl_ackm_rx_pkt_st {
-
- QUIC_PN pkt_num;
-
- OSSL_TIME time;
-
- unsigned int pkt_space :2;
-
- unsigned int is_ack_eliciting :1;
-
- unsigned int ecn :2;
- } OSSL_ACKM_RX_PKT;
- int ossl_ackm_on_rx_packet(OSSL_ACKM *ackm, const OSSL_ACKM_RX_PKT *pkt);
- int ossl_ackm_on_rx_ack_frame(OSSL_ACKM *ackm, const OSSL_QUIC_FRAME_ACK *ack,
- int pkt_space, OSSL_TIME rx_time);
- int ossl_ackm_on_pkt_space_discarded(OSSL_ACKM *ackm, int pkt_space);
- int ossl_ackm_on_handshake_confirmed(OSSL_ACKM *ackm);
- int ossl_ackm_on_timeout(OSSL_ACKM *ackm);
- OSSL_TIME ossl_ackm_get_loss_detection_deadline(OSSL_ACKM *ackm);
- const OSSL_QUIC_FRAME_ACK *ossl_ackm_get_ack_frame(OSSL_ACKM *ackm,
- int pkt_space);
- OSSL_TIME ossl_ackm_get_ack_deadline(OSSL_ACKM *ackm, int pkt_space);
- int ossl_ackm_is_ack_desired(OSSL_ACKM *ackm, int pkt_space);
- int ossl_ackm_is_rx_pn_processable(OSSL_ACKM *ackm, QUIC_PN pn, int pkt_space);
- typedef struct ossl_ackm_probe_info_st {
-
- uint32_t anti_deadlock_initial, anti_deadlock_handshake;
-
- uint32_t pto[QUIC_PN_SPACE_NUM];
- } OSSL_ACKM_PROBE_INFO;
- OSSL_ACKM_PROBE_INFO *ossl_ackm_get0_probe_request(OSSL_ACKM *ackm);
- int ossl_ackm_get_largest_unacked(OSSL_ACKM *ackm, int pkt_space, QUIC_PN *pn);
- int ossl_ackm_mark_packet_pseudo_lost(OSSL_ACKM *ackm,
- int pkt_space, QUIC_PN pn);
- OSSL_TIME ossl_ackm_get_pto_duration(OSSL_ACKM *ackm);
- QUIC_PN ossl_ackm_get_largest_acked(OSSL_ACKM *ackm, int pkt_space);
- # endif
- #endif
|