diff options
author | Florian Dold <florian.dold@gmail.com> | 2013-04-24 11:48:31 +0000 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2013-04-24 11:48:31 +0000 |
commit | 9113520987972a798a23d1d21544d8ec4daa078c (patch) | |
tree | 178a1bca3b9083d554de20227cd0a8f1190c958c /src/include | |
parent | 6a9bc072e64367297498b93cd6d975995203d2e9 (diff) | |
download | gnunet-9113520987972a798a23d1d21544d8ec4daa078c.tar.gz gnunet-9113520987972a798a23d1d21544d8ec4daa078c.zip |
started implementing union operation for set
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_applications.h | 6 | ||||
-rw-r--r-- | src/include/gnunet_protocols.h | 33 | ||||
-rw-r--r-- | src/include/gnunet_set_service.h | 21 |
3 files changed, 46 insertions, 14 deletions
diff --git a/src/include/gnunet_applications.h b/src/include/gnunet_applications.h index 5710a8838..4e86e332e 100644 --- a/src/include/gnunet_applications.h +++ b/src/include/gnunet_applications.h | |||
@@ -77,6 +77,12 @@ extern "C" | |||
77 | #define GNUNET_APPLICATION_TYPE_CONSENSUS 18 | 77 | #define GNUNET_APPLICATION_TYPE_CONSENSUS 18 |
78 | 78 | ||
79 | 79 | ||
80 | /** | ||
81 | * Set. Used for two-peer set operations implemented using stream. | ||
82 | */ | ||
83 | #define GNUNET_APPLICATION_TYPE_SET 19 | ||
84 | |||
85 | |||
80 | #if 0 /* keep Emacsens' auto-indent happy */ | 86 | #if 0 /* keep Emacsens' auto-indent happy */ |
81 | { | 87 | { |
82 | #endif | 88 | #endif |
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h index ae28da7b1..33e97b80c 100644 --- a/src/include/gnunet_protocols.h +++ b/src/include/gnunet_protocols.h | |||
@@ -1807,10 +1807,41 @@ extern "C" | |||
1807 | #define GNUNET_MESSAGE_TYPE_SET_REQUEST 578 | 1807 | #define GNUNET_MESSAGE_TYPE_SET_REQUEST 578 |
1808 | 1808 | ||
1809 | /** | 1809 | /** |
1810 | * Evaluate a set operation | 1810 | * Evaluate a set operation. |
1811 | */ | 1811 | */ |
1812 | #define GNUNET_MESSAGE_TYPE_SET_CREATE 579 | 1812 | #define GNUNET_MESSAGE_TYPE_SET_CREATE 579 |
1813 | 1813 | ||
1814 | /** | ||
1815 | * Evaluate a set operation. | ||
1816 | */ | ||
1817 | #define GNUNET_MESSAGE_TYPE_SET_P2P_OPERATION_REQUEST 580 | ||
1818 | |||
1819 | /** | ||
1820 | * Strata estimator. | ||
1821 | */ | ||
1822 | #define GNUNET_MESSAGE_TYPE_SET_P2P_SE 581 | ||
1823 | |||
1824 | /** | ||
1825 | * Invertible bloom filter. | ||
1826 | */ | ||
1827 | #define GNUNET_MESSAGE_TYPE_SET_P2P_IBF 582 | ||
1828 | |||
1829 | /** | ||
1830 | * Actual set elements. | ||
1831 | */ | ||
1832 | #define GNUNET_MESSAGE_TYPE_SET_P2P_ELEMENTS 583 | ||
1833 | |||
1834 | /** | ||
1835 | * Requests for the elements with the given hashes. | ||
1836 | */ | ||
1837 | #define GNUNET_MESSAGE_TYPE_SET_P2P_ELEMENT_REQUESTS 584 | ||
1838 | |||
1839 | /** | ||
1840 | * Operation is done. | ||
1841 | */ | ||
1842 | #define GNUNET_MESSAGE_TYPE_SET_P2P_DONE 585 | ||
1843 | |||
1844 | |||
1814 | 1845 | ||
1815 | /******************************************************************************* | 1846 | /******************************************************************************* |
1816 | * TESTBED LOGGER message types | 1847 | * TESTBED LOGGER message types |
diff --git a/src/include/gnunet_set_service.h b/src/include/gnunet_set_service.h index cf782c841..87d766c68 100644 --- a/src/include/gnunet_set_service.h +++ b/src/include/gnunet_set_service.h | |||
@@ -63,11 +63,6 @@ struct GNUNET_SET_OperationHandle; | |||
63 | 63 | ||
64 | 64 | ||
65 | /** | 65 | /** |
66 | * Opaque handle to a listen operation. | ||
67 | */ | ||
68 | struct GNUNET_SET_ListenHandle; | ||
69 | |||
70 | /** | ||
71 | * The operation that a set set supports. | 66 | * The operation that a set set supports. |
72 | */ | 67 | */ |
73 | enum GNUNET_SET_OperationType | 68 | enum GNUNET_SET_OperationType |
@@ -135,10 +130,12 @@ struct GNUNET_SET_Element | |||
135 | * Number of bytes in the buffer pointed to by data. | 130 | * Number of bytes in the buffer pointed to by data. |
136 | */ | 131 | */ |
137 | uint16_t size; | 132 | uint16_t size; |
133 | |||
138 | /** | 134 | /** |
139 | * Application-specific element type. | 135 | * Application-specific element type. |
140 | */ | 136 | */ |
141 | uint16_t type; | 137 | uint16_t type; |
138 | |||
142 | /** | 139 | /** |
143 | * Actual data of the element | 140 | * Actual data of the element |
144 | */ | 141 | */ |
@@ -153,6 +150,7 @@ struct GNUNET_SET_Element | |||
153 | */ | 150 | */ |
154 | typedef void (*GNUNET_SET_Continuation) (void *cls); | 151 | typedef void (*GNUNET_SET_Continuation) (void *cls); |
155 | 152 | ||
153 | |||
156 | /** | 154 | /** |
157 | * Callback for set operation results. Called for each element | 155 | * Callback for set operation results. Called for each element |
158 | * in the result set. | 156 | * in the result set. |
@@ -161,10 +159,9 @@ typedef void (*GNUNET_SET_Continuation) (void *cls); | |||
161 | * @param element a result element, only valid if status is GNUNET_SET_STATUS_OK | 159 | * @param element a result element, only valid if status is GNUNET_SET_STATUS_OK |
162 | * @param status see enum GNUNET_SET_Status | 160 | * @param status see enum GNUNET_SET_Status |
163 | */ | 161 | */ |
164 | typedef void | 162 | typedef void (*GNUNET_SET_ResultIterator) (void *cls, |
165 | (*GNUNET_SET_ResultIterator) (void *cls, | 163 | struct GNUNET_SET_Element *element, |
166 | struct GNUNET_SET_Element *element, | 164 | enum GNUNET_SET_Status status); |
167 | enum GNUNET_SET_Status status); | ||
168 | 165 | ||
169 | 166 | ||
170 | /** | 167 | /** |
@@ -201,7 +198,7 @@ typedef void | |||
201 | * @return a handle to the set | 198 | * @return a handle to the set |
202 | */ | 199 | */ |
203 | struct GNUNET_SET_Handle * | 200 | struct GNUNET_SET_Handle * |
204 | GNUNET_SET_create (struct GNUNET_CONFIGURATION_Handle *cfg, | 201 | GNUNET_SET_create (const struct GNUNET_CONFIGURATION_Handle *cfg, |
205 | enum GNUNET_SET_OperationType op); | 202 | enum GNUNET_SET_OperationType op); |
206 | 203 | ||
207 | 204 | ||
@@ -270,8 +267,6 @@ GNUNET_SET_evaluate (struct GNUNET_SET_Handle *set, | |||
270 | void *result_cls); | 267 | void *result_cls); |
271 | 268 | ||
272 | 269 | ||
273 | |||
274 | |||
275 | /** | 270 | /** |
276 | * Wait for set operation requests for the given application id | 271 | * Wait for set operation requests for the given application id |
277 | * | 272 | * |
@@ -285,7 +280,7 @@ GNUNET_SET_evaluate (struct GNUNET_SET_Handle *set, | |||
285 | * @return a handle that can be used to cancel the listen operation | 280 | * @return a handle that can be used to cancel the listen operation |
286 | */ | 281 | */ |
287 | struct GNUNET_SET_ListenHandle * | 282 | struct GNUNET_SET_ListenHandle * |
288 | GNUNET_SET_listen (struct GNUNET_CONFIGURATION_Handle *cfg, | 283 | GNUNET_SET_listen (const struct GNUNET_CONFIGURATION_Handle *cfg, |
289 | enum GNUNET_SET_OperationType op_type, | 284 | enum GNUNET_SET_OperationType op_type, |
290 | const struct GNUNET_HashCode *app_id, | 285 | const struct GNUNET_HashCode *app_id, |
291 | GNUNET_SET_ListenCallback listen_cb, | 286 | GNUNET_SET_ListenCallback listen_cb, |