aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_http.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/plugin_transport_http.h')
-rw-r--r--src/transport/plugin_transport_http.h96
1 files changed, 52 insertions, 44 deletions
diff --git a/src/transport/plugin_transport_http.h b/src/transport/plugin_transport_http.h
index 4ad8f6e58..a3b59513e 100644
--- a/src/transport/plugin_transport_http.h
+++ b/src/transport/plugin_transport_http.h
@@ -62,12 +62,14 @@
62#define OUTBOUND GNUNET_NO 62#define OUTBOUND GNUNET_NO
63 63
64 64
65#define HTTP_NOT_VALIDATED_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 15) 65#define HTTP_NOT_VALIDATED_TIMEOUT GNUNET_TIME_relative_multiply ( \
66 GNUNET_TIME_UNIT_SECONDS, 15)
66 67
67/** 68/**
68 * Encapsulation of all of the state of the plugin. 69 * Encapsulation of all of the state of the plugin.
69 */ 70 */
70struct Plugin { 71struct Plugin
72{
71 /** 73 /**
72 * Our environment. 74 * Our environment.
73 */ 75 */
@@ -118,7 +120,7 @@ struct Plugin {
118 /** 120 /**
119 * Task calling transport service about external address 121 * Task calling transport service about external address
120 */ 122 */
121 struct GNUNET_SCHEDULER_Task * notify_ext_task; 123 struct GNUNET_SCHEDULER_Task *notify_ext_task;
122 124
123 /** 125 /**
124 * Plugin name. 126 * Plugin name.
@@ -206,7 +208,7 @@ struct Plugin {
206 /** 208 /**
207 * MHD IPv4 task 209 * MHD IPv4 task
208 */ 210 */
209 struct GNUNET_SCHEDULER_Task * server_v4_task; 211 struct GNUNET_SCHEDULER_Task *server_v4_task;
210 212
211 /** 213 /**
212 * The IPv4 server is scheduled to run asap 214 * The IPv4 server is scheduled to run asap
@@ -221,7 +223,7 @@ struct Plugin {
221 /** 223 /**
222 * MHD IPv4 task 224 * MHD IPv4 task
223 */ 225 */
224 struct GNUNET_SCHEDULER_Task * server_v6_task; 226 struct GNUNET_SCHEDULER_Task *server_v6_task;
225 227
226 /** 228 /**
227 * The IPv6 server is scheduled to run asap 229 * The IPv6 server is scheduled to run asap
@@ -260,7 +262,7 @@ struct Plugin {
260 /** 262 /**
261 * curl perform task 263 * curl perform task
262 */ 264 */
263 struct GNUNET_SCHEDULER_Task * client_perform_task; 265 struct GNUNET_SCHEDULER_Task *client_perform_task;
264}; 266};
265 267
266GNUNET_NETWORK_STRUCT_BEGIN 268GNUNET_NETWORK_STRUCT_BEGIN
@@ -268,7 +270,8 @@ GNUNET_NETWORK_STRUCT_BEGIN
268/** 270/**
269 * HTTP addresses including a full URI 271 * HTTP addresses including a full URI
270 */ 272 */
271struct HttpAddress { 273struct HttpAddress
274{
272 /** 275 /**
273 * Length of the address following in NBO 276 * Length of the address following in NBO
274 */ 277 */
@@ -283,7 +286,8 @@ struct HttpAddress {
283/** 286/**
284 * IPv4 addresses 287 * IPv4 addresses
285 */ 288 */
286struct IPv4HttpAddress { 289struct IPv4HttpAddress
290{
287 /** 291 /**
288 * IPv4 address, in network byte order. 292 * IPv4 address, in network byte order.
289 */ 293 */
@@ -298,7 +302,8 @@ struct IPv4HttpAddress {
298/** 302/**
299 * IPv4 addresses 303 * IPv4 addresses
300 */ 304 */
301struct IPv6HttpAddress { 305struct IPv6HttpAddress
306{
302 /** 307 /**
303 * IPv6 address. 308 * IPv6 address.
304 */ 309 */
@@ -312,7 +317,8 @@ struct IPv6HttpAddress {
312GNUNET_NETWORK_STRUCT_END 317GNUNET_NETWORK_STRUCT_END
313 318
314 319
315struct ServerRequest { 320struct ServerRequest
321{
316 /** 322 /**
317 * _RECV or _SEND 323 * _RECV or _SEND
318 */ 324 */
@@ -338,7 +344,8 @@ struct ServerRequest {
338/** 344/**
339 * Session handle for connections. 345 * Session handle for connections.
340 */ 346 */
341struct GNUNET_ATS_Session { 347struct GNUNET_ATS_Session
348{
342 /** 349 /**
343 * To whom are we talking to 350 * To whom are we talking to
344 */ 351 */
@@ -420,12 +427,12 @@ struct GNUNET_ATS_Session {
420 /** 427 /**
421 * Task to wake up client receive handle when receiving is allowed again 428 * Task to wake up client receive handle when receiving is allowed again
422 */ 429 */
423 struct GNUNET_SCHEDULER_Task * recv_wakeup_task; 430 struct GNUNET_SCHEDULER_Task *recv_wakeup_task;
424 431
425 /** 432 /**
426 * Session timeout task 433 * Session timeout task
427 */ 434 */
428 struct GNUNET_SCHEDULER_Task * timeout_task; 435 struct GNUNET_SCHEDULER_Task *timeout_task;
429 436
430 /** 437 /**
431 * Is client send handle paused since there are no data to send? 438 * Is client send handle paused since there are no data to send?
@@ -448,7 +455,8 @@ struct GNUNET_ATS_Session {
448/** 455/**
449 * Message to send using http 456 * Message to send using http
450 */ 457 */
451struct HTTP_Message { 458struct HTTP_Message
459{
452 /** 460 /**
453 * next pointer for double linked list 461 * next pointer for double linked list
454 */ 462 */
@@ -489,81 +497,81 @@ struct HTTP_Message {
489 497
490 498
491struct GNUNET_ATS_Session * 499struct GNUNET_ATS_Session *
492create_session(struct Plugin *plugin, 500create_session (struct Plugin *plugin,
493 const struct GNUNET_PeerIdentity *target, 501 const struct GNUNET_PeerIdentity *target,
494 const void *addr, 502 const void *addr,
495 size_t addrlen); 503 size_t addrlen);
496 504
497 505
498int 506int
499exist_session(struct Plugin *plugin, 507exist_session (struct Plugin *plugin,
500 struct GNUNET_ATS_Session *s); 508 struct GNUNET_ATS_Session *s);
501 509
502 510
503void 511void
504delete_session(struct GNUNET_ATS_Session *s); 512delete_session (struct GNUNET_ATS_Session *s);
505 513
506 514
507int 515int
508exist_session(struct Plugin *plugin, 516exist_session (struct Plugin *plugin,
509 struct GNUNET_ATS_Session *s); 517 struct GNUNET_ATS_Session *s);
510 518
511 519
512struct GNUNET_TIME_Relative 520struct GNUNET_TIME_Relative
513http_plugin_receive(void *cls, 521http_plugin_receive (void *cls,
514 const struct GNUNET_PeerIdentity *peer, 522 const struct GNUNET_PeerIdentity *peer,
515 const struct GNUNET_MessageHeader *message, 523 const struct GNUNET_MessageHeader *message,
516 struct GNUNET_ATS_Session *session, 524 struct GNUNET_ATS_Session *session,
517 const char *sender_address, 525 const char *sender_address,
518 uint16_t sender_address_len); 526 uint16_t sender_address_len);
519 527
520 528
521const char * 529const char *
522http_plugin_address_to_string(void *cls, 530http_plugin_address_to_string (void *cls,
523 const void *addr, 531 const void *addr,
524 size_t addrlen); 532 size_t addrlen);
525 533
526 534
527int 535int
528client_disconnect(struct GNUNET_ATS_Session *s); 536client_disconnect (struct GNUNET_ATS_Session *s);
529 537
530 538
531int 539int
532client_connect(struct GNUNET_ATS_Session *s); 540client_connect (struct GNUNET_ATS_Session *s);
533 541
534 542
535int 543int
536client_send(struct GNUNET_ATS_Session *s, struct HTTP_Message *msg); 544client_send (struct GNUNET_ATS_Session *s, struct HTTP_Message *msg);
537 545
538 546
539int 547int
540client_start(struct Plugin *plugin); 548client_start (struct Plugin *plugin);
541 549
542 550
543void 551void
544client_stop(struct Plugin *plugin); 552client_stop (struct Plugin *plugin);
545 553
546 554
547int 555int
548server_disconnect(struct GNUNET_ATS_Session *s); 556server_disconnect (struct GNUNET_ATS_Session *s);
549 557
550 558
551int 559int
552server_send(struct GNUNET_ATS_Session *s, struct HTTP_Message *msg); 560server_send (struct GNUNET_ATS_Session *s, struct HTTP_Message *msg);
553 561
554 562
555int 563int
556server_start(struct Plugin *plugin); 564server_start (struct Plugin *plugin);
557 565
558 566
559void 567void
560server_stop(struct Plugin *plugin); 568server_stop (struct Plugin *plugin);
561 569
562 570
563void 571void
564notify_session_end(void *cls, 572notify_session_end (void *cls,
565 const struct GNUNET_PeerIdentity *peer, 573 const struct GNUNET_PeerIdentity *peer,
566 struct GNUNET_ATS_Session *s); 574 struct GNUNET_ATS_Session *s);
567 575
568 576
569/*#ifndef PLUGIN_TRANSPORT_HTTP_H*/ 577/*#ifndef PLUGIN_TRANSPORT_HTTP_H*/