Skip to content

Commit

Permalink
Improve PEER_INFO packet prep
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishcoleman committed Feb 25, 2024
1 parent 9ce4c6c commit 3386cb8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/tests-wire.expected
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,19 @@ pattern_PEER_INFO_prep1:
pktbuf:
000: 03 01 04 02 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 | |
010: 11 12 13 14 15 16 17 18 1a 19 1b 1c 1d 1e 1f 20 | |
020: 21 22 23 24 25 26 54 53 52 51 6c 6b 6a 69 55 56 |!"#$%&TSRQlkjiUV|
030: 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 64 65 66 |WXYZ[\]^_`abcdef|
040: 67 68 |gh|
020: 21 22 23 24 25 26 00 00 2a 29 2b 2c 2d 2e 54 53 |!"#$%& *)+,-.TS|
030: 52 51 6c 6b 6a 69 55 56 57 58 59 5a 5b 5c 5d 5e |RQlkjiUVWXYZ[\]^|
040: 5f 60 61 62 63 64 65 66 67 68 |_`abcdefgh|
out_common:
000: 01 02 00 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 | |
010: 11 12 13 14 15 16 17 18 | |
out_data:
000: 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 02 01 | !"#$%& |
010: 51 52 6c 6b 6a 69 00 00 00 00 00 00 00 00 00 00 |QRlkji |
000: 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 02 02 | !"#$%& |
010: 29 2a 2b 2c 2d 2e 00 00 00 00 00 00 00 00 00 00 |)*+,-. |
020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | |
030: 00 00 00 00 00 00 00 00 58 57 56 55 00 00 00 00 | XWVU |
040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | |
050: 5c 5b 5a 59 00 00 00 00 |\[ZY |
030: 00 00 00 00 00 00 00 00 51 52 53 54 55 56 57 58 | QRSTUVWX|
040: 59 5a 5b 5c 5d 5e 5f 60 61 62 63 64 65 66 67 68 |YZ[\]^_`abcdefgh|
050: 69 6a 6b 6c 00 00 00 00 |ijkl |

pattern_QUERY_PEER_prep1:
pktbuf:
Expand Down
3 changes: 3 additions & 0 deletions tools/tests-wire.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,9 @@ void pattern_PEER_INFO_prep1() {
pattern_init_out_buffers();
pattern_memset(&in_common, sizeof(in_common), 0);
pattern_memset(&in_data, sizeof(n2n_PEER_INFO_t), sizeof(in_common));

n2n_PEER_INFO_t *reg = (n2n_PEER_INFO_t *)&in_data;
reg->sock.family = AF_INET;
}

void pattern_PEER_INFO_codec() {
Expand Down

0 comments on commit 3386cb8

Please sign in to comment.