From 4b8d39764f9b54ea3090d0fea92a23025dbea30d Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 7 Mar 2026 14:24:05 +0800 Subject: protocol: Add v0v1 server protocol and its receivepack subprotocol --- protocol/v0v1/server/errors.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 protocol/v0v1/server/errors.go (limited to 'protocol/v0v1/server/errors.go') diff --git a/protocol/v0v1/server/errors.go b/protocol/v0v1/server/errors.go new file mode 100644 index 00000000..6a456234 --- /dev/null +++ b/protocol/v0v1/server/errors.go @@ -0,0 +1,18 @@ +package server + +// ProtocolError reports one malformed or unsupported protocol input. +type ProtocolError struct { + Reason string +} + +// Error returns the formatted error string. +func (err *ProtocolError) Error() string { + return "protocol/v0v1/server: protocol error: " + err.Reason +} + +// ErrUnexpectedPacket reports one unexpected pkt-line control packet. +var ErrUnexpectedPacket = &ProtocolError{Reason: "unexpected control packet"} + +// ErrSideBandNotEnabled reports one attempt to write sideband frames without a +// negotiated side-band-64k session. +var ErrSideBandNotEnabled = &ProtocolError{Reason: "side-band-64k not enabled"} -- cgit v1.3.1-10-gc9f91