summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton <anton@picapica>2019-01-12 16:24:34 +0400
committerAnton <anton@picapica>2019-01-12 16:24:34 +0400
commit996e64d071cdbbd25cf96b3f594c53ca47cf029d (patch)
tree016e437bddf2a173a241934b3fa82d47c0fe4e95
parent80163e368584c259437adef8dfa809e58c2b2fa7 (diff)
downloadpica-pica-996e64d071cdbbd25cf96b3f594c53ca47cf029d.tar.gz
pica-pica-996e64d071cdbbd25cf96b3f594c53ca47cf029d.zip
doc: packet format section
-rw-r--r--doc/proto-doc.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/proto-doc.txt b/doc/proto-doc.txt
index 7955847..3d7d853 100644
--- a/doc/proto-doc.txt
+++ b/doc/proto-doc.txt
@@ -35,3 +35,26 @@ establish mutually authenticated TLS session over proxied connection,
initiator client is a TLS client, accepting client has TLS server role.
n2n connection continues to operate in ADH TLS session, as by design nodes
do not store state that identifies them except network address.
+
+
+Packet Format.
+
+Pica Pica protocol message packet contains header and tail.
+
+[Header][Tail]
+
+Header is a 2 octet sequence that identifies packet. First and second octets
+are always equal to each other.
+Tail is a remaining part of the packet. Can be empty. Tail can have fixed
+predefined length or in case of variable length packet it begins with 1 or 2
+octet sequence that contains unsigned integer number which defines length in
+octets of remaining part of the tail not including lenght octets. Length field
+is stored in little-endian format, least significant octet first.
+
+Example:
+
+0x55 0x55 0x03 0x00 0xAA 0xBB 0xCC
+[0x55 0x55] - header
+[0x03 0x00] - tail length, 2 octets
+[0xAA 0xBB 0xCC] payload, 3 octets
+