summaryrefslogtreecommitdiffstats
path: root/src/fuse/helper.h
diff options
context:
space:
mode:
authorSimon Rettberg2015-11-24 12:30:46 +0100
committerSimon Rettberg2015-11-24 12:30:46 +0100
commit7b51c287a60d2f202fb131eeed9d1bf19b65a7a3 (patch)
tree031573c708b50aeafe9a6fe6f0992b3ae6456e7c /src/fuse/helper.h
parent[SERVER] Fix race condition potentially leading to use after release (diff)
downloaddnbd3-7b51c287a60d2f202fb131eeed9d1bf19b65a7a3.tar.gz
dnbd3-7b51c287a60d2f202fb131eeed9d1bf19b65a7a3.tar.xz
dnbd3-7b51c287a60d2f202fb131eeed9d1bf19b65a7a3.zip
[FUSE] Mid-refactoring, does not compile
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