summaryrefslogtreecommitdiff
path: root/core/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/util.c')
-rw-r--r--core/util.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/core/util.c b/core/util.c
index 6b40dad7..5b560171 100644
--- a/core/util.c
+++ b/core/util.c
@@ -9,7 +9,8 @@
9#include <stdint.h> 9#include <stdint.h>
10#include <stdbool.h> 10#include <stdbool.h>
11 11
12#include "network.h" 12#include "DHT.h"
13#include "packets.h"
13 14
14uint64_t now() { 15uint64_t now() {
15 return time(NULL); 16 return time(NULL);
@@ -29,3 +30,11 @@ uint64_t random_64b() {
29bool ipp_eq(IP_Port a, IP_Port b) { 30bool ipp_eq(IP_Port a, IP_Port b) {
30 return (a.ip.i == b.ip.i) && (a.port == b.port); 31 return (a.ip.i == b.ip.i) && (a.port == b.port);
31} 32}
33
34bool id_eq(clientid_t* dest, clientid_t* src) {
35 return memcmp(dest, src, sizeof(clientid_t)) == 0;
36}
37
38void id_cpy(clientid_t* dest, clientid_t* src) {
39 memcpy(dest, src, sizeof(clientid_t));
40}