summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_hello_lib.h11
-rw-r--r--src/include/gnunet_transport_communication_service.h27
-rw-r--r--src/include/gnunet_transport_monitor_service.h7
3 files changed, 38 insertions, 7 deletions
diff --git a/src/include/gnunet_hello_lib.h b/src/include/gnunet_hello_lib.h
index e19419f25..ceaa60466 100644
--- a/src/include/gnunet_hello_lib.h
+++ b/src/include/gnunet_hello_lib.h
@@ -42,7 +42,6 @@ extern "C"
#include "gnunet_util_lib.h"
-
/**
* Prefix that every HELLO URI must start with.
*/
@@ -475,11 +474,18 @@ GNUNET_HELLO_parse_uri (const char *uri,
/* NG API */
+/**
+ * Defined in gnunet_ats_service.h, but here we do not care about
+ * the details so are just giving the declaration.
+ */
+enum GNUNET_ATS_Network_Type;
+
/**
* Build address record by signing raw information with private key.
*
* @param address text address to sign
+ * @param nt network type of @a address
* @param expiration how long is @a address valid
* @param private_key signing key to use
* @param result[out] where to write address record (allocated)
@@ -487,6 +493,7 @@ GNUNET_HELLO_parse_uri (const char *uri,
*/
void
GNUNET_HELLO_sign_address (const char *address,
+ enum GNUNET_ATS_Network_Type nt,
struct GNUNET_TIME_Absolute expiration,
const struct GNUNET_CRYPTO_EddsaPrivateKey *private_key,
void **result,
@@ -499,6 +506,7 @@ GNUNET_HELLO_sign_address (const char *address,
* @param raw raw signed address
* @param raw_size size of @a raw
* @param public_key public key to use for signature verification
+ * @param nt[out] set to network type
* @param expiration[out] how long is the address valid
* @return NULL on error, otherwise the address
*/
@@ -506,6 +514,7 @@ char *
GNUNET_HELLO_extract_address (const void *raw,
size_t raw_size,
const struct GNUNET_CRYPTO_EddsaPublicKey *public_key,
+ enum GNUNET_ATS_Network_Type *nt,
struct GNUNET_TIME_Absolute *expiration);
diff --git a/src/include/gnunet_transport_communication_service.h b/src/include/gnunet_transport_communication_service.h
index 50f94bddf..fed681f0f 100644
--- a/src/include/gnunet_transport_communication_service.h
+++ b/src/include/gnunet_transport_communication_service.h
@@ -86,8 +86,6 @@ struct GNUNET_TRANSPORT_CommunicatorHandle;
* @param config_section section of the configuration to use for options
* @param addr_prefix address prefix for addresses supported by this
* communicator, could be NULL for incoming-only communicators
- * @param mtu maximum message size supported by communicator, 0 if
- * sending is not supported, SIZE_MAX for no MTU
* @param mq_init function to call to initialize a message queue given
* the address of another peer, can be NULL if the
* communicator only supports receiving messages
@@ -98,7 +96,6 @@ struct GNUNET_TRANSPORT_CommunicatorHandle *
GNUNET_TRANSPORT_communicator_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
const char *config_section_name,
const char *addr_prefix,
- size_t mtu,
GNUNET_TRANSPORT_CommunicatorMqInit mq_init,
void *mq_init_cls);
@@ -162,6 +159,25 @@ struct GNUNET_TRANSPORT_QueueHandle;
/**
+ * Possible states of a connection.
+ */
+enum GNUNET_TRANSPORT_ConnectionStatus {
+ /**
+ * Connection is down.
+ */
+ GNUNET_TRANSPORT_CS_DOWN = -1,
+ /**
+ * this is an outbound connection (transport initiated)
+ */
+ GNUNET_TRANSPORT_CS_OUTBOUND = 0,
+ /**
+ * this is an inbound connection (communicator initiated)
+ */
+ GNUNET_TRANSPORT_CS_INBOUND = 1
+};
+
+
+/**
* Notify transport service that an MQ became available due to an
* "inbound" connection or because the communicator discovered the
* presence of another peer.
@@ -169,7 +185,10 @@ struct GNUNET_TRANSPORT_QueueHandle;
* @param ch connection to transport service
* @param peer peer with which we can now communicate
* @param address address in human-readable format, 0-terminated, UTF-8
+ * @param mtu maximum message size supported by queue, 0 if
+ * sending is not supported, SIZE_MAX for no MTU
* @param nt which network type does the @a address belong to?
+ * @param cs what is the connection status of the queue?
* @param mq message queue of the @a peer
* @return API handle identifying the new MQ
*/
@@ -177,7 +196,9 @@ struct GNUNET_TRANSPORT_QueueHandle *
GNUNET_TRANSPORT_communicator_mq_add (struct GNUNET_TRANSPORT_CommunicatorHandle *ch,
const struct GNUNET_PeerIdentity *peer,
const char *address,
+ uint32_t mtu,
enum GNUNET_ATS_Network_Type nt,
+ enum GNUNET_TRANSPORT_ConnectionStatus cs,
struct GNUNET_MQ_Handle *mq);
diff --git a/src/include/gnunet_transport_monitor_service.h b/src/include/gnunet_transport_monitor_service.h
index 76fec0af4..799434016 100644
--- a/src/include/gnunet_transport_monitor_service.h
+++ b/src/include/gnunet_transport_monitor_service.h
@@ -42,6 +42,8 @@ extern "C"
#include "gnunet_util_lib.h"
#include "gnunet_ats_service.h"
+#include "gnunet_transport_communication_service.h"
+
/**
* Version number of the transport API.
@@ -66,10 +68,9 @@ struct GNUNET_TRANSPORT_MonitorInformation
enum GNUNET_ATS_Network_Type nt;
/**
- * #GNUNET_YES if this is an inbound connection (communicator initiated)
- * #GNUNET_NO if this is an outbound connection (transport initiated)
+ * Connection status.
*/
- int is_inbound;
+ enum GNUNET_TRANSPORT_ConnectionStatus cs;
/**
* Number of messages pending transmission for this @e address.