String returns a human-readable name for the packet type
()
| 34 | |
| 35 | // String returns a human-readable name for the packet type |
| 36 | func (t PacketType) String() string { |
| 37 | switch t { |
| 38 | case PacketInitial: |
| 39 | return "Initial" |
| 40 | case PacketZeroRTT: |
| 41 | return "0-RTT" |
| 42 | case PacketHandshake: |
| 43 | return "Handshake" |
| 44 | case PacketRetry: |
| 45 | return "Retry" |
| 46 | case PacketShortHeader: |
| 47 | return "1-RTT" |
| 48 | default: |
| 49 | return "Unknown" |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | // ClassifyPacket determines the type of a QUIC packet from its first byte |
| 54 | // This is a fast check that doesn't parse the entire packet |
no outgoing calls