feat(protocol): add gateway transport authority contracts

This commit is contained in:
sechmachine
2026-07-29 05:59:46 +07:00
parent b2c24b3fa3
commit b5558133e3
21 changed files with 1898 additions and 15 deletions
+1 -1
View File
@@ -157,7 +157,7 @@ func classifyDatagram(encoded string) string {
if raw[2] != 1 {
return "invalid:unsupported_version"
}
limits := map[byte]int{1: 1024, 2: 2048, 3: 65515}
limits := map[byte]int{1: 1024, 2: 2048, 3: 65515, 10: 1179, 11: 1179, 12: 1179}
limit, ok := limits[raw[3]]
if !ok {
return "invalid:unknown_channel"
+1
View File
@@ -85,6 +85,7 @@ fn classify_datagram(encoded: &str) -> &'static str {
1 => 1024,
2 => 2048,
3 => 65515,
10 | 11 | 12 => 1179,
_ => return "invalid:unknown_channel",
};
if raw[4] != 0 {
+1
View File
@@ -50,6 +50,7 @@ func classifyDatagram(_ encoded: String) -> String {
case 1: limit = 1024
case 2: limit = 2048
case 3: limit = 65515
case 10, 11, 12: limit = 1179
default: return "invalid:unknown_channel"
}
guard raw[4] == 0 else { return "invalid:flags" }
+1 -1
View File
@@ -9,7 +9,7 @@ import pathlib
ROOT = pathlib.Path(__file__).resolve().parents[1]
HEADER_BYTES = 21
MAX_FRAME_BYTES = 65536
CHANNEL_LIMITS = {1: 1024, 2: 2048, 3: 65515}
CHANNEL_LIMITS = {1: 1024, 2: 2048, 3: 65515, 10: 1179, 11: 1179, 12: 1179}
def classify(raw: bytes) -> str: