aboutsummaryrefslogtreecommitdiff
path: root/src/credential/credential_serialization.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/credential/credential_serialization.h')
-rw-r--r--src/credential/credential_serialization.h94
1 files changed, 54 insertions, 40 deletions
diff --git a/src/credential/credential_serialization.h b/src/credential/credential_serialization.h
index 426034164..65326de31 100644
--- a/src/credential/credential_serialization.h
+++ b/src/credential/credential_serialization.h
@@ -42,8 +42,9 @@
42 * @return the required size to serialize 42 * @return the required size to serialize
43 */ 43 */
44size_t 44size_t
45GNUNET_CREDENTIAL_delegation_set_get_size(unsigned int ds_count, 45GNUNET_CREDENTIAL_delegation_set_get_size (unsigned int ds_count,
46 const struct GNUNET_CREDENTIAL_DelegationSet *dsr); 46 const struct
47 GNUNET_CREDENTIAL_DelegationSet *dsr);
47 48
48/** 49/**
49 * Serizalize the given delegation record entries 50 * Serizalize the given delegation record entries
@@ -55,10 +56,11 @@ GNUNET_CREDENTIAL_delegation_set_get_size(unsigned int ds_count,
55 * @return the size of the data, -1 on failure 56 * @return the size of the data, -1 on failure
56 */ 57 */
57ssize_t 58ssize_t
58GNUNET_CREDENTIAL_delegation_set_serialize(unsigned int d_count, 59GNUNET_CREDENTIAL_delegation_set_serialize (unsigned int d_count,
59 const struct GNUNET_CREDENTIAL_DelegationSet *dsr, 60 const struct
60 size_t dest_size, 61 GNUNET_CREDENTIAL_DelegationSet *dsr,
61 char *dest); 62 size_t dest_size,
63 char *dest);
62 64
63 65
64/** 66/**
@@ -71,10 +73,12 @@ GNUNET_CREDENTIAL_delegation_set_serialize(unsigned int d_count,
71 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 73 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
72 */ 74 */
73int 75int
74GNUNET_CREDENTIAL_delegation_set_deserialize(size_t len, 76GNUNET_CREDENTIAL_delegation_set_deserialize (size_t len,
75 const char *src, 77 const char *src,
76 unsigned int d_count, 78 unsigned int d_count,
77 struct GNUNET_CREDENTIAL_DelegationSet *dsr); 79 struct
80 GNUNET_CREDENTIAL_DelegationSet *
81 dsr);
78 82
79/** 83/**
80 * Calculate how many bytes we will need to serialize 84 * Calculate how many bytes we will need to serialize
@@ -87,10 +91,12 @@ GNUNET_CREDENTIAL_delegation_set_deserialize(size_t len,
87 * @return the required size to serialize 91 * @return the required size to serialize
88 */ 92 */
89size_t 93size_t
90GNUNET_CREDENTIAL_delegation_chain_get_size(unsigned int d_count, 94GNUNET_CREDENTIAL_delegation_chain_get_size (unsigned int d_count,
91 const struct GNUNET_CREDENTIAL_Delegation *dd, 95 const struct
92 unsigned int c_count, 96 GNUNET_CREDENTIAL_Delegation *dd,
93 const struct GNUNET_CREDENTIAL_Credential *cd); 97 unsigned int c_count,
98 const struct
99 GNUNET_CREDENTIAL_Credential *cd);
94 100
95/** 101/**
96 * Serizalize the given delegation chain entries and credential 102 * Serizalize the given delegation chain entries and credential
@@ -104,12 +110,14 @@ GNUNET_CREDENTIAL_delegation_chain_get_size(unsigned int d_count,
104 * @return the size of the data, -1 on failure 110 * @return the size of the data, -1 on failure
105 */ 111 */
106ssize_t 112ssize_t
107GNUNET_CREDENTIAL_delegation_chain_serialize(unsigned int d_count, 113GNUNET_CREDENTIAL_delegation_chain_serialize (unsigned int d_count,
108 const struct GNUNET_CREDENTIAL_Delegation *dd, 114 const struct
109 unsigned int c_count, 115 GNUNET_CREDENTIAL_Delegation *dd,
110 const struct GNUNET_CREDENTIAL_Credential *cd, 116 unsigned int c_count,
111 size_t dest_size, 117 const struct
112 char *dest); 118 GNUNET_CREDENTIAL_Credential *cd,
119 size_t dest_size,
120 char *dest);
113 121
114 122
115/** 123/**
@@ -124,36 +132,42 @@ GNUNET_CREDENTIAL_delegation_chain_serialize(unsigned int d_count,
124 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 132 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
125 */ 133 */
126int 134int
127GNUNET_CREDENTIAL_delegation_chain_deserialize(size_t len, 135GNUNET_CREDENTIAL_delegation_chain_deserialize (size_t len,
128 const char *src, 136 const char *src,
129 unsigned int d_count, 137 unsigned int d_count,
130 struct GNUNET_CREDENTIAL_Delegation *dd, 138 struct
131 unsigned int c_count, 139 GNUNET_CREDENTIAL_Delegation *dd,
132 struct GNUNET_CREDENTIAL_Credential *cd); 140 unsigned int c_count,
141 struct
142 GNUNET_CREDENTIAL_Credential *cd);
133size_t 143size_t
134GNUNET_CREDENTIAL_credentials_get_size(unsigned int c_count, 144GNUNET_CREDENTIAL_credentials_get_size (unsigned int c_count,
135 const struct GNUNET_CREDENTIAL_Credential *cd); 145 const struct
146 GNUNET_CREDENTIAL_Credential *cd);
136 147
137ssize_t 148ssize_t
138GNUNET_CREDENTIAL_credentials_serialize(unsigned int c_count, 149GNUNET_CREDENTIAL_credentials_serialize (unsigned int c_count,
139 const struct GNUNET_CREDENTIAL_Credential *cd, 150 const struct
140 size_t dest_size, 151 GNUNET_CREDENTIAL_Credential *cd,
141 char *dest); 152 size_t dest_size,
153 char *dest);
142 154
143 155
144int 156int
145GNUNET_CREDENTIAL_credentials_deserialize(size_t len, 157GNUNET_CREDENTIAL_credentials_deserialize (size_t len,
146 const char *src, 158 const char *src,
147 unsigned int c_count, 159 unsigned int c_count,
148 struct GNUNET_CREDENTIAL_Credential *cd); 160 struct GNUNET_CREDENTIAL_Credential *
161 cd);
149 162
150 163
151int 164int
152GNUNET_CREDENTIAL_credential_serialize(struct GNUNET_CREDENTIAL_Credential *cred, 165GNUNET_CREDENTIAL_credential_serialize (struct
153 char **data); 166 GNUNET_CREDENTIAL_Credential *cred,
167 char **data);
154 168
155struct GNUNET_CREDENTIAL_Credential* 169struct GNUNET_CREDENTIAL_Credential*
156GNUNET_CREDENTIAL_credential_deserialize(const char* data, 170GNUNET_CREDENTIAL_credential_deserialize (const char*data,
157 size_t data_size); 171 size_t data_size);
158#endif 172#endif
159/* end of credential_serialization.h */ 173/* end of credential_serialization.h */