Source File
types.go
Belonging Package
github.com/quic-go/quic-go/qlog
package qlogimport ()type (ConnectionID = protocol.ConnectionIDArbitraryLenConnectionID = protocol.ArbitraryLenConnectionIDVersion = protocol.VersionPacketNumber = protocol.PacketNumberEncryptionLevel = protocol.EncryptionLevelKeyPhaseBit = protocol.KeyPhaseBitKeyPhase = protocol.KeyPhaseStreamID = protocol.StreamIDTransportErrorCode = qerr.TransportErrorCodeApplicationErrorCode = qerr.ApplicationErrorCode)const (// KeyPhaseZero is key phase bit 0KeyPhaseZero = protocol.KeyPhaseZero// KeyPhaseOne is key phase bit 1KeyPhaseOne = protocol.KeyPhaseOne)// ECN represents the Explicit Congestion Notification value.type ECN stringconst (// ECNUnsupported means that no ECN value was set / receivedECNUnsupported ECN = ""// ECTNot is Not-ECTECTNot ECN = "Not-ECT"// ECT0 is ECT(0)ECT0 ECN = "ECT(0)"// ECT1 is ECT(1)ECT1 ECN = "ECT(1)"// ECNCE is CEECNCE ECN = "CE")type Initiator stringconst (InitiatorLocal Initiator = "local"InitiatorRemote Initiator = "remote")type streamType protocol.StreamTypefunc ( streamType) () string {switch protocol.StreamType() {case protocol.StreamTypeUni:return "unidirectional"case protocol.StreamTypeBidi:return "bidirectional"default:return "unknown stream type"}}type version protocol.Versionfunc ( version) () string {return fmt.Sprintf("%x", uint32())}func encLevelToPacketNumberSpace( protocol.EncryptionLevel) string {switch {case protocol.EncryptionInitial:return "initial"case protocol.EncryptionHandshake:return "handshake"case protocol.Encryption0RTT, protocol.Encryption1RTT:return "application_data"default:return "unknown encryption level"}}// KeyType represents the type of cryptographic key used in QUIC connections.type KeyType stringconst (// KeyTypeServerInitial represents the server's initial secret key.KeyTypeServerInitial KeyType = "server_initial_secret"// KeyTypeClientInitial represents the client's initial secret key.KeyTypeClientInitial KeyType = "client_initial_secret"// KeyTypeServerHandshake represents the server's handshake secret key.KeyTypeServerHandshake KeyType = "server_handshake_secret"// KeyTypeClientHandshake represents the client's handshake secret key.KeyTypeClientHandshake KeyType = "client_handshake_secret"// KeyTypeServer0RTT represents the server's 0-RTT secret key.KeyTypeServer0RTT KeyType = "server_0rtt_secret"// KeyTypeClient0RTT represents the client's 0-RTT secret key.KeyTypeClient0RTT KeyType = "client_0rtt_secret"// KeyTypeServer1RTT represents the server's 1-RTT secret key.KeyTypeServer1RTT KeyType = "server_1rtt_secret"// KeyTypeClient1RTT represents the client's 1-RTT secret key.KeyTypeClient1RTT KeyType = "client_1rtt_secret")// KeyUpdateTrigger describes what caused a key update event.type KeyUpdateTrigger stringconst (// KeyUpdateTLS indicates the key update was triggered by TLS.KeyUpdateTLS KeyUpdateTrigger = "tls"// KeyUpdateRemote indicates the key update was triggered by the remote peer.KeyUpdateRemote KeyUpdateTrigger = "remote_update"// KeyUpdateLocal indicates the key update was triggered locally.KeyUpdateLocal KeyUpdateTrigger = "local_update")type transportError uint64func ( transportError) () string {switch qerr.TransportErrorCode() {case qerr.NoError:return "no_error"case qerr.InternalError:return "internal_error"case qerr.ConnectionRefused:return "connection_refused"case qerr.FlowControlError:return "flow_control_error"case qerr.StreamLimitError:return "stream_limit_error"case qerr.StreamStateError:return "stream_state_error"case qerr.FinalSizeError:return "final_size_error"case qerr.FrameEncodingError:return "frame_encoding_error"case qerr.TransportParameterError:return "transport_parameter_error"case qerr.ConnectionIDLimitError:return "connection_id_limit_error"case qerr.ProtocolViolation:return "protocol_violation"case qerr.InvalidToken:return "invalid_token"case qerr.ApplicationErrorErrorCode:return "application_error"case qerr.CryptoBufferExceeded:return "crypto_buffer_exceeded"case qerr.KeyUpdateError:return "key_update_error"case qerr.AEADLimitReached:return "aead_limit_reached"case qerr.NoViablePathError:return "no_viable_path"default:return ""}}type PacketType stringconst (// PacketTypeInitial represents an Initial packetPacketTypeInitial PacketType = "initial"// PacketTypeHandshake represents a Handshake packetPacketTypeHandshake PacketType = "handshake"// PacketTypeRetry represents a Retry packetPacketTypeRetry PacketType = "retry"// PacketType0RTT represents a 0-RTT packetPacketType0RTT PacketType = "0RTT"// PacketTypeVersionNegotiation represents a Version Negotiation packetPacketTypeVersionNegotiation PacketType = "version_negotiation"// PacketTypeStatelessReset represents a Stateless Reset packetPacketTypeStatelessReset PacketType = "stateless_reset"// PacketType1RTT represents a 1-RTT packetPacketType1RTT PacketType = "1RTT"// // PacketTypeNotDetermined represents a packet type that could not be determined// PacketTypeNotDetermined packetType = "")func ( EncryptionLevel) PacketType {switch {case protocol.EncryptionInitial:return PacketTypeInitialcase protocol.EncryptionHandshake:return PacketTypeHandshakecase protocol.Encryption0RTT:return PacketType0RTTcase protocol.Encryption1RTT:return PacketType1RTTdefault:panic(fmt.Sprintf("unknown encryption level: %d", ))}}type PacketLossReason stringconst (// PacketLossReorderingThreshold is used when a packet is declared lost due to reordering thresholdPacketLossReorderingThreshold PacketLossReason = "reordering_threshold"// PacketLossTimeThreshold is used when a packet is declared lost due to time thresholdPacketLossTimeThreshold PacketLossReason = "time_threshold")type PacketDropReason stringconst (// PacketDropKeyUnavailable is used when a packet is dropped because keys are unavailablePacketDropKeyUnavailable PacketDropReason = "key_unavailable"// PacketDropUnknownConnectionID is used when a packet is dropped because the connection ID is unknownPacketDropUnknownConnectionID PacketDropReason = "unknown_connection_id"// PacketDropHeaderParseError is used when a packet is dropped because header parsing failedPacketDropHeaderParseError PacketDropReason = "header_parse_error"// PacketDropPayloadDecryptError is used when a packet is dropped because decrypting the payload failedPacketDropPayloadDecryptError PacketDropReason = "payload_decrypt_error"// PacketDropProtocolViolation is used when a packet is dropped due to a protocol violationPacketDropProtocolViolation PacketDropReason = "protocol_violation"// PacketDropDOSPrevention is used when a packet is dropped to mitigate a DoS attackPacketDropDOSPrevention PacketDropReason = "dos_prevention"// PacketDropUnsupportedVersion is used when a packet is dropped because the version is not supportedPacketDropUnsupportedVersion PacketDropReason = "unsupported_version"// PacketDropUnexpectedPacket is used when an unexpected packet is receivedPacketDropUnexpectedPacket PacketDropReason = "unexpected_packet"// PacketDropUnexpectedSourceConnectionID is used when a packet with an unexpected source connection ID is receivedPacketDropUnexpectedSourceConnectionID PacketDropReason = "unexpected_source_connection_id"// PacketDropUnexpectedVersion is used when a packet with an unexpected version is receivedPacketDropUnexpectedVersion PacketDropReason = "unexpected_version"// PacketDropDuplicate is used when a duplicate packet is receivedPacketDropDuplicate PacketDropReason = "duplicate")type LossTimerUpdateType stringconst (LossTimerUpdateTypeSet LossTimerUpdateType = "set"LossTimerUpdateTypeExpired LossTimerUpdateType = "expired"LossTimerUpdateTypeCancelled LossTimerUpdateType = "cancelled")type TimerType stringconst (// TimerTypeACK represents an ACK timerTimerTypeACK TimerType = "ack"// TimerTypePTO represents a PTO (Probe Timeout) timerTimerTypePTO TimerType = "pto"// TimerTypePathProbe represents a path probe timerTimerTypePathProbe TimerType = "path_probe")type CongestionState stringconst (// CongestionStateSlowStart is the slow start phase of Reno / CubicCongestionStateSlowStart CongestionState = "slow_start"// CongestionStateCongestionAvoidance is the congestion avoidance phase of Reno / CubicCongestionStateCongestionAvoidance CongestionState = "congestion_avoidance"// CongestionStateRecovery is the recovery phase of Reno / CubicCongestionStateRecovery CongestionState = "recovery"// CongestionStateApplicationLimited means that the congestion controller is application limitedCongestionStateApplicationLimited CongestionState = "application_limited")func ( CongestionState) () string {return string()}// ECNState is the state of the ECN state machine (see Appendix A.4 of RFC 9000)type ECNState stringconst (// ECNStateTesting is the testing stateECNStateTesting ECNState = "testing"// ECNStateUnknown is the unknown stateECNStateUnknown ECNState = "unknown"// ECNStateFailed is the failed stateECNStateFailed ECNState = "failed"// ECNStateCapable is the capable stateECNStateCapable ECNState = "capable")type ConnectionCloseTrigger stringconst (// IdleTimeout indicates the connection was closed due to idle timeoutConnectionCloseTriggerIdleTimeout ConnectionCloseTrigger = "idle_timeout"// Application indicates the connection was closed by the applicationConnectionCloseTriggerApplication ConnectionCloseTrigger = "application"// VersionMismatch indicates the connection was closed due to a QUIC version mismatchConnectionCloseTriggerVersionMismatch ConnectionCloseTrigger = "version_mismatch"// StatelessReset indicates the connection was closed due to receiving a stateless reset from the peerConnectionCloseTriggerStatelessReset ConnectionCloseTrigger = "stateless_reset")// DatagramID is a unique identifier for a datagramtype DatagramID uint32// CalculateDatagramID computes a DatagramID for a given packetfunc ( []byte) DatagramID {return DatagramID(crc32.ChecksumIEEE())}
![]() |
The pages are generated with Golds v0.8.4. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |