/**
* Calculate an updated bandwidth assignment and notify.
*
- * @param ats handle
+ * @param atc handle
* @param change which allocation record changed?
*/
static void
* the given iterator for each of them.
*
* @param cls our "struct Plugin*"
+ * @param offset offset of the result (modulo num-results);
+ * specific ordering does not matter for the offset
* @param type entries of which type should be considered?
* Use 0 for any type.
* @param proc function to call on the matching value;
* iterator.
*
* @param cls closure
- * @param next_cls closure to pass to the "next" function.
* @param key key for the content
* @param size number of bytes in data
* @param data content stored
* callback.
*
* @param pi structure to fill in
- * @param sc overall publishing context
+ * @param pc overall publishing context
* @param p file information for the file being published
* @param offset where in the file are we so far
* @return value returned from callback
*/
void *
GNUNET_FS_publish_make_status_ (struct GNUNET_FS_ProgressInfo *pi,
- struct GNUNET_FS_PublishContext *sc,
+ struct GNUNET_FS_PublishContext *pc,
const struct GNUNET_FS_FileInformation *p,
uint64_t offset);
* jointly).
*
* @param pra a pending request
- * @param pra another pending request
+ * @param prb another pending request
* @return GNUNET_OK if the requests are compatible
*/
int
* jointly).
*
* @param pra a pending request
- * @param pra another pending request
+ * @param prb another pending request
* @return GNUNET_OK if the requests are compatible
*/
int
* @param atsi performance information for the tunnel
* @return initial tunnel context for the tunnel (can be NULL -- that's not an error)
*/
-typedef void* (*GNUNET_MESH_InboundTunnelNotificationHandler) (void *cls,
- struct GNUNET_MESH_Tunnel * tunnel,
- const struct
- GNUNET_PeerIdentity *
- initiator,
- const struct
- GNUNET_TRANSPORT_ATS_Information *
- atsi);
+typedef void *(*GNUNET_MESH_InboundTunnelNotificationHandler) (void *cls,
+ struct
+ GNUNET_MESH_Tunnel
+ * tunnel,
+ const struct
+ GNUNET_PeerIdentity
+ * initiator,
+ const struct
+ GNUNET_TRANSPORT_ATS_Information
+ * atsi);
/**
* @param handler_cls closure for connect/disconnect handlers
*/
struct GNUNET_MESH_Tunnel *
-GNUNET_MESH_tunnel_create (struct GNUNET_MESH_Handle *h,
- void *tunnel_ctx,
+GNUNET_MESH_tunnel_create (struct GNUNET_MESH_Handle *h, void *tunnel_ctx,
GNUNET_MESH_TunnelConnectHandler connect_handler,
GNUNET_MESH_TunnelDisconnectHandler
disconnect_handler, void *handler_cls);
static void
destroy_tunnel (struct GNUNET_MESH_Handle *h, MESH_TunnelNumber tid)
{
- struct GNUNET_MESH_Tunnel *t;
- struct GNUNET_PeerIdentity pi;
- unsigned int i;
+ struct GNUNET_MESH_Tunnel *t;
+ struct GNUNET_PeerIdentity pi;
+ unsigned int i;
- t = retrieve_tunnel(h, tid);
- if (NULL == t)
- {
- GNUNET_break (0);
- return;
- }
- GNUNET_CONTAINER_DLL_remove (h->tunnels_head, h->tunnels_tail, t);
- for (i = 0; i < t->npeers; i++)
- {
- GNUNET_PEER_resolve(t->peers[i]->id, &pi);
- t->disconnect_handler(t->cls, &pi);
- GNUNET_PEER_change_rc(t->peers[i]->id, -1);
- GNUNET_free (t->peers[i]);
- }
- h->cleaner(h->cls, t, NULL); /* FIXME ctx? */
- if (0 != t->owner)
- GNUNET_PEER_change_rc(t->owner, -1);
- GNUNET_free(t->peers);
- GNUNET_free(t);
+ t = retrieve_tunnel (h, tid);
+ if (NULL == t)
+ {
+ GNUNET_break (0);
return;
+ }
+ GNUNET_CONTAINER_DLL_remove (h->tunnels_head, h->tunnels_tail, t);
+ for (i = 0; i < t->npeers; i++)
+ {
+ GNUNET_PEER_resolve (t->peers[i]->id, &pi);
+ t->disconnect_handler (t->cls, &pi);
+ GNUNET_PEER_change_rc (t->peers[i]->id, -1);
+ GNUNET_free (t->peers[i]);
+ }
+ h->cleaner (h->cls, t, NULL); /* FIXME ctx? */
+ if (0 != t->owner)
+ GNUNET_PEER_change_rc (t->owner, -1);
+ GNUNET_free (t->peers);
+ GNUNET_free (t);
+ return;
}
t->cls = h->cls;
t->mesh = h;
t->tid = tid;
- GNUNET_CONTAINER_DLL_insert(h->tunnels_head, h->tunnels_tail, t);
+ GNUNET_CONTAINER_DLL_insert (h->tunnels_head, h->tunnels_tail, t);
return;
}
process_tunnel_destroy (struct GNUNET_MESH_Handle *h,
const struct GNUNET_MESH_TunnelMessage *msg)
{
- struct GNUNET_MESH_Tunnel *t;
- MESH_TunnelNumber tid;
-
- tid = ntohl (msg->tunnel_id);
- t = retrieve_tunnel(h, tid);
-
- t->cls = h->cls;
- t->mesh = h;
- t->tid = tid;
- GNUNET_CONTAINER_DLL_insert(h->tunnels_head, h->tunnels_tail, t);
- return;
+ struct GNUNET_MESH_Tunnel *t;
+ MESH_TunnelNumber tid;
+
+ tid = ntohl (msg->tunnel_id);
+ t = retrieve_tunnel (h, tid);
+
+ t->cls = h->cls;
+ t->mesh = h;
+ t->tid = tid;
+ GNUNET_CONTAINER_DLL_insert (h->tunnels_head, h->tunnels_tail, t);
+ return;
}
* @param tun tunnel handle
*/
void
-GNUNET_MESH_tunnel_destroy (struct GNUNET_MESH_Tunnel *t)
+GNUNET_MESH_tunnel_destroy (struct GNUNET_MESH_Tunnel *tun)
{
struct GNUNET_MESH_Handle *h;
struct GNUNET_MESH_TunnelMessage msg;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: Destroying tunnel\n");
- h = t->mesh;
+ h = tun->mesh;
- if (0 != t->owner)
- GNUNET_PEER_change_rc (t->owner, -1);
+ if (0 != tun->owner)
+ GNUNET_PEER_change_rc (tun->owner, -1);
msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_DESTROY);
msg.header.size = htons (sizeof (struct GNUNET_MESH_TunnelMessage));
- msg.tunnel_id = htonl (t->tid);
- GNUNET_free (t);
+ msg.tunnel_id = htonl (tun->tid);
+ GNUNET_free (tun);
send_packet (h, &msg.header);
}
* Task called by the scheduler once we can do the TCP send
* (or once we failed to connect...).
*
- * @param ctx the 'struct TcpContext'
+ * @param cls the 'struct TcpContext'
* @param tc scheduler context
*/
static void
* Try to send 'data' to the
* IP 'dst_ipv4' at port 'dport' via TCP.
*
- * @param dst_ivp4 target IP
+ * @param dst_ipv4 target IP
* @param dport target port
* @param data data to send
*/
* Try to send 'data' to the
* IP 'dst_ipv4' at port 'dport' via UDP.
*
- * @param dst_ivp4 target IP
+ * @param dst_ipv4 target IP
* @param dport target port
* @param data data to send
*/
/**
* Task run during shutdown.
*
- * @param ctx unused
+ * @param cls unused
* @param tc scheduler context
*/
static void
* Remove all addresses from the list of 'local' addresses
* that originated from the given source.
*
- * @param plugin the plugin
+ * @param h handle to NAT
* @param src source that identifies addresses to remove
*/
static void
* Add the given address to the list of 'local' addresses, thereby
* making it a 'legal' address for this peer to have.
*
- * @param plugin the plugin
+ * @param h handle to NAT
* @param src where did the local address originate from?
* @param arg the address, some 'struct sockaddr'
* @param arg_size number of bytes in arg
* port number in the process to the advertised port and possibly
* also to zero (if we have the gnunet-helper-nat-server).
*
- * @param plugin the plugin
+ * @param h handle to NAT
* @param src where did the local address originate from?
* @param arg the address, some 'struct sockaddr'
* @param arg_size number of bytes in arg
* Add the given IP address to the list of 'local' addresses, thereby
* making it a 'legal' address for this peer to have.
*
- * @param plugin the plugin
+ * @param h handle to NAT
* @param src where did the local address originate from?
- * @param arg the address, some 'struct in_addr' or 'struct in6_addr'
- * @param arg_size number of bytes in arg
+ * @param addr the address, some 'struct in_addr' or 'struct in6_addr'
+ * @param addrlen number of bytes in addr
*/
static void
add_ip_to_address_list (struct GNUNET_NAT_Handle *h,
* @param adv_port advertised port (port we are either bound to or that our OS
* locally performs redirection from to our bound port).
* @param num_addrs number of addresses in 'addrs'
- * @param addr the local address packets should be redirected to
- * @param addrlen actual lenght of the address
+ * @param addrs the local addresses packets should be redirected to
+ * @param addrlens actual lengths of the addresses
* @param address_callback function to call everytime the public IP address changes
* @param reversal_callback function to call if someone wants connection reversal from us
* @param callback_cls closure for callbacks
Boston, MA 02111-1307, USA.
*/
/**
- * @file nse/nse-profiler.c
+ * @file nse/gnunet-nse-profiler.c
*
* @brief Profiling driver for the network size estimation service.
* Generally, the profiler starts a given number of peers,
* Task scheduled to re-try connecting to the peerinfo service.
*
* @param cls the 'struct GNUNET_PEERINFO_Handle'
- * @param ts scheduler context
+ * @param tc scheduler context
*/
static void
reconnect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
* @param timeout how long to wait for process for shutdown to complete
* @param cb function called once the daemon was stopped
* @param cb_cls closure for cb
- * @param delete_files GNUNET_YES to remove files, GNUNET_NO
- * to leave them
* @param allow_restart GNUNET_YES to restart peer later (using this API)
* GNUNET_NO to kill off and clean up for good
*/
*/
/**
- * @file transport/transport_ats.c
+ * @file transport/gnunet-service-transport_ats.c
* @brief automatic transport selection
* @author Matthias Wachs
*
*/
/**
- * @file core/gnunet-transport-list-connections.c
+ * @file transport/gnunet-transport-list-connections.c
*
* @brief Print all known address information about other peers.
*
*/
/**
- * @file transport_testing.c
+ * @file transport-testing.c
* @brief testing lib for transport service
*
* @author Matthias Wachs
*/
/**
- * @file transport_testing.h
+ * @file transport-testing.h
* @brief testing lib for transport service
*
* @author Matthias Wachs
* Dup partially a string (same semantics as strndup).
*
* @param str the string to dup
- * @param len the lenght of the string to dup
+ * @param len the length of the string to dup
* @param filename where in the code was the call to GNUNET_strndup
* @param linenumber where in the code was the call to GNUNET_strndup
* @return strndup(str,len)
void
GNUNET_CONNECTION_notify_transmit_ready_cancel (struct
GNUNET_CONNECTION_TransmitHandle
- *h)
+ *th)
{
- GNUNET_assert (h->notify_ready != NULL);
- if (0 != (h->sh->ccs & COCO_TRANSMIT_READY))
+ GNUNET_assert (th->notify_ready != NULL);
+ if (0 != (th->sh->ccs & COCO_TRANSMIT_READY))
{
#if DEBUG_CONNECTION
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "notify_transmit_ready_cancel cancels timeout_task (%p)\n", h);
+ "notify_transmit_ready_cancel cancels timeout_task (%p)\n", th);
#endif
- GNUNET_SCHEDULER_cancel (h->timeout_task);
- h->timeout_task = GNUNET_SCHEDULER_NO_TASK;
- h->sh->ccs -= COCO_TRANSMIT_READY;
+ GNUNET_SCHEDULER_cancel (th->timeout_task);
+ th->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ th->sh->ccs -= COCO_TRANSMIT_READY;
}
else
{
- if (h->sh->write_task != GNUNET_SCHEDULER_NO_TASK)
+ if (th->sh->write_task != GNUNET_SCHEDULER_NO_TASK)
{
- GNUNET_SCHEDULER_cancel (h->sh->write_task);
- h->sh->write_task = GNUNET_SCHEDULER_NO_TASK;
+ GNUNET_SCHEDULER_cancel (th->sh->write_task);
+ th->sh->write_task = GNUNET_SCHEDULER_NO_TASK;
}
}
- h->notify_ready = NULL;
+ th->notify_ready = NULL;
}
/* end of connection.c */
/**
* Configuration.
*/
-static const struct GNUNET_CONFIGURATION_Handle *cfg;
+static const struct GNUNET_CONFIGURATION_Handle *resolver_cfg;
/**
* Our connection to the resolver service, created on-demand, but then
* (or equivalent).
*/
static void
-check_config (const struct GNUNET_CONFIGURATION_Handle *cfg)
+check_config ()
{
char *hostname;
unsigned int i;
v6.sin6_len = sizeof (v6);
#endif
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (cfg, "resolver", "HOSTNAME",
- &hostname))
+ GNUNET_CONFIGURATION_get_value_string (resolver_cfg, "resolver",
+ "HOSTNAME", &hostname))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Must specify `%s' for `%s' in configuration!\n"), "HOSTNAME",
/**
* Create the connection to the resolver service.
*
- * @param c configuration to use
+ * @param cfg configuration to use
*/
void
-GNUNET_RESOLVER_connect (const struct GNUNET_CONFIGURATION_Handle *c)
+GNUNET_RESOLVER_connect (const struct GNUNET_CONFIGURATION_Handle *cfg)
{
- GNUNET_assert (NULL != c);
- check_config (c);
+ GNUNET_assert (NULL != cfg);
backoff = GNUNET_TIME_UNIT_MILLISECONDS;
- cfg = c;
+ resolver_cfg = cfg;
+ check_config ();
}
/**
* Process pending requests to the resolver.
- *
- * @param h handle to the resolver
*/
static void
process_requests ();
#if DEBUG_RESOLVER
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Trying to connect to DNS service\n");
#endif
- client = GNUNET_CLIENT_connect ("resolver", cfg);
+ client = GNUNET_CLIENT_connect ("resolver", resolver_cfg);
if (NULL == client)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Will try to connect to DNS service in %llu ms\n",
(unsigned long long) backoff.rel_value);
#endif
- GNUNET_assert (NULL != cfg);
+ GNUNET_assert (NULL != resolver_cfg);
r_task = GNUNET_SCHEDULER_add_delayed (backoff, &reconnect_task, NULL);
backoff = GNUNET_TIME_relative_multiply (backoff, 2);
}
{
struct GNUNET_RESOLVER_RequestHandle *rh;
- check_config (cfg);
+ check_config ();
rh = GNUNET_malloc (sizeof (struct GNUNET_RESOLVER_RequestHandle) + salen);
rh->name_callback = callback;
rh->cls = cls;
* Sets the select function to use in the scheduler (scheduler_select).
*
* @param new_select new select function to use
+ * @param new_select_cls closure for 'new_select'
* @return previously used select function, NULL for default
*/
void