diff --git a/include/tquic.h b/include/tquic.h index d77392b9..abf927fa 100644 --- a/include/tquic.h +++ b/include/tquic.h @@ -711,6 +711,14 @@ void quic_config_enable_stateless_reset(struct quic_config_t *config, bool enabl */ void quic_config_set_cid_len(struct quic_config_t *config, uint8_t v); +/** + * Set the anti-amplification factor. + * + * The server limits the data sent to an unvalidated address to + * `anti_amplification_factor` times the received data. + */ +void quic_config_set_anti_amplification_factor(struct quic_config_t *config, uint8_t v); + /** * Set the batch size for sending packets. * Applicable to Endpoint only. diff --git a/src/ffi.rs b/src/ffi.rs index 718d4769..e939143c 100644 --- a/src/ffi.rs +++ b/src/ffi.rs @@ -504,6 +504,15 @@ pub extern "C" fn quic_config_set_cid_len(config: &mut Config, v: u8) { config.set_cid_len(v as usize); } +/// Set the anti-amplification factor. +/// +/// The server limits the data sent to an unvalidated address to +/// `anti_amplification_factor` times the received data. +#[no_mangle] +pub extern "C" fn quic_config_set_anti_amplification_factor(config: &mut Config, v: u8) { + config.set_anti_amplification_factor(v as usize); +} + /// Set the batch size for sending packets. /// Applicable to Endpoint only. #[no_mangle]