diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/core.h | 55 | ||||
-rw-r--r-- | src/core/core_api_peer_get_info.c | 19 |
2 files changed, 51 insertions, 23 deletions
diff --git a/src/core/core.h b/src/core/core.h index 30130b84b..20c3ddc4b 100644 --- a/src/core/core.h +++ b/src/core/core.h | |||
@@ -112,6 +112,36 @@ struct ConnectNotifyMessage | |||
112 | struct GNUNET_MessageHeader header; | 112 | struct GNUNET_MessageHeader header; |
113 | 113 | ||
114 | /** | 114 | /** |
115 | * Distance to the peer. | ||
116 | */ | ||
117 | uint32_t distance GNUNET_PACKED; | ||
118 | |||
119 | /** | ||
120 | * Currently observed latency. | ||
121 | */ | ||
122 | struct GNUNET_TIME_RelativeNBO latency; | ||
123 | |||
124 | /** | ||
125 | * Identity of the connecting peer. | ||
126 | */ | ||
127 | struct GNUNET_PeerIdentity peer; | ||
128 | |||
129 | }; | ||
130 | |||
131 | |||
132 | |||
133 | /** | ||
134 | * Message sent by the service to clients to notify them | ||
135 | * about a peer disconnecting. | ||
136 | */ | ||
137 | struct DisconnectNotifyMessage | ||
138 | { | ||
139 | /** | ||
140 | * Header with type GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT. | ||
141 | */ | ||
142 | struct GNUNET_MessageHeader header; | ||
143 | |||
144 | /** | ||
115 | * Always zero. | 145 | * Always zero. |
116 | */ | 146 | */ |
117 | uint32_t reserved GNUNET_PACKED; | 147 | uint32_t reserved GNUNET_PACKED; |
@@ -143,9 +173,14 @@ struct NotifyTrafficMessage | |||
143 | struct GNUNET_MessageHeader header; | 173 | struct GNUNET_MessageHeader header; |
144 | 174 | ||
145 | /** | 175 | /** |
146 | * Always zero. | 176 | * Distance to the peer. |
147 | */ | 177 | */ |
148 | uint32_t reserved GNUNET_PACKED; | 178 | uint32_t distance GNUNET_PACKED; |
179 | |||
180 | /** | ||
181 | * Currently observed latency. | ||
182 | */ | ||
183 | struct GNUNET_TIME_RelativeNBO latency; | ||
149 | 184 | ||
150 | /** | 185 | /** |
151 | * Identity of the receiver or sender. | 186 | * Identity of the receiver or sender. |
@@ -230,12 +265,6 @@ struct ConfigurationInfoMessage | |||
230 | uint32_t bpm_out GNUNET_PACKED; | 265 | uint32_t bpm_out GNUNET_PACKED; |
231 | 266 | ||
232 | /** | 267 | /** |
233 | * Latest transport latency estimate for the peer. | ||
234 | * FOREVER if we have been disconnected. | ||
235 | */ | ||
236 | struct GNUNET_TIME_RelativeNBO latency; | ||
237 | |||
238 | /** | ||
239 | * Current traffic preference for the peer. | 268 | * Current traffic preference for the peer. |
240 | * 0 if we have been disconnected. | 269 | * 0 if we have been disconnected. |
241 | */ | 270 | */ |
@@ -280,11 +309,11 @@ struct SendMessage | |||
280 | 309 | ||
281 | 310 | ||
282 | /** | 311 | /** |
283 | * Client asking core to transmit a particular message to a particular | 312 | * Client asking core to connect to a particular target. There is no |
284 | * target. There is no response from the core to this type of request | 313 | * response from the core to this type of request (however, if an |
285 | * (however, if an actual connection is created or destroyed, be it | 314 | * actual connection is created or destroyed, be it because of this |
286 | * because of this type request or not, the core generally needs to | 315 | * type request or not, the core generally needs to notify the |
287 | * notify the clients). | 316 | * clients). |
288 | */ | 317 | */ |
289 | struct ConnectMessage | 318 | struct ConnectMessage |
290 | { | 319 | { |
diff --git a/src/core/core_api_peer_get_info.c b/src/core/core_api_peer_get_info.c index 23ae04f01..f6ce31110 100644 --- a/src/core/core_api_peer_get_info.c +++ b/src/core/core_api_peer_get_info.c | |||
@@ -88,7 +88,6 @@ receive_info (void *cls, | |||
88 | &cim->peer, | 88 | &cim->peer, |
89 | ntohl (cim->bpm_in), | 89 | ntohl (cim->bpm_in), |
90 | ntohl (cim->bpm_out), | 90 | ntohl (cim->bpm_out), |
91 | GNUNET_TIME_relative_ntoh (cim->latency), | ||
92 | ntohl (cim->reserved_amount), | 91 | ntohl (cim->reserved_amount), |
93 | GNUNET_ntohll (cim->preference)); | 92 | GNUNET_ntohll (cim->preference)); |
94 | GNUNET_CLIENT_disconnect (irc->client); | 93 | GNUNET_CLIENT_disconnect (irc->client); |
@@ -122,15 +121,15 @@ receive_info (void *cls, | |||
122 | * @return NULL on error | 121 | * @return NULL on error |
123 | */ | 122 | */ |
124 | struct GNUNET_CORE_InformationRequestContext * | 123 | struct GNUNET_CORE_InformationRequestContext * |
125 | GNUNET_CORE_peer_get_info (struct GNUNET_SCHEDULER_Handle *sched, | 124 | GNUNET_CORE_peer_change_preference (struct GNUNET_SCHEDULER_Handle *sched, |
126 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 125 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
127 | const struct GNUNET_PeerIdentity *peer, | 126 | const struct GNUNET_PeerIdentity *peer, |
128 | struct GNUNET_TIME_Relative timeout, | 127 | struct GNUNET_TIME_Relative timeout, |
129 | uint32_t bpm_out, | 128 | uint32_t bpm_out, |
130 | int32_t amount, | 129 | int32_t amount, |
131 | uint64_t preference, | 130 | uint64_t preference, |
132 | GNUNET_CORE_PeerConfigurationInfoCallback info, | 131 | GNUNET_CORE_PeerConfigurationInfoCallback info, |
133 | void *info_cls) | 132 | void *info_cls) |
134 | { | 133 | { |
135 | struct GNUNET_CORE_InformationRequestContext *irc; | 134 | struct GNUNET_CORE_InformationRequestContext *irc; |
136 | struct RequestInfoMessage rim; | 135 | struct RequestInfoMessage rim; |