towards PEERSTORE file plugin
[oweals/gnunet.git] / src / include / gnunet_transport_service.h
index 0c719d955f65c730879e6962b45ca8e0facccf73..87affd190990bbe218f4bc0c8e5f619a96eabc24 100644 (file)
@@ -47,46 +47,38 @@ extern "C"
 /**
  * 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 if we are allowed to communicate with
- * this peer (#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 (#GNUNET_TRANSPORT_PS_CONNECT_RECV_ATS).
- * If ATS makes a suggestion, we ALSO give that suggestion to the blacklist
- * (#GNUNET_TRANSPORT_PS_CONNECT_RECV_BLACKLIST).  Once the blacklist approves the
- * address we got from ATS, we send our CONNECT_ACK and go to
- * #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.
+ * Then, there are two main paths. If we receive a CONNECT message, we give
+ * the inbound address to ATS. After the check we ask ATS for a suggestion
+ * (#GNUNET_TRANSPORT_PS_CONNECT_RECV_ATS). If ATS makes a suggestion, we
+ * send our CONNECT_ACK and go to #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 #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 #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
+ * start with #GNUNET_TRANSPORT_PS_INIT_ATS.  If we get an address, we send
+ * the CONNECT message and go to 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
  * #GNUNET_TRANSPORT_PS_DISCONNECT.
  *
  * If the session is in trouble (i.e. transport-level disconnect or
  * 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 #GNUNET_TRANSPORT_PS_RECONNECT_BLACKLIST to check the new
- * address against the blacklist.  If the blacklist approves, we enter
- * #GNUNET_TRANSPORT_PS_RECONNECT_SENT and send a CONNECT message.  If we receive a
+ * have a new address, we enter #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 #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 #GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_BLACKLIST to check the
- * new address against the blacklist.  If the blacklist approves, we
- * go to #GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_CONNECT_SENT and send a
- * SESSION_CONNECT.  If we get a SESSION_ACK back, we switch the
+ * connection, we 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 #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),
+ * sure.  If the operation times out
  * we go to #GNUNET_TRANSPORT_PS_CONNECTED (and notify ATS that the given alternative
  * address is "invalid").
  *
@@ -180,7 +172,11 @@ enum GNUNET_TRANSPORT_PeerState
 
 
 /**
- * Current state of a validation process
+ * Current state of a validation process.
+ *
+ * FIXME: what state is used to indicate that a validation
+ * was successful? If that is clarified/determined, "UGH" in
+ * ~gnunet-peerinfo-gtk.c:1103 should be resolved.
  */
 enum GNUNET_TRANSPORT_ValidationState
 {
@@ -454,7 +450,7 @@ GNUNET_TRANSPORT_try_connect (struct GNUNET_TRANSPORT_Handle *handle,
  * Cancel the request to transport to try a connect
  * Callback will not be called
  *
- * @param tch GNUNET_TRANSPORT_TryConnectHandle handle to cancel
+ * @param tch handle to cancel
  */
 void
 GNUNET_TRANSPORT_try_connect_cancel (struct GNUNET_TRANSPORT_TryConnectHandle *tch);
@@ -474,16 +470,16 @@ GNUNET_TRANSPORT_try_connect_cancel (struct GNUNET_TRANSPORT_TryConnectHandle *t
  */
 struct GNUNET_TRANSPORT_TryConnectHandle *
 GNUNET_TRANSPORT_try_disconnect (struct GNUNET_TRANSPORT_Handle *handle,
-                              const struct GNUNET_PeerIdentity *target,
-                              GNUNET_TRANSPORT_TryConnectCallback cb,
-                              void *cb_cls);
+                                 const struct GNUNET_PeerIdentity *target,
+                                 GNUNET_TRANSPORT_TryConnectCallback cb,
+                                 void *cb_cls);
 
 
 /**
  * Cancel the request to transport to try a disconnect
  * Callback will not be called
  *
- * @param tch GNUNET_TRANSPORT_TryConnectHandle handle to cancel
+ * @param tch handle for operation to cancel
  */
 void
 GNUNET_TRANSPORT_try_disconnect_cancel (struct GNUNET_TRANSPORT_TryConnectHandle *tch);
@@ -636,6 +632,9 @@ void
 GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_GetHelloHandle *ghh);
 
 
+/**
+ * Handle for a #GNUNET_TRANSPORT_offer_hello operation
+ */
 struct GNUNET_TRANSPORT_OfferHelloHandle;
 
 /**
@@ -732,6 +731,10 @@ GNUNET_TRANSPORT_is_connected (enum GNUNET_TRANSPORT_PeerState state);
 const char *
 GNUNET_TRANSPORT_vs2s (enum GNUNET_TRANSPORT_ValidationState state);
 
+
+/**
+ * Handle for a #GNUNET_TRANSPORT_monitor_peers operation.
+ */
 struct GNUNET_TRANSPORT_PeerMonitoringContext;
 
 /**
@@ -779,6 +782,9 @@ void
 GNUNET_TRANSPORT_monitor_peers_cancel (struct GNUNET_TRANSPORT_PeerMonitoringContext *pic);
 
 
+/**
+ * Handle for a #GNUNET_TRANSPORT_monitor_validation_entries() operation.
+ */
 struct GNUNET_TRANSPORT_ValidationMonitoringContext;
 
 /**