summaryrefslogtreecommitdiffstats
path: root/src/fuse/helper.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/fuse/helper.h')
-rw-r--r--src/fuse/helper.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/fuse/helper.h b/src/fuse/helper.h
index bbba44c..35cdc8a 100644
--- a/src/fuse/helper.h
+++ b/src/fuse/helper.h
@@ -4,6 +4,9 @@
#include <netdb.h>
#include <stdbool.h>
#include <stdint.h>
+#include <string.h>
+
+#include "../types.h"
typedef struct log_info {
@@ -21,4 +24,9 @@ bool sock_printable(struct sockaddr *addr, socklen_t addrLen, char *output, int
int connect_to_server(char *server_adress, int port);
+static inline bool isSameAddressPort(const dnbd3_host_t * const a, const dnbd3_host_t * const b)
+{
+ return (a->type == b->type) && (a->port == b->port) && (0 == memcmp( a->addr, b->addr, (a->type == AF_INET ? 4 : 16) ));
+}
+
#endif