From 9cd0d5068f3341fe8451a61872894f28a5ac9047 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 18 Oct 2015 12:33:21 +0000 Subject: rename 'struct Session' to 'struct GNUNET_ATS_Session' to satisfy naming conventions --- src/ats/ats.h | 2 +- src/ats/ats_api_scheduling.c | 16 ++-- src/ats/gnunet-service-ats_scheduling.c | 4 +- src/ats/test_ats_lib.c | 18 ++--- src/dv/plugin_transport_dv.c | 46 +++++------ src/include/gnunet_ats_service.h | 11 ++- src/include/gnunet_transport_plugin.h | 24 +++--- src/include/gnunet_transport_service.h | 2 +- src/transport/gnunet-service-transport.c | 38 ++++----- src/transport/gnunet-service-transport.h | 2 +- src/transport/gnunet-service-transport_ats.c | 18 ++--- src/transport/gnunet-service-transport_ats.h | 12 +-- src/transport/gnunet-service-transport_blacklist.c | 8 +- src/transport/gnunet-service-transport_blacklist.h | 6 +- src/transport/gnunet-service-transport_clients.c | 2 +- .../gnunet-service-transport_manipulation.c | 4 +- .../gnunet-service-transport_manipulation.h | 4 +- .../gnunet-service-transport_neighbours.c | 76 +++++++++--------- .../gnunet-service-transport_neighbours.h | 16 ++-- .../gnunet-service-transport_validation.c | 8 +- .../gnunet-service-transport_validation.h | 2 +- src/transport/plugin_transport_http.h | 38 ++++----- src/transport/plugin_transport_http_client.c | 90 +++++++++++----------- src/transport/plugin_transport_http_server.c | 64 +++++++-------- src/transport/plugin_transport_tcp.c | 78 +++++++++---------- src/transport/plugin_transport_template.c | 22 +++--- src/transport/plugin_transport_udp.c | 76 +++++++++--------- src/transport/plugin_transport_udp.h | 2 +- src/transport/plugin_transport_unix.c | 52 ++++++------- src/transport/plugin_transport_wlan.c | 48 ++++++------ src/transport/test_plugin_transport.c | 4 +- src/transport/transport_api_monitor_plugins.c | 2 +- 32 files changed, 397 insertions(+), 398 deletions(-) diff --git a/src/ats/ats.h b/src/ats/ats.h index 7cad9e98e..3a7f28a64 100644 --- a/src/ats/ats.h +++ b/src/ats/ats.h @@ -218,7 +218,7 @@ struct AddressDestroyedMessage * Message sent by ATS service to client to confirm that it is done * using the given session ID. */ -struct SessionReleaseMessage +struct GNUNET_ATS_SessionReleaseMessage { /** * Type is #GNUNET_MESSAGE_TYPE_ATS_SESSION_RELEASE. diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c index a5dd0827c..d7a5a83a1 100644 --- a/src/ats/ats_api_scheduling.c +++ b/src/ats/ats_api_scheduling.c @@ -70,7 +70,7 @@ struct GNUNET_ATS_AddressRecord * Session handle. NULL if we have an address but no * active session for this address. */ - struct Session *session; + struct GNUNET_ATS_Session *session; /** * Performance data about the address. @@ -295,7 +295,7 @@ find_empty_session_slot (struct GNUNET_ATS_SchedulingHandle *sh) */ static uint32_t find_session_id (struct GNUNET_ATS_SchedulingHandle *sh, - struct Session *session, + struct GNUNET_ATS_Session *session, const struct GNUNET_HELLO_Address *address) { uint32_t i; @@ -367,9 +367,9 @@ process_ats_session_release_message (void *cls, const struct GNUNET_MessageHeader *msg) { struct GNUNET_ATS_SchedulingHandle *sh = cls; - const struct SessionReleaseMessage *srm; + const struct GNUNET_ATS_SessionReleaseMessage *srm; - srm = (const struct SessionReleaseMessage *) msg; + srm = (const struct GNUNET_ATS_SessionReleaseMessage *) msg; /* Note: peer field in srm not necessary right now, but might be good to have in the future */ release_session (sh, @@ -534,7 +534,7 @@ reconnect (struct GNUNET_ATS_SchedulingHandle *sh) static const struct GNUNET_MQ_MessageHandler handlers[] = { { &process_ats_session_release_message, GNUNET_MESSAGE_TYPE_ATS_SESSION_RELEASE, - sizeof (struct SessionReleaseMessage) }, + sizeof (struct GNUNET_ATS_SessionReleaseMessage) }, { &process_ats_address_suggestion_message, GNUNET_MESSAGE_TYPE_ATS_ADDRESS_SUGGESTION, sizeof (struct AddressSuggestionMessage) }, @@ -659,7 +659,7 @@ GNUNET_ATS_scheduling_done (struct GNUNET_ATS_SchedulingHandle *sh) struct GNUNET_ATS_AddressRecord * GNUNET_ATS_address_add (struct GNUNET_ATS_SchedulingHandle *sh, const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, const struct GNUNET_ATS_Properties *prop) { struct GNUNET_ATS_AddressRecord *ar; @@ -716,7 +716,7 @@ GNUNET_ATS_address_add (struct GNUNET_ATS_SchedulingHandle *sh, */ void GNUNET_ATS_address_add_session (struct GNUNET_ATS_AddressRecord *ar, - struct Session *session) + struct GNUNET_ATS_Session *session) { GNUNET_break (NULL == ar->session); ar->session = session; @@ -737,7 +737,7 @@ GNUNET_ATS_address_add_session (struct GNUNET_ATS_AddressRecord *ar, */ int GNUNET_ATS_address_del_session (struct GNUNET_ATS_AddressRecord *ar, - struct Session *session) + struct GNUNET_ATS_Session *session) { GNUNET_assert (session == ar->session); ar->session = NULL; diff --git a/src/ats/gnunet-service-ats_scheduling.c b/src/ats/gnunet-service-ats_scheduling.c index 1aa96b861..fe472103c 100644 --- a/src/ats/gnunet-service-ats_scheduling.c +++ b/src/ats/gnunet-service-ats_scheduling.c @@ -232,7 +232,7 @@ GAS_handle_address_destroyed (void *cls, const struct GNUNET_MessageHeader *message) { const struct AddressDestroyedMessage *m; - struct SessionReleaseMessage srm; + struct GNUNET_ATS_SessionReleaseMessage srm; m = (const struct AddressDestroyedMessage *) message; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, @@ -245,7 +245,7 @@ GAS_handle_address_destroyed (void *cls, GAS_addresses_destroy (&m->peer, ntohl (m->session_id)); srm.header.type = ntohs (GNUNET_MESSAGE_TYPE_ATS_SESSION_RELEASE); - srm.header.size = ntohs (sizeof (struct SessionReleaseMessage)); + srm.header.size = ntohs (sizeof (struct GNUNET_ATS_SessionReleaseMessage)); srm.session_id = m->session_id; srm.peer = m->peer; GNUNET_SERVER_notification_context_unicast (nc, diff --git a/src/ats/test_ats_lib.c b/src/ats/test_ats_lib.c index 314f19007..e191588bb 100644 --- a/src/ats/test_ats_lib.c +++ b/src/ats/test_ats_lib.c @@ -36,7 +36,7 @@ struct AddressSuggestData /** * Which session were we given? */ - struct Session *session; + struct GNUNET_ATS_Session *session; /** * What address was assigned? @@ -404,10 +404,10 @@ make_address (uint32_t pid, /** * Our dummy sessions. */ -struct Session +struct GNUNET_ATS_Session { /** - * Field to avoid `0 == sizeof(struct Session)`. + * Field to avoid `0 == sizeof(struct GNUNET_ATS_Session)`. */ unsigned int non_empty; }; @@ -419,10 +419,10 @@ struct Session * @param i which session number to return * @return NULL if @a i is 0, otherwise a pointer unique to @a i */ -static struct Session * +static struct GNUNET_ATS_Session * make_session (unsigned int i) { - struct Session *baseptr = NULL; + struct GNUNET_ATS_Session *baseptr = NULL; if (0 == i) return NULL; @@ -618,7 +618,7 @@ interpreter (void *cls, case CMD_ADD_ADDRESS: { struct GNUNET_HELLO_Address *addr; - struct Session *session; + struct GNUNET_ATS_Session *session; addr = make_address (cmd->details.add_address.pid, cmd->details.add_address.addr_num, @@ -781,7 +781,7 @@ interpreter (void *cls, case CMD_ADD_SESSION: { struct Command *add; - struct Session *session; + struct GNUNET_ATS_Session *session; add = find_command (CMD_ADD_ADDRESS, cmd->details.add_session.add_label); @@ -796,7 +796,7 @@ interpreter (void *cls, { struct Command *add_address; struct Command *add_session; - struct Session *session; + struct GNUNET_ATS_Session *session; add_session = find_command (CMD_ADD_SESSION, cmd->details.del_session.add_session_label); @@ -891,7 +891,7 @@ static void address_suggest_cb (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) { diff --git a/src/dv/plugin_transport_dv.c b/src/dv/plugin_transport_dv.c index 32b25bea0..8c4f385bf 100644 --- a/src/dv/plugin_transport_dv.c +++ b/src/dv/plugin_transport_dv.c @@ -80,7 +80,7 @@ struct PendingRequest /** * Session of this request. */ - struct Session *session; + struct GNUNET_ATS_Session *session; /** * Number of bytes to transmit. @@ -92,7 +92,7 @@ struct PendingRequest /** * Session handle for connections. */ -struct Session +struct GNUNET_ATS_Session { /** * Pointer to the global plugin struct. @@ -203,7 +203,7 @@ struct Plugin */ static void notify_session_monitor (struct Plugin *plugin, - struct Session *session, + struct GNUNET_ATS_Session *session, enum GNUNET_TRANSPORT_SessionState state) { struct GNUNET_TRANSPORT_SessionInfo info; @@ -231,7 +231,7 @@ notify_session_monitor (struct Plugin *plugin, * @param session session where the distance changed */ static void -notify_distance_change (struct Session *session) +notify_distance_change (struct GNUNET_ATS_Session *session) { struct Plugin *plugin = session->plugin; @@ -247,7 +247,7 @@ notify_distance_change (struct Session *session) * Function called by MST on each message from the box. * * @param cls closure with the `struct Plugin *` - * @param client identification of the client (with the 'struct Session') + * @param client identification of the client (with the 'struct GNUNET_ATS_Session') * @param message the actual message * @return #GNUNET_OK on success */ @@ -257,7 +257,7 @@ unbox_cb (void *cls, const struct GNUNET_MessageHeader *message) { struct Plugin *plugin = cls; - struct Session *session = client; + struct GNUNET_ATS_Session *session = client; session->active = GNUNET_YES; LOG (GNUNET_ERROR_TYPE_DEBUG, @@ -291,7 +291,7 @@ handle_dv_message_received (void *cls, const struct GNUNET_MessageHeader *msg) { struct Plugin *plugin = cls; - struct Session *session; + struct GNUNET_ATS_Session *session; LOG (GNUNET_ERROR_TYPE_DEBUG, "Received DV_MESSAGE_RECEIVED message for peer `%s': new distance %u\n", @@ -348,7 +348,7 @@ handle_dv_connect (void *cls, enum GNUNET_ATS_Network_Type network) { struct Plugin *plugin = cls; - struct Session *session; + struct GNUNET_ATS_Session *session; GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != network); /** @@ -370,7 +370,7 @@ handle_dv_connect (void *cls, return; /* nothing to do */ } - session = GNUNET_new (struct Session); + session = GNUNET_new (struct GNUNET_ATS_Session); session->address = GNUNET_HELLO_address_allocate (peer, "dv", NULL, 0, GNUNET_HELLO_ADDRESS_INFO_NONE); @@ -419,7 +419,7 @@ handle_dv_distance_changed (void *cls, enum GNUNET_ATS_Network_Type network) { struct Plugin *plugin = cls; - struct Session *session; + struct GNUNET_ATS_Session *session; GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != network); LOG (GNUNET_ERROR_TYPE_DEBUG, @@ -446,7 +446,7 @@ handle_dv_distance_changed (void *cls, * @param session session to clean up */ static void -free_session (struct Session *session) +free_session (struct GNUNET_ATS_Session *session) { struct Plugin *plugin = session->plugin; struct PendingRequest *pr; @@ -500,7 +500,7 @@ handle_dv_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) { struct Plugin *plugin = cls; - struct Session *session; + struct GNUNET_ATS_Session *session; LOG (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message for peer `%s'\n", @@ -526,7 +526,7 @@ send_finished (void *cls, int ok) { struct PendingRequest *pr = cls; - struct Session *session = pr->session; + struct GNUNET_ATS_Session *session = pr->session; pr->th = NULL; GNUNET_CONTAINER_DLL_remove (session->pr_head, @@ -562,7 +562,7 @@ send_finished (void *cls, */ static ssize_t dv_plugin_send (void *cls, - struct Session *session, + struct GNUNET_ATS_Session *session, const char *msgbuf, size_t msgbuf_size, unsigned int priority, @@ -619,7 +619,7 @@ dv_plugin_disconnect_peer (void *cls, const struct GNUNET_PeerIdentity *target) { struct Plugin *plugin = cls; - struct Session *session; + struct GNUNET_ATS_Session *session; struct PendingRequest *pr; session = GNUNET_CONTAINER_multipeermap_get (plugin->sessions, @@ -655,7 +655,7 @@ dv_plugin_disconnect_peer (void *cls, */ static int dv_plugin_disconnect_session (void *cls, - struct Session *session) + struct GNUNET_ATS_Session *session) { struct PendingRequest *pr; @@ -773,12 +773,12 @@ dv_plugin_check_address (void *cls, * @param address the address * @return the session if the address is valid, NULL otherwise */ -static struct Session * +static struct GNUNET_ATS_Session * dv_get_session (void *cls, const struct GNUNET_HELLO_Address *address) { struct Plugin *plugin = cls; - struct Session *session; + struct GNUNET_ATS_Session *session; if (0 != address->address_length) return NULL; @@ -832,7 +832,7 @@ dv_plugin_string_to_address (void *cls, static void dv_plugin_update_session_timeout (void *cls, const struct GNUNET_PeerIdentity *peer, - struct Session *session) + struct GNUNET_ATS_Session *session) { /* DV currently doesn't time out like "normal" plugins, so it should be safe to do nothing, right? @@ -852,7 +852,7 @@ dv_plugin_update_session_timeout (void *cls, */ static enum GNUNET_ATS_Network_Type dv_get_network (void *cls, - struct Session *session) + struct GNUNET_ATS_Session *session) { GNUNET_assert (NULL != session); return session->network; @@ -895,7 +895,7 @@ dv_plugin_query_keepalive_factor (void *cls) * * @param cls the `struct Plugin` with the monitor callback (`sic`) * @param peer peer we send information about - * @param value our `struct Session` to send information about + * @param value our `struct GNUNET_ATS_Session` to send information about * @return #GNUNET_OK (continue to iterate) */ static int @@ -904,7 +904,7 @@ send_session_info_iter (void *cls, void *value) { struct Plugin *plugin = cls; - struct Session *session = value; + struct GNUNET_ATS_Session *session = value; if (GNUNET_YES != session->active) return GNUNET_OK; @@ -1010,7 +1010,7 @@ free_session_iterator (void *cls, const struct GNUNET_PeerIdentity *key, void *value) { - struct Session *session = value; + struct GNUNET_ATS_Session *session = value; free_session (session); return GNUNET_OK; diff --git a/src/include/gnunet_ats_service.h b/src/include/gnunet_ats_service.h index 6a2449a7a..4264f22a4 100644 --- a/src/include/gnunet_ats_service.h +++ b/src/include/gnunet_ats_service.h @@ -328,9 +328,8 @@ struct GNUNET_ATS_SchedulingHandle; /** * Opaque session handle, defined by plugins. Contents not known to ATS. - * FIXME: This violates our naming conventions. */ -struct Session; +struct GNUNET_ATS_Session; /** @@ -353,7 +352,7 @@ typedef void (*GNUNET_ATS_AddressSuggestionCallback) (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in); @@ -402,7 +401,7 @@ struct GNUNET_ATS_AddressRecord; struct GNUNET_ATS_AddressRecord * GNUNET_ATS_address_add (struct GNUNET_ATS_SchedulingHandle *sh, const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, const struct GNUNET_ATS_Properties *prop); @@ -414,7 +413,7 @@ GNUNET_ATS_address_add (struct GNUNET_ATS_SchedulingHandle *sh, */ void GNUNET_ATS_address_add_session (struct GNUNET_ATS_AddressRecord *ar, - struct Session *session); + struct GNUNET_ATS_Session *session); /** @@ -431,7 +430,7 @@ GNUNET_ATS_address_add_session (struct GNUNET_ATS_AddressRecord *ar, */ int GNUNET_ATS_address_del_session (struct GNUNET_ATS_AddressRecord *ar, - struct Session *session); + struct GNUNET_ATS_Session *session); /** diff --git a/src/include/gnunet_transport_plugin.h b/src/include/gnunet_transport_plugin.h index 0dc159cb4..375104c46 100644 --- a/src/include/gnunet_transport_plugin.h +++ b/src/include/gnunet_transport_plugin.h @@ -48,11 +48,11 @@ * connection may not have an address that can be used for meaningful * distinction between sessions to the same peer. * - * Each 'struct Session' MUST start with the 'struct GNUNET_PeerIdentity' + * Each 'struct GNUNET_ATS_Session' MUST start with the 'struct GNUNET_PeerIdentity' * of the peer the session is for (which will be used for some error * checking by the ATS code). */ -struct Session; +struct GNUNET_ATS_Session; /** @@ -71,7 +71,7 @@ struct Session; typedef void (*GNUNET_TRANSPORT_SessionEnd) (void *cls, const struct GNUNET_HELLO_Address *address, - struct Session *session); + struct GNUNET_ATS_Session *session); /** @@ -85,7 +85,7 @@ typedef void typedef void (*GNUNET_TRANSPORT_SessionStart) (void *cls, const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, enum GNUNET_ATS_Network_Type net); @@ -114,7 +114,7 @@ typedef void typedef struct GNUNET_TIME_Relative (*GNUNET_TRANSPORT_PluginReceiveCallback) (void *cls, const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, const struct GNUNET_MessageHeader *message); @@ -334,7 +334,7 @@ typedef void */ typedef ssize_t (*GNUNET_TRANSPORT_TransmitFunction) (void *cls, - struct Session *session, + struct GNUNET_ATS_Session *session, const char *msgbuf, size_t msgbuf_size, unsigned int priority, @@ -357,7 +357,7 @@ typedef ssize_t */ typedef int (*GNUNET_TRANSPORT_DisconnectSessionFunction) (void *cls, - struct Session *session); + struct GNUNET_ATS_Session *session); /** @@ -463,7 +463,7 @@ typedef int * @param address the hello address * @return the session if the address is valid, NULL otherwise */ -typedef struct Session * +typedef struct GNUNET_ATS_Session * (*GNUNET_TRANSPORT_CreateSession) (void *cls, const struct GNUNET_HELLO_Address *address); @@ -480,7 +480,7 @@ typedef struct Session * typedef void (*GNUNET_TRANSPORT_UpdateSessionTimeout) (void *cls, const struct GNUNET_PeerIdentity *peer, - struct Session *session); + struct GNUNET_ATS_Session *session); /** @@ -496,7 +496,7 @@ typedef void typedef void (*GNUNET_TRANSPORT_UpdateInboundDelay) (void *cls, const struct GNUNET_PeerIdentity *peer, - struct Session *session, + struct GNUNET_ATS_Session *session, struct GNUNET_TIME_Relative delay); @@ -546,7 +546,7 @@ typedef int */ typedef enum GNUNET_ATS_Network_Type (*GNUNET_TRANSPORT_GetNetworkType) (void *cls, - struct Session *session); + struct GNUNET_ATS_Session *session); /** @@ -575,7 +575,7 @@ typedef enum GNUNET_ATS_Network_Type */ typedef void (*GNUNET_TRANSPORT_SessionInfoCallback) (void *cls, - struct Session *session, + struct GNUNET_ATS_Session *session, const struct GNUNET_TRANSPORT_SessionInfo *info); diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h index 7f178e4c4..07470047e 100644 --- a/src/include/gnunet_transport_service.h +++ b/src/include/gnunet_transport_service.h @@ -891,7 +891,7 @@ struct GNUNET_TRANSPORT_PluginMonitor; /** * Abstract representation of a plugin's session. - * Corresponds to the `struct Session` within the TRANSPORT service. + * Corresponds to the `struct GNUNET_ATS_Session` within the TRANSPORT service. */ struct GNUNET_TRANSPORT_PluginSession; diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index 8e2a135f2..89a1ec4c9 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c @@ -44,22 +44,22 @@ /** * Information we need for an asynchronous session kill. */ -struct SessionKiller +struct GNUNET_ATS_SessionKiller { /** * Kept in a DLL. */ - struct SessionKiller *next; + struct GNUNET_ATS_SessionKiller *next; /** * Kept in a DLL. */ - struct SessionKiller *prev; + struct GNUNET_ATS_SessionKiller *prev; /** * Session to kill. */ - struct Session *session; + struct GNUNET_ATS_Session *session; /** * Plugin for the session. @@ -123,12 +123,12 @@ struct GNUNET_TIME_Relative hello_expiration; /** * Head of DLL of asynchronous tasks to kill sessions. */ -static struct SessionKiller *sk_head; +static struct GNUNET_ATS_SessionKiller *sk_head; /** * Tail of DLL of asynchronous tasks to kill sessions. */ -static struct SessionKiller *sk_tail; +static struct GNUNET_ATS_SessionKiller *sk_tail; /** * Interface scanner determines our LAN address range(s). @@ -206,7 +206,7 @@ process_hello_update (void *cls, */ static struct GNUNET_TIME_Relative process_payload (const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, const struct GNUNET_MessageHeader *message) { struct GNUNET_TIME_Relative ret; @@ -249,14 +249,14 @@ process_payload (const struct GNUNET_HELLO_Address *address, /** * Task to asynchronously terminate a session. * - * @param cls the `struct SessionKiller` with the information for the kill + * @param cls the `struct GNUNET_ATS_SessionKiller` with the information for the kill * @param tc scheduler context */ static void kill_session_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - struct SessionKiller *sk = cls; + struct GNUNET_ATS_SessionKiller *sk = cls; sk->task = NULL; GNUNET_CONTAINER_DLL_remove (sk_head, sk_tail, sk); @@ -274,10 +274,10 @@ kill_session_task (void *cls, */ static void kill_session (const char *plugin_name, - struct Session *session) + struct GNUNET_ATS_Session *session) { struct GNUNET_TRANSPORT_PluginFunctions *plugin; - struct SessionKiller *sk; + struct GNUNET_ATS_SessionKiller *sk; for (sk = sk_head; NULL != sk; sk = sk->next) if (sk->session == session) @@ -289,7 +289,7 @@ kill_session (const char *plugin_name, return; } /* need to issue disconnect asynchronously */ - sk = GNUNET_new (struct SessionKiller); + sk = GNUNET_new (struct GNUNET_ATS_SessionKiller); sk->session = session; sk->plugin = plugin; sk->task = GNUNET_SCHEDULER_add_now (&kill_session_task, sk); @@ -313,7 +313,7 @@ static void connect_bl_check_cont (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, int result) { struct GNUNET_MessageHeader *msg = cls; @@ -365,7 +365,7 @@ connect_bl_check_cont (void *cls, struct GNUNET_TIME_Relative GST_receive_callback (void *cls, const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, const struct GNUNET_MessageHeader *message) { const char *plugin_name = cls; @@ -559,9 +559,9 @@ plugin_env_address_change_notification (void *cls, static void plugin_env_session_end (void *cls, const struct GNUNET_HELLO_Address *address, - struct Session *session) + struct GNUNET_ATS_Session *session) { - struct SessionKiller *sk; + struct GNUNET_ATS_SessionKiller *sk; if (NULL == address) { @@ -614,7 +614,7 @@ static void plugin_env_session_start_bl_check_cont (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, int result) { if (GNUNET_OK != result) @@ -646,7 +646,7 @@ plugin_env_session_start_bl_check_cont (void *cls, static void plugin_env_session_start (void *cls, const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, enum GNUNET_ATS_Network_Type scope) { struct GNUNET_ATS_Properties prop; @@ -713,7 +713,7 @@ static void ats_request_address_change (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) { diff --git a/src/transport/gnunet-service-transport.h b/src/transport/gnunet-service-transport.h index 4966341af..a38dbd2fe 100644 --- a/src/transport/gnunet-service-transport.h +++ b/src/transport/gnunet-service-transport.h @@ -107,7 +107,7 @@ typedef void struct GNUNET_TIME_Relative GST_receive_callback (void *cls, const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, const struct GNUNET_MessageHeader *message); diff --git a/src/transport/gnunet-service-transport_ats.c b/src/transport/gnunet-service-transport_ats.c index 5fcd8f479..d6bc836d3 100644 --- a/src/transport/gnunet-service-transport_ats.c +++ b/src/transport/gnunet-service-transport_ats.c @@ -50,7 +50,7 @@ struct AddressInfo /** * Session (can be NULL) */ - struct Session *session; + struct GNUNET_ATS_Session *session; /** * Record with ATS API for the address. @@ -114,7 +114,7 @@ struct FindClosure /** * Session to look for (only used if the address is inbound). */ - struct Session *session; + struct GNUNET_ATS_Session *session; /** * Address to look for. @@ -188,7 +188,7 @@ find_ai_cb (void *cls, */ static struct AddressInfo * find_ai (const struct GNUNET_HELLO_Address *address, - struct Session *session) + struct GNUNET_ATS_Session *session) { struct FindClosure fc; @@ -267,7 +267,7 @@ find_ai_no_session (const struct GNUNET_HELLO_Address *address) */ int GST_ats_is_known (const struct GNUNET_HELLO_Address *address, - struct Session *session) + struct GNUNET_ATS_Session *session) { return (NULL != find_ai (address, session)) ? GNUNET_YES : GNUNET_NO; } @@ -328,7 +328,7 @@ unblock_address (void *cls, */ void GST_ats_block_address (const struct GNUNET_HELLO_Address *address, - struct Session *session) + struct GNUNET_ATS_Session *session) { struct AddressInfo *ai; @@ -395,7 +395,7 @@ GST_ats_block_address (const struct GNUNET_HELLO_Address *address, */ void GST_ats_block_reset (const struct GNUNET_HELLO_Address *address, - struct Session *session) + struct GNUNET_ATS_Session *session) { struct AddressInfo *ai; @@ -423,7 +423,7 @@ GST_ats_block_reset (const struct GNUNET_HELLO_Address *address, */ void GST_ats_add_inbound_address (const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, const struct GNUNET_ATS_Properties *prop) { struct GNUNET_ATS_AddressRecord *ar; @@ -533,7 +533,7 @@ GST_ats_add_address (const struct GNUNET_HELLO_Address *address, */ void GST_ats_new_session (const struct GNUNET_HELLO_Address *address, - struct Session *session) + struct GNUNET_ATS_Session *session) { struct AddressInfo *ai; @@ -611,7 +611,7 @@ destroy_ai (struct AddressInfo *ai) */ void GST_ats_del_session (const struct GNUNET_HELLO_Address *address, - struct Session *session) + struct GNUNET_ATS_Session *session) { struct AddressInfo *ai; diff --git a/src/transport/gnunet-service-transport_ats.h b/src/transport/gnunet-service-transport_ats.h index e73e82913..5e98112f8 100644 --- a/src/transport/gnunet-service-transport_ats.h +++ b/src/transport/gnunet-service-transport_ats.h @@ -52,7 +52,7 @@ GST_ats_done (void); */ int GST_ats_is_known (const struct GNUNET_HELLO_Address *address, - struct Session *session); + struct GNUNET_ATS_Session *session); /** @@ -77,7 +77,7 @@ GST_ats_is_known_no_session (const struct GNUNET_HELLO_Address *address); */ void GST_ats_block_address (const struct GNUNET_HELLO_Address *address, - struct Session *session); + struct GNUNET_ATS_Session *session); /** @@ -90,7 +90,7 @@ GST_ats_block_address (const struct GNUNET_HELLO_Address *address, */ void GST_ats_block_reset (const struct GNUNET_HELLO_Address *address, - struct Session *session); + struct GNUNET_ATS_Session *session); /** @@ -105,7 +105,7 @@ GST_ats_block_reset (const struct GNUNET_HELLO_Address *address, */ void GST_ats_add_inbound_address (const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, const struct GNUNET_ATS_Properties *prop); @@ -132,7 +132,7 @@ GST_ats_add_address (const struct GNUNET_HELLO_Address *address, */ void GST_ats_new_session (const struct GNUNET_HELLO_Address *address, - struct Session *session); + struct GNUNET_ATS_Session *session); /** @@ -187,7 +187,7 @@ GST_ats_update_distance (const struct GNUNET_HELLO_Address *address, */ void GST_ats_del_session (const struct GNUNET_HELLO_Address *address, - struct Session *session); + struct GNUNET_ATS_Session *session); /** diff --git a/src/transport/gnunet-service-transport_blacklist.c b/src/transport/gnunet-service-transport_blacklist.c index 987957911..967aae89b 100644 --- a/src/transport/gnunet-service-transport_blacklist.c +++ b/src/transport/gnunet-service-transport_blacklist.c @@ -153,7 +153,7 @@ struct GST_BlacklistCheck /** * Session for #GST_blacklist_abort_matching(), can be NULL. */ - struct Session *session; + struct GNUNET_ATS_Session *session; /** * Current transmission request handle for this client, or NULL if no @@ -495,7 +495,7 @@ static void confirm_or_drop_neighbour (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, int allowed) { if (GNUNET_OK == allowed) @@ -744,7 +744,7 @@ GST_blacklist_add_peer (const struct GNUNET_PeerIdentity *peer, */ void GST_blacklist_abort_matching (const struct GNUNET_HELLO_Address *address, - struct Session *session) + struct GNUNET_ATS_Session *session) { struct GST_BlacklistCheck *bc; struct GST_BlacklistCheck *n; @@ -832,7 +832,7 @@ GST_blacklist_test_allowed (const struct GNUNET_PeerIdentity *peer, GST_BlacklistTestContinuation cont, void *cont_cls, const struct GNUNET_HELLO_Address *address, - struct Session *session) + struct GNUNET_ATS_Session *session) { struct GST_BlacklistCheck *bc; diff --git a/src/transport/gnunet-service-transport_blacklist.h b/src/transport/gnunet-service-transport_blacklist.h index 268e03d8c..6c5e57030 100644 --- a/src/transport/gnunet-service-transport_blacklist.h +++ b/src/transport/gnunet-service-transport_blacklist.h @@ -110,7 +110,7 @@ typedef void (*GST_BlacklistTestContinuation) (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, int result); @@ -132,7 +132,7 @@ GST_blacklist_test_allowed (const struct GNUNET_PeerIdentity *peer, GST_BlacklistTestContinuation cont, void *cont_cls, const struct GNUNET_HELLO_Address *address, - struct Session *session); + struct GNUNET_ATS_Session *session); /** @@ -143,7 +143,7 @@ GST_blacklist_test_allowed (const struct GNUNET_PeerIdentity *peer, */ void GST_blacklist_abort_matching (const struct GNUNET_HELLO_Address *address, - struct Session *session); + struct GNUNET_ATS_Session *session); diff --git a/src/transport/gnunet-service-transport_clients.c b/src/transport/gnunet-service-transport_clients.c index 103c6fd0a..f286016a6 100644 --- a/src/transport/gnunet-service-transport_clients.c +++ b/src/transport/gnunet-service-transport_clients.c @@ -1430,7 +1430,7 @@ clients_handle_monitor_validation (void *cls, */ static void plugin_session_info_cb (void *cls, - struct Session *session, + struct GNUNET_ATS_Session *session, const struct GNUNET_TRANSPORT_SessionInfo *info) { struct TransportPluginMonitorMessage *msg; diff --git a/src/transport/gnunet-service-transport_manipulation.c b/src/transport/gnunet-service-transport_manipulation.c index d8f12827c..89d4b532a 100644 --- a/src/transport/gnunet-service-transport_manipulation.c +++ b/src/transport/gnunet-service-transport_manipulation.c @@ -369,7 +369,7 @@ GST_manipulation_send (const struct GNUNET_PeerIdentity *target, */ void GST_manipulation_manipulate_metrics (const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, struct GNUNET_ATS_Properties *prop) { const struct GNUNET_PeerIdentity *peer = &address->peer; @@ -395,7 +395,7 @@ GST_manipulation_manipulate_metrics (const struct GNUNET_HELLO_Address *address, struct GNUNET_TIME_Relative GST_manipulation_recv (void *cls, const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, const struct GNUNET_MessageHeader *message) { struct TM_Peer *tmp; diff --git a/src/transport/gnunet-service-transport_manipulation.h b/src/transport/gnunet-service-transport_manipulation.h index e0395e2fe..3afb9885a 100644 --- a/src/transport/gnunet-service-transport_manipulation.h +++ b/src/transport/gnunet-service-transport_manipulation.h @@ -83,7 +83,7 @@ GST_manipulation_send (const struct GNUNET_PeerIdentity *target, struct GNUNET_TIME_Relative GST_manipulation_recv (void *cls, const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, const struct GNUNET_MessageHeader *message); @@ -97,7 +97,7 @@ GST_manipulation_recv (void *cls, */ void GST_manipulation_manipulate_metrics (const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, struct GNUNET_ATS_Properties *prop); diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index 442935993..d41fa6582 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c @@ -148,7 +148,7 @@ struct TransportSynMessage * When the keep alive response with type is received, transport service * will call the respective plugin to update the session timeout */ -struct SessionKeepAliveMessage +struct GNUNET_ATS_SessionKeepAliveMessage { /** * Header of type #GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_KEEPALIVE or @@ -168,7 +168,7 @@ struct SessionKeepAliveMessage * the other peer should limit transmissions to the indicated * quota. */ -struct SessionQuotaMessage +struct GNUNET_ATS_SessionQuotaMessage { /** * Header of type #GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_QUOTA. @@ -188,7 +188,7 @@ struct SessionQuotaMessage * notification, peers must not rely on always receiving disconnect * messages. */ -struct SessionDisconnectMessage +struct GNUNET_ATS_SessionDisconnectMessage { /** * Header of type #GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT @@ -284,7 +284,7 @@ struct NeighbourAddress /** * Active session for this address. */ - struct Session *session; + struct GNUNET_ATS_Session *session; /** * Network-level address information. @@ -819,7 +819,7 @@ set_state_and_timeout (struct NeighbourMapEntry *n, static void set_alternative_address (struct NeighbourMapEntry *n, const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out) { @@ -1063,12 +1063,12 @@ send_disconnect_cont (void *cls, static void send_disconnect (struct NeighbourMapEntry *n) { - struct SessionDisconnectMessage disconnect_msg; + struct GNUNET_ATS_SessionDisconnectMessage disconnect_msg; GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Sending DISCONNECT message to peer `%4s'\n", GNUNET_i2s (&n->id)); - disconnect_msg.header.size = htons (sizeof (struct SessionDisconnectMessage)); + disconnect_msg.header.size = htons (sizeof (struct GNUNET_ATS_SessionDisconnectMessage)); disconnect_msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT); disconnect_msg.reserved = htonl (0); @@ -1196,9 +1196,9 @@ set_incoming_quota (struct NeighbourMapEntry *n, quota); if (0 != ntohl (quota.value__)) { - struct SessionQuotaMessage sqm; + struct GNUNET_ATS_SessionQuotaMessage sqm; - sqm.header.size = htons (sizeof (struct SessionQuotaMessage)); + sqm.header.size = htons (sizeof (struct GNUNET_ATS_SessionQuotaMessage)); sqm.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_QUOTA); sqm.quota = quota.value__; (void) send_with_session (n, @@ -1235,7 +1235,7 @@ set_incoming_quota (struct NeighbourMapEntry *n, static void set_primary_address (struct NeighbourMapEntry *n, const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out) { @@ -1475,7 +1475,7 @@ try_transmission_to_peer (struct NeighbourMapEntry *n) static void send_keepalive (struct NeighbourMapEntry *n) { - struct SessionKeepAliveMessage m; + struct GNUNET_ATS_SessionKeepAliveMessage m; struct GNUNET_TIME_Relative timeout; uint32_t nonce; @@ -1493,7 +1493,7 @@ send_keepalive (struct NeighbourMapEntry *n) "Sending KEEPALIVE to peer `%s' with nonce %u\n", GNUNET_i2s (&n->id), nonce); - m.header.size = htons (sizeof (struct SessionKeepAliveMessage)); + m.header.size = htons (sizeof (struct GNUNET_ATS_SessionKeepAliveMessage)); m.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_KEEPALIVE); m.nonce = htonl (nonce); @@ -1527,16 +1527,16 @@ GST_neighbours_keepalive (const struct GNUNET_PeerIdentity *neighbour, const struct GNUNET_MessageHeader *m) { struct NeighbourMapEntry *n; - const struct SessionKeepAliveMessage *msg_in; - struct SessionKeepAliveMessage msg; + const struct GNUNET_ATS_SessionKeepAliveMessage *msg_in; + struct GNUNET_ATS_SessionKeepAliveMessage msg; - if (sizeof (struct SessionKeepAliveMessage) != ntohs (m->size)) + if (sizeof (struct GNUNET_ATS_SessionKeepAliveMessage) != ntohs (m->size)) { GNUNET_break_op (0); return; } - msg_in = (const struct SessionKeepAliveMessage *) m; + msg_in = (const struct GNUNET_ATS_SessionKeepAliveMessage *) m; if (NULL == (n = lookup_neighbour (neighbour))) { GNUNET_STATISTICS_update (GST_stats, @@ -1564,12 +1564,12 @@ GST_neighbours_keepalive (const struct GNUNET_PeerIdentity *neighbour, GNUNET_NO); /* send reply to allow neighbour to measure latency */ - msg.header.size = htons (sizeof (struct SessionKeepAliveMessage)); + msg.header.size = htons (sizeof (struct GNUNET_ATS_SessionKeepAliveMessage)); msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_KEEPALIVE_RESPONSE); msg.nonce = msg_in->nonce; (void) send_with_session (n, &msg, - sizeof (struct SessionKeepAliveMessage), + sizeof (struct GNUNET_ATS_SessionKeepAliveMessage), UINT32_MAX /* priority */, GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_YES, @@ -1590,17 +1590,17 @@ GST_neighbours_keepalive_response (const struct GNUNET_PeerIdentity *neighbour, const struct GNUNET_MessageHeader *m) { struct NeighbourMapEntry *n; - const struct SessionKeepAliveMessage *msg; + const struct GNUNET_ATS_SessionKeepAliveMessage *msg; struct GNUNET_TRANSPORT_PluginFunctions *papi; struct GNUNET_TIME_Relative latency; - if (sizeof (struct SessionKeepAliveMessage) != ntohs (m->size)) + if (sizeof (struct GNUNET_ATS_SessionKeepAliveMessage) != ntohs (m->size)) { GNUNET_break_op (0); return; } - msg = (const struct SessionKeepAliveMessage *) m; + msg = (const struct GNUNET_ATS_SessionKeepAliveMessage *) m; if (NULL == (n = lookup_neighbour (neighbour))) { GNUNET_STATISTICS_update (GST_stats, @@ -2080,7 +2080,7 @@ send_syn_ack_message (struct NeighbourAddress *na, struct GNUNET_TIME_Absolute timestamp) { const struct GNUNET_HELLO_Address *address = na->address; - struct Session *session = na->session; + struct GNUNET_ATS_Session *session = na->session; struct GNUNET_TRANSPORT_PluginFunctions *papi; struct TransportSynMessage connect_msg; struct NeighbourMapEntry *n; @@ -2267,7 +2267,7 @@ static void try_connect_bl_check_cont (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, int result) { struct BlacklistCheckSwitchContext *blc_ctx = cls; @@ -2534,7 +2534,7 @@ GST_neighbours_handle_session_syn (const struct GNUNET_MessageHeader *message, */ static int try_run_fast_ats_update (const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out) { @@ -2589,7 +2589,7 @@ static void switch_address_bl_check_cont (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, int result) { struct BlacklistCheckSwitchContext *blc_ctx = cls; @@ -2882,7 +2882,7 @@ switch_address_bl_check_cont (void *cls, */ void GST_neighbours_switch_to_address (const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out) { @@ -3042,7 +3042,7 @@ GST_neighbours_notify_data_recv (const struct GNUNET_HELLO_Address *address, */ void GST_neighbours_notify_data_sent (const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, size_t size) { struct NeighbourMapEntry *n; @@ -3240,7 +3240,7 @@ send_session_ack_message (struct NeighbourMapEntry *n) * We received a 'SESSION_SYN_ACK' message from the other peer. * Consider switching to it. * - * @param message possibly a `struct SessionConnectMessage` (check format) + * @param message possibly a `struct GNUNET_ATS_SessionConnectMessage` (check format) * @param peer identity of the peer to switch the address for * @param address address of the other peer, NULL if other peer * connected to us @@ -3250,7 +3250,7 @@ send_session_ack_message (struct NeighbourMapEntry *n) int GST_neighbours_handle_session_syn_ack (const struct GNUNET_MessageHeader *message, const struct GNUNET_HELLO_Address *address, - struct Session *session) + struct GNUNET_ATS_Session *session) { const struct TransportSynMessage *scm; struct GNUNET_TIME_Absolute ts; @@ -3391,7 +3391,7 @@ GST_neighbours_handle_session_syn_ack (const struct GNUNET_MessageHeader *messag */ int GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, - struct Session *session) + struct GNUNET_ATS_Session *session) { struct NeighbourMapEntry *n; struct BlackListCheckContext *bcc; @@ -3539,7 +3539,7 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, * If we sent a 'SYN_ACK' last, this means we are now * connected. Otherwise, do nothing. * - * @param message possibly a 'struct SessionConnectMessage' (check format) + * @param message possibly a 'struct GNUNET_ATS_SessionConnectMessage' (check format) * @param address address of the other peer * @param session session to use (or NULL) * @return #GNUNET_OK if the message was fine, #GNUNET_SYSERR on serious error @@ -3547,7 +3547,7 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, int GST_neighbours_handle_session_ack (const struct GNUNET_MessageHeader *message, const struct GNUNET_HELLO_Address *address, - struct Session *session) + struct GNUNET_ATS_Session *session) { struct NeighbourMapEntry *n; @@ -3673,12 +3673,12 @@ GST_neighbours_handle_quota_message (const struct GNUNET_PeerIdentity *peer, const struct GNUNET_MessageHeader *msg) { struct NeighbourMapEntry *n; - const struct SessionQuotaMessage *sqm; + const struct GNUNET_ATS_SessionQuotaMessage *sqm; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received QUOTA message from peer `%s'\n", GNUNET_i2s (peer)); - if (ntohs (msg->size) != sizeof (struct SessionQuotaMessage)) + if (ntohs (msg->size) != sizeof (struct GNUNET_ATS_SessionQuotaMessage)) { GNUNET_break_op (0); GNUNET_STATISTICS_update (GST_stats, @@ -3691,7 +3691,7 @@ GST_neighbours_handle_quota_message (const struct GNUNET_PeerIdentity *peer, gettext_noop ("# QUOTA messages received"), 1, GNUNET_NO); - sqm = (const struct SessionQuotaMessage *) msg; + sqm = (const struct GNUNET_ATS_SessionQuotaMessage *) msg; if (NULL == (n = lookup_neighbour (peer))) { /* gone already */ @@ -3716,12 +3716,12 @@ GST_neighbours_handle_disconnect_message (const struct GNUNET_PeerIdentity *peer const struct GNUNET_MessageHeader *msg) { struct NeighbourMapEntry *n; - const struct SessionDisconnectMessage *sdm; + const struct GNUNET_ATS_SessionDisconnectMessage *sdm; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received DISCONNECT message from peer `%s'\n", GNUNET_i2s (peer)); - if (ntohs (msg->size) != sizeof (struct SessionDisconnectMessage)) + if (ntohs (msg->size) != sizeof (struct GNUNET_ATS_SessionDisconnectMessage)) { GNUNET_break_op (0); GNUNET_STATISTICS_update (GST_stats, @@ -3735,7 +3735,7 @@ GST_neighbours_handle_disconnect_message (const struct GNUNET_PeerIdentity *peer gettext_noop ("# DISCONNECT messages received"), 1, GNUNET_NO); - sdm = (const struct SessionDisconnectMessage *) msg; + sdm = (const struct GNUNET_ATS_SessionDisconnectMessage *) msg; if (NULL == (n = lookup_neighbour (peer))) { /* gone already */ diff --git a/src/transport/gnunet-service-transport_neighbours.h b/src/transport/gnunet-service-transport_neighbours.h index a6c9f2f53..b7864399d 100644 --- a/src/transport/gnunet-service-transport_neighbours.h +++ b/src/transport/gnunet-service-transport_neighbours.h @@ -194,7 +194,7 @@ GST_neighbours_iterate (GST_NeighbourIterator cb, void *cb_cls); */ int GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, - struct Session *session); + struct GNUNET_ATS_Session *session); /** @@ -221,7 +221,7 @@ GST_neighbours_notify_data_recv (const struct GNUNET_HELLO_Address *address, */ void GST_neighbours_notify_data_sent (const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, size_t size); @@ -236,7 +236,7 @@ GST_neighbours_notify_data_sent (const struct GNUNET_HELLO_Address *address, */ void GST_neighbours_switch_to_address (const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out); @@ -245,7 +245,7 @@ GST_neighbours_switch_to_address (const struct GNUNET_HELLO_Address *address, * We received a 'SESSION_CONNECT' message from the other peer. * Consider switching to it. * - * @param message possibly a 'struct SessionConnectMessage' (check format) + * @param message possibly a 'struct GNUNET_ATS_SessionConnectMessage' (check format) * @param peer identity of the peer to switch the address for * @return #GNUNET_OK if the message was fine, #GNUNET_SYSERR on serious error */ @@ -258,7 +258,7 @@ GST_neighbours_handle_session_syn (const struct GNUNET_MessageHeader *message, * We received a 'SESSION_CONNECT_ACK' message from the other peer. * Consider switching to it. * - * @param message possibly a `struct SessionConnectMessage` (check format) + * @param message possibly a `struct GNUNET_ATS_SessionConnectMessage` (check format) * @param address address of the other peer * @param session session to use (or NULL) * @return #GNUNET_OK if the message was fine, #GNUNET_SYSERR on serious error @@ -266,7 +266,7 @@ GST_neighbours_handle_session_syn (const struct GNUNET_MessageHeader *message, int GST_neighbours_handle_session_syn_ack (const struct GNUNET_MessageHeader *message, const struct GNUNET_HELLO_Address *address, - struct Session *session); + struct GNUNET_ATS_Session *session); /** @@ -274,7 +274,7 @@ GST_neighbours_handle_session_syn_ack (const struct GNUNET_MessageHeader *messag * If we sent a 'CONNECT_ACK' last, this means we are now * connected. Otherwise, do nothing. * - * @param message possibly a 'struct SessionConnectMessage' (check format) + * @param message possibly a 'struct GNUNET_ATS_SessionConnectMessage' (check format) * @param address address of the other peer * @param session session to use (or NULL) * @return #GNUNET_OK if the message was fine, #GNUNET_SYSERR on serious error @@ -282,7 +282,7 @@ GST_neighbours_handle_session_syn_ack (const struct GNUNET_MessageHeader *messag int GST_neighbours_handle_session_ack (const struct GNUNET_MessageHeader *message, const struct GNUNET_HELLO_Address *address, - struct Session *session); + struct GNUNET_ATS_Session *session); /** diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c index 89e901561..d36418cc2 100644 --- a/src/transport/gnunet-service-transport_validation.c +++ b/src/transport/gnunet-service-transport_validation.c @@ -517,7 +517,7 @@ static void transmit_ping_if_allowed (void *cls, const struct GNUNET_PeerIdentity *pid, const struct GNUNET_HELLO_Address *address_null, - struct Session *session_null, + struct GNUNET_ATS_Session *session_null, int result) { struct ValidationEntry *ve = cls; @@ -529,7 +529,7 @@ transmit_ping_if_allowed (void *cls, size_t tsize; size_t slen; uint16_t hsize; - struct Session *session; + struct GNUNET_ATS_Session *session; ve->bc = NULL; if (GNUNET_OK != result) @@ -995,7 +995,7 @@ multicast_pong (void *cls, { struct TransportPongMessage *pong = cls; struct GNUNET_TRANSPORT_PluginFunctions *papi; - struct Session *session; + struct GNUNET_ATS_Session *session; papi = GST_plugins_find (address->transport_name); if (NULL == papi) @@ -1039,7 +1039,7 @@ int GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender, const struct GNUNET_MessageHeader *hdr, const struct GNUNET_HELLO_Address *sender_address, - struct Session *session) + struct GNUNET_ATS_Session *session) { const struct TransportPingMessage *ping; struct TransportPongMessage *pong; diff --git a/src/transport/gnunet-service-transport_validation.h b/src/transport/gnunet-service-transport_validation.h index 6a807934b..458fda453 100644 --- a/src/transport/gnunet-service-transport_validation.h +++ b/src/transport/gnunet-service-transport_validation.h @@ -104,7 +104,7 @@ int GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender, const struct GNUNET_MessageHeader *hdr, const struct GNUNET_HELLO_Address *sender_address, - struct Session *session); + struct GNUNET_ATS_Session *session); /** diff --git a/src/transport/plugin_transport_http.h b/src/transport/plugin_transport_http.h index 94952173c..1e32cbf42 100644 --- a/src/transport/plugin_transport_http.h +++ b/src/transport/plugin_transport_http.h @@ -80,12 +80,12 @@ struct Plugin /** * Head of linked list of open sessions. */ - struct Session *head; + struct GNUNET_ATS_Session *head; /** * Tail of linked list of open sessions. */ - struct Session *tail; + struct GNUNET_ATS_Session *tail; /** * NAT handle & address management @@ -247,14 +247,14 @@ struct Plugin * A full session consists of 2 semi-connections: send and receive * If not both directions are established the server keeps this sessions here */ - struct Session *server_semi_head; + struct GNUNET_ATS_Session *server_semi_head; /** * Tail of server semi connections * A full session consists of 2 semi-connections: send and receive * If not both directions are established the server keeps this sessions here */ - struct Session *server_semi_tail; + struct GNUNET_ATS_Session *server_semi_tail; /** * cURL Multihandle @@ -335,7 +335,7 @@ struct ServerRequest /** * The session this server connection belongs to */ - struct Session *session; + struct GNUNET_ATS_Session *session; /** * The MHD connection @@ -347,7 +347,7 @@ struct ServerRequest /** * Session handle for connections. */ -struct Session +struct GNUNET_ATS_Session { /** * To whom are we talking to @@ -357,12 +357,12 @@ struct Session /** * Stored in a linked list. */ - struct Session *next; + struct GNUNET_ATS_Session *next; /** * Stored in a linked list. */ - struct Session *prev; + struct GNUNET_ATS_Session *prev; /** * Pointer to the global plugin struct. @@ -499,7 +499,7 @@ struct HTTP_Message }; -struct Session * +struct GNUNET_ATS_Session * create_session (struct Plugin *plugin, const struct GNUNET_PeerIdentity *target, const void *addr, @@ -508,23 +508,23 @@ create_session (struct Plugin *plugin, int exist_session (struct Plugin *plugin, - struct Session *s); + struct GNUNET_ATS_Session *s); void -delete_session (struct Session *s); +delete_session (struct GNUNET_ATS_Session *s); int exist_session (struct Plugin *plugin, - struct Session *s); + struct GNUNET_ATS_Session *s); struct GNUNET_TIME_Relative http_plugin_receive (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_MessageHeader *message, - struct Session *session, + struct GNUNET_ATS_Session *session, const char *sender_address, uint16_t sender_address_len); @@ -536,15 +536,15 @@ http_plugin_address_to_string (void *cls, int -client_disconnect (struct Session *s); +client_disconnect (struct GNUNET_ATS_Session *s); int -client_connect (struct Session *s); +client_connect (struct GNUNET_ATS_Session *s); int -client_send (struct Session *s, struct HTTP_Message *msg); +client_send (struct GNUNET_ATS_Session *s, struct HTTP_Message *msg); int @@ -556,11 +556,11 @@ client_stop (struct Plugin *plugin); int -server_disconnect (struct Session *s); +server_disconnect (struct GNUNET_ATS_Session *s); int -server_send (struct Session *s, struct HTTP_Message *msg); +server_send (struct GNUNET_ATS_Session *s, struct HTTP_Message *msg); int @@ -574,7 +574,7 @@ server_stop (struct Plugin *plugin); void notify_session_end (void *cls, const struct GNUNET_PeerIdentity *peer, - struct Session *s); + struct GNUNET_ATS_Session *s); /*#ifndef PLUGIN_TRANSPORT_HTTP_H*/ diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c index 8066fb384..262961a29 100644 --- a/src/transport/plugin_transport_http_client.c +++ b/src/transport/plugin_transport_http_client.c @@ -152,7 +152,7 @@ struct HTTP_Message /** * Session handle for HTTP(S) connections. */ -struct Session; +struct GNUNET_ATS_Session; /** @@ -174,14 +174,14 @@ struct RequestHandle /** * The related session */ - struct Session *s; + struct GNUNET_ATS_Session *s; }; /** * Session handle for connections. */ -struct Session +struct GNUNET_ATS_Session { /** * The URL to connect to @@ -397,7 +397,7 @@ struct HTTP_Client_Plugin * @return #GNUNET_OK on success, #GNUNET_SYSERR on error */ static int -http_client_plugin_session_disconnect (void *cls, struct Session *s); +http_client_plugin_session_disconnect (void *cls, struct GNUNET_ATS_Session *s); /** @@ -410,7 +410,7 @@ http_client_plugin_session_disconnect (void *cls, struct Session *s); */ static void notify_session_monitor (struct HTTP_Client_Plugin *plugin, - struct Session *session, + struct GNUNET_ATS_Session *session, enum GNUNET_TRANSPORT_SessionState state) { struct GNUNET_TRANSPORT_SessionInfo info; @@ -437,7 +437,7 @@ notify_session_monitor (struct HTTP_Client_Plugin *plugin, * @param s the session to delete */ static void -client_delete_session (struct Session *s) +client_delete_session (struct GNUNET_ATS_Session *s) { struct HTTP_Client_Plugin *plugin = s->plugin; struct HTTP_Message *pos; @@ -543,7 +543,7 @@ client_delete_session (struct Session *s) * @param s the session */ static void -client_reschedule_session_timeout (struct Session *s) +client_reschedule_session_timeout (struct GNUNET_ATS_Session *s) { GNUNET_assert (NULL != s->timeout_task); s->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT); @@ -708,7 +708,7 @@ client_log (CURL *curl, * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise */ static int -client_connect_get (struct Session *s); +client_connect_get (struct GNUNET_ATS_Session *s); /** @@ -718,7 +718,7 @@ client_connect_get (struct Session *s); * @return #GNUNET_SYSERR for hard failure, #GNUNET_OK for success */ static int -client_connect_put (struct Session *s); +client_connect_put (struct GNUNET_ATS_Session *s); /** @@ -750,7 +750,7 @@ client_connect_put (struct Session *s); */ static ssize_t http_client_plugin_send (void *cls, - struct Session *s, + struct GNUNET_ATS_Session *s, const char *msgbuf, size_t msgbuf_size, unsigned int priority, @@ -842,7 +842,7 @@ http_client_plugin_send (void *cls, */ static int http_client_plugin_session_disconnect (void *cls, - struct Session *s) + struct GNUNET_ATS_Session *s) { struct HTTP_Client_Plugin *plugin = cls; @@ -886,7 +886,7 @@ http_client_query_keepalive_factor (void *cls) * * @param cls the `struct HTTP_Client_Plugin *` * @param peer identity of the peer - * @param value the `struct Session *` + * @param value the `struct GNUNET_ATS_Session *` * @return #GNUNET_OK (continue iterating) */ static int @@ -895,7 +895,7 @@ destroy_session_cb (void *cls, void *value) { struct HTTP_Client_Plugin *plugin = cls; - struct Session *session = value; + struct GNUNET_ATS_Session *session = value; http_client_plugin_session_disconnect (plugin, session); return GNUNET_OK; @@ -929,7 +929,7 @@ http_client_plugin_peer_disconnect (void *cls, /** * Closure for #session_lookup_client_by_address(). */ -struct SessionClientCtx +struct GNUNET_ATS_SessionClientCtx { /** * Address we are looking for. @@ -939,16 +939,16 @@ struct SessionClientCtx /** * Session that was found. */ - struct Session *ret; + struct GNUNET_ATS_Session *ret; }; /** * Locate the seession object for a given address. * - * @param cls the `struct SessionClientCtx *` + * @param cls the `struct GNUNET_ATS_SessionClientCtx *` * @param key peer identity - * @param value the `struct Session` to check + * @param value the `struct GNUNET_ATS_Session` to check * @return #GNUNET_NO if found, #GNUNET_OK if not */ static int @@ -956,8 +956,8 @@ session_lookup_client_by_address (void *cls, const struct GNUNET_PeerIdentity *key, void *value) { - struct SessionClientCtx *sc_ctx = cls; - struct Session *s = value; + struct GNUNET_ATS_SessionClientCtx *sc_ctx = cls; + struct GNUNET_ATS_Session *s = value; if (0 == GNUNET_HELLO_address_cmp (sc_ctx->address, s->address)) @@ -976,11 +976,11 @@ session_lookup_client_by_address (void *cls, * @param address the address * @return the session or NULL */ -static struct Session * +static struct GNUNET_ATS_Session * client_lookup_session (struct HTTP_Client_Plugin *plugin, const struct GNUNET_HELLO_Address *address) { - struct SessionClientCtx sc_ctx; + struct GNUNET_ATS_SessionClientCtx sc_ctx; sc_ctx.address = address; sc_ctx.ret = NULL; @@ -996,14 +996,14 @@ client_lookup_session (struct HTTP_Client_Plugin *plugin, * after a while (so that gnurl stops asking). This task * is the delayed task that actually disconnects the PUT. * - * @param cls the `struct Session *` with the put + * @param cls the `struct GNUNET_ATS_Session *` with the put * @param tc scheduler context */ static void client_put_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - struct Session *s = cls; + struct GNUNET_ATS_Session *s = cls; s->put_disconnect_task = NULL; LOG (GNUNET_ERROR_TYPE_DEBUG, @@ -1024,7 +1024,7 @@ client_put_disconnect (void *cls, * @param stream pointer where to write data * @param size size of an individual element * @param nmemb count of elements that can be written to the buffer - * @param cls our `struct Session` + * @param cls our `struct GNUNET_ATS_Session` * @return bytes written to stream, returning 0 will terminate request! */ static size_t @@ -1033,7 +1033,7 @@ client_send_cb (void *stream, size_t nmemb, void *cls) { - struct Session *s = cls; + struct GNUNET_ATS_Session *s = cls; struct HTTP_Client_Plugin *plugin = s->plugin; struct HTTP_Message *msg = s->msg_head; size_t len; @@ -1134,7 +1134,7 @@ static void client_wake_up (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - struct Session *s = cls; + struct GNUNET_ATS_Session *s = cls; s->recv_wakeup_task = NULL; if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) @@ -1170,7 +1170,7 @@ client_receive_mst_cb (void *cls, void *client, const struct GNUNET_MessageHeader *message) { - struct Session *s = cls; + struct GNUNET_ATS_Session *s = cls; struct HTTP_Client_Plugin *plugin; struct GNUNET_TIME_Relative delay; char *stat_txt; @@ -1242,7 +1242,7 @@ client_receive (void *stream, size_t nmemb, void *cls) { - struct Session *s = cls; + struct GNUNET_ATS_Session *s = cls; struct GNUNET_TIME_Absolute now; size_t len = size * nmemb; @@ -1322,14 +1322,14 @@ client_run (void *cls, while (NULL != (msg = curl_multi_info_read (plugin->curl_multi_handle, &msgs_left))) { CURL *easy_h = msg->easy_handle; - struct Session *s = NULL; + struct GNUNET_ATS_Session *s = NULL; char *d = NULL; /* curl requires 'd' to be a 'char *' */ GNUNET_assert (NULL != easy_h); /* Obtain session from easy handle */ GNUNET_assert (CURLE_OK == curl_easy_getinfo (easy_h, CURLINFO_PRIVATE, &d)); - s = (struct Session *) d; + s = (struct GNUNET_ATS_Session *) d; GNUNET_assert (NULL != s); if (msg->msg != CURLMSG_DONE) @@ -1450,7 +1450,7 @@ client_run (void *cls, /** * Open TCP socket with TCP STEALTH enabled. * - * @param clientp our `struct Session *` + * @param clientp our `struct GNUNET_ATS_Session *` * @param purpose why does curl want to open a socket * @param address what kind of socket does curl want to have opened? * @return opened socket @@ -1460,7 +1460,7 @@ open_tcp_stealth_socket_cb (void *clientp, curlsocktype purpose, struct curl_sockaddr *address) { - struct Session *s = clientp; + struct GNUNET_ATS_Session *s = clientp; int ret; switch (purpose) @@ -1509,7 +1509,7 @@ open_tcp_stealth_socket_cb (void *clientp, * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise */ static int -client_connect_get (struct Session *s) +client_connect_get (struct GNUNET_ATS_Session *s) { CURLMcode mret; struct HttpAddress *ha; @@ -1689,7 +1689,7 @@ client_connect_get (struct Session *s) * @return #GNUNET_SYSERR for hard failure, #GNUNET_OK for ok */ static int -client_connect_put (struct Session *s) +client_connect_put (struct GNUNET_ATS_Session *s) { CURLMcode mret; struct HttpAddress *ha; @@ -1861,7 +1861,7 @@ client_connect_put (struct Session *s) * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise */ static int -client_connect (struct Session *s) +client_connect (struct GNUNET_ATS_Session *s) { struct HTTP_Client_Plugin *plugin = s->plugin; int res = GNUNET_OK; @@ -1935,7 +1935,7 @@ client_connect (struct Session *s) */ static enum GNUNET_ATS_Network_Type http_client_plugin_get_network (void *cls, - struct Session *session) + struct GNUNET_ATS_Session *session) { return session->scope; } @@ -1962,14 +1962,14 @@ http_client_plugin_get_network_for_address (void *cls, /** * Session was idle, so disconnect it * - * @param cls the `struct Session` of the idle session + * @param cls the `struct GNUNET_ATS_Session` of the idle session * @param tc scheduler context */ static void client_session_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - struct Session *s = cls; + struct GNUNET_ATS_Session *s = cls; struct GNUNET_TIME_Relative left; s->timeout_task = NULL; @@ -2005,12 +2005,12 @@ client_session_timeout (void *cls, * @param address the address * @return the session or NULL of max connections exceeded */ -static struct Session * +static struct GNUNET_ATS_Session * http_client_plugin_get_session (void *cls, const struct GNUNET_HELLO_Address *address) { struct HTTP_Client_Plugin *plugin = cls; - struct Session *s; + struct GNUNET_ATS_Session *s; struct sockaddr *sa; enum GNUNET_ATS_Network_Type net_type; size_t salen = 0; @@ -2066,7 +2066,7 @@ http_client_plugin_get_session (void *cls, return NULL; } - s = GNUNET_new (struct Session); + s = GNUNET_new (struct GNUNET_ATS_Session); s->plugin = plugin; s->address = GNUNET_HELLO_address_copy (address); s->scope = net_type; @@ -2354,7 +2354,7 @@ http_client_plugin_address_to_string (void *cls, static void http_client_plugin_update_session_timeout (void *cls, const struct GNUNET_PeerIdentity *peer, - struct Session *session) + struct GNUNET_ATS_Session *session) { client_reschedule_session_timeout (session); } @@ -2373,7 +2373,7 @@ http_client_plugin_update_session_timeout (void *cls, static void http_client_plugin_update_inbound_delay (void *cls, const struct GNUNET_PeerIdentity *peer, - struct Session *s, + struct GNUNET_ATS_Session *s, struct GNUNET_TIME_Relative delay) { s->next_receive = GNUNET_TIME_relative_to_absolute (delay); @@ -2396,7 +2396,7 @@ http_client_plugin_update_inbound_delay (void *cls, * * @param cls the `struct Plugin` with the monitor callback (`sic`) * @param peer peer we send information about - * @param value our `struct Session` to send information about + * @param value our `struct GNUNET_ATS_Session` to send information about * @return #GNUNET_OK (continue to iterate) */ static int @@ -2405,7 +2405,7 @@ send_session_info_iter (void *cls, void *value) { struct HTTP_Client_Plugin *plugin = cls; - struct Session *session = value; + struct GNUNET_ATS_Session *session = value; notify_session_monitor (plugin, session, diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c index db483098a..07137e0fb 100644 --- a/src/transport/plugin_transport_http_server.c +++ b/src/transport/plugin_transport_http_server.c @@ -63,7 +63,7 @@ struct ServerRequest * The session this server request belongs to * Can be NULL, when session was disconnected and freed */ - struct Session *session; + struct GNUNET_ATS_Session *session; /** * The MHD connection @@ -174,7 +174,7 @@ struct HTTP_Message /** * Session handle for connections. */ -struct Session +struct GNUNET_ATS_Session { /** @@ -466,7 +466,7 @@ struct HTTP_Server_Plugin */ static void notify_session_monitor (struct HTTP_Server_Plugin *plugin, - struct Session *session, + struct GNUNET_ATS_Session *session, enum GNUNET_TRANSPORT_SessionState state) { struct GNUNET_TRANSPORT_SessionInfo info; @@ -497,7 +497,7 @@ static void server_wake_up (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - struct Session *s = cls; + struct GNUNET_ATS_Session *s = cls; s->recv_wakeup_task = NULL; if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) @@ -529,7 +529,7 @@ server_reschedule (struct HTTP_Server_Plugin *plugin, * @param s the session to delete */ static void -server_delete_session (struct Session *s) +server_delete_session (struct GNUNET_ATS_Session *s) { struct HTTP_Server_Plugin *plugin = s->plugin; struct HTTP_Message *msg; @@ -630,7 +630,7 @@ server_delete_session (struct Session *s) */ static int http_server_plugin_disconnect_session (void *cls, - struct Session *s) + struct GNUNET_ATS_Session *s) { server_delete_session (s); return GNUNET_OK; @@ -647,7 +647,7 @@ static void server_session_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - struct Session *s = cls; + struct GNUNET_ATS_Session *s = cls; struct GNUNET_TIME_Relative left; s->timeout_task = NULL; @@ -679,7 +679,7 @@ server_session_timeout (void *cls, * @param s the session */ static void -server_reschedule_session_timeout (struct Session *s) +server_reschedule_session_timeout (struct GNUNET_ATS_Session *s) { GNUNET_assert (NULL != s->timeout_task); s->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT); @@ -715,7 +715,7 @@ server_reschedule_session_timeout (struct Session *s) */ static ssize_t http_server_plugin_send (void *cls, - struct Session *session, + struct GNUNET_ATS_Session *session, const char *msgbuf, size_t msgbuf_size, unsigned int priority, @@ -775,7 +775,7 @@ http_server_plugin_send (void *cls, * * @param cls the `struct HTTP_Server_Plugin *` * @param peer for which this is a session - * @param value the `struct Session` to clean up + * @param value the `struct GNUNET_ATS_Session` to clean up * @return #GNUNET_OK (continue to iterate) */ static int @@ -783,7 +783,7 @@ destroy_session_shutdown_cb (void *cls, const struct GNUNET_PeerIdentity *peer, void *value) { - struct Session *s = value; + struct GNUNET_ATS_Session *s = value; struct ServerRequest *sc_send; struct ServerRequest *sc_recv; @@ -802,7 +802,7 @@ destroy_session_shutdown_cb (void *cls, * * @param cls the `struct HTTP_Server_Plugin *` * @param peer for which this is a session - * @param value the `struct Session` to clean up + * @param value the `struct GNUNET_ATS_Session` to clean up * @return #GNUNET_OK (continue to iterate) */ static int @@ -810,7 +810,7 @@ destroy_session_cb (void *cls, const struct GNUNET_PeerIdentity *peer, void *value) { - struct Session *s = value; + struct GNUNET_ATS_Session *s = value; server_delete_session (s); return GNUNET_OK; @@ -897,7 +897,7 @@ http_server_plugin_address_suggested (void *cls, * @param address the address * @return always NULL */ -static struct Session * +static struct GNUNET_ATS_Session * http_server_plugin_get_session (void *cls, const struct GNUNET_HELLO_Address *address) { @@ -1127,7 +1127,7 @@ http_server_query_keepalive_factor (void *cls) static void http_server_plugin_update_session_timeout (void *cls, const struct GNUNET_PeerIdentity *peer, - struct Session *session) + struct GNUNET_ATS_Session *session) { server_reschedule_session_timeout (session); } @@ -1142,7 +1142,7 @@ http_server_plugin_update_session_timeout (void *cls, */ static void server_mhd_connection_timeout (struct HTTP_Server_Plugin *plugin, - struct Session *s, + struct GNUNET_ATS_Session *s, unsigned int to) { /* Setting timeouts for other connections */ @@ -1305,12 +1305,12 @@ server_parse_url (struct HTTP_Server_Plugin *plugin, /** * Closure for #session_tag_it(). */ -struct SessionTagContext +struct GNUNET_ATS_SessionTagContext { /** * Set to session matching the tag. */ - struct Session *res; + struct GNUNET_ATS_Session *res; /** * Tag we are looking for. @@ -1322,9 +1322,9 @@ struct SessionTagContext /** * Find a session with a matching tag. * - * @param cls the `struct SessionTagContext *` + * @param cls the `struct GNUNET_ATS_SessionTagContext *` * @param key peer identity (unused) - * @param value the `struct Session *` + * @param value the `struct GNUNET_ATS_Session *` * @return #GNUNET_NO if we found the session, #GNUNET_OK if not */ static int @@ -1332,8 +1332,8 @@ session_tag_it (void *cls, const struct GNUNET_PeerIdentity *key, void *value) { - struct SessionTagContext *stc = cls; - struct Session *s = value; + struct GNUNET_ATS_SessionTagContext *stc = cls; + struct GNUNET_ATS_Session *s = value; if (s->tag == stc->tag) { @@ -1359,13 +1359,13 @@ server_lookup_connection (struct HTTP_Server_Plugin *plugin, const char *url, const char *method) { - struct Session *s = NULL; + struct GNUNET_ATS_Session *s = NULL; struct ServerRequest *sc = NULL; const union MHD_ConnectionInfo *conn_info; struct HttpAddress *addr; struct GNUNET_PeerIdentity target; size_t addr_len; - struct SessionTagContext stc; + struct GNUNET_ATS_SessionTagContext stc; uint32_t options; int direction = GNUNET_SYSERR; unsigned int to; @@ -1442,7 +1442,7 @@ server_lookup_connection (struct HTTP_Server_Plugin *plugin, /* external host name */ return NULL; } - s = GNUNET_new (struct Session); + s = GNUNET_new (struct GNUNET_ATS_Session); s->target = target; s->plugin = plugin; s->scope = scope; @@ -1548,7 +1548,7 @@ server_send_callback (void *cls, size_t max) { struct ServerRequest *sc = cls; - struct Session *s = sc->session; + struct GNUNET_ATS_Session *s = sc->session; ssize_t bytes_read = 0; struct HTTP_Message *msg; char *stat_txt; @@ -1638,7 +1638,7 @@ server_receive_mst_cb (void *cls, void *client, const struct GNUNET_MessageHeader *message) { - struct Session *s = cls; + struct GNUNET_ATS_Session *s = cls; struct HTTP_Server_Plugin *plugin = s->plugin; struct GNUNET_TIME_Relative delay; char *stat_txt; @@ -1727,7 +1727,7 @@ server_access_cb (void *cls, { struct HTTP_Server_Plugin *plugin = cls; struct ServerRequest *sc = *httpSessionCache; - struct Session *s; + struct GNUNET_ATS_Session *s; struct MHD_Response *response; int res = MHD_YES; @@ -3257,7 +3257,7 @@ http_server_plugin_address_to_string (void *cls, */ static enum GNUNET_ATS_Network_Type http_server_plugin_get_network (void *cls, - struct Session *session) + struct GNUNET_ATS_Session *session) { return session->scope; } @@ -3294,7 +3294,7 @@ http_server_plugin_get_network_for_address (void *cls, static void http_server_plugin_update_inbound_delay (void *cls, const struct GNUNET_PeerIdentity *peer, - struct Session *session, + struct GNUNET_ATS_Session *session, struct GNUNET_TIME_Relative delay) { session->next_receive = GNUNET_TIME_relative_to_absolute (delay); @@ -3319,7 +3319,7 @@ http_server_plugin_update_inbound_delay (void *cls, * * @param cls the `struct Plugin` with the monitor callback (`sic`) * @param peer peer we send information about - * @param value our `struct Session` to send information about + * @param value our `struct GNUNET_ATS_Session` to send information about * @return #GNUNET_OK (continue to iterate) */ static int @@ -3328,7 +3328,7 @@ send_session_info_iter (void *cls, void *value) { struct HTTP_Server_Plugin *plugin = cls; - struct Session *session = value; + struct GNUNET_ATS_Session *session = value; notify_session_monitor (plugin, session, diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index 453a0095f..38ba2c3ce 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c @@ -248,7 +248,7 @@ struct PendingMessage /** * Session handle for TCP connections. */ -struct Session +struct GNUNET_ATS_Session { /** * To whom are we talking to (set to our identity @@ -536,7 +536,7 @@ struct Plugin */ static void notify_session_monitor (struct Plugin *plugin, - struct Session *session, + struct GNUNET_ATS_Session *session, enum GNUNET_TRANSPORT_SessionState state) { struct GNUNET_TRANSPORT_SessionInfo info; @@ -807,12 +807,12 @@ tcp_plugin_string_to_address (void *cls, * @param client which client to find the session handle for * @return NULL if no matching session exists */ -static struct Session * +static struct GNUNET_ATS_Session * lookup_session_by_client (struct Plugin *plugin, struct GNUNET_SERVER_Client *client) { return GNUNET_SERVER_client_get_user_context (client, - struct Session); + struct GNUNET_ATS_Session); } @@ -827,7 +827,7 @@ lookup_session_by_client (struct Plugin *plugin, */ static int tcp_plugin_disconnect_session (void *cls, - struct Session *session) + struct GNUNET_ATS_Session *session) { struct Plugin *plugin = cls; struct PendingMessage *pm; @@ -956,14 +956,14 @@ tcp_plugin_query_keepalive_factor (void *cls) /** * Session was idle for too long, so disconnect it * - * @param cls the `struct Session` of the idle session + * @param cls the `struct GNUNET_ATS_Session` of the idle session * @param tc scheduler context */ static void session_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - struct Session *s = cls; + struct GNUNET_ATS_Session *s = cls; struct GNUNET_TIME_Relative left; s->timeout_task = NULL; @@ -997,7 +997,7 @@ session_timeout (void *cls, * @param s session to increment timeout for */ static void -reschedule_session_timeout (struct Session *s) +reschedule_session_timeout (struct GNUNET_ATS_Session *s) { GNUNET_assert (NULL != s->timeout_task); s->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT); @@ -1016,14 +1016,14 @@ reschedule_session_timeout (struct Session *s) * the session * @return new session object */ -static struct Session * +static struct GNUNET_ATS_Session * create_session (struct Plugin *plugin, const struct GNUNET_HELLO_Address *address, enum GNUNET_ATS_Network_Type scope, struct GNUNET_SERVER_Client *client, int is_nat) { - struct Session *session; + struct GNUNET_ATS_Session *session; struct PendingMessage *pm; if (GNUNET_YES != is_nat) @@ -1037,7 +1037,7 @@ create_session (struct Plugin *plugin, tcp_plugin_address_to_string (plugin, address->address, address->address_length)); - session = GNUNET_new (struct Session); + session = GNUNET_new (struct GNUNET_ATS_Session); session->last_activity = GNUNET_TIME_absolute_get (); session->plugin = plugin; session->is_nat = is_nat; @@ -1102,7 +1102,7 @@ create_session (struct Plugin *plugin, * @param session for which session should we do this */ static void -process_pending_messages (struct Session *session); +process_pending_messages (struct GNUNET_ATS_Session *session); /** @@ -1121,7 +1121,7 @@ do_transmit (void *cls, size_t size, void *buf) { - struct Session *session = cls; + struct GNUNET_ATS_Session *session = cls; struct GNUNET_PeerIdentity pid; struct Plugin *plugin; struct PendingMessage *pos; @@ -1275,7 +1275,7 @@ do_transmit (void *cls, * @param session for which session should we do this */ static void -process_pending_messages (struct Session *session) +process_pending_messages (struct GNUNET_ATS_Session *session) { struct PendingMessage *pm; @@ -1323,7 +1323,7 @@ process_pending_messages (struct Session *session) */ static ssize_t tcp_plugin_send (void *cls, - struct Session *session, + struct GNUNET_ATS_Session *session, const char *msgbuf, size_t msgbuf_size, unsigned int priority, @@ -1413,7 +1413,7 @@ tcp_plugin_send (void *cls, /** * Closure for #session_lookup_it(). */ -struct SessionItCtx +struct GNUNET_ATS_SessionItCtx { /** * Address we are looking for. @@ -1423,7 +1423,7 @@ struct SessionItCtx /** * Where to store the session (if we found it). */ - struct Session *result; + struct GNUNET_ATS_Session *result; }; @@ -1431,9 +1431,9 @@ struct SessionItCtx /** * Look for a session by address. * - * @param cls the `struct SessionItCtx` + * @param cls the `struct GNUNET_ATS_SessionItCtx` * @param key unused - * @param value a `struct Session` + * @param value a `struct GNUNET_ATS_Session` * @return #GNUNET_YES to continue looking, #GNUNET_NO if we found the session */ static int @@ -1441,8 +1441,8 @@ session_lookup_it (void *cls, const struct GNUNET_PeerIdentity *key, void *value) { - struct SessionItCtx *si_ctx = cls; - struct Session *session = value; + struct GNUNET_ATS_SessionItCtx *si_ctx = cls; + struct GNUNET_ATS_Session *session = value; if (0 != GNUNET_HELLO_address_cmp (si_ctx->address, @@ -1456,14 +1456,14 @@ session_lookup_it (void *cls, /** * Task cleaning up a NAT connection attempt after timeout * - * @param cls the `struct Session` + * @param cls the `struct GNUNET_ATS_Session` * @param tc scheduler context (unused) */ static void nat_connect_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - struct Session *session = cls; + struct GNUNET_ATS_Session *session = cls; session->nat_connection_timeout = NULL; LOG (GNUNET_ERROR_TYPE_DEBUG, @@ -1489,7 +1489,7 @@ nat_connect_timeout (void *cls, static void tcp_plugin_update_session_timeout (void *cls, const struct GNUNET_PeerIdentity *peer, - struct Session *session) + struct GNUNET_ATS_Session *session) { reschedule_session_timeout (session); } @@ -1499,14 +1499,14 @@ tcp_plugin_update_session_timeout (void *cls, * Task to signal the server that we can continue * receiving from the TCP client now. * - * @param cls the `struct Session *` + * @param cls the `struct GNUNET_ATS_Session *` * @param tc task context (unused) */ static void delayed_done (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - struct Session *session = cls; + struct GNUNET_ATS_Session *session = cls; session->receive_delay_task = NULL; reschedule_session_timeout (session); @@ -1528,7 +1528,7 @@ delayed_done (void *cls, static void tcp_plugin_update_inbound_delay (void *cls, const struct GNUNET_PeerIdentity *peer, - struct Session *session, + struct GNUNET_ATS_Session *session, struct GNUNET_TIME_Relative delay) { if (NULL == session->receive_delay_task) @@ -1554,12 +1554,12 @@ tcp_plugin_update_inbound_delay (void *cls, * @param address the address to use * @return the session if the address is valid, NULL otherwise */ -static struct Session * +static struct GNUNET_ATS_Session * tcp_plugin_get_session (void *cls, const struct GNUNET_HELLO_Address *address) { struct Plugin *plugin = cls; - struct Session *session = NULL; + struct GNUNET_ATS_Session *session = NULL; int af; const void *sb; size_t sbs; @@ -1596,7 +1596,7 @@ tcp_plugin_get_session (void *cls, GNUNET_CONTAINER_multipeermap_contains (plugin->sessionmap, &address->peer)) { - struct SessionItCtx si_ctx; + struct GNUNET_ATS_SessionItCtx si_ctx; si_ctx.address = address; si_ctx.result = NULL; @@ -1812,7 +1812,7 @@ tcp_plugin_get_session (void *cls, * * @param cls the `struct Plugin *` * @param key the peer which the session belongs to (unused) - * @param value the `struct Session` + * @param value the `struct GNUNET_ATS_Session` * @return #GNUNET_YES (continue to iterate) */ static int @@ -1821,7 +1821,7 @@ session_disconnect_it (void *cls, void *value) { struct Plugin *plugin = cls; - struct Session *session = value; + struct GNUNET_ATS_Session *session = value; GNUNET_STATISTICS_update (session->plugin->env->stats, gettext_noop ("# transport-service disconnect requests for TCP"), @@ -2135,7 +2135,7 @@ handle_tcp_nat_probe (void *cls, const struct GNUNET_MessageHeader *message) { struct Plugin *plugin = cls; - struct Session *session; + struct GNUNET_ATS_Session *session; const struct TCP_NAT_ProbeMessage *tcp_nat_probe; size_t alen; void *vaddr; @@ -2281,7 +2281,7 @@ handle_tcp_welcome (void *cls, struct Plugin *plugin = cls; const struct WelcomeMessage *wm = (const struct WelcomeMessage *) message; struct GNUNET_HELLO_Address *address; - struct Session *session; + struct GNUNET_ATS_Session *session; size_t alen; void *vaddr; struct IPv4TcpAddress t4; @@ -2444,7 +2444,7 @@ handle_tcp_data (void *cls, const struct GNUNET_MessageHeader *message) { struct Plugin *plugin = cls; - struct Session *session; + struct GNUNET_ATS_Session *session; struct GNUNET_TIME_Relative delay; uint16_t type; @@ -2589,7 +2589,7 @@ disconnect_notify (void *cls, struct GNUNET_SERVER_Client *client) { struct Plugin *plugin = cls; - struct Session *session; + struct GNUNET_ATS_Session *session; if (NULL == client) return; @@ -2727,7 +2727,7 @@ try_connection_reversal (void *cls, */ static enum GNUNET_ATS_Network_Type tcp_plugin_get_network (void *cls, - struct Session *session) + struct GNUNET_ATS_Session *session) { return session->scope; } @@ -2799,7 +2799,7 @@ tcp_plugin_get_network_for_address (void *cls, * * @param cls the `struct Plugin` with the monitor callback (`sic`) * @param peer peer we send information about - * @param value our `struct Session` to send information about + * @param value our `struct GNUNET_ATS_Session` to send information about * @return #GNUNET_OK (continue to iterate) */ static int @@ -2808,7 +2808,7 @@ send_session_info_iter (void *cls, void *value) { struct Plugin *plugin = cls; - struct Session *session = value; + struct GNUNET_ATS_Session *session = value; notify_session_monitor (plugin, session, diff --git a/src/transport/plugin_transport_template.c b/src/transport/plugin_transport_template.c index 7c8bc3cba..81a914943 100644 --- a/src/transport/plugin_transport_template.c +++ b/src/transport/plugin_transport_template.c @@ -51,7 +51,7 @@ struct Plugin; /** * Session handle for connections. */ -struct Session +struct GNUNET_ATS_Session { /** * To whom are we talking to (set to our identity @@ -62,7 +62,7 @@ struct Session /** * Stored in a linked list (or a peer map, or ...) */ - struct Session *next; + struct GNUNET_ATS_Session *next; /** * Pointer to the global plugin struct. @@ -132,7 +132,7 @@ struct Plugin /** * List of open sessions (or peer map, or...) */ - struct Session *sessions; + struct GNUNET_ATS_Session *sessions; /** * Function to call about session status changes. @@ -162,7 +162,7 @@ struct Plugin */ static void notify_session_monitor (struct Plugin *plugin, - struct Session *session, + struct GNUNET_ATS_Session *session, enum GNUNET_TRANSPORT_SessionState state) { struct GNUNET_TRANSPORT_SessionInfo info; @@ -213,7 +213,7 @@ notify_session_monitor (struct Plugin *plugin, */ static ssize_t template_plugin_send (void *cls, - struct Session *session, + struct GNUNET_ATS_Session *session, const char *msgbuf, size_t msgbuf_size, unsigned int priority, @@ -256,7 +256,7 @@ template_plugin_disconnect_peer (void *cls, */ static int template_plugin_disconnect_session (void *cls, - struct Session *session) + struct GNUNET_ATS_Session *session) { // struct Plugin *plugin = cls; // FIXME @@ -288,7 +288,7 @@ template_plugin_query_keepalive_factor (void *cls) */ static enum GNUNET_ATS_Network_Type template_plugin_get_network (void *cls, - struct Session *session) + struct GNUNET_ATS_Session *session) { GNUNET_assert (NULL != session); return GNUNET_ATS_NET_UNSPECIFIED; /* Change to correct network type */ @@ -423,7 +423,7 @@ template_plugin_string_to_address (void *cls, * @param address pointer to the GNUNET_HELLO_Address * @return the session if the address is valid, NULL otherwise */ -static struct Session * +static struct GNUNET_ATS_Session * template_plugin_get_session (void *cls, const struct GNUNET_HELLO_Address *address) { @@ -435,7 +435,7 @@ template_plugin_get_session (void *cls, static void template_plugin_update_session_timeout (void *cls, const struct GNUNET_PeerIdentity *peer, - struct Session *session) + struct GNUNET_ATS_Session *session) { } @@ -448,7 +448,7 @@ template_plugin_update_session_timeout (void *cls, * * @param cls the `struct Plugin` with the monitor callback (`sic`) * @param peer peer we send information about - * @param value our `struct Session` to send information about + * @param value our `struct GNUNET_ATS_Session` to send information about * @return #GNUNET_OK (continue to iterate) */ static int @@ -457,7 +457,7 @@ send_session_info_iter (void *cls, void *value) { struct Plugin *plugin = cls; - struct Session *session = value; + struct GNUNET_ATS_Session *session = value; notify_session_monitor (plugin, session, diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index 66843ed97..af1b412c2 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c @@ -151,7 +151,7 @@ struct PrettyPrinterContext /** * Session with another peer. */ -struct Session +struct GNUNET_ATS_Session { /** * Which peer is this session for? @@ -324,7 +324,7 @@ struct UDP_FragmentationContext /** * The session this fragmentation context belongs to */ - struct Session *session; + struct GNUNET_ATS_Session *session; /** * Function to call upon completion of the transmission. @@ -390,7 +390,7 @@ struct UDP_MessageWrapper /** * Session this message belongs to */ - struct Session *session; + struct GNUNET_ATS_Session *session; /** * DLL of messages, previous element @@ -506,7 +506,7 @@ GNUNET_NETWORK_STRUCT_END */ static void notify_session_monitor (struct Plugin *plugin, - struct Session *session, + struct GNUNET_ATS_Session *session, enum GNUNET_TRANSPORT_SessionState state) { struct GNUNET_TRANSPORT_SessionInfo info; @@ -538,7 +538,7 @@ notify_session_monitor (struct Plugin *plugin, * * @param cls the `struct Plugin` with the monitor callback (`sic`) * @param peer peer we send information about - * @param value our `struct Session` to send information about + * @param value our `struct GNUNET_ATS_Session` to send information about * @return #GNUNET_OK (continue to iterate) */ static int @@ -547,7 +547,7 @@ send_session_info_iter (void *cls, void *value) { struct Plugin *plugin = cls; - struct Session *session = value; + struct GNUNET_ATS_Session *session = value; notify_session_monitor (plugin, session, @@ -602,7 +602,7 @@ udp_plugin_setup_monitor (void *cls, * @param s session to free */ static void -free_session (struct Session *s) +free_session (struct GNUNET_ATS_Session *s) { if (NULL != s->address) { @@ -645,7 +645,7 @@ udp_query_keepalive_factor (void *cls) */ static enum GNUNET_ATS_Network_Type udp_plugin_get_network (void *cls, - struct Session *session) + struct GNUNET_ATS_Session *session) { return session->scope; } @@ -1350,12 +1350,12 @@ udp_nat_port_map_callback (void *cls, /** * Closure for #session_cmp_it(). */ -struct SessionCompareContext +struct GNUNET_ATS_SessionCompareContext { /** * Set to session matching the address. */ - struct Session *res; + struct GNUNET_ATS_Session *res; /** * Address we are looking for. @@ -1367,9 +1367,9 @@ struct SessionCompareContext /** * Find a session with a matching address. * - * @param cls the `struct SessionCompareContext *` + * @param cls the `struct GNUNET_ATS_SessionCompareContext *` * @param key peer identity (unused) - * @param value the `struct Session *` + * @param value the `struct GNUNET_ATS_Session *` * @return #GNUNET_NO if we found the session, #GNUNET_OK if not */ static int @@ -1377,8 +1377,8 @@ session_cmp_it (void *cls, const struct GNUNET_PeerIdentity *key, void *value) { - struct SessionCompareContext *cctx = cls; - struct Session *s = value; + struct GNUNET_ATS_SessionCompareContext *cctx = cls; + struct GNUNET_ATS_Session *s = value; if (0 == GNUNET_HELLO_address_cmp (s->address, cctx->address)) @@ -1400,14 +1400,14 @@ session_cmp_it (void *cls, * @param address the address we should locate the session by * @return the session if it exists, or NULL if it is not found */ -static struct Session * +static struct GNUNET_ATS_Session * udp_plugin_lookup_session (void *cls, const struct GNUNET_HELLO_Address *address) { struct Plugin *plugin = cls; const struct IPv6UdpAddress *udp_a6; const struct IPv4UdpAddress *udp_a4; - struct SessionCompareContext cctx; + struct GNUNET_ATS_SessionCompareContext cctx; if (NULL == address->address) { @@ -1473,7 +1473,7 @@ udp_plugin_lookup_session (void *cls, * @param s session to reschedule timeout activity for */ static void -reschedule_session_timeout (struct Session *s) +reschedule_session_timeout (struct GNUNET_ATS_Session *s) { if (GNUNET_YES == s->in_destroy) return; @@ -1495,7 +1495,7 @@ reschedule_session_timeout (struct Session *s) static void udp_plugin_update_session_timeout (void *cls, const struct GNUNET_PeerIdentity *peer, - struct Session *session) + struct GNUNET_ATS_Session *session) { struct Plugin *plugin = cls; @@ -1526,7 +1526,7 @@ static void dequeue (struct Plugin *plugin, struct UDP_MessageWrapper *udpw) { - struct Session *session = udpw->session; + struct GNUNET_ATS_Session *session = udpw->session; if (plugin->bytes_in_buffer < udpw->msg_size) { @@ -1578,7 +1578,7 @@ static void enqueue (struct Plugin *plugin, struct UDP_MessageWrapper *udpw) { - struct Session *session = udpw->session; + struct GNUNET_ATS_Session *session = udpw->session; if (GNUNET_YES == session->in_destroy) { @@ -1644,7 +1644,7 @@ fragmented_message_done (struct UDP_FragmentationContext *frag_ctx, int result) { struct Plugin *plugin = frag_ctx->plugin; - struct Session *s = frag_ctx->session; + struct GNUNET_ATS_Session *s = frag_ctx->session; struct UDP_MessageWrapper *udpw; struct UDP_MessageWrapper *tmp; size_t overhead; @@ -1834,7 +1834,7 @@ enqueue_fragment (void *cls, struct UDP_FragmentationContext *frag_ctx = cls; struct Plugin *plugin = frag_ctx->plugin; struct UDP_MessageWrapper *udpw; - struct Session *session = frag_ctx->session; + struct GNUNET_ATS_Session *session = frag_ctx->session; size_t msg_len = ntohs (msg->size); LOG (GNUNET_ERROR_TYPE_DEBUG, @@ -1981,7 +1981,7 @@ qc_message_sent (void *cls, */ static ssize_t udp_plugin_send (void *cls, - struct Session *s, + struct GNUNET_ATS_Session *s, const char *msgbuf, size_t msgbuf_size, unsigned int priority, @@ -2142,7 +2142,7 @@ read_process_ack (struct Plugin *plugin, const struct GNUNET_MessageHeader *ack; const struct UDP_ACK_Message *udp_ack; struct GNUNET_HELLO_Address *address; - struct Session *s; + struct GNUNET_ATS_Session *s; struct GNUNET_TIME_Relative flow_delay; if (ntohs (msg->size) @@ -2246,7 +2246,7 @@ struct FindReceiveContext /** * Session associated with this context. */ - struct Session *session; + struct GNUNET_ATS_Session *session; /** * Address to find. @@ -2297,7 +2297,7 @@ find_receive_context (void *cls, * to the service. * * @param cls the `struct Plugin *` - * @param client the `struct Session *` + * @param client the `struct GNUNET_ATS_Session *` * @param hdr the actual message * @return #GNUNET_OK (always) */ @@ -2307,7 +2307,7 @@ process_inbound_tokenized_messages (void *cls, const struct GNUNET_MessageHeader *hdr) { struct Plugin *plugin = cls; - struct Session *session = client; + struct GNUNET_ATS_Session *session = client; if (GNUNET_YES == session->in_destroy) return GNUNET_OK; @@ -2331,7 +2331,7 @@ process_inbound_tokenized_messages (void *cls, */ static int udp_disconnect_session (void *cls, - struct Session *s) + struct GNUNET_ATS_Session *s) { struct Plugin *plugin = cls; struct UDP_MessageWrapper *udpw; @@ -2486,14 +2486,14 @@ udp_disconnect (void *cls, /** * Session was idle, so disconnect it. * - * @param cls the `struct Session` to time out + * @param cls the `struct GNUNET_ATS_Session` to time out * @param tc scheduler context */ static void session_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - struct Session *s = cls; + struct GNUNET_ATS_Session *s = cls; struct Plugin *plugin = s->plugin; struct GNUNET_TIME_Relative left; @@ -2533,15 +2533,15 @@ session_timeout (void *cls, * @param network_type network type the address belongs to * @return NULL on error, otherwise session handle */ -static struct Session * +static struct GNUNET_ATS_Session * udp_plugin_create_session (void *cls, const struct GNUNET_HELLO_Address *address, enum GNUNET_ATS_Network_Type network_type) { struct Plugin *plugin = cls; - struct Session *s; + struct GNUNET_ATS_Session *s; - s = GNUNET_new (struct Session); + s = GNUNET_new (struct GNUNET_ATS_Session); s->plugin = plugin; s->address = GNUNET_HELLO_address_copy (address); s->target = address->peer; @@ -2588,12 +2588,12 @@ udp_plugin_create_session (void *cls, * @param address the address * @return the session or NULL of max connections exceeded */ -static struct Session * +static struct GNUNET_ATS_Session * udp_plugin_get_session (void *cls, const struct GNUNET_HELLO_Address *address) { struct Plugin *plugin = cls; - struct Session *s; + struct GNUNET_ATS_Session *s; enum GNUNET_ATS_Network_Type network_type = GNUNET_ATS_NET_UNSPECIFIED; const struct IPv4UdpAddress *udp_v4; const struct IPv6UdpAddress *udp_v6; @@ -2669,7 +2669,7 @@ process_udp_message (struct Plugin *plugin, size_t udp_addr_len, enum GNUNET_ATS_Network_Type network_type) { - struct Session *s; + struct GNUNET_ATS_Session *s; struct GNUNET_HELLO_Address *address; GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != network_type); @@ -2806,7 +2806,7 @@ ack_proc (void *cls, struct UDP_ACK_Message *udp_ack; uint32_t delay; struct UDP_MessageWrapper *udpw; - struct Session *s; + struct GNUNET_ATS_Session *s; struct GNUNET_HELLO_Address *address; if (GNUNET_NO == rc->have_sender) @@ -3161,7 +3161,7 @@ remove_timeout_messages_and_select (struct Plugin *plugin, { struct UDP_MessageWrapper *udpw; struct GNUNET_TIME_Relative remaining; - struct Session *session; + struct GNUNET_ATS_Session *session; int removed; removed = GNUNET_NO; diff --git a/src/transport/plugin_transport_udp.h b/src/transport/plugin_transport_udp.h index 5f8366636..40c86a402 100644 --- a/src/transport/plugin_transport_udp.h +++ b/src/transport/plugin_transport_udp.h @@ -145,7 +145,7 @@ struct Plugin /** * Session of peers with whom we are currently connected, - * map of peer identity to `struct Session *`. + * map of peer identity to `struct GNUNET_ATS_Session *`. */ struct GNUNET_CONTAINER_MultiPeerMap *sessions; diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c index c6ac0e508..359cf575d 100644 --- a/src/transport/plugin_transport_unix.c +++ b/src/transport/plugin_transport_unix.c @@ -137,7 +137,7 @@ struct UNIXMessageWrapper /** * Session this message belongs to. */ - struct Session *session; + struct GNUNET_ATS_Session *session; /** * Function to call upon transmission. @@ -174,18 +174,18 @@ struct UNIXMessageWrapper /** * Handle for a session. */ -struct Session +struct GNUNET_ATS_Session { /** * Sessions with pending messages (!) are kept in a DLL. */ - struct Session *next; + struct GNUNET_ATS_Session *next; /** * Sessions with pending messages (!) are kept in a DLL. */ - struct Session *prev; + struct GNUNET_ATS_Session *prev; /** * To whom are we talking to (set to our identity @@ -278,7 +278,7 @@ struct Plugin struct GNUNET_TRANSPORT_PluginEnvironment *env; /** - * Sessions (map from peer identity to `struct Session`) + * Sessions (map from peer identity to `struct GNUNET_ATS_Session`) */ struct GNUNET_CONTAINER_MultiPeerMap *session_map; @@ -335,7 +335,7 @@ struct Plugin */ static void notify_session_monitor (struct Plugin *plugin, - struct Session *session, + struct GNUNET_ATS_Session *session, enum GNUNET_TRANSPORT_SessionState state) { struct GNUNET_TRANSPORT_SessionInfo info; @@ -431,7 +431,7 @@ unix_plugin_address_to_string (void *cls, */ static int unix_plugin_session_disconnect (void *cls, - struct Session *session) + struct GNUNET_ATS_Session *session) { struct Plugin *plugin = cls; struct UNIXMessageWrapper *msgw; @@ -497,14 +497,14 @@ unix_plugin_session_disconnect (void *cls, /** * Session was idle for too long, so disconnect it * - * @param cls the `struct Session *` to disconnect + * @param cls the `struct GNUNET_ATS_Session *` to disconnect * @param tc scheduler context */ static void session_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - struct Session *session = cls; + struct GNUNET_ATS_Session *session = cls; struct GNUNET_TIME_Relative left; session->timeout_task = NULL; @@ -538,7 +538,7 @@ session_timeout (void *cls, * @param session session for which the timeout should be rescheduled */ static void -reschedule_session_timeout (struct Session *session) +reschedule_session_timeout (struct GNUNET_ATS_Session *session) { GNUNET_assert (NULL != session->timeout_task); session->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT); @@ -584,7 +584,7 @@ struct LookupCtx /** * Location to store the session, if found. */ - struct Session *res; + struct GNUNET_ATS_Session *res; /** * Address we are looking for. @@ -607,7 +607,7 @@ lookup_session_it (void *cls, void *value) { struct LookupCtx *lctx = cls; - struct Session *session = value; + struct GNUNET_ATS_Session *session = value; if (0 == GNUNET_HELLO_address_cmp (lctx->address, session->address)) @@ -626,7 +626,7 @@ lookup_session_it (void *cls, * @param address the address to find * @return NULL if session was not found */ -static struct Session * +static struct GNUNET_ATS_Session * lookup_session (struct Plugin *plugin, const struct GNUNET_HELLO_Address *address) { @@ -797,7 +797,7 @@ resend: */ static enum GNUNET_ATS_Network_Type unix_plugin_get_network (void *cls, - struct Session *session) + struct GNUNET_ATS_Session *session) { GNUNET_assert (NULL != session); return GNUNET_ATS_NET_LOOPBACK; @@ -828,12 +828,12 @@ unix_plugin_get_network_for_address (void *cls, * @param address the address * @return the session or NULL of max connections exceeded */ -static struct Session * +static struct GNUNET_ATS_Session * unix_plugin_get_session (void *cls, const struct GNUNET_HELLO_Address *address) { struct Plugin *plugin = cls; - struct Session *session; + struct GNUNET_ATS_Session *session; struct UnixAddress *ua; char * addrstr; uint32_t addr_str_len; @@ -886,7 +886,7 @@ unix_plugin_get_session (void *cls, } /* create a new session */ - session = GNUNET_new (struct Session); + session = GNUNET_new (struct GNUNET_ATS_Session); session->target = address->peer; session->address = GNUNET_HELLO_address_copy (address); session->plugin = plugin; @@ -929,7 +929,7 @@ unix_plugin_get_session (void *cls, static void unix_plugin_update_session_timeout (void *cls, const struct GNUNET_PeerIdentity *peer, - struct Session *session) + struct GNUNET_ATS_Session *session) { struct Plugin *plugin = cls; @@ -961,7 +961,7 @@ unix_demultiplexer (struct Plugin *plugin, const struct UnixAddress *ua, size_t ua_len) { - struct Session *session; + struct GNUNET_ATS_Session *session; struct GNUNET_HELLO_Address *address; GNUNET_assert (ua_len >= sizeof (struct UnixAddress)); @@ -1103,7 +1103,7 @@ unix_plugin_do_write (struct Plugin *plugin) { ssize_t sent = 0; struct UNIXMessageWrapper *msgw; - struct Session *session; + struct GNUNET_ATS_Session *session; int did_delete; session = NULL; @@ -1301,7 +1301,7 @@ unix_plugin_select_write (void *cls, */ static ssize_t unix_plugin_send (void *cls, - struct Session *session, + struct GNUNET_ATS_Session *session, const char *msgbuf, size_t msgbuf_size, unsigned int priority, @@ -1655,7 +1655,7 @@ address_notification (void *cls, * * @param cls the plugin * @param key peer identity (unused) - * @param value the `struct Session *` to disconnect + * @param value the `struct GNUNET_ATS_Session *` to disconnect * @return #GNUNET_YES (always, continue to iterate) */ static int @@ -1664,7 +1664,7 @@ get_session_delete_it (void *cls, void *value) { struct Plugin *plugin = cls; - struct Session *session = value; + struct GNUNET_ATS_Session *session = value; unix_plugin_session_disconnect (plugin, session); return GNUNET_YES; @@ -1696,7 +1696,7 @@ unix_plugin_peer_disconnect (void *cls, * * @param cls the `struct Plugin` with the monitor callback (`sic`) * @param peer peer we send information about - * @param value our `struct Session` to send information about + * @param value our `struct GNUNET_ATS_Session` to send information about * @return #GNUNET_OK (continue to iterate) */ static int @@ -1705,7 +1705,7 @@ send_session_info_iter (void *cls, void *value) { struct Plugin *plugin = cls; - struct Session *session = value; + struct GNUNET_ATS_Session *session = value; notify_session_monitor (plugin, session, @@ -1849,7 +1849,7 @@ libgnunet_plugin_transport_unix_done (void *cls) struct UNIXMessageWrapper * msgw; struct UnixAddress *ua; size_t len; - struct Session *session; + struct GNUNET_ATS_Session *session; if (NULL == plugin) { diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c index d5932bb30..f9f76ac7c 100644 --- a/src/transport/plugin_transport_wlan.c +++ b/src/transport/plugin_transport_wlan.c @@ -221,7 +221,7 @@ struct PendingMessage /** * Session handle for connections with other peers. */ -struct Session +struct GNUNET_ATS_Session { /** * To whom are we talking to (set to our identity @@ -233,13 +233,13 @@ struct Session * We keep all sessions in a DLL at their respective * `struct MACEndpoint *`. */ - struct Session *next; + struct GNUNET_ATS_Session *next; /** * We keep all sessions in a DLL at their respective * `struct MACEndpoint *`. */ - struct Session *prev; + struct GNUNET_ATS_Session *prev; /** * MAC endpoint with the address of this peer. @@ -364,12 +364,12 @@ struct MacEndpoint /** * Head of sessions that use this MAC. */ - struct Session *sessions_head; + struct GNUNET_ATS_Session *sessions_head; /** * Tail of sessions that use this MAC. */ - struct Session *sessions_tail; + struct GNUNET_ATS_Session *sessions_tail; /** * Head of messages we are currently sending to this MAC. @@ -539,7 +539,7 @@ struct MacAndSession /** * NULL if the identity of the other peer is not known. */ - struct Session *session; + struct GNUNET_ATS_Session *session; /** * MAC address of the other peer, NULL if not known. @@ -616,7 +616,7 @@ wlan_plugin_address_to_string (void *cls, */ static void notify_session_monitor (struct Plugin *plugin, - struct Session *session, + struct GNUNET_ATS_Session *session, enum GNUNET_TRANSPORT_SessionState state) { struct GNUNET_TRANSPORT_SessionInfo info; @@ -780,7 +780,7 @@ wlan_data_message_handler (void *cls, */ static int wlan_plugin_disconnect_session (void *cls, - struct Session *session) + struct GNUNET_ATS_Session *session) { struct MacEndpoint *endpoint = session->mac; struct Plugin *plugin = endpoint->plugin; @@ -834,7 +834,7 @@ static void session_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - struct Session *session = cls; + struct GNUNET_ATS_Session *session = cls; struct GNUNET_TIME_Relative left; session->timeout_task = NULL; @@ -860,11 +860,11 @@ session_timeout (void *cls, * @param peer peer identity to use for this session * @return returns the session or NULL */ -static struct Session * +static struct GNUNET_ATS_Session * lookup_session (struct MacEndpoint *endpoint, const struct GNUNET_PeerIdentity *peer) { - struct Session *session; + struct GNUNET_ATS_Session *session; for (session = endpoint->sessions_head; NULL != session; session = session->next) if (0 == memcmp (peer, &session->target, sizeof (struct GNUNET_PeerIdentity))) @@ -880,17 +880,17 @@ lookup_session (struct MacEndpoint *endpoint, * @param peer peer identity to use for this session * @return returns the session or NULL */ -static struct Session * +static struct GNUNET_ATS_Session * create_session (struct MacEndpoint *endpoint, const struct GNUNET_PeerIdentity *peer) { - struct Session *session; + struct GNUNET_ATS_Session *session; GNUNET_STATISTICS_update (endpoint->plugin->env->stats, _("# Sessions allocated"), 1, GNUNET_NO); - session = GNUNET_new (struct Session); + session = GNUNET_new (struct GNUNET_ATS_Session); GNUNET_CONTAINER_DLL_insert_tail (endpoint->sessions_head, endpoint->sessions_tail, session); @@ -928,11 +928,11 @@ create_session (struct MacEndpoint *endpoint, * @param peer peer identity to use for this session * @return returns the session */ -static struct Session * +static struct GNUNET_ATS_Session * get_session (struct MacEndpoint *endpoint, const struct GNUNET_PeerIdentity *peer) { - struct Session *session; + struct GNUNET_ATS_Session *session; if (NULL != (session = lookup_session (endpoint, peer))) return session; @@ -1165,7 +1165,7 @@ free_macendpoint (struct MacEndpoint *endpoint) { struct Plugin *plugin = endpoint->plugin; struct FragmentMessage *fm; - struct Session *session; + struct GNUNET_ATS_Session *session; GNUNET_STATISTICS_update (plugin->env->stats, _("# MAC endpoints allocated"), @@ -1281,7 +1281,7 @@ create_macendpoint (struct Plugin *plugin, */ static enum GNUNET_ATS_Network_Type wlan_plugin_get_network (void *cls, - struct Session *session) + struct GNUNET_ATS_Session *session) { #if BUILD_WLAN return GNUNET_ATS_NET_WLAN; @@ -1318,7 +1318,7 @@ wlan_plugin_get_network_for_address (void *cls, * @param address the address * @return the session or NULL of max connections exceeded */ -static struct Session * +static struct GNUNET_ATS_Session * wlan_plugin_get_session (void *cls, const struct GNUNET_HELLO_Address *address) { @@ -1357,7 +1357,7 @@ wlan_plugin_disconnect_peer (void *cls, const struct GNUNET_PeerIdentity *target) { struct Plugin *plugin = cls; - struct Session *session; + struct GNUNET_ATS_Session *session; struct MacEndpoint *endpoint; for (endpoint = plugin->mac_head; NULL != endpoint; endpoint = endpoint->next) @@ -1400,7 +1400,7 @@ wlan_plugin_disconnect_peer (void *cls, */ static ssize_t wlan_plugin_send (void *cls, - struct Session *session, + struct GNUNET_ATS_Session *session, const char *msgbuf, size_t msgbuf_size, unsigned int priority, struct GNUNET_TIME_Relative to, @@ -2143,7 +2143,7 @@ wlan_plugin_setup_monitor (void *cls, { struct Plugin *plugin = cls; struct MacEndpoint *mac; - struct Session *session; + struct GNUNET_ATS_Session *session; plugin->sic = sic; plugin->sic_cls = sic_cls; @@ -2177,7 +2177,7 @@ wlan_plugin_setup_monitor (void *cls, static void wlan_plugin_update_session_timeout (void *cls, const struct GNUNET_PeerIdentity *peer, - struct Session *session) + struct GNUNET_ATS_Session *session) { GNUNET_assert (NULL != session->timeout_task); session->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT); @@ -2197,7 +2197,7 @@ wlan_plugin_update_session_timeout (void *cls, static void wlan_plugin_update_inbound_delay (void *cls, const struct GNUNET_PeerIdentity *peer, - struct Session *session, + struct GNUNET_ATS_Session *session, struct GNUNET_TIME_Relative delay) { /* does nothing, as inbound delay is not supported by WLAN */ diff --git a/src/transport/test_plugin_transport.c b/src/transport/test_plugin_transport.c index f3c5e260e..d7c53f51b 100644 --- a/src/transport/test_plugin_transport.c +++ b/src/transport/test_plugin_transport.c @@ -285,7 +285,7 @@ end_badly_now () static struct GNUNET_TIME_Relative env_receive (void *cls, const struct GNUNET_HELLO_Address *address, - struct Session *session, + struct GNUNET_ATS_Session *session, const struct GNUNET_MessageHeader *message) { /* do nothing */ @@ -520,7 +520,7 @@ env_get_our_hello () static void env_session_end (void *cls, const struct GNUNET_HELLO_Address *address, - struct Session *session) + struct GNUNET_ATS_Session *session) { } diff --git a/src/transport/transport_api_monitor_plugins.c b/src/transport/transport_api_monitor_plugins.c index 1a8ec8b7c..56d6f928d 100644 --- a/src/transport/transport_api_monitor_plugins.c +++ b/src/transport/transport_api_monitor_plugins.c @@ -79,7 +79,7 @@ struct GNUNET_TRANSPORT_PluginMonitor /** * Abstract representation of a plugin's session. - * Corresponds to the `struct Session` within the TRANSPORT service. + * Corresponds to the `struct GNUNET_ATS_Session` within the TRANSPORT service. */ struct GNUNET_TRANSPORT_PluginSession { -- cgit v1.2.3