1package ackhandler
2
3import "fmt"
4
5// The SendMode says what kind of packets can be sent.
6type SendMode uint8
7
8const (
9	// SendNone means that no packets should be sent
10	SendNone SendMode = iota
11	// SendAck means an ACK-only packet should be sent
12	SendAck
13	// SendPTOInitial means that an Initial probe packet should be sent
14	SendPTOInitial
15	// SendPTOHandshake means that a Handshake probe packet should be sent
16	SendPTOHandshake
17	// SendPTOAppData means that an Application data probe packet should be sent
18	SendPTOAppData
19	// SendAny means that any packet should be sent
20	SendAny
21)
22
23func (s SendMode) String() string {
24	switch s {
25	case SendNone:
26		return "none"
27	case SendAck:
28		return "ack"
29	case SendPTOInitial:
30		return "pto (Initial)"
31	case SendPTOHandshake:
32		return "pto (Handshake)"
33	case SendPTOAppData:
34		return "pto (Application Data)"
35	case SendAny:
36		return "any"
37	default:
38		return fmt.Sprintf("invalid send mode: %d", s)
39	}
40}
41