* @file arm/gnunet-service-arm_interceptor.c
* @brief listen to incoming connections from clients to services,
* start services for which incoming an incoming connection occur,
- * and relay communication between the client and the service for
+ * and relay communication between the client and the service for
* that first incoming connection.
*
* @author Safey Abdel Halim
/**
* Put the default services represented by a space separated string into an array of strings
- *
+ *
* @param services space separated string of default services
*/
static void
/**
* Checks whether the serviceName is in the list of default services
- *
+ *
* @param serviceName string to check its existance in the list
* @return GNUNET_YES if the service is started by default
*/
/**
* Close forwarded connection (partial or full).
*
- * @param fc connection to close
+ * @param fc connection to close
* @param reason which direction to close
*/
static void
/**
* Read data from the client and then forward it to the service.
- *
+ *
* @param cls callback data, struct ForwardedConnection for the communication between client and service
- * @param tc context
+ * @param tc context
*/
-static void receiveFromClient (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+receiveFromClient (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* Receive service messages sent by the service and forward it to client
- *
+ *
* @param cls callback data, struct ForwardedConnection for the communication between client and service
* @param tc scheduler context
*/
-static void receiveFromService (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+receiveFromService (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
*
*/
-static void start_forwarding (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+start_forwarding (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* Forward messages sent from service to client
- *
+ *
* @param cls callback data, struct ForwardedConnection for the communication between client and service
* @param tc context
*/
/**
* Receive service messages sent by the service and forward it to client
- *
+ *
* @param cls callback data, struct ForwardedConnection for the communication between client and service
* @param tc scheduler context
*/
GNUNET_a2s (fc->listen_info->service_addr,
fc->listen_info->service_addr_len),
(unsigned long long) GNUNET_TIME_relative_min (fc->back_off,
- rem).
- rel_value);
+ rem).rel_value);
#endif
rem = GNUNET_TIME_absolute_get_remaining (fc->timeout);
GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == fc->start_task);
/**
* Forward client message to service
- *
+ *
* @param cls callback data, struct ForwardedConnection for the communication between client and service
* @param tc scheduler context
*/
GNUNET_a2s (fc->listen_info->service_addr,
fc->listen_info->service_addr_len),
(unsigned long long) GNUNET_TIME_relative_min (fc->back_off,
- rem).
- rel_value);
+ rem).rel_value);
#endif
rem = GNUNET_TIME_absolute_get_remaining (fc->timeout);
GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == fc->start_task);
/**
* Read data from the client and then forward it to the service.
- *
+ *
* @param cls callback data, struct ForwardedConnection for the communication between client and service
- * @param tc context
+ * @param tc context
*/
static void
receiveFromClient (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
/**
* First connection has come to the listening socket associated with the service,
* create the service in order to relay the incoming connection to it
- *
+ *
* @param cls callback data, struct ServiceListeningInfo describing a listen socket
- * @param tc context
+ * @param tc context
*/
-static void acceptConnection (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+acceptConnection (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
static void
return;
}
GNUNET_break (GNUNET_OK ==
- GNUNET_NETWORK_socket_close (serviceListeningInfo->
- listeningSocket));
+ GNUNET_NETWORK_socket_close
+ (serviceListeningInfo->listeningSocket));
start_service (NULL, serviceListeningInfo->serviceName, NULL);
GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Service `%s' started\n"),
fc->listen_info->serviceName);
/**
* First connection has come to the listening socket associated with the service,
* create the service in order to relay the incoming connection to it
- *
+ *
* @param cls callback data, struct ServiceListeningInfo describing a listen socket
- * @param tc context
+ * @param tc context
*/
static void
acceptConnection (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
/**
* Creating a listening socket for each of the service's addresses and
* wait for the first incoming connection to it
- *
+ *
* @param sa address associated with the service
* @param addr_len length of sa
* @param serviceName the name of the service in question
/**
* Callback function, checks whether the current tokens are representing a service,
* gets its addresses and create listening socket for it.
- *
+ *
* @param cls callback data, not used
* @param section configuration section
* @param option configuration option