aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_transport_communication_service.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_transport_communication_service.h')
-rw-r--r--src/include/gnunet_transport_communication_service.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/include/gnunet_transport_communication_service.h b/src/include/gnunet_transport_communication_service.h
index fed681f0f..e80ba85cf 100644
--- a/src/include/gnunet_transport_communication_service.h
+++ b/src/include/gnunet_transport_communication_service.h
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
@@ -80,12 +80,36 @@ struct GNUNET_TRANSPORT_CommunicatorHandle;
80 80
81 81
82/** 82/**
83 * What characteristics does this communicator have?
84 */
85enum GNUNET_TRANSPORT_CommunicatorCharacteristics {
86
87 /**
88 * Characteristics are unknown (i.e. DV).
89 */
90 GNUNET_TRANSPORT_CC_UNKNOWN = 0,
91
92 /**
93 * Transmission is reliabile (with ACKs), i.e. TCP/HTTP/HTTPS.
94 */
95 GNUNET_TRANSPORT_CC_RELIABLE = 1,
96
97 /**
98 * Transmission is unreliable (i.e. UDP)
99 */
100 GNUNET_TRANSPORT_CC_UNRELIABILE = 2
101
102};
103
104
105/**
83 * Connect to the transport service. 106 * Connect to the transport service.
84 * 107 *
85 * @param cfg configuration to use 108 * @param cfg configuration to use
86 * @param config_section section of the configuration to use for options 109 * @param config_section section of the configuration to use for options
87 * @param addr_prefix address prefix for addresses supported by this 110 * @param addr_prefix address prefix for addresses supported by this
88 * communicator, could be NULL for incoming-only communicators 111 * communicator, could be NULL for incoming-only communicators
112 * @param cc what characteristics does the communicator have?
89 * @param mq_init function to call to initialize a message queue given 113 * @param mq_init function to call to initialize a message queue given
90 * the address of another peer, can be NULL if the 114 * the address of another peer, can be NULL if the
91 * communicator only supports receiving messages 115 * communicator only supports receiving messages
@@ -96,6 +120,7 @@ struct GNUNET_TRANSPORT_CommunicatorHandle *
96GNUNET_TRANSPORT_communicator_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, 120GNUNET_TRANSPORT_communicator_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
97 const char *config_section_name, 121 const char *config_section_name,
98 const char *addr_prefix, 122 const char *addr_prefix,
123 enum GNUNET_TRANSPORT_CommunicatorCharacteristics cc,
99 GNUNET_TRANSPORT_CommunicatorMqInit mq_init, 124 GNUNET_TRANSPORT_CommunicatorMqInit mq_init,
100 void *mq_init_cls); 125 void *mq_init_cls);
101 126
@@ -162,14 +187,17 @@ struct GNUNET_TRANSPORT_QueueHandle;
162 * Possible states of a connection. 187 * Possible states of a connection.
163 */ 188 */
164enum GNUNET_TRANSPORT_ConnectionStatus { 189enum GNUNET_TRANSPORT_ConnectionStatus {
190
165 /** 191 /**
166 * Connection is down. 192 * Connection is down.
167 */ 193 */
168 GNUNET_TRANSPORT_CS_DOWN = -1, 194 GNUNET_TRANSPORT_CS_DOWN = -1,
195
169 /** 196 /**
170 * this is an outbound connection (transport initiated) 197 * this is an outbound connection (transport initiated)
171 */ 198 */
172 GNUNET_TRANSPORT_CS_OUTBOUND = 0, 199 GNUNET_TRANSPORT_CS_OUTBOUND = 0,
200
173 /** 201 /**
174 * this is an inbound connection (communicator initiated) 202 * this is an inbound connection (communicator initiated)
175 */ 203 */
@@ -188,6 +216,7 @@ enum GNUNET_TRANSPORT_ConnectionStatus {
188 * @param mtu maximum message size supported by queue, 0 if 216 * @param mtu maximum message size supported by queue, 0 if
189 * sending is not supported, SIZE_MAX for no MTU 217 * sending is not supported, SIZE_MAX for no MTU
190 * @param nt which network type does the @a address belong to? 218 * @param nt which network type does the @a address belong to?
219 * @param distance how many hops does this queue use (DV-only)?
191 * @param cs what is the connection status of the queue? 220 * @param cs what is the connection status of the queue?
192 * @param mq message queue of the @a peer 221 * @param mq message queue of the @a peer
193 * @return API handle identifying the new MQ 222 * @return API handle identifying the new MQ
@@ -198,6 +227,7 @@ GNUNET_TRANSPORT_communicator_mq_add (struct GNUNET_TRANSPORT_CommunicatorHandle
198 const char *address, 227 const char *address,
199 uint32_t mtu, 228 uint32_t mtu,
200 enum GNUNET_ATS_Network_Type nt, 229 enum GNUNET_ATS_Network_Type nt,
230 uint32_t distance,
201 enum GNUNET_TRANSPORT_ConnectionStatus cs, 231 enum GNUNET_TRANSPORT_ConnectionStatus cs,
202 struct GNUNET_MQ_Handle *mq); 232 struct GNUNET_MQ_Handle *mq);
203 233