aboutsummaryrefslogtreecommitdiff
path: root/src/gns/gns.h
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2012-03-05 21:49:42 +0000
committerMartin Schanzenbach <mschanzenbach@posteo.de>2012-03-05 21:49:42 +0000
commit9b187e018ab2565f4ce119eda94f916ec053cc7e (patch)
treedc212a097dc9f6a9e2c0dd4f2b10bd577b834bff /src/gns/gns.h
parent3ed2943313b62b41fa92b90eb92d5bd9bbce7843 (diff)
downloadgnunet-9b187e018ab2565f4ce119eda94f916ec053cc7e.tar.gz
gnunet-9b187e018ab2565f4ce119eda94f916ec053cc7e.zip
-started some gns service api
Diffstat (limited to 'src/gns/gns.h')
-rw-r--r--src/gns/gns.h62
1 files changed, 56 insertions, 6 deletions
diff --git a/src/gns/gns.h b/src/gns/gns.h
index cb47c817a..df964939a 100644
--- a/src/gns/gns.h
+++ b/src/gns/gns.h
@@ -18,6 +18,8 @@
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19 */ 19 */
20 20
21#include "gnunet_gns_service.h"
22
21/** 23/**
22 * @file gns/gns.h 24 * @file gns/gns.h
23 * @brief IPC messages between GNS API and GNS service 25 * @brief IPC messages between GNS API and GNS service
@@ -46,14 +48,13 @@ struct GNUNET_GNS_ClientLookupMessage
46 /** 48 /**
47 * Unique identifier for this request (for key collisions). 49 * Unique identifier for this request (for key collisions).
48 */ 50 */
49 // FIXME: unaligned 51 uint64_t unique_id GNUNET_PACKED;
50 uint64_t unique_id;
51 52
52 /** 53 /**
53 * the type of record to look up 54 * the type of record to look up
54 */ 55 */
55 // FIXME: bad type - should be of GNUNET_GNS_RecordType 56 // FIXME: bad type - should be of GNUNET_GNS_RecordType
56 int type; 57 enum GNUNET_GNS_RecordType type;
57 58
58 /* Followed by the name to look up */ 59 /* Followed by the name to look up */
59}; 60};
@@ -62,7 +63,7 @@ struct GNUNET_GNS_ClientLookupMessage
62/** 63/**
63 * Message from GNS service to client: new results. 64 * Message from GNS service to client: new results.
64 */ 65 */
65struct GNUNET_GNS_ClientResultMessage 66struct GNUNET_GNS_ClientLookupResultMessage
66{ 67{
67 /** 68 /**
68 * Header of type GNUNET_MESSAGE_TYPE_GNS_CLIENT_RESULT 69 * Header of type GNUNET_MESSAGE_TYPE_GNS_CLIENT_RESULT
@@ -84,14 +85,63 @@ struct GNUNET_GNS_ClientResultMessage
84 /** 85 /**
85 * The number of records contained in response 86 * The number of records contained in response
86 */ 87 */
87 uint32_t num_records; 88 uint32_t rd_count;
88 89
89 // FIXME: what format has a GNS_Record? 90 // FIXME: what format has a GNS_Record?
90 /* followed by num_records GNUNET_GNS_Records*/ 91 /* followed by rd_count GNUNET_NAMESTORE_RecordData structs*/
91 92
92}; 93};
93 94
95/**
96 * Message from client to GNS service to lookup records.
97 */
98struct GNUNET_GNS_ClientShortenMessage
99{
100 /**
101 * Header of type GNUNET_MESSAGE_TYPE_GNS_CLIENT_SHORTEN
102 */
103 struct GNUNET_MessageHeader header;
104
105 /**
106 * A key. TODO some uid
107 */
108 GNUNET_HashCode key;
109
110 /**
111 * Unique identifier for this request (for key collisions).
112 */
113 // FIXME: unaligned
114 uint64_t unique_id GNUNET_PACKED;
115
116 /* Followed by the name to shorten up */
117};
94 118
119
120/**
121 * Message from GNS service to client: shorten result.
122 */
123struct GNUNET_GNS_ClientShortenResultMessage
124{
125 /**
126 * Header of type GNUNET_MESSAGE_TYPE_GNS_CLIENT_SHORTEN_RESULT
127 */
128 struct GNUNET_MessageHeader header;
129
130 /**
131 * Unique identifier for this request (for key collisions).
132 */
133 // FIXME: unaligned
134 uint64_t unique_id GNUNET_PACKED;
135
136 /**
137 * A key. TODO some uid
138 * // FIXME: why hash?
139 */
140 GNUNET_HashCode key;
141
142 /* followed by the shortened name or '\0' for no result*/
143
144};
95GNUNET_NETWORK_STRUCT_END 145GNUNET_NETWORK_STRUCT_END
96 146
97#endif 147#endif