aboutsummaryrefslogtreecommitdiff
path: root/src/transport/transport.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-12-16 17:13:42 +0100
committerChristian Grothoff <christian@grothoff.org>2018-12-16 17:13:42 +0100
commitd37218d0b13292b78fcfc08d2903d6e415da0236 (patch)
treef9f354e6859b9868859cf421acbf747d8351ee7b /src/transport/transport.h
parent18784b77764c56842ae59428f3ebea95c157ffab (diff)
downloadgnunet-d37218d0b13292b78fcfc08d2903d6e415da0236.tar.gz
gnunet-d37218d0b13292b78fcfc08d2903d6e415da0236.zip
more work on tng
Diffstat (limited to 'src/transport/transport.h')
-rw-r--r--src/transport/transport.h101
1 files changed, 64 insertions, 37 deletions
diff --git a/src/transport/transport.h b/src/transport/transport.h
index df1321d1a..3c5fe72de 100644
--- a/src/transport/transport.h
+++ b/src/transport/transport.h
@@ -26,7 +26,6 @@
26 26
27#include "gnunet_crypto_lib.h" 27#include "gnunet_crypto_lib.h"
28#include "gnunet_time_lib.h" 28#include "gnunet_time_lib.h"
29#include "gnunet_transport_service.h"
30#include "gnunet_constants.h" 29#include "gnunet_constants.h"
31 30
32#define DEBUG_TRANSPORT GNUNET_EXTRA_LOGGING 31#define DEBUG_TRANSPORT GNUNET_EXTRA_LOGGING
@@ -79,6 +78,7 @@ typedef void
79 78
80GNUNET_NETWORK_STRUCT_BEGIN 79GNUNET_NETWORK_STRUCT_BEGIN
81 80
81
82/** 82/**
83 * Message from the transport service to the library 83 * Message from the transport service to the library
84 * asking to check if both processes agree about this 84 * asking to check if both processes agree about this
@@ -241,61 +241,67 @@ struct SendOkMessage
241 241
242}; 242};
243 243
244
244/** 245/**
245 * Message used to notify the transport API about an address to string 246 * Message used to notify the transport service about a message
246 * conversion. Message is followed by the string with the humand-readable 247 * to be transmitted to another peer. The actual message follows.
247 * address. For each lookup, multiple results may be returned. The
248 * last message must have a @e res of #GNUNET_OK and an @e addr_len
249 * of zero.
250 */ 248 */
251struct AddressToStringResultMessage 249struct OutboundMessage
252{ 250{
253 251
254 /** 252 /**
255 * Type will be #GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_TO_STRING_REPLY 253 * Type will be #GNUNET_MESSAGE_TYPE_TRANSPORT_SEND
256 */ 254 */
257 struct GNUNET_MessageHeader header; 255 struct GNUNET_MessageHeader header;
258 256
259 /** 257 /**
260 * #GNUNET_OK if the conversion succeeded, 258 * Always zero.
261 * #GNUNET_SYSERR if it failed
262 */ 259 */
263 uint32_t res GNUNET_PACKED; 260 uint32_t reserved GNUNET_PACKED;
264 261
265 /** 262 /**
266 * Length of the following string, zero if @e is #GNUNET_SYSERR 263 * Allowed delay.
267 */ 264 */
268 uint32_t addr_len GNUNET_PACKED; 265 struct GNUNET_TIME_RelativeNBO timeout;
266
267 /**
268 * Which peer should receive the message?
269 */
270 struct GNUNET_PeerIdentity peer;
271
269}; 272};
270 273
271 274
275
276
277#if !(defined(GNUNET_TRANSPORT_COMMUNICATION_VERSION)||defined(GNUNET_TRANSPORT_CORE_VERSION))
278
279
272/** 280/**
273 * Message used to notify the transport service about a message 281 * Message used to notify the transport API about an address to string
274 * to be transmitted to another peer. The actual message follows. 282 * conversion. Message is followed by the string with the humand-readable
283 * address. For each lookup, multiple results may be returned. The
284 * last message must have a @e res of #GNUNET_OK and an @e addr_len
285 * of zero.
275 */ 286 */
276struct OutboundMessage 287struct AddressToStringResultMessage
277{ 288{
278 289
279 /** 290 /**
280 * Type will be #GNUNET_MESSAGE_TYPE_TRANSPORT_SEND 291 * Type will be #GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_TO_STRING_REPLY
281 */ 292 */
282 struct GNUNET_MessageHeader header; 293 struct GNUNET_MessageHeader header;
283 294
284 /** 295 /**
285 * Always zero. 296 * #GNUNET_OK if the conversion succeeded,
286 */ 297 * #GNUNET_SYSERR if it failed
287 uint32_t reserved GNUNET_PACKED;
288
289 /**
290 * Allowed delay.
291 */ 298 */
292 struct GNUNET_TIME_RelativeNBO timeout; 299 uint32_t res GNUNET_PACKED;
293 300
294 /** 301 /**
295 * Which peer should receive the message? 302 * Length of the following string, zero if @e is #GNUNET_SYSERR
296 */ 303 */
297 struct GNUNET_PeerIdentity peer; 304 uint32_t addr_len GNUNET_PACKED;
298
299}; 305};
300 306
301 307
@@ -639,13 +645,7 @@ struct TransportPluginMonitorMessage
639 645
640}; 646};
641 647
642 648#else
643
644
645
646
647
648
649 649
650/* *********************** TNG messages ***************** */ 650/* *********************** TNG messages ***************** */
651 651
@@ -950,6 +950,35 @@ struct GNUNET_TRANSPORT_SendMessageToAck
950}; 950};
951 951
952 952
953/**
954 * Message from communicator to transport service asking for
955 * transmission of a backchannel message with the given peer @e pid
956 * and communicator.
957 */
958struct GNUNET_TRANSPORT_CommunicatorBackchannel
959{
960 /**
961 * Type will be #GNUNET_MESSAGE_TYPE_TRANSPORT_COMMUNICATOR_BACKCHANNEL
962 */
963 struct GNUNET_MessageHeader header;
964
965 /**
966 * Always zero, for alignment.
967 */
968 uint32_t reserved;
969
970 /**
971 * Target peer.
972 */
973 struct GNUNET_PeerIdentity pid;
974
975 /* Followed by a `struct GNUNET_MessageHeader` with the encapsulated
976 message to the communicator */
977
978 /* Followed by the 0-terminated string specifying the desired
979 communicator */
980};
981
953 982
954 983
955/** 984/**
@@ -1028,9 +1057,7 @@ struct GNUNET_TRANSPORT_MonitorData
1028 1057
1029}; 1058};
1030 1059
1031 1060#endif
1032
1033
1034 1061
1035GNUNET_NETWORK_STRUCT_END 1062GNUNET_NETWORK_STRUCT_END
1036 1063