Skip to content

Instantly share code, notes, and snippets.

@GGist
Created November 28, 2017 02:15
Show Gist options
  • Save GGist/714f4f6efd7523bfb28d79e5de145c34 to your computer and use it in GitHub Desktop.
Save GGist/714f4f6efd7523bfb28d79e5de145c34 to your computer and use it in GitHub Desktop.
+-------------------------------------------------------------------+
| |
| 13/27 16/30 |
| ^ ^ ^ ^ |
| +--++ +--+ |
| 0 4 5 6 7 8 9 12 9 26 | | |
| +--------------------------------------------+--++ |
| |XXXX||X||X||X||X||XXXX OR XXXXXXXXXXXXXXXX||XXXX| |
| +^--^--^--^--^--^--^--^----^--------------^--^--^+ |
| +--+ | | | | |--| +--------------+ +--+ |
| | | | | | |-----+ | | |
| | | | | +-----+ | | | |
| | | | +------+ | +-+-------------+ | |
| +--+ +---+ +-+ | | | | |
| | | | | +-------+ | | |
| | | | | | | | |
| ++----+--------+-------+---------+----------+-----+-------+ |
| |Len||Ext_Msg||Ext_Id||Msg_Type||Addr_Type||Addr||Err_Code| |
| +---------------------------------------------------------+ |
| |
+-------------------------------------------------------------------+
|Msg Type |ByteCode|Usage |
|Rendezvous | 0|Send connect message to the initiating |
| | |peer with address in this mesage + Send |
| | |connect message to the address in this mesage|
| | |with the address of the initiating peer |
|Connect | 1|Tell a peer to connect to the address |
|Failed | 2|A previous request failed for some reason |
+-------------------------------------------------------------------+
|Addr Type |ByteCode|Usage |
|Ipv4 | 0|Address in the message is an ipv4 address |
|Ipv6 | 1|Address in the message is an ipv6 address |
+-------------------------------------------------------------------+
|Err Code |ByteCode|Usage |
|NoSuchPeer | 1|??? |
|NotConnected| 2|We cant rendezvous the connection as we arent|
| | |connected to the peer |
|NoSupport | 3|Other peer doesnt support the extension |
| | |(if the peer that send the message doesnt |
| | |support the extension, dont respond) |
|NoSelf | 4|Our address was listed in the message |
+------------+------------------------------------------------------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment