gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r31932 - in gnunet/src: include transport


From: gnunet
Subject: [GNUnet-SVN] r31932 - in gnunet/src: include transport
Date: Thu, 16 Jan 2014 13:29:57 +0100

Author: wachs
Date: 2014-01-16 13:29:57 +0100 (Thu, 16 Jan 2014)
New Revision: 31932

Modified:
   gnunet/src/include/gnunet_transport_service.h
   gnunet/src/transport/gnunet-service-transport.c
   gnunet/src/transport/gnunet-service-transport.h
   gnunet/src/transport/gnunet-service-transport_clients.c
   gnunet/src/transport/gnunet-service-transport_validation.h
Log:
documentation for transport service


Modified: gnunet/src/include/gnunet_transport_service.h
===================================================================
--- gnunet/src/include/gnunet_transport_service.h       2014-01-16 12:21:45 UTC 
(rev 31931)
+++ gnunet/src/include/gnunet_transport_service.h       2014-01-16 12:29:57 UTC 
(rev 31932)
@@ -45,53 +45,53 @@
 
 
 /**
- * Possible state of a neighbour.  Initially, we are #S_NOT_CONNECTED.
+ * Possible state of a neighbour.  Initially, we are 
#GNUNET_TRANSPORT_PS_NOT_CONNECTED.
  *
  * Then, there are two main paths. If we receive a CONNECT message, we
- * first run a check against the blacklist (#S_CONNECT_RECV_BLACKLIST_INBOUND).
+ * first run a check against the blacklist 
(#GNUNET_TRANSPORT_PS_CONNECT_RECV_BLACKLIST_INBOUND).
  * If this check is successful, we give the inbound address to ATS.
- * After the check we ask ATS for a suggestion (S_CONNECT_RECV_ATS).
+ * After the check we ask ATS for a suggestion 
(#GNUNET_TRANSPORT_PS_CONNECT_RECV_ATS).
  * If ATS makes a suggestion, we ALSO give that suggestion to the blacklist
- * (#S_CONNECT_RECV_BLACKLIST).  Once the blacklist approves the
+ * (#GNUNET_TRANSPORT_PS_CONNECT_RECV_BLACKLIST).  Once the blacklist approves 
the
  * address we got from ATS, we send our CONNECT_ACK and go to
- * #S_CONNECT_RECV_ACK.  If we receive a SESSION_ACK, we go to
- * #S_CONNECTED (and notify everyone about the new connection).  If the
- * operation times out, we go to #S_DISCONNECT.
+ * #GNUNET_TRANSPORT_PS_CONNECT_RECV_ACK.  If we receive a SESSION_ACK, we go 
to
+ * #GNUNET_TRANSPORT_PS_CONNECTED (and notify everyone about the new 
connection).
+ * If the operation times out, we go to #GNUNET_TRANSPORT_PS_DISCONNECT.
  *
  * The other case is where we transmit a CONNECT message first.  We
- * start with #S_INIT_ATS.  If we get an address, we enter
- * #S_INIT_BLACKLIST and check the blacklist.  If the blacklist is OK
+ * start with #GNUNET_TRANSPORT_PS_INIT_ATS.  If we get an address, we enter
+ * #GNUNET_TRANSPORT_PS_INIT_BLACKLIST and check the blacklist.  If the 
blacklist is OK
  * with the connection, we actually send the CONNECT message and go to
- * state S_CONNECT_SENT.  Once we receive a CONNECT_ACK, we go to
- * #S_CONNECTED (and notify everyone about the new connection and send
+ * state #GNUNET_TRANSPORT_PS_CONNECT_SENT.  Once we receive a CONNECT_ACK, we 
go to
+ * #GNUNET_TRANSPORT_PS_CONNECTED (and notify everyone about the new 
connection and send
  * back a SESSION_ACK).  If the operation times out, we go to
- * #S_DISCONNECT.
+ * #GNUNET_TRANSPORT_PS_DISCONNECT.
  *
  * If the session is in trouble (i.e. transport-level disconnect or
- * timeout), we go to #S_RECONNECT_ATS where we ask ATS for a new
+ * timeout), we go to #GNUNET_TRANSPORT_PS_RECONNECT_ATS where we ask ATS for 
a new
  * address (we don't notify anyone about the disconnect yet).  Once we
- * have a new address, we go to #S_RECONNECT_BLACKLIST to check the new
+ * have a new address, we go to #GNUNET_TRANSPORT_PS_RECONNECT_BLACKLIST to 
check the new
  * address against the blacklist.  If the blacklist approves, we enter
- * #S_RECONNECT_SENT and send a CONNECT message.  If we receive a
- * CONNECT_ACK, we go to #S_CONNECTED and nobody noticed that we had
+ * #GNUNET_TRANSPORT_PS_RECONNECT_SENT and send a CONNECT message.  If we 
receive a
+ * CONNECT_ACK, we go to #GNUNET_TRANSPORT_PS_CONNECTED and nobody noticed 
that we had
  * trouble; we also send a SESSION_ACK at this time just in case.  If
- * the operation times out, we go to S_DISCONNECT (and notify everyone
+ * the operation times out, we go to #GNUNET_TRANSPORT_PS_DISCONNECT (and 
notify everyone
  * about the lost connection).
  *
  * If ATS decides to switch addresses while we have a normal
- * connection, we go to #S_CONNECTED_SWITCHING_BLACKLIST to check the
+ * connection, we go to #GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_BLACKLIST to 
check the
  * new address against the blacklist.  If the blacklist approves, we
- * go to #S_CONNECTED_SWITCHING_CONNECT_SENT and send a
+ * go to #GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_CONNECT_SENT and send a
  * SESSION_CONNECT.  If we get a SESSION_ACK back, we switch the
  * primary connection to the suggested alternative from ATS, go back
- * to #S_CONNECTED and send a SESSION_ACK to the other peer just to be
+ * to #GNUNET_TRANSPORT_PS_CONNECTED and send a SESSION_ACK to the other peer 
just to be
  * sure.  If the operation times out (or the blacklist disapproves),
- * we go to #S_CONNECTED (and notify ATS that the given alternative
+ * we go to #GNUNET_TRANSPORT_PS_CONNECTED (and notify ATS that the given 
alternative
  * address is "invalid").
  *
- * Once a session is in #S_DISCONNECT, it is cleaned up and then goes
- * to (#S_DISCONNECT_FINISHED).  If we receive an explicit disconnect
- * request, we can go from any state to #S_DISCONNECT, possibly after
+ * Once a session is in #GNUNET_TRANSPORT_PS_DISCONNECT, it is cleaned up and 
then goes
+ * to (#GNUNET_TRANSPORT_PS_DISCONNECT_FINISHED).  If we receive an explicit 
disconnect
+ * request, we can go from any state to #GNUNET_TRANSPORT_PS_DISCONNECT, 
possibly after
  * generating disconnect notifications.
  *
  * Note that it is quite possible that while we are in any of these
@@ -101,7 +101,7 @@
  * set to 1.  If our state machine allows us to send a 'CONNECT_ACK'
  * (because we have an acceptable address), we send the 'CONNECT_ACK'
  * and set the 'send_connect_ack' to 2.  If we then receive a
- * 'SESSION_ACK', we go to #S_CONNECTED (and reset 'send_connect_ack'
+ * 'SESSION_ACK', we go to #GNUNET_TRANSPORT_PS_CONNECTED (and reset 
'send_connect_ack'
  * to 0).
  *
  */

