aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_transport_plugin.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_transport_plugin.h')
-rw-r--r--src/include/gnunet_transport_plugin.h123
1 files changed, 68 insertions, 55 deletions
diff --git a/src/include/gnunet_transport_plugin.h b/src/include/gnunet_transport_plugin.h
index 37eef9427..b90f3f1cf 100644
--- a/src/include/gnunet_transport_plugin.h
+++ b/src/include/gnunet_transport_plugin.h
@@ -63,7 +63,7 @@ struct SessionHeader
63 * Expiration time for signature. Do not use in the plugin! 63 * Expiration time for signature. Do not use in the plugin!
64 */ 64 */
65 struct GNUNET_TIME_Absolute pong_sig_expires; 65 struct GNUNET_TIME_Absolute pong_sig_expires;
66 66
67}; 67};
68 68
69/** 69/**
@@ -80,8 +80,8 @@ struct SessionHeader
80 * @param session which session is being destoyed 80 * @param session which session is being destoyed
81 */ 81 */
82typedef void (*GNUNET_TRANSPORT_SessionEnd) (void *cls, 82typedef void (*GNUNET_TRANSPORT_SessionEnd) (void *cls,
83 const struct GNUNET_PeerIdentity *peer, 83 const struct GNUNET_PeerIdentity *
84 struct Session *session); 84 peer, struct Session * session);
85 85
86 86
87/** 87/**
@@ -105,18 +105,26 @@ typedef void (*GNUNET_TRANSPORT_SessionEnd) (void *cls,
105 * @return how long the plugin should wait until receiving more data 105 * @return how long the plugin should wait until receiving more data
106 * (plugins that do not support this, can ignore the return value) 106 * (plugins that do not support this, can ignore the return value)
107 */ 107 */
108typedef struct GNUNET_TIME_Relative (*GNUNET_TRANSPORT_PluginReceiveCallback) (void *cls, 108typedef struct
109 const struct 109 GNUNET_TIME_Relative (*GNUNET_TRANSPORT_PluginReceiveCallback) (void *cls,
110 GNUNET_PeerIdentity * 110 const struct
111 peer, 111 GNUNET_PeerIdentity
112 const struct 112 * peer,
113 GNUNET_MessageHeader * 113 const struct
114 message, 114 GNUNET_MessageHeader
115 const struct GNUNET_TRANSPORT_ATS_Information *ats, 115 * message,
116 uint32_t ats_count, 116 const struct
117 struct Session *session, 117 GNUNET_TRANSPORT_ATS_Information
118 const char *sender_address, 118 * ats,
119 uint16_t sender_address_len); 119 uint32_t
120 ats_count,
121 struct
122 Session *
123 session,
124 const char
125 *sender_address,
126 uint16_t
127 sender_address_len);
120 128
121 129
122/** 130/**
@@ -131,7 +139,7 @@ typedef struct GNUNET_TIME_Relative (*GNUNET_TRANSPORT_PluginReceiveCallback) (v
131 * @param addrlen length of the address 139 * @param addrlen length of the address
132 */ 140 */
133typedef void (*GNUNET_TRANSPORT_AddressNotification) (void *cls, 141typedef void (*GNUNET_TRANSPORT_AddressNotification) (void *cls,
134 int add_remove, 142 int add_remove,
135 const void *addr, 143 const void *addr,
136 size_t addrlen); 144 size_t addrlen);
137 145
@@ -151,16 +159,21 @@ typedef void (*GNUNET_TRANSPORT_AddressNotification) (void *cls,
151 * @return how long to wait until reading more from this peer 159 * @return how long to wait until reading more from this peer
152 * (to enforce inbound quotas) 160 * (to enforce inbound quotas)
153 */ 161 */
154typedef struct GNUNET_TIME_Relative (*GNUNET_TRANSPORT_TrafficReport) (void *cls, 162typedef struct GNUNET_TIME_Relative (*GNUNET_TRANSPORT_TrafficReport) (void
155 const struct 163 *cls,
156 GNUNET_PeerIdentity *peer, 164 const
157 size_t amount_recved); 165 struct
166 GNUNET_PeerIdentity
167 * peer,
168 size_t
169 amount_recved);
158 170
159 171
160/** 172/**
161 * Function that returns a HELLO message. 173 * Function that returns a HELLO message.
162 */ 174 */
163typedef const struct GNUNET_MessageHeader * (*GNUNET_TRANSPORT_GetHelloCallback)(void); 175typedef const struct GNUNET_MessageHeader
176 *(*GNUNET_TRANSPORT_GetHelloCallback) (void);
164 177
165 178
166/** 179/**
@@ -242,9 +255,9 @@ struct GNUNET_TRANSPORT_PluginEnvironment
242 * the ReceiveCallback. 255 * the ReceiveCallback.
243 */ 256 */
244typedef void 257typedef void
245 (*GNUNET_TRANSPORT_TransmitContinuation) (void *cls, 258 (*GNUNET_TRANSPORT_TransmitContinuation) (void *cls,
246 const struct GNUNET_PeerIdentity * 259 const struct GNUNET_PeerIdentity *
247 target, int result); 260 target, int result);
248 261
249 262
250/** 263/**
@@ -284,19 +297,19 @@ typedef void
284 * and does NOT mean that the message was not transmitted (DV) 297 * and does NOT mean that the message was not transmitted (DV)
285 */ 298 */
286typedef ssize_t 299typedef ssize_t
287 (*GNUNET_TRANSPORT_TransmitFunction) (void *cls, 300 (*GNUNET_TRANSPORT_TransmitFunction) (void *cls,
288 const struct GNUNET_PeerIdentity * 301 const struct GNUNET_PeerIdentity *
289 target, 302 target,
290 const char *msgbuf, 303 const char *msgbuf,
291 size_t msgbuf_size, 304 size_t msgbuf_size,
292 uint32_t priority, 305 uint32_t priority,
293 struct GNUNET_TIME_Relative timeout, 306 struct GNUNET_TIME_Relative timeout,
294 struct Session *session, 307 struct Session * session,
295 const void *addr, 308 const void *addr,
296 size_t addrlen, 309 size_t addrlen,
297 int force_address, 310 int force_address,
298 GNUNET_TRANSPORT_TransmitContinuation 311 GNUNET_TRANSPORT_TransmitContinuation
299 cont, void *cont_cls); 312 cont, void *cont_cls);
300 313
301 314
302/** 315/**
@@ -316,9 +329,9 @@ typedef ssize_t
316 * to be cancelled 329 * to be cancelled
317 */ 330 */
318typedef void 331typedef void
319 (*GNUNET_TRANSPORT_DisconnectFunction) (void *cls, 332 (*GNUNET_TRANSPORT_DisconnectFunction) (void *cls,
320 const struct GNUNET_PeerIdentity * 333 const struct GNUNET_PeerIdentity *
321 target); 334 target);
322 335
323 336
324/** 337/**
@@ -348,15 +361,15 @@ typedef void (*GNUNET_TRANSPORT_AddressStringCallback) (void *cls,
348 * @param asc_cls closure for asc 361 * @param asc_cls closure for asc
349 */ 362 */
350typedef void 363typedef void
351 (*GNUNET_TRANSPORT_AddressPrettyPrinter) (void *cls, 364 (*GNUNET_TRANSPORT_AddressPrettyPrinter) (void *cls,
352 const char *type, 365 const char *type,
353 const void *addr, 366 const void *addr,
354 size_t addrlen, 367 size_t addrlen,
355 int numeric, 368 int numeric,
356 struct GNUNET_TIME_Relative 369 struct GNUNET_TIME_Relative
357 timeout, 370 timeout,
358 GNUNET_TRANSPORT_AddressStringCallback 371 GNUNET_TRANSPORT_AddressStringCallback
359 asc, void *asc_cls); 372 asc, void *asc_cls);
360 373
361 374
362/** 375/**
@@ -374,8 +387,8 @@ typedef void
374 * and transport, GNUNET_SYSERR if not 387 * and transport, GNUNET_SYSERR if not
375 */ 388 */
376typedef int 389typedef int
377(*GNUNET_TRANSPORT_CheckAddress) (void *cls, 390 (*GNUNET_TRANSPORT_CheckAddress) (void *cls,
378 const void *addr, size_t addrlen); 391 const void *addr, size_t addrlen);
379 392
380 393
381/** 394/**
@@ -389,9 +402,9 @@ typedef int
389 * @param addr_len length of the address 402 * @param addr_len length of the address
390 * @return string representing the same address 403 * @return string representing the same address
391 */ 404 */
392typedef const char* (*GNUNET_TRANSPORT_AddressToString) (void *cls, 405typedef const char *(*GNUNET_TRANSPORT_AddressToString) (void *cls,
393 const void *addr, 406 const void *addr,
394 size_t addrlen); 407 size_t addrlen);
395 408
396 409
397/** 410/**