Letter |
Name |
Description |
W |
Wrapper |
Wrap the message in an envelope giving its length |
Wrapper
[Definition]
RAW |
= |
"W " LENSTR " " MESSAGE |
|
; |
the raw bits that get sent down the wire |
LENSTR |
= |
4HEX |
|
; |
len = strlen(message) |
MESSAGE |
= |
LINK_MESSAGE | NEGOTIATION_MESSAGE | GAME_MESSAGE |
|
; |
these are defined in the other parts |
|
[Example]
RAW |
= |
"W 001A G testgame2 | P modulo 3E8" |
LENSTR |
= |
"001A" |
|
; |
hex(001A) = decimal(26) |
MESSAGE |
= |
"G testgame2 | P modulo 3E8" |
|
; |
strlen(MESSAGE) = 26 |
|
Note: decryption and removal (and checking)
of authentication signatures also happens at this stage.
If there is any authentication, encryption or encoding then:
MESSAGE = Encrypt(Sign(Encode(LINK_MESSAGE | NEGOTIATION_MESSAGE | GAME_MESSAGE)))
(TOP)(UP)