2018-03-25 23:37:41 -05:00
|
|
|
package ackhandler
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
|
|
|
|
// The SendMode says what kind of packets can be sent.
|
|
|
|
type SendMode uint8
|
|
|
|
|
|
|
|
const (
|
|
|
|
// SendNone means that no packets should be sent
|
|
|
|
SendNone SendMode = iota
|
|
|
|
// SendAck means an ACK-only packet should be sent
|
|
|
|
SendAck
|
|
|
|
// SendRetransmission means that retransmissions should be sent
|
|
|
|
SendRetransmission
|
2018-04-18 16:48:08 -05:00
|
|
|
// SendRTO means that an RTO probe packet should be sent
|
|
|
|
SendRTO
|
2018-09-02 16:18:54 -05:00
|
|
|
// SendTLP means that a TLP probe packet should be sent
|
|
|
|
SendTLP
|
|
|
|
// SendAny means that any packet should be sent
|
2018-03-25 23:37:41 -05:00
|
|
|
SendAny
|
|
|
|
)
|
|
|
|
|
|
|
|
func (s SendMode) String() string {
|
|
|
|
switch s {
|
|
|
|
case SendNone:
|
|
|
|
return "none"
|
|
|
|
case SendAck:
|
|
|
|
return "ack"
|
|
|
|
case SendRetransmission:
|
|
|
|
return "retransmission"
|
2018-04-18 16:48:08 -05:00
|
|
|
case SendRTO:
|
|
|
|
return "rto"
|
2018-09-02 16:18:54 -05:00
|
|
|
case SendTLP:
|
|
|
|
return "tlp"
|
2018-03-25 23:37:41 -05:00
|
|
|
case SendAny:
|
|
|
|
return "any"
|
|
|
|
default:
|
|
|
|
return fmt.Sprintf("invalid send mode: %d", s)
|
|
|
|
}
|
|
|
|
}
|