-indentation
[oweals/gnunet.git] / src / transport / plugin_transport_udp.h
index fe5a47285f3beb592fa2cb9c0778b6b2efb2365e..44791668b3370fc283b3d3f60db3975c72453636 100644 (file)
@@ -25,6 +25,9 @@
  * @author Nathan Evans
  * @author Matthias Wachs
  */
+#ifndef PLUGIN_TRANSPORT_UDP_H
+#define PLUGIN_TRANSPORT_UDP_H
+
 #include "platform.h"
 #include "gnunet_hello_lib.h"
 #include "gnunet_util_lib.h"
@@ -41,6 +44,8 @@
 
 #define LOG(kind,...) GNUNET_log_from (kind, "transport-udp", __VA_ARGS__)
 
+#define PLUGIN_NAME "udp"
+
 #define DEBUG_UDP GNUNET_NO
 #define DEBUG_UDP_BROADCASTING GNUNET_NO
 
@@ -119,6 +124,8 @@ struct UDPMessage
 
 };
 
+struct UDP_MessageWrapper;
+
 
 /**
  * Encapsulation of all of the state of the plugin.
@@ -221,43 +228,22 @@ struct Plugin
    */
   struct GNUNET_TIME_Relative broadcast_interval;
 
-  /**
-   * Broadcast with IPv4
-   */
-  int broadcast_ipv4;
-
-  /**
-   * Broadcast with IPv6
-   */
-  int broadcast_ipv6;
-
-
   /**
    * Tokenizer for inbound messages.
    */
   struct GNUNET_SERVER_MessageStreamTokenizer *broadcast_ipv6_mst;
   struct GNUNET_SERVER_MessageStreamTokenizer *broadcast_ipv4_mst;
 
-  /**
-   * ID of select broadcast task
-   */
-  GNUNET_SCHEDULER_TaskIdentifier send_ipv4_broadcast_task;
-
-  /**
-   * ID of select broadcast task
-   */
-  GNUNET_SCHEDULER_TaskIdentifier send_ipv6_broadcast_task;
-
   /**
    * IPv6 multicast address
    */
   struct sockaddr_in6 ipv6_multicast_address;
 
   /**
-   * DLL of IPv4 broadcast addresses
+   * DLL of broadcast addresses
    */
-  struct BroadcastAddress *ipv4_broadcast_tail;
-  struct BroadcastAddress *ipv4_broadcast_head;
+  struct BroadcastAddress *broadcast_tail;
+  struct BroadcastAddress *broadcast_head;
 
   /**
    * Is IPv6 enabled: GNUNET_YES or GNUNET_NO
@@ -269,6 +255,16 @@ struct Plugin
    */
   int enable_ipv4;
 
+  /**
+   * Is broadcasting enabled: GNUNET_YES or GNUNET_NO
+   */
+  int enable_broadcasting;
+
+  /**
+   * Is receiving broadcasts enabled: GNUNET_YES or GNUNET_NO
+   */
+  int enable_broadcasting_receiving;
+
   /**
    * Port we broadcasting on.
    */
@@ -310,4 +306,6 @@ setup_broadcast (struct Plugin *plugin,
 void
 stop_broadcast (struct Plugin *plugin);
 
+/*#ifndef PLUGIN_TRANSPORT_UDP_H*/
+#endif
 /* end of plugin_transport_udp.h */