diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-01-09 11:31:53 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-01-09 11:31:53 +0100 |
commit | c3ecadd45b11f82e22ba81b42864c7826d0f97c6 (patch) | |
tree | bb0ee6ca8184aaeb27502d7436871f56c113e076 /src/include | |
parent | 5b9d8a931e50fff58bf260176aab8b6c27fe200a (diff) | |
download | gnunet-c3ecadd45b11f82e22ba81b42864c7826d0f97c6.tar.gz gnunet-c3ecadd45b11f82e22ba81b42864c7826d0f97c6.zip |
DHT: signed path definition (not implemented at all)
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_dht_service.h | 57 |
1 files changed, 56 insertions, 1 deletions
diff --git a/src/include/gnunet_dht_service.h b/src/include/gnunet_dht_service.h index 160beffdd..15da9ecdd 100644 --- a/src/include/gnunet_dht_service.h +++ b/src/include/gnunet_dht_service.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | Copyright (C) 2004-2013, 2016 GNUnet e.V. | 3 | Copyright (C) 2004-2013, 2016, 2022 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
@@ -113,6 +113,61 @@ enum GNUNET_DHT_RouteOption | |||
113 | }; | 113 | }; |
114 | 114 | ||
115 | 115 | ||
116 | GNUNET_NETWORK_STRUCT_BEGIN | ||
117 | |||
118 | /** | ||
119 | * Message signed by a peer when doing path tracking. | ||
120 | */ | ||
121 | struct GNUNET_DHT_HopSignature | ||
122 | { | ||
123 | /** | ||
124 | * Must be #GNUNET_SIGNATURE_PURPOSE_DHT_HOP. | ||
125 | */ | ||
126 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | ||
127 | |||
128 | /** | ||
129 | * Previous hop the message was received from. All zeros | ||
130 | * if this peer was the initiator. | ||
131 | */ | ||
132 | struct GNUNET_PeerIdentity pred; | ||
133 | |||
134 | /** | ||
135 | * Next hop the message was forwarded to. | ||
136 | */ | ||
137 | struct GNUNET_PeerIdentity succ; | ||
138 | }; | ||
139 | |||
140 | |||
141 | /** | ||
142 | * A (signed) path tracking a block's flow through the DHT is represented by | ||
143 | * an array of path elements, each consisting of a peer on the path and a | ||
144 | * signature by which the peer affirms its routing decision. | ||
145 | */ | ||
146 | struct GNUNET_DHT_PathElement | ||
147 | { | ||
148 | |||
149 | /** | ||
150 | * Previous peer on the path (matches "pred" in the signed field). | ||
151 | * | ||
152 | * The public key used to create the @e sig is in the *next* path element, | ||
153 | * or is the sender of the message if this was the last path element. | ||
154 | * | ||
155 | * The "succ" field can be found in 'pred' if there are two more path | ||
156 | * elements in the path, is the sender if there is only one more path | ||
157 | * element, or the recipient if this was the last element on the path. | ||
158 | */ | ||
159 | struct GNUNET_PeerIdentity pred; | ||
160 | |||
161 | /** | ||
162 | * Signature affirming the hop of type | ||
163 | * #GNUNET_SIGNATURE_PURPOSE_DHT_HOP. | ||
164 | */ | ||
165 | struct GNUNET_CRYPTO_EddsaSignature sig; | ||
166 | |||
167 | }; | ||
168 | |||
169 | GNUNET_NETWORK_STRUCT_END | ||
170 | |||
116 | /** | 171 | /** |
117 | * Initialize the connection with the DHT service. | 172 | * Initialize the connection with the DHT service. |
118 | * | 173 | * |