aboutsummaryrefslogtreecommitdiff
path: root/src/gns/gns.h
diff options
context:
space:
mode:
authorBertrand Marc <beberking@gmail.com>2012-05-02 21:43:37 +0200
committerBertrand Marc <beberking@gmail.com>2012-05-02 21:43:37 +0200
commit2b81464a43485fcc8ce079fafdee7b7a171835f4 (patch)
tree394774c0f735199b57d51a2d3840356317853fe1 /src/gns/gns.h
Imported Upstream version 0.9.2upstream/0.9.2
Diffstat (limited to 'src/gns/gns.h')
-rw-r--r--src/gns/gns.h97
1 files changed, 97 insertions, 0 deletions
diff --git a/src/gns/gns.h b/src/gns/gns.h
new file mode 100644
index 0000000..cb47c81
--- /dev/null
+++ b/src/gns/gns.h
@@ -0,0 +1,97 @@
+/*
+ This file is part of GNUnet
+ (C) 2012 Christian Grothoff (and other contributing authors)
+
+ GNUnet is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 2, or (at your
+ option) any later version.
+
+ GNUnet is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNUnet; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+ */
+
+/**
+ * @file gns/gns.h
+ * @brief IPC messages between GNS API and GNS service
+ * @author Martin Schanzenbach
+ */
+#ifndef GNS_H
+#define GNS_H
+
+GNUNET_NETWORK_STRUCT_BEGIN
+
+/**
+ * Message from client to GNS service to lookup records.
+ */
+struct GNUNET_GNS_ClientLookupMessage
+{
+ /**
+ * Header of type GNUNET_MESSAGE_TYPE_GNS_CLIENT_LOOKUP
+ */
+ struct GNUNET_MessageHeader header;
+
+ /**
+ * A key. TODO some uid
+ */
+ GNUNET_HashCode key;
+
+ /**
+ * Unique identifier for this request (for key collisions).
+ */
+ // FIXME: unaligned
+ uint64_t unique_id;
+
+ /**
+ * the type of record to look up
+ */
+ // FIXME: bad type - should be of GNUNET_GNS_RecordType
+ int type;
+
+ /* Followed by the name to look up */
+};
+
+
+/**
+ * Message from GNS service to client: new results.
+ */
+struct GNUNET_GNS_ClientResultMessage
+{
+ /**
+ * Header of type GNUNET_MESSAGE_TYPE_GNS_CLIENT_RESULT
+ */
+ struct GNUNET_MessageHeader header;
+
+ /**
+ * Unique identifier for this request (for key collisions).
+ */
+ // FIXME: unaligned
+ uint64_t unique_id;
+
+ /**
+ * A key. TODO some uid
+ * // FIXME: why hash?
+ */
+ GNUNET_HashCode key;
+
+ /**
+ * The number of records contained in response
+ */
+ uint32_t num_records;
+
+ // FIXME: what format has a GNS_Record?
+ /* followed by num_records GNUNET_GNS_Records*/
+
+};
+
+
+GNUNET_NETWORK_STRUCT_END
+
+#endif