diff options
author | Christian Fuchs <christian.fuchs@cfuchs.net> | 2013-10-04 14:20:04 +0000 |
---|---|---|
committer | Christian Fuchs <christian.fuchs@cfuchs.net> | 2013-10-04 14:20:04 +0000 |
commit | c53de7e597b8f10efe19b0e44e879a4c7a431580 (patch) | |
tree | ea8075bc4d6fd6343b3a90cec3e578d2a9df0a91 /src/scalarproduct/scalarproduct.h | |
parent | c7d80251ce87a5015409446d9ac93658ad5ca5d7 (diff) | |
download | gnunet-c53de7e597b8f10efe19b0e44e879a4c7a431580.tar.gz gnunet-c53de7e597b8f10efe19b0e44e879a4c7a431580.zip |
added first part of multipart-message support to SP
extended and renamed properties in existing structs and message formats for multipart support
fixed a memory leak
Diffstat (limited to 'src/scalarproduct/scalarproduct.h')
-rw-r--r-- | src/scalarproduct/scalarproduct.h | 43 |
1 files changed, 35 insertions, 8 deletions
diff --git a/src/scalarproduct/scalarproduct.h b/src/scalarproduct/scalarproduct.h index 02c6d8b21..af2e251e1 100644 --- a/src/scalarproduct/scalarproduct.h +++ b/src/scalarproduct/scalarproduct.h | |||
@@ -106,6 +106,16 @@ struct GNUNET_SCALARPRODUCT_service_request { | |||
106 | struct GNUNET_MessageHeader header; | 106 | struct GNUNET_MessageHeader header; |
107 | 107 | ||
108 | /** | 108 | /** |
109 | * how many elements the total message including all multipart msgs contains | ||
110 | */ | ||
111 | uint32_t total_element_count GNUNET_PACKED; | ||
112 | |||
113 | /** | ||
114 | * how many elements are actually included after the mask was applied. | ||
115 | */ | ||
116 | uint32_t contained_element_count GNUNET_PACKED; | ||
117 | |||
118 | /** | ||
109 | * how many bytes the mask has | 119 | * how many bytes the mask has |
110 | */ | 120 | */ |
111 | uint32_t mask_length GNUNET_PACKED; | 121 | uint32_t mask_length GNUNET_PACKED; |
@@ -126,13 +136,25 @@ struct GNUNET_SCALARPRODUCT_service_request { | |||
126 | uint32_t element_count GNUNET_PACKED; | 136 | uint32_t element_count GNUNET_PACKED; |
127 | 137 | ||
128 | /** | 138 | /** |
129 | * how many elements are actually included after the mask was applied. | 139 | * followed by mask | public_key | vector[used_element_count] |
130 | */ | 140 | */ |
131 | uint32_t used_element_count GNUNET_PACKED; | 141 | }; |
132 | 142 | ||
143 | /** | ||
144 | * Multipart Message type passed between to supply additional elements for the peer | ||
145 | */ | ||
146 | struct GNUNET_SCALARPRODUCT_multipart_message { | ||
133 | /** | 147 | /** |
134 | * followed by mask | public_key | vector[used_element_count] | 148 | * GNUNET message header |
135 | */ | 149 | */ |
150 | struct GNUNET_MessageHeader header; | ||
151 | |||
152 | /** | ||
153 | * how many elements we supply within this message | ||
154 | */ | ||
155 | uint32_t multipart_element_count GNUNET_PACKED; | ||
156 | |||
157 | // followed by vector[multipart_element_count] or k[i][perm] | ||
136 | }; | 158 | }; |
137 | 159 | ||
138 | /** | 160 | /** |
@@ -146,14 +168,19 @@ struct GNUNET_SCALARPRODUCT_service_response { | |||
146 | struct GNUNET_MessageHeader header; | 168 | struct GNUNET_MessageHeader header; |
147 | 169 | ||
148 | /** | 170 | /** |
149 | * how many elements the vector in payload contains | 171 | * how many elements the session input had |
150 | */ | 172 | */ |
151 | uint32_t element_count GNUNET_PACKED; | 173 | uint32_t total_element_count GNUNET_PACKED; |
152 | 174 | ||
153 | /** | 175 | /** |
154 | * how many elements are actually included after the mask was applied. | 176 | * how many elements were included after the mask was applied including all multipart msgs. |
155 | */ | 177 | */ |
156 | uint32_t used_element_count GNUNET_PACKED; | 178 | uint32_t used_element_count GNUNET_PACKED; |
179 | |||
180 | /** | ||
181 | * how many elements this individual message delivers | ||
182 | */ | ||
183 | uint32_t contained_element_count GNUNET_PACKED; | ||
157 | 184 | ||
158 | /** | 185 | /** |
159 | * the transaction/session key used to identify a session | 186 | * the transaction/session key used to identify a session |
@@ -161,7 +188,7 @@ struct GNUNET_SCALARPRODUCT_service_response { | |||
161 | struct GNUNET_HashCode key; | 188 | struct GNUNET_HashCode key; |
162 | 189 | ||
163 | /** | 190 | /** |
164 | * followed by s | s' | kp[] | kq[] | 191 | * followed by s | s' | k[i][perm] |
165 | */ | 192 | */ |
166 | }; | 193 | }; |
167 | 194 | ||