pub enum Action {
Cancel {
timer: Timer,
},
SendPadding {
bypass: bool,
replace: bool,
timeout: Dist,
limit: Option<Dist>,
},
BlockOutgoing {
bypass: bool,
replace: bool,
timeout: Dist,
duration: Dist,
limit: Option<Dist>,
},
UpdateTimer {
replace: bool,
duration: Dist,
limit: Option<Dist>,
},
}
Expand description
An Action happens upon transition to a State
. All actions
(except Cancel) can be limited. The limit is the maximum number of times the
action can be taken upon repeated transitions to the same state.
Variants§
Cancel
Cancel a timer.
SendPadding
Schedule padding to be sent after a timeout.
The bypass flag determines if the padding packet MUST bypass any existing blocking that was triggered with the bypass flag set.
The replace flag determines if the padding packet MAY be replaced by a packet already queued to be sent at the time the padding packet would be sent. This applies for data queued to be turned into normal (non-padding) packets AND any packet (padding or normal) in the egress queue yet to be sent (i.e., before the TunnelSent event is triggered). Such a packet could be in the queue due to ongoing blocking or just not being sent yet (e.g., due to CC). We assume that packets will be encrypted ASAP for the egress queue and we do not want to keep state around to distinguish padding and non-padding, hence, any packet. Similarly, this implies that a single blocked packet in the egress queue can replace multiple padding packets with the replace flag set.
BlockOutgoing
Schedule blocking of outgoing traffic after a timeout.
The bypass flag determines if padding actions are allowed to bypass this blocking action. This allows for machines that can fail closed (never bypass blocking) while simultaneously providing support for constant-rate defenses, when set along with the replace flag.
The replace flag determines if the action duration MUST replace any existing blocking. Note that the blocking with the replace flag is always allowed if blocking is currently active, regardless of any limits set. This is to make it possible to create a machine that is guaranteed to prevent indefinite blocking (but comes at the cost of making it possible for a machine that indefinitely refresh blocking by using the replace flag).
UpdateTimer
Update the timer duration for a machine.
The replace flag determines if the action duration MUST replace the current timer duration, if the timer has already been set.