Modified: gnunet/src/transport/gnunet-service-transport.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport.c     2014-01-16 12:21:45 UTC 
(rev 31931)
+++ gnunet/src/transport/gnunet-service-transport.c     2014-01-16 12:29:57 UTC 
(rev 31932)
@@ -267,18 +267,12 @@
  * Function called by the transport for each received message.
  *
  * @param cls closure, const char* with the name of the plugin we received the 
message from
- * @param peer (claimed) identity of the other peer
+ * @param address address and (claimed) identity of the other peer
  * @param message the message, NULL if we only care about
  *                learning about the delay until we should receive again
  * @param session identifier used for this session (NULL for plugins
  *                that do not offer bi-directional communication to the sender
  *                using the same "connection")
- * @param sender_address binary address of the sender (if we established the
- *                connection or are otherwise sure of it; should be NULL
- *                for inbound TCP/UDP connections since it it not clear
- *                that we could establish ourselves a connection to that
- *                IP address and get the same system)
- * @param sender_address_len number of bytes in @a sender_address
  * @return how long the plugin should wait until receiving more data
  *         (plugins that do not support this, can ignore the return value)
  */
@@ -579,13 +573,10 @@
 }
 
 /**
- * Function that will be called to figure if an address is an loopback,
- * LAN, WAN etc. address
+ * Function that will be called to update metrics for an address
  *
  * @param cls closure
- * @param peer the peer
- * @param address binary address
- * @param address_len length of the @a address
+ * @param address address to update metrics for
  * @param session the session
  * @param ats the ats information to update
  * @param ats_count the number of @a ats elements
@@ -649,6 +640,7 @@
  * actually happened.
  *
  * @param cls closure
+ * @param peer the peer this address is intended for
  * @param address address to use (for peer given in address)
  * @param session session to use (if available)
  * @param bandwidth_out assigned outbound bandwidth for the connection in NBO,
@@ -659,11 +651,14 @@
  * @param ats_count number of @a ats elements
  */
 static void
-ats_request_address_change (void *cls, const struct GNUNET_PeerIdentity *peer,
-    const struct GNUNET_HELLO_Address *address, struct Session *session,
+ats_request_address_change (void *cls,
+    const struct GNUNET_PeerIdentity *peer,
+    const struct GNUNET_HELLO_Address *address,
+    struct Session *session,
     struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
     struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
-    const struct GNUNET_ATS_Information *ats, uint32_t ats_count)
+    const struct GNUNET_ATS_Information *ats,
+    uint32_t ats_count)
 {
   uint32_t bw_in = ntohl (bandwidth_in.value__);
   uint32_t bw_out = ntohl (bandwidth_out.value__);
@@ -776,11 +771,11 @@
  *
  * @param cls closure
  * @param peer peer this update is about (never NULL)
- * @param address address, NULL on disconnect
- * @param state current state this peer is in
- * @param state_timeout timeout for the current state of the peer
- * @param bandwidth_in bandwidth assigned inbound
- * @param bandwidth_out bandwidth assigned outbound
+ * @param address address (never NULL)
+ * @param last_validation point in time when last validation was performed
+ * @param valid_until point in time how long address is valid
+ * @param next_validation point in time when next validation will be performed
+ * @param state state of validation notification
  */
 static void
 validation_changed_notification (void *cls,

Modified: gnunet/src/transport/gnunet-service-transport.h
===================================================================
--- gnunet/src/transport/gnunet-service-transport.h     2014-01-16 12:21:45 UTC 
(rev 31931)
+++ gnunet/src/transport/gnunet-service-transport.h     2014-01-16 12:29:57 UTC 
(rev 31932)
@@ -82,22 +82,14 @@
 
 /**
  * Function called by the transport for each received message.
- * This function should also be called with "NULL" for the
- * message to signal that the other peer disconnected.
  *
  * @param cls closure, const char* with the name of the plugin we received the 
message from
- * @param peer (claimed) identity of the other peer
+ * @param address address and (claimed) identity of the other peer
  * @param message the message, NULL if we only care about
- *                learning about the delay until we should receive again -- 
FIXME!
+ *                learning about the delay until we should receive again
  * @param session identifier used for this session (NULL for plugins
  *                that do not offer bi-directional communication to the sender
  *                using the same "connection")
- * @param sender_address binary address of the sender (if we established the
- *                connection or are otherwise sure of it; should be NULL
- *                for inbound TCP/UDP connections since it it not clear
- *                that we could establish ourselves a connection to that
- *                IP address and get the same system)
- * @param sender_address_len number of bytes in sender_address
  * @return how long the plugin should wait until receiving more data
  *         (plugins that do not support this, can ignore the return value)
  */

Modified: gnunet/src/transport/gnunet-service-transport_clients.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_clients.c     2014-01-16 
12:21:45 UTC (rev 31931)
+++ gnunet/src/transport/gnunet-service-transport_clients.c     2014-01-16 
12:29:57 UTC (rev 31932)
@@ -262,6 +262,7 @@
  * Find the handle to the monitoring client associated with the given
  * client handle
  *
+ * @param head the head of the client queue to look in
  * @param client server's client handle to look up
  * @return handle to the monitoring client
  */
@@ -1006,15 +1007,15 @@
 };
 
 /**
- * Output information of neighbours to the given client.
+ * Output information of validation entries to the given client.
  *
- * @param cls the 'struct PeerIterationContext'
+ * @param cls the 'struct IterationContext'
  * @param peer identity of the neighbour
  * @param address the address
- * @param state current state this peer is in
- * @param state_timeout timeout for the current state of the peer
- * @param bandwidth_in inbound quota in NBO
- * @param bandwidth_out outbound quota in NBO
+ * @param last_validation point in time when last validation was performed
+ * @param valid_until point in time how long address is valid
+ * @param next_validation point in time when next validation will be performed
+ * @param state state of validation notification
  */
 static void
 send_validation_information (void *cls,

Modified: gnunet/src/transport/gnunet-service-transport_validation.h
===================================================================
--- gnunet/src/transport/gnunet-service-transport_validation.h  2014-01-16 
12:21:45 UTC (rev 31931)
+++ gnunet/src/transport/gnunet-service-transport_validation.h  2014-01-16 
12:29:57 UTC (rev 31932)
@@ -32,17 +32,16 @@
 #include "gnunet_hello_lib.h"
 
 /**
- * Function called for each address (or address status change) that
- * the validation module is aware of (for the given target).
+ * Function called to notify transport users that a neighbour peer changed its
+ * active address.
  *
  * @param cls closure
- * @param public_key public key for the peer, never NULL
- * @param valid_until is ZERO if we never validated the address,
- *                    otherwise a time up to when we consider it (or was) valid
- * @param validation_block  is FOREVER if the address is for an unsupported 
plugin (from PEERINFO)
- *                          is ZERO if the address is considered valid (no 
validation needed)
- *                          otherwise a time in the future if we're currently 
denying re-validation
- * @param address the address
+ * @param peer peer this update is about (never NULL)
+ * @param address address (never NULL)
+ * @param last_validation point in time when last validation was performed
+ * @param valid_until point in time how long address is valid
+ * @param next_validation point in time when next validation will be performed
+ * @param state state of validation notification
  */
 typedef void (*GST_ValidationChangedCallback) (void *cls,
     const struct GNUNET_PeerIdentity *peer,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]