- fix error messages
[oweals/gnunet.git] / src / transport / plugin_transport_udp.h
index 6fb573690bc9913eb3993c4e5b1442aef7a5fce0..8f78ed4bc3b839dbe4734343275f16482e2e114e 100644 (file)
@@ -57,10 +57,10 @@ GNUNET_NETWORK_STRUCT_BEGIN
  */
 struct IPv4UdpAddress
 {
-       /**
-        * Optional options and flags for this address
-        */
-       uint32_t options GNUNET_PACKED;
+  /**
+   * Optional options and flags for this address
+   */
+  uint32_t options GNUNET_PACKED;
 
   /**
    * IPv4 address, in network byte order.
@@ -79,10 +79,10 @@ struct IPv4UdpAddress
  */
 struct IPv6UdpAddress
 {
-       /**
-        * Optional options and flags for this address
-        */
-       uint32_t options GNUNET_PACKED;
+  /**
+   * Optional options and flags for this address
+   */
+  uint32_t options GNUNET_PACKED;
 
   /**
    * IPv6 address.
@@ -221,43 +221,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 +248,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.
    */
@@ -296,10 +285,16 @@ const char *
 udp_address_to_string (void *cls, const void *addr, size_t addrlen);
 
 void
-udp_broadcast_receive ();
+udp_broadcast_receive (struct Plugin *plugin,
+                       const char * buf,
+                       ssize_t size,
+                       const struct sockaddr *addr,
+                       size_t addrlen);
 
 void
-setup_broadcast (struct Plugin *plugin, struct sockaddr_in6 *serverAddrv6, struct sockaddr_in *serverAddrv4);
+setup_broadcast (struct Plugin *plugin,
+                 struct sockaddr_in6 *server_addrv6,
+                 struct sockaddr_in *server_addrv4);
 
 void
 stop_broadcast (struct Plugin *plugin);