begin prepping policy refactor manually

This commit is contained in:
Patricio Whittingslow
2026-08-24 15:59:17 -03:00
parent 263b1ecf11
commit 936790a5d0
8 changed files with 415 additions and 375 deletions
+9 -3
View File
@@ -257,14 +257,20 @@ func (tcb *ControlBlock) HasPendingRetransmit() bool {
return tcb._state.TxDataOpen() && tcb.dupack >= retransmitAfterDupacks && tcb.nRetransmit <= tcb.dupack-retransmitAfterDupacks
}
func (tcb *ControlBlock) RetransmitFrom(newNxt Value) bool {
panic("not yet implemented")
tcb.snd.NXT = newNxt
tcb.dupack = 0
tcb.nRetransmit = 0
return true
}
// RetransmitAll rewinds snd.NXT back to snd.UNA so the next PendingSegment and
// Send calls retransmit all unacknowledged data from the oldest sequence number
// (go-back-N). It must be paired with ringTx.RetransmitFromUNA to rewind the
// transmit buffer. Implements RFC 9293 §3.10.8 (RETRANSMISSION TIMEOUT).
func (tcb *ControlBlock) RetransmitAll() {
tcb.snd.NXT = tcb.snd.UNA
tcb.dupack = 0
tcb.nRetransmit = 0
tcb.RetransmitFrom(tcb.snd.UNA)
}
// PendingSegment calculates a suitable next segment to send from a payload length.