diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-06-15 04:46:35 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-06-15 04:46:35 +0000 |
commit | f90483fc8b2a7ee72c0c5f82e714b3de1dd26a71 (patch) | |
tree | efa70facdba2a31f4e5bdfbef5f87b85aa807e10 /src/datastore/datastore.h | |
parent | 17b95ebf7226cc5ca4ee7d90ff0de874b0dc7576 (diff) | |
download | gnunet-f90483fc8b2a7ee72c0c5f82e714b3de1dd26a71.tar.gz gnunet-f90483fc8b2a7ee72c0c5f82e714b3de1dd26a71.zip |
stuff
Diffstat (limited to 'src/datastore/datastore.h')
-rw-r--r-- | src/datastore/datastore.h | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/src/datastore/datastore.h b/src/datastore/datastore.h index e6860efbb..9165c8af8 100644 --- a/src/datastore/datastore.h +++ b/src/datastore/datastore.h | |||
@@ -29,6 +29,108 @@ | |||
29 | 29 | ||
30 | #include "gnunet_util_lib.h" | 30 | #include "gnunet_util_lib.h" |
31 | 31 | ||
32 | /** | ||
33 | * Message from datastore service informing client about | ||
34 | * the current size of the datastore. | ||
35 | */ | ||
36 | struct SizeMessage | ||
37 | { | ||
38 | /** | ||
39 | * Type is GNUNET_MESSAGE_TYPE_DATASTORE_SIZE. | ||
40 | */ | ||
41 | struct GNUNET_MessageHeader header; | ||
42 | |||
43 | /** | ||
44 | * Always zero. | ||
45 | */ | ||
46 | uint32_t reserved GNUNET_PACKED; | ||
47 | |||
48 | /** | ||
49 | * Size of the datastore in bytes. | ||
50 | */ | ||
51 | uint64_t size GNUNET_PACKED; | ||
52 | }; | ||
53 | |||
54 | |||
55 | /** | ||
56 | * Message to the datastore service asking about specific | ||
57 | * content. | ||
58 | */ | ||
59 | struct GetMessage | ||
60 | { | ||
61 | /** | ||
62 | * Type is GNUNET_MESSAGE_TYPE_DATASTORE_GET. Size | ||
63 | * can either be "sizeof(struct GetMessage)" or | ||
64 | * "sizeof(struct GetMessage) - sizeof(GNUNET_HashCode)"! | ||
65 | */ | ||
66 | struct GNUNET_MessageHeader header; | ||
67 | |||
68 | /** | ||
69 | * Desired content type. | ||
70 | */ | ||
71 | uint32_t type GNUNET_PACKED; | ||
72 | |||
73 | /** | ||
74 | * Desired key (optional). Check the "size" of the | ||
75 | * header to see if the key is actually present. | ||
76 | */ | ||
77 | GNUNET_HashCode key GNUNET_PACKED; | ||
78 | |||
79 | }; | ||
80 | |||
81 | |||
82 | /** | ||
83 | * Message transmitting content from or to the datastore | ||
84 | * service. | ||
85 | */ | ||
86 | struct DataMessage | ||
87 | { | ||
88 | /** | ||
89 | * Type is either GNUNET_MESSAGE_TYPE_DATASTORE_PUT, | ||
90 | * GNUNET_MESSAGE_TYPE_DATASTORE_REMOVE or | ||
91 | * GNUNET_MESSAGE_TYPE_DATASTORE_DATA. Depending on the message | ||
92 | * type, some fields may simply have values of zero. | ||
93 | */ | ||
94 | struct GNUNET_MessageHeader header; | ||
95 | |||
96 | /** | ||
97 | * Always zero. | ||
98 | */ | ||
99 | uint32_t reserved GNUNET_PACKED; | ||
100 | |||
101 | /** | ||
102 | * Number of bytes in the item (NBO). | ||
103 | */ | ||
104 | uint32_t size GNUNET_PACKED; | ||
105 | |||
106 | /** | ||
107 | * Type of the item (NBO), zero for remove. | ||
108 | */ | ||
109 | uint32_t type GNUNET_PACKED; | ||
110 | |||
111 | /** | ||
112 | * Priority of the item (NBO), zero for remove. | ||
113 | */ | ||
114 | uint32_t priority GNUNET_PACKED; | ||
115 | |||
116 | /** | ||
117 | * Desired anonymity level (NBO), zero for remove. | ||
118 | */ | ||
119 | uint32_t anonymity GNUNET_PACKED; | ||
120 | |||
121 | /** | ||
122 | * Expiration time (NBO); zero for remove. | ||
123 | */ | ||
124 | struct GNUNET_TIME_AbsoluteNBO expiration; | ||
125 | |||
126 | /** | ||
127 | * Key under which the item can be found. | ||
128 | */ | ||
129 | GNUNET_HashCode key GNUNET_PACKED; | ||
130 | |||
131 | }; | ||
132 | |||
133 | |||
32 | 134 | ||
33 | 135 | ||
34 | #endif | 136 | #endif |