From ca90ebdfa8789654766c5d7969baa7afacd9ebd2 Mon Sep 17 00:00:00 2001 From: BanceDev Date: Mon, 16 Feb 2026 16:31:54 -0500 Subject: initial commit --- protocol/extension.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 protocol/extension.go (limited to 'protocol/extension.go') diff --git a/protocol/extension.go b/protocol/extension.go new file mode 100644 index 0000000..5f17cff --- /dev/null +++ b/protocol/extension.go @@ -0,0 +1,22 @@ +package protocol + +import ( + "fmt" + + "github.com/osm/quake/common/buffer" +) + +type Extension struct { + Version uint32 + Extensions uint32 +} + +func (cmd *Extension) Bytes() []byte { + buf := buffer.New() + + buf.PutBytes([]byte(fmt.Sprintf("0x%x", cmd.Version))) + buf.PutBytes([]byte(fmt.Sprintf("0x%x", cmd.Extensions))) + buf.PutByte(0x0a) + + return buf.Bytes() +} -- cgit v1.2.3-59-g8ed1b