aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_reclaim_attribute_lib.h
diff options
context:
space:
mode:
authorSchanzenbach, Martin <mschanzenbach@posteo.de>2019-04-11 20:25:11 +0200
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2019-04-14 10:01:23 +0200
commit94f8e5437da8cc1c5ee38a333da2e1c68b3289f1 (patch)
tree8f56950954baccbc7e1867f9ac01144b419a4798 /src/include/gnunet_reclaim_attribute_lib.h
parent61625d4834bc7a599446486c9d16f2451527f989 (diff)
downloadgnunet-94f8e5437da8cc1c5ee38a333da2e1c68b3289f1.tar.gz
gnunet-94f8e5437da8cc1c5ee38a333da2e1c68b3289f1.zip
RECLAIM: Start move to GNS encryption
Diffstat (limited to 'src/include/gnunet_reclaim_attribute_lib.h')
-rw-r--r--src/include/gnunet_reclaim_attribute_lib.h44
1 files changed, 24 insertions, 20 deletions
diff --git a/src/include/gnunet_reclaim_attribute_lib.h b/src/include/gnunet_reclaim_attribute_lib.h
index 1f26927b2..db009da3f 100644
--- a/src/include/gnunet_reclaim_attribute_lib.h
+++ b/src/include/gnunet_reclaim_attribute_lib.h
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
@@ -59,10 +59,9 @@ extern "C"
59struct GNUNET_RECLAIM_ATTRIBUTE_Claim 59struct GNUNET_RECLAIM_ATTRIBUTE_Claim
60{ 60{
61 /** 61 /**
62 * The name of the attribute. Note "name" must never be individually 62 * ID
63 * free'd
64 */ 63 */
65 const char* name; 64 uint64_t id;
66 65
67 /** 66 /**
68 * Type of Claim 67 * Type of Claim
@@ -73,6 +72,11 @@ struct GNUNET_RECLAIM_ATTRIBUTE_Claim
73 * Version 72 * Version
74 */ 73 */
75 uint32_t version; 74 uint32_t version;
75 /**
76 * The name of the attribute. Note "name" must never be individually
77 * free'd
78 */
79 const char* name;
76 80
77 /** 81 /**
78 * Number of bytes in @e data. 82 * Number of bytes in @e data.
@@ -130,9 +134,9 @@ struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry
130 */ 134 */
131struct GNUNET_RECLAIM_ATTRIBUTE_Claim * 135struct GNUNET_RECLAIM_ATTRIBUTE_Claim *
132GNUNET_RECLAIM_ATTRIBUTE_claim_new (const char* attr_name, 136GNUNET_RECLAIM_ATTRIBUTE_claim_new (const char* attr_name,
133 uint32_t type, 137 uint32_t type,
134 const void* data, 138 const void* data,
135 size_t data_size); 139 size_t data_size);
136 140
137 141
138/** 142/**
@@ -150,10 +154,10 @@ GNUNET_RECLAIM_ATTRIBUTE_list_destroy (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList
150 154
151void 155void
152GNUNET_RECLAIM_ATTRIBUTE_list_add (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs, 156GNUNET_RECLAIM_ATTRIBUTE_list_add (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs,
153 const char* attr_name, 157 const char* attr_name,
154 uint32_t type, 158 uint32_t type,
155 const void* data, 159 const void* data,
156 size_t data_size); 160 size_t data_size);
157 161
158/** 162/**
159 * Serialize an attribute list 163 * Serialize an attribute list
@@ -165,7 +169,7 @@ GNUNET_RECLAIM_ATTRIBUTE_list_add (struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *at
165 */ 169 */
166size_t 170size_t
167GNUNET_RECLAIM_ATTRIBUTE_list_serialize (const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs, 171GNUNET_RECLAIM_ATTRIBUTE_list_serialize (const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs,
168 char *result); 172 char *result);
169 173
170/** 174/**
171 * Deserialize an attribute list 175 * Deserialize an attribute list
@@ -177,7 +181,7 @@ GNUNET_RECLAIM_ATTRIBUTE_list_serialize (const struct GNUNET_RECLAIM_ATTRIBUTE_C
177 */ 181 */
178struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList * 182struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *
179GNUNET_RECLAIM_ATTRIBUTE_list_deserialize (const char* data, 183GNUNET_RECLAIM_ATTRIBUTE_list_deserialize (const char* data,
180 size_t data_size); 184 size_t data_size);
181 185
182 186
183/** 187/**
@@ -202,7 +206,7 @@ GNUNET_RECLAIM_ATTRIBUTE_serialize_get_size (const struct GNUNET_RECLAIM_ATTRIBU
202 */ 206 */
203size_t 207size_t
204GNUNET_RECLAIM_ATTRIBUTE_serialize (const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, 208GNUNET_RECLAIM_ATTRIBUTE_serialize (const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr,
205 char *result); 209 char *result);
206 210
207/** 211/**
208 * Deserialize an attribute 212 * Deserialize an attribute
@@ -214,7 +218,7 @@ GNUNET_RECLAIM_ATTRIBUTE_serialize (const struct GNUNET_RECLAIM_ATTRIBUTE_Claim
214 */ 218 */
215struct GNUNET_RECLAIM_ATTRIBUTE_Claim * 219struct GNUNET_RECLAIM_ATTRIBUTE_Claim *
216GNUNET_RECLAIM_ATTRIBUTE_deserialize (const char* data, 220GNUNET_RECLAIM_ATTRIBUTE_deserialize (const char* data,
217 size_t data_size); 221 size_t data_size);
218 222
219struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList* 223struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList*
220GNUNET_RECLAIM_ATTRIBUTE_list_dup (const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs); 224GNUNET_RECLAIM_ATTRIBUTE_list_dup (const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs);
@@ -240,9 +244,9 @@ GNUNET_RECLAIM_ATTRIBUTE_typename_to_number (const char *typename);
240 */ 244 */
241int 245int
242GNUNET_RECLAIM_ATTRIBUTE_string_to_value (uint32_t type, 246GNUNET_RECLAIM_ATTRIBUTE_string_to_value (uint32_t type,
243 const char *s, 247 const char *s,
244 void **data, 248 void **data,
245 size_t *data_size); 249 size_t *data_size);
246 250
247/** 251/**
248 * Convert the 'claim' of an attribute to a string 252 * Convert the 'claim' of an attribute to a string
@@ -254,8 +258,8 @@ GNUNET_RECLAIM_ATTRIBUTE_string_to_value (uint32_t type,
254 */ 258 */
255char * 259char *
256GNUNET_RECLAIM_ATTRIBUTE_value_to_string (uint32_t type, 260GNUNET_RECLAIM_ATTRIBUTE_value_to_string (uint32_t type,
257 const void* data, 261 const void* data,
258 size_t data_size); 262 size_t data_size);
259 263
260/** 264/**
261 * Convert a type number to the corresponding type string 265 * Convert a type number to the corresponding type string