diff options
| author | 2026-02-16 16:31:54 -0500 | |
|---|---|---|
| committer | 2026-02-16 16:31:54 -0500 | |
| commit | ca90ebdfa8789654766c5d7969baa7afacd9ebd2 (patch) | |
| tree | 9693e0c7a5af6713f4c5e39372dcf22d05844ec3 /protocol/extension.go | |
Diffstat (limited to '')
| -rw-r--r-- | protocol/extension.go | 22 |
1 files changed, 22 insertions, 0 deletions
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() +} |
