diff options
author | David Timber <mieabby@gmail.com> | 2020-08-30 21:30:46 +0930 |
---|---|---|
committer | David Timber <mieabby@gmail.com> | 2020-08-30 21:30:46 +0930 |
commit | fbb4d5d648a8dc6dba9e33240bf66d82939e2880 (patch) | |
tree | a3ba1be81b7c5c5dcd2f64a5d50be1b969c1048d /src/protocol.c | |
parent | f36333b2c915ac7d9cf82e09ab5cb2a2f8296177 (diff) |
* Impl run_cmd
* Add prne_htbt_hover_t
* Add run_cmd test data
Diffstat (limited to 'src/protocol.c')
-rw-r--r-- | src/protocol.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/protocol.c b/src/protocol.c index 51cbc15..301e884 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -396,6 +396,20 @@ bool prne_htbt_eq_bin_meta (const prne_htbt_bin_meta_t *a, const prne_htbt_bin_m prne_htbt_eq_cmd(&a->cmd, &b->cmd); } +void prne_htbt_init_hover (prne_htbt_hover_t *ho) { + prne_memzero(ho, sizeof(prne_htbt_hover_t)); +} + +void prne_htbt_free_hover (prne_htbt_hover_t *ho) {} + +bool prne_htbt_eq_hover (const prne_htbt_hover_t *a, const prne_htbt_hover_t *b) { + return + memcmp(a->v4.addr, b->v4.addr, 4) == 0 && + memcmp(a->v6.addr, b->v6.addr, 16) == 0 && + a->v4.port == b->v4.port && + a->v6.port == b->v6.port; +} + void prne_htbt_init_stdio (prne_htbt_stdio_t *s) { s->len = 0; s->err = false; |