Add native protocol service plugins
测试构建 / 代码检查 (push) Has been cancelled
测试构建 / 单元测试和构建 (push) Has been cancelled
测试构建 / 构建验证 (push) Has been cancelled

This commit is contained in:
ZacharyZcR
2026-05-23 15:51:50 +08:00
parent 73cbe803c4
commit 8d30ee334c
16 changed files with 812 additions and 2 deletions
+19
View File
@@ -0,0 +1,19 @@
//go:build plugin_dnstcp || !plugin_selective
package services
import (
"encoding/binary"
"testing"
)
func TestDNSTCPFrame(t *testing.T) {
query := buildDNSRootNSQuery(0x4321)
frame := make([]byte, 2, len(query)+2)
binary.BigEndian.PutUint16(frame, uint16(len(query)))
frame = append(frame, query...)
if binary.BigEndian.Uint16(frame[:2]) != uint16(len(query)) {
t.Fatalf("unexpected dns tcp length prefix: %#v", frame[:2])
}
}