summaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_udp.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-06-23 10:53:10 +0000
committerChristian Grothoff <christian@grothoff.org>2014-06-23 10:53:10 +0000
commit77056f3bc6cd9b2a67498d007a8c2252a375cabb (patch)
tree8b1860001e4bb550b4e7954c1b2c54e23e6b41d4 /src/transport/plugin_transport_udp.h
parente605b0a9eb0e5229d2c936df4cdf8b2f513abb72 (diff)
-removing global state from UDP plugin (statics), doxygen, indentation, starting support for monitoring
Diffstat (limited to 'src/transport/plugin_transport_udp.h')
-rw-r--r--src/transport/plugin_transport_udp.h107
1 files changed, 77 insertions, 30 deletions
diff --git a/src/transport/plugin_transport_udp.h b/src/transport/plugin_transport_udp.h
index 44791668b..3770b3b70 100644
--- a/src/transport/plugin_transport_udp.h
+++ b/src/transport/plugin_transport_udp.h
@@ -1,6 +1,6 @@
/*
This file is part of GNUnet
- (C) 2010, 2011 Christian Grothoff (and other contributing authors)
+ (C) 2010-2014 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@ -47,6 +47,7 @@
#define PLUGIN_NAME "udp"
#define DEBUG_UDP GNUNET_NO
+
#define DEBUG_UDP_BROADCASTING GNUNET_NO
/**
@@ -126,6 +127,8 @@ struct UDPMessage
struct UDP_MessageWrapper;
+struct PrettyPrinterContext;
+
/**
* Encapsulation of all of the state of the plugin.
@@ -140,7 +143,7 @@ struct Plugin
/**
* Session of peers with whom we are currently connected,
- * map of peer identity to 'struct PeerSession'.
+ * map of peer identity to `struct Session *`.
*/
struct GNUNET_CONTAINER_MultiPeerMap *sessions;
@@ -150,9 +153,13 @@ struct Plugin
struct GNUNET_CONTAINER_Heap *defrag_ctxs;
/**
- * ID of select task
+ * ID of select task for IPv4
*/
GNUNET_SCHEDULER_TaskIdentifier select_task;
+
+ /**
+ * ID of select task for IPv6
+ */
GNUNET_SCHEDULER_TaskIdentifier select_task_v6;
/**
@@ -175,12 +182,6 @@ struct Plugin
*/
char *bind6_address;
-
- /**
- * Bytes currently in buffer
- */
- int64_t bytes_in_buffer;
-
/**
* Handle to NAT traversal support.
*/
@@ -196,13 +197,11 @@ struct Plugin
*/
struct GNUNET_NETWORK_FDSet *ws_v4;
-
/**
* The read socket for IPv4
*/
struct GNUNET_NETWORK_Handle *sockv4;
-
/**
* FD Read set
*/
@@ -219,20 +218,64 @@ struct Plugin
struct GNUNET_NETWORK_Handle *sockv6;
/**
- * Beacon broadcasting
- * -------------------
+ * Tokenizer for inbound IPv6 messages.
*/
+ struct GNUNET_SERVER_MessageStreamTokenizer *broadcast_ipv6_mst;
/**
- * Broadcast interval
+ * Tokenizer for inbound IPv4 messages.
*/
- struct GNUNET_TIME_Relative broadcast_interval;
+ struct GNUNET_SERVER_MessageStreamTokenizer *broadcast_ipv4_mst;
/**
- * Tokenizer for inbound messages.
+ * Head of DLL of broadcast addresses
*/
- struct GNUNET_SERVER_MessageStreamTokenizer *broadcast_ipv6_mst;
- struct GNUNET_SERVER_MessageStreamTokenizer *broadcast_ipv4_mst;
+ struct BroadcastAddress *broadcast_tail;
+
+ /**
+ * Tail of DLL of broadcast addresses
+ */
+ struct BroadcastAddress *broadcast_head;
+
+ /**
+ * Head of messages in IPv4 queue.
+ */
+ struct UDP_MessageWrapper *ipv4_queue_head;
+
+ /**
+ * Tail of messages in IPv4 queue.
+ */
+ struct UDP_MessageWrapper *ipv4_queue_tail;
+
+ /**
+ * Head of messages in IPv6 queue.
+ */
+ struct UDP_MessageWrapper *ipv6_queue_head;
+
+ /**
+ * Tail of messages in IPv6 queue.
+ */
+ struct UDP_MessageWrapper *ipv6_queue_tail;
+
+ /**
+ * Running pretty printers: head
+ */
+ struct PrettyPrinterContext *ppc_dll_head;
+
+ /**
+ * Running pretty printers: tail
+ */
+ struct PrettyPrinterContext *ppc_dll_tail;
+
+ /**
+ * Function to call about session status changes.
+ */
+ GNUNET_TRANSPORT_SessionInfoCallback sic;
+
+ /**
+ * Closure for @e sic.
+ */
+ void *sic_cls;
/**
* IPv6 multicast address
@@ -240,28 +283,37 @@ struct Plugin
struct sockaddr_in6 ipv6_multicast_address;
/**
- * DLL of broadcast addresses
+ * Broadcast interval
*/
- struct BroadcastAddress *broadcast_tail;
- struct BroadcastAddress *broadcast_head;
+ struct GNUNET_TIME_Relative broadcast_interval;
+
+ /**
+ * Bytes currently in buffer
+ */
+ int64_t bytes_in_buffer;
/**
- * Is IPv6 enabled: GNUNET_YES or GNUNET_NO
+ * Address options
+ */
+ uint32_t myoptions;
+
+ /**
+ * Is IPv6 enabled: #GNUNET_YES or #GNUNET_NO
*/
int enable_ipv6;
/**
- * Is IPv4 enabled: GNUNET_YES or GNUNET_NO
+ * Is IPv4 enabled: #GNUNET_YES or #GNUNET_NO
*/
int enable_ipv4;
/**
- * Is broadcasting enabled: GNUNET_YES or GNUNET_NO
+ * Is broadcasting enabled: #GNUNET_YES or #GNUNET_NO
*/
int enable_broadcasting;
/**
- * Is receiving broadcasts enabled: GNUNET_YES or GNUNET_NO
+ * Is receiving broadcasts enabled: #GNUNET_YES or #GNUNET_NO
*/
int enable_broadcasting_receiving;
@@ -280,11 +332,6 @@ struct Plugin
*/
uint16_t aport;
- struct UDP_MessageWrapper *ipv4_queue_head;
- struct UDP_MessageWrapper *ipv4_queue_tail;
-
- struct UDP_MessageWrapper *ipv6_queue_head;
- struct UDP_MessageWrapper *ipv6_queue_tail;
};