aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorNils Gillmann <ng0@n0.is>2018-11-13 11:42:15 +0000
committerNils Gillmann <ng0@n0.is>2018-11-13 11:42:15 +0000
commit9d1e77b9331acb9bd8b6c99aa942f62b9759e650 (patch)
tree85475b117fff75b563a6f9512d3ead476a830f7d /src/include
parente8a1a082555f98af40f98fd3a20ccd803ad478f8 (diff)
parent98288a7b26344294a3668101b9c2b502dfc19e12 (diff)
downloadgnunet-9d1e77b9331acb9bd8b6c99aa942f62b9759e650.tar.gz
gnunet-9d1e77b9331acb9bd8b6c99aa942f62b9759e650.zip
Merge branch 'master' of gnunet.org:gnunet
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_configuration_lib.h31
-rw-r--r--src/include/gnunet_protocols.h19
-rw-r--r--src/include/gnunet_transport_communication_service.h10
3 files changed, 54 insertions, 6 deletions
diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h
index e3eefa18d..ec3d12738 100644
--- a/src/include/gnunet_configuration_lib.h
+++ b/src/include/gnunet_configuration_lib.h
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2006, 2008, 2009 GNUnet e.V. 3 Copyright (C) 2006, 2008, 2009, 2018 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published 6 under the terms of the GNU Affero General Public License as published
@@ -191,6 +191,35 @@ GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg);
191 191
192 192
193/** 193/**
194 * Signature of a function to be run with a configuration.
195 *
196 * @param cls closure
197 * @param cfg the configuration
198 * @return status code
199 */
200typedef int
201(*GNUNET_CONFIGURATION_Callback)(void *cls,
202 const struct GNUNET_CONFIGURATION_Handle *cfg);
203
204
205/**
206 * Parse a configuration file @a filename and run the function
207 * @a cb with the resulting configuration object. Then free the
208 * configuration object and return the status value from @a cb.
209 *
210 * @param filename configuration to parse, NULL for "default"
211 * @param cb function to run
212 * @param cb_cls closure for @a cb
213 * @return #GNUNET_SYSERR if parsing the configuration failed,
214 * otherwise return value from @a cb.
215 */
216int
217GNUNET_CONFIGURATION_parse_and_run (const char *filename,
218 GNUNET_CONFIGURATION_Callback cb,
219 void *cb_cls);
220
221
222/**
194 * Function to iterate over options. 223 * Function to iterate over options.
195 * 224 *
196 * @param cls closure 225 * @param cls closure
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h
index 898ad6258..fbdee5415 100644
--- a/src/include/gnunet_protocols.h
+++ b/src/include/gnunet_protocols.h
@@ -3051,15 +3051,30 @@ extern "C"
3051#define GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE 1206 3051#define GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE 1206
3052 3052
3053/** 3053/**
3054 * Response from communicator: will try to create queue.
3055 */
3056#define GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE_OK 1207
3057
3058/**
3059 * Response from communicator: address bogus, will not try to create queue.
3060 */
3061#define GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE_FAIL 1208
3062
3063/**
3054 * @brief transport tells communicator it wants to transmit 3064 * @brief transport tells communicator it wants to transmit
3055 */ 3065 */
3056#define GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG 1207 3066#define GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG 1209
3057 3067
3058/** 3068/**
3059 * @brief communicator tells transports that message was sent 3069 * @brief communicator tells transports that message was sent
3060 */ 3070 */
3061#define GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG_ACK 1208 3071#define GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG_ACK 1210
3062 3072
3073/**
3074 * Message sent to indicate to the transport which address
3075 * prefix is supported by a communicator.
3076 */
3077#define GNUNET_MESSAGE_TYPE_TRANSPORT_NEW_COMMUNICATOR 1211
3063 3078
3064/** 3079/**
3065 * Next available: 1300 3080 * Next available: 1300
diff --git a/src/include/gnunet_transport_communication_service.h b/src/include/gnunet_transport_communication_service.h
index d93d5134e..50f94bddf 100644
--- a/src/include/gnunet_transport_communication_service.h
+++ b/src/include/gnunet_transport_communication_service.h
@@ -42,6 +42,7 @@ extern "C"
42#endif 42#endif
43 43
44#include "gnunet_util_lib.h" 44#include "gnunet_util_lib.h"
45#include "gnunet_ats_service.h"
45 46
46/** 47/**
47 * Version number of the transport communication API. 48 * Version number of the transport communication API.
@@ -69,7 +70,7 @@ extern "C"
69typedef int 70typedef int
70(*GNUNET_TRANSPORT_CommunicatorMqInit) (void *cls, 71(*GNUNET_TRANSPORT_CommunicatorMqInit) (void *cls,
71 const struct GNUNET_PeerIdentity *peer, 72 const struct GNUNET_PeerIdentity *peer,
72 const void *address); 73 const char *address);
73 74
74 75
75/** 76/**
@@ -82,7 +83,9 @@ struct GNUNET_TRANSPORT_CommunicatorHandle;
82 * Connect to the transport service. 83 * Connect to the transport service.
83 * 84 *
84 * @param cfg configuration to use 85 * @param cfg configuration to use
85 * @param name name of the communicator that is connecting 86 * @param config_section section of the configuration to use for options
87 * @param addr_prefix address prefix for addresses supported by this
88 * communicator, could be NULL for incoming-only communicators
86 * @param mtu maximum message size supported by communicator, 0 if 89 * @param mtu maximum message size supported by communicator, 0 if
87 * sending is not supported, SIZE_MAX for no MTU 90 * sending is not supported, SIZE_MAX for no MTU
88 * @param mq_init function to call to initialize a message queue given 91 * @param mq_init function to call to initialize a message queue given
@@ -93,7 +96,8 @@ struct GNUNET_TRANSPORT_CommunicatorHandle;
93 */ 96 */
94struct GNUNET_TRANSPORT_CommunicatorHandle * 97struct GNUNET_TRANSPORT_CommunicatorHandle *
95GNUNET_TRANSPORT_communicator_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, 98GNUNET_TRANSPORT_communicator_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
96 const char *name, 99 const char *config_section_name,
100 const char *addr_prefix,
97 size_t mtu, 101 size_t mtu,
98 GNUNET_TRANSPORT_CommunicatorMqInit mq_init, 102 GNUNET_TRANSPORT_CommunicatorMqInit mq_init,
99 void *mq_init_cls); 103 void *mq_init_cls);