GNUNET_CONNECTION_destroy (cls->s, GNUNET_NO);
- (*cls->caller_cb) (cls->buffer, cls->buf_size, cls->caller_cls);
+ cls->caller_cb (cls->buffer, cls->buf_size, cls->caller_cls);
GNUNET_free (cls->content);
GNUNET_free (cls);
if (!p2 || (p2 > p3))
{
- strncpy (hostname, p1, MIN (MAX_HOSTNAME_LEN, (int) (p3 - p1)));
+ strncpy (hostname, p1, GNUNET_MIN (MAX_HOSTNAME_LEN, (int) (p3 - p1)));
*port = 80;
}
else
{
- strncpy (hostname, p1, MIN (MAX_HOSTNAME_LEN, (int) (p2 - p1)));
+ strncpy (hostname, p1, GNUNET_MIN (MAX_HOSTNAME_LEN, (int) (p2 - p1)));
*port = 0;
p2++;
/**
* Send UPnP command to the device identified by url and service.
*
- * @param sched scheduler to use for network tasks
* @param url control URL of the device
* @param service type of the service corresponding to the command
* @param action action to send
* @param caller_cls closure to pass to caller_cb
*/
void
-UPNP_command_ (struct GNUNET_SCHEDULER_Handle *sched,
- const char *url, const char *service,
+UPNP_command_ (const char *url, const char *service,
const char *action, struct UPNP_Arg_ *args,
char *buffer, size_t buf_size,
UPNP_command_cb_ caller_cb, void *caller_cls)
if (soap_body + sizeof (soap_body) <= p + 100)
{
GNUNET_assert (GNUNET_NO);
- (*caller_cb) (buffer, 0, caller_cls);
+ caller_cb (buffer, 0, caller_cls);
return;
}
*(p++) = '<';
{
GNUNET_log_from (GNUNET_ERROR_TYPE_WARNING, "UPnP",
"Invalid URL passed to UPNP_command(): %s\n", url);
+ caller_cb (buffer, 0, caller_cls);
return;
}
dest.sin_len = sizeof (dest);
#endif
- s = GNUNET_CONNECTION_create_from_sockaddr (sched, PF_INET,
+ s = GNUNET_CONNECTION_create_from_sockaddr (PF_INET,
(struct sockaddr *) &dest,
sizeof (dest));
}
dest6.sin6_len = sizeof (dest6);
#endif
- s = GNUNET_CONNECTION_create_from_sockaddr (sched, PF_INET6,
+ s = GNUNET_CONNECTION_create_from_sockaddr (PF_INET6,
(struct sockaddr *) &dest6,
sizeof (dest6));
}
GNUNET_log_from (GNUNET_ERROR_TYPE_WARNING, _("%s failed at %s:%d\n"),
"UPnP", "inet_pton", __FILE__, __LINE__);
- (*caller_cb) (buffer, 0, caller_cls);
+ caller_cb (buffer, 0, caller_cls);
return;
}
__LINE__);
#endif
- (*caller_cb) (buffer, 0, caller_cls);
+ caller_cb (buffer, 0, caller_cls);
GNUNET_free (content_buf);
GNUNET_free (cls);
* 501 Action Failed - See UPnP Device Architecture section on Control.
*/
void
-UPNP_get_external_ip_address_ (struct GNUNET_SCHEDULER_Handle *sched,
- const char *control_url,
+UPNP_get_external_ip_address_ (const char *control_url,
const char *service_type,
UPNP_get_external_ip_address_cb_ caller_cb,
void *caller_cls)
buffer = GNUNET_malloc (UPNP_COMMAND_BUFSIZE);
- UPNP_command_ (sched, control_url, service_type, "GetExternalIPAddress",
+ UPNP_command_ (control_url, service_type, "GetExternalIPAddress",
NULL, buffer, UPNP_COMMAND_BUFSIZE,
(UPNP_command_cb_) get_external_ip_address_receiver, cls);
}
}
void
-UPNP_add_port_mapping_ (struct GNUNET_SCHEDULER_Handle *sched,
- const char *control_url, const char *service_type,
+UPNP_add_port_mapping_ (const char *control_url, const char *service_type,
const char *ext_port,
const char *in_port,
const char *inClient,
buffer = GNUNET_malloc (UPNP_COMMAND_BUFSIZE);
- UPNP_command_ (sched, control_url, service_type, "AddPortMapping",
+ UPNP_command_ (control_url, service_type, "AddPortMapping",
args, buffer, UPNP_COMMAND_BUFSIZE,
add_delete_port_mapping_receiver, cls);
}
void
-UPNP_delete_port_mapping_ (struct GNUNET_SCHEDULER_Handle *sched,
- const char *control_url, const char *service_type,
+UPNP_delete_port_mapping_ (const char *control_url, const char *service_type,
const char *ext_port, const char *proto,
const char *remoteHost,
UPNP_port_mapping_cb_ caller_cb, void *caller_cls)
buffer = GNUNET_malloc (UPNP_COMMAND_BUFSIZE);
- UPNP_command_ (sched, control_url, service_type,
+ UPNP_command_ (control_url, service_type,
"DeletePortMapping",
args, buffer, UPNP_COMMAND_BUFSIZE,
add_delete_port_mapping_receiver, cls);
* the result is returned in the in_client and in_port strings
* please provide 128 and 6 bytes of data */
void
-UPNP_get_specific_port_mapping_entry_ (struct GNUNET_SCHEDULER_Handle *sched,
- const char *control_url,
+UPNP_get_specific_port_mapping_entry_ (const char *control_url,
const char *service_type,
const char *ext_port,
const char *proto,
buffer = GNUNET_malloc (UPNP_COMMAND_BUFSIZE);
- UPNP_command_ (sched, control_url, service_type,
+ UPNP_command_ (control_url, service_type,
"GetSpecificPortMappingEntry",
args, buffer, UPNP_COMMAND_BUFSIZE,
get_specific_port_mapping_entry_receiver, cls);