From 7f4259c8576c7f536cb00f90dfcc6a68bf436428 Mon Sep 17 00:00:00 2001
From: Hugo Trentesaux <hugo.trentesaux@u-psud.fr>
Date: Wed, 12 Jun 2019 21:04:23 +0200
Subject: [PATCH] [feat] change fields order in endpoint v2

---
 rfc/0006_ws2p_v2.md | 52 +++++++++++++++++++++++----------------------
 1 file changed, 27 insertions(+), 25 deletions(-)

diff --git a/rfc/0006_ws2p_v2.md b/rfc/0006_ws2p_v2.md
index a6488a9..37bccd0 100644
--- a/rfc/0006_ws2p_v2.md
+++ b/rfc/0006_ws2p_v2.md
@@ -296,20 +296,20 @@ WS2Pv1 used endpoints version v1. So, in WS2Pv2 we improve to endpoints version
 
 ### Endpoint binary format
 
-|     data name    | size in bytes | data type     |
-|:----------------:|--------------:|--------------:|
-| endpoint_version | 4             | u32           |
-| api_name         | ?             | String        |
-| api_version      | 2             |    u16        |
-| nf_size          | 8             |   u64         |
-| network_features | nf_size       | specific      |
-| af_size          | 8             |   u64         |
-| api_features     | af_size       | specific      |
-| ip_v4            | 4             | Opt([u8; 4])  |
-| ip_v6            | 16            | Opt([u16; 8]) |
-| host             | ?             | Opt(String)   |
-| port             | 2             |    u16        |
-| path             | ?             | Opt(String)   |
+|    data name     | size in bytes |     data type |
+| :--------------: | ------------: | ------------: |
+|     api_name     |             ? |        String |
+|   api_version    |             2 |           u16 |
+|     nf_size      |             8 |           u64 |
+| network_features |       nf_size |      specific |
+|     af_size      |             8 |           u64 |
+|   api_features   |       af_size |      specific |
+| endpoint_version |             4 |           u32 |
+|       host       |             ? |   Opt(String) |
+|      ip_v4       |             4 |  Opt([u8; 4]) |
+|      ip_v6       |            16 | Opt([u16; 8]) |
+|       port       |             2 |           u16 |
+|       path       |             ? |   Opt(String) |
 
 endpoint_version := value is `1`.
 
@@ -376,22 +376,24 @@ Example:
 
 Same endpoint in binary format :
 
-|     data name    | size in bytes | data type     | value               |
-|:----------------:|--------------:|--------------:|---------------------|
-| api_name         | ?             | String        | 0x0000_0004 ++ "ws2p" encoded in utf8 |
-| api_version      | 2             |    u16        | 0x0002              |
-| nf_size          | 8             |   u64         | 0x0000_0001         |
-| network_features | nf_size       | specific      | 0x04                |
-| af_size          | 8             |   u64         | 0x0000_0001         |
-| api_features     | af_size       | specific      | 0x07   |
-| ip_v4            | 4             | Opt([u8; 4])  | 0x00   |
-| ip_v6            | 16            | Opt([u16; 8]) | 0x00   |
+| data name        | size in bytes | data type     | value                                         |
+| :--------------: | ------------: | ------------: | --------------------------------------------- |
+| api_name         | ?             | String        | 0x0000_0004 ++ "ws2p" encoded in utf8         |
+| api_version      | 2             | u16           | 0x0002                                        |
+| nf_size          | 8             | u64           | 0x0000_0001                                   |
+| network_features | nf_size       | specific      | 0x04                                          |
+| af_size          | 8             | u64           | 0x0000_0001                                   |
+| api_features     | af_size       | specific      | 0x07                                          |
+| endpoint_version | 4             | u32           | 0x0002                                        |
 | host             | ?             | Opt(String)   | 0x0000_0004 ++ "g1.durs.info" encoded in utf8 |
-| port             | 2             |    u16        | 0x01BB   |
+| ip_v4            | 4             | Opt([u8; 4])  | 0x00                                          |
+| ip_v6            | 16            | Opt([u16; 8]) | 0x00                                          |
+| port             | 2             | u16           | 0x01BB                                        |
 | path             | ?             | Opt(String)   | 0x01 ++ 0x0000_0004 ++ "ws2p" encoded in utf8 |
 
 ## Peer card
 
+
 Signed document declaring all the endpoints of a peer.
 
 ### Peer card binary format
-- 
GitLab