aboutsummaryrefslogtreecommitdiff
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"
42 42
43#include "gnunet_util_lib.h" 43#include "gnunet_util_lib.h"
44 44
45
46/** 45/**
47 * Prefix that every HELLO URI must start with. 46 * Prefix that every HELLO URI must start with.
48 */ 47 */
@@ -475,11 +474,18 @@ GNUNET_HELLO_parse_uri (const char *uri,
475 474
476 475
477/* NG API */ 476/* NG API */
477/**
478 * Defined in gnunet_ats_service.h, but here we do not care about
479 * the details so are just giving the declaration.
480 */
481enum GNUNET_ATS_Network_Type;
482
478 483
479/** 484/**
480 * Build address record by signing raw information with private key. 485 * Build address record by signing raw information with private key.
481 * 486 *
482 * @param address text address to sign 487 * @param address text address to sign
488 * @param nt network type of @a address
483 * @param expiration how long is @a address valid 489 * @param expiration how long is @a address valid
484 * @param private_key signing key to use 490 * @param private_key signing key to use
485 * @param result[out] where to write address record (allocated) 491 * @param result[out] where to write address record (allocated)
@@ -487,6 +493,7 @@ GNUNET_HELLO_parse_uri (const char *uri,
487 */ 493 */
488void 494void
489GNUNET_HELLO_sign_address (const char *address, 495GNUNET_HELLO_sign_address (const char *address,
496 enum GNUNET_ATS_Network_Type nt,
490 struct GNUNET_TIME_Absolute expiration, 497 struct GNUNET_TIME_Absolute expiration,
491 const struct GNUNET_CRYPTO_EddsaPrivateKey *private_key, 498 const struct GNUNET_CRYPTO_EddsaPrivateKey *private_key,
492 void **result, 499 void **result,
@@ -499,6 +506,7 @@ GNUNET_HELLO_sign_address (const char *address,
499 * @param raw raw signed address 506 * @param raw raw signed address
500 * @param raw_size size of @a raw 507 * @param raw_size size of @a raw
501 * @param public_key public key to use for signature verification 508 * @param public_key public key to use for signature verification
509 * @param nt[out] set to network type
502 * @param expiration[out] how long is the address valid 510 * @param expiration[out] how long is the address valid
503 * @return NULL on error, otherwise the address 511 * @return NULL on error, otherwise the address
504 */ 512 */
@@ -506,6 +514,7 @@ char *
506GNUNET_HELLO_extract_address (const void *raw, 514GNUNET_HELLO_extract_address (const void *raw,
507 size_t raw_size, 515 size_t raw_size,
508 const struct GNUNET_CRYPTO_EddsaPublicKey *public_key, 516 const struct GNUNET_CRYPTO_EddsaPublicKey *public_key,
517 enum GNUNET_ATS_Network_Type *nt,
509 struct GNUNET_TIME_Absolute *expiration); 518 struct GNUNET_TIME_Absolute *expiration);
510 519
511 520
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;
86 * @param config_section section of the configuration to use for options 86 * @param config_section section of the configuration to use for options
87 * @param addr_prefix address prefix for addresses supported by this 87 * @param addr_prefix address prefix for addresses supported by this
88 * communicator, could be NULL for incoming-only communicators 88 * communicator, could be NULL for incoming-only communicators
89 * @param mtu maximum message size supported by communicator, 0 if
90 * sending is not supported, SIZE_MAX for no MTU
91 * @param mq_init function to call to initialize a message queue given 89 * @param mq_init function to call to initialize a message queue given
92 * the address of another peer, can be NULL if the 90 * the address of another peer, can be NULL if the
93 * communicator only supports receiving messages 91 * communicator only supports receiving messages
@@ -98,7 +96,6 @@ struct GNUNET_TRANSPORT_CommunicatorHandle *
98GNUNET_TRANSPORT_communicator_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, 96GNUNET_TRANSPORT_communicator_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
99 const char *config_section_name, 97 const char *config_section_name,
100 const char *addr_prefix, 98 const char *addr_prefix,
101 size_t mtu,
102 GNUNET_TRANSPORT_CommunicatorMqInit mq_init, 99 GNUNET_TRANSPORT_CommunicatorMqInit mq_init,
103 void *mq_init_cls); 100 void *mq_init_cls);
104 101
@@ -162,6 +159,25 @@ struct GNUNET_TRANSPORT_QueueHandle;
162 159
163 160
164/** 161/**
162 * Possible states of a connection.
163 */
164enum GNUNET_TRANSPORT_ConnectionStatus {
165 /**
166 * Connection is down.
167 */
168 GNUNET_TRANSPORT_CS_DOWN = -1,
169 /**
170 * this is an outbound connection (transport initiated)
171 */
172 GNUNET_TRANSPORT_CS_OUTBOUND = 0,
173 /**
174 * this is an inbound connection (communicator initiated)
175 */
176 GNUNET_TRANSPORT_CS_INBOUND = 1
177};
178
179
180/**
165 * Notify transport service that an MQ became available due to an 181 * Notify transport service that an MQ became available due to an
166 * "inbound" connection or because the communicator discovered the 182 * "inbound" connection or because the communicator discovered the
167 * presence of another peer. 183 * presence of another peer.
@@ -169,7 +185,10 @@ struct GNUNET_TRANSPORT_QueueHandle;
169 * @param ch connection to transport service 185 * @param ch connection to transport service
170 * @param peer peer with which we can now communicate 186 * @param peer peer with which we can now communicate
171 * @param address address in human-readable format, 0-terminated, UTF-8 187 * @param address address in human-readable format, 0-terminated, UTF-8
188 * @param mtu maximum message size supported by queue, 0 if
189 * sending is not supported, SIZE_MAX for no MTU
172 * @param nt which network type does the @a address belong to? 190 * @param nt which network type does the @a address belong to?
191 * @param cs what is the connection status of the queue?
173 * @param mq message queue of the @a peer 192 * @param mq message queue of the @a peer
174 * @return API handle identifying the new MQ 193 * @return API handle identifying the new MQ
175 */ 194 */
@@ -177,7 +196,9 @@ struct GNUNET_TRANSPORT_QueueHandle *
177GNUNET_TRANSPORT_communicator_mq_add (struct GNUNET_TRANSPORT_CommunicatorHandle *ch, 196GNUNET_TRANSPORT_communicator_mq_add (struct GNUNET_TRANSPORT_CommunicatorHandle *ch,
178 const struct GNUNET_PeerIdentity *peer, 197 const struct GNUNET_PeerIdentity *peer,
179 const char *address, 198 const char *address,
199 uint32_t mtu,
180 enum GNUNET_ATS_Network_Type nt, 200 enum GNUNET_ATS_Network_Type nt,
201 enum GNUNET_TRANSPORT_ConnectionStatus cs,
181 struct GNUNET_MQ_Handle *mq); 202 struct GNUNET_MQ_Handle *mq);
182 203
183 204
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"
42 42
43#include "gnunet_util_lib.h" 43#include "gnunet_util_lib.h"
44#include "gnunet_ats_service.h" 44#include "gnunet_ats_service.h"
45#include "gnunet_transport_communication_service.h"
46
45 47
46/** 48/**
47 * Version number of the transport API. 49 * Version number of the transport API.
@@ -66,10 +68,9 @@ struct GNUNET_TRANSPORT_MonitorInformation
66 enum GNUNET_ATS_Network_Type nt; 68 enum GNUNET_ATS_Network_Type nt;
67 69
68 /** 70 /**
69 * #GNUNET_YES if this is an inbound connection (communicator initiated) 71 * Connection status.
70 * #GNUNET_NO if this is an outbound connection (transport initiated)
71 */ 72 */
72 int is_inbound; 73 enum GNUNET_TRANSPORT_ConnectionStatus cs;
73 74
74 /** 75 /**
75 * Number of messages pending transmission for this @e address. 76 * Number of messages pending transmission for this @e address.