diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-01-18 11:43:09 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-01-18 11:43:09 +0100 |
commit | 965d792189fa54bc9423f643cd8dccb681632b41 (patch) | |
tree | 7a7b72c753deaf7adc20951a046b4cde9c5e69d5 /src/cadet/cadet_protocol.h | |
parent | a1bd2dcc29c126023dbd1ddf83d7514859d1775b (diff) | |
download | gnunet-965d792189fa54bc9423f643cd8dccb681632b41.tar.gz gnunet-965d792189fa54bc9423f643cd8dccb681632b41.zip |
introduce CadetEncryptedMessageIdentifier instead of over-using uint32_t
Diffstat (limited to 'src/cadet/cadet_protocol.h')
-rw-r--r-- | src/cadet/cadet_protocol.h | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/cadet/cadet_protocol.h b/src/cadet/cadet_protocol.h index c45c4c684..2a0de2a8f 100644 --- a/src/cadet/cadet_protocol.h +++ b/src/cadet/cadet_protocol.h | |||
@@ -162,6 +162,23 @@ struct GNUNET_CADET_ConnectionDestroyMessage | |||
162 | 162 | ||
163 | 163 | ||
164 | /** | 164 | /** |
165 | * Unique identifier (counter) for an encrypted message in a channel. | ||
166 | * Used to match #GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED_HOP_BY_HOP_ACK | ||
167 | * and #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_HOP_BY_HOP_POLL messages | ||
168 | * against the respective #GNUNET_MESSAGE_TYPE_CONNECTION_ENCRYPTED | ||
169 | * messages. | ||
170 | */ | ||
171 | struct CadetEncryptedMessageIdentifier | ||
172 | { | ||
173 | /** | ||
174 | * This number is incremented by one per message. It may wrap around. | ||
175 | * In network byte order. | ||
176 | */ | ||
177 | uint32_t pid GNUNET_PACKED; | ||
178 | }; | ||
179 | |||
180 | |||
181 | /** | ||
165 | * Message to acknowledge cadet encrypted traffic. | 182 | * Message to acknowledge cadet encrypted traffic. |
166 | */ | 183 | */ |
167 | struct GNUNET_CADET_ConnectionEncryptedAckMessage | 184 | struct GNUNET_CADET_ConnectionEncryptedAckMessage |
@@ -174,7 +191,7 @@ struct GNUNET_CADET_ConnectionEncryptedAckMessage | |||
174 | /** | 191 | /** |
175 | * Maximum packet ID authorized. | 192 | * Maximum packet ID authorized. |
176 | */ | 193 | */ |
177 | uint32_t ack GNUNET_PACKED; | 194 | struct CadetEncryptedMessageIdentifier cemi; |
178 | 195 | ||
179 | /** | 196 | /** |
180 | * ID of the connection. | 197 | * ID of the connection. |
@@ -196,7 +213,7 @@ struct GNUNET_CADET_ConnectionHopByHopPollMessage | |||
196 | /** | 213 | /** |
197 | * Last packet sent. | 214 | * Last packet sent. |
198 | */ | 215 | */ |
199 | uint32_t pid GNUNET_PACKED; | 216 | struct CadetEncryptedMessageIdentifier cemi; |
200 | 217 | ||
201 | /** | 218 | /** |
202 | * ID of the connection. | 219 | * ID of the connection. |
@@ -278,7 +295,7 @@ struct GNUNET_CADET_ConnectionEncryptedMessage | |||
278 | /** | 295 | /** |
279 | * ID of the packet (hop by hop). | 296 | * ID of the packet (hop by hop). |
280 | */ | 297 | */ |
281 | uint32_t pid GNUNET_PACKED; | 298 | struct CadetEncryptedMessageIdentifier cemi; |
282 | 299 | ||
283 | /** | 300 | /** |
284 | * ID of the connection. | 301 | * ID of the connection. |
@@ -404,7 +421,7 @@ struct GNUNET_CADET_ChannelDataMessage | |||
404 | struct GNUNET_CADET_ChannelDataAckMessage | 421 | struct GNUNET_CADET_ChannelDataAckMessage |
405 | { | 422 | { |
406 | /** | 423 | /** |
407 | * Type: GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK | 424 | * Type: #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DATA_ACK |
408 | */ | 425 | */ |
409 | struct GNUNET_MessageHeader header; | 426 | struct GNUNET_MessageHeader header; |
410 | 427 | ||