summaryrefslogtreecommitdiffstats
path: root/server/query.h
diff options
context:
space:
mode:
authorLars Müller2008-03-01 19:30:38 +0100
committerLars Müller2008-03-01 19:30:38 +0100
commit868fec1f8eca7c344fc9ac057b7418331299d9ce (patch)
treec07cdf11db710dc495c3c7a513cc0f8fd68d6626 /server/query.h
downloaddnbd-868fec1f8eca7c344fc9ac057b7418331299d9ce.tar.gz
dnbd-868fec1f8eca7c344fc9ac057b7418331299d9ce.tar.xz
dnbd-868fec1f8eca7c344fc9ac057b7418331299d9ce.zip
Import dnbd* from the former openslx-contrib repo as of revision 92.
openslx-contrib is currently read only and will get removed in some days. git-svn-id: http://svn.openslx.org/svn/openslx/contrib/dnbd/trunk@1592 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'server/query.h')
-rw-r--r--server/query.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/server/query.h b/server/query.h
new file mode 100644
index 0000000..f4a9376
--- /dev/null
+++ b/server/query.h
@@ -0,0 +1,42 @@
+#ifndef LINUX_DNBD_REQUEST_H
+#define LINUX_DNBD_REQUEST_H 1
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <time.h>
+
+#include "net.h"
+#include "filer.h"
+
+struct query_info {
+ pthread_t p_thread;
+ net_info_t *net_info;
+ filer_info_t *filer_info;
+ int id;
+};
+
+typedef struct query_info query_info_t;
+
+/* query information for requests and replies */
+struct query {
+ time_t time;
+ net_request_t request;
+ net_reply_t reply;
+};
+
+typedef struct query query_t;
+
+/* functions */
+query_info_t *query_init(net_info_t *, filer_info_t *, int id, int threads);
+
+/* host to network byte order */
+#include <endian.h>
+#if __BYTE_ORDER == __BIG_ENDIAN
+#define htonll(x) (x)
+#else
+#define htonll(x) bswap_64(x)
+#endif
+
+
+#endif