summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-05-05 14:02:24 +0200
committerChristian Grothoff <christian@grothoff.org>2019-05-05 14:02:24 +0200
commite94c5914935ca0842ca762d343cb167c68b8a79a (patch)
tree4719d48bbcd9be334854d0ed88ba76f5b259b296 /src/include
parentb84057d7593651e16a161de9f2ec51f93c98589d (diff)
downloadgnunet-e94c5914935ca0842ca762d343cb167c68b8a79a.tar.gz
gnunet-e94c5914935ca0842ca762d343cb167c68b8a79a.zip
use new PriorityPreferences consistently, note on deprecation
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_mq_lib.h4
-rw-r--r--src/include/gnunet_transport_address_service.h15
-rw-r--r--src/include/gnunet_transport_application_service.h28
-rw-r--r--src/include/gnunet_transport_hello_service.h29
4 files changed, 56 insertions, 20 deletions
diff --git a/src/include/gnunet_mq_lib.h b/src/include/gnunet_mq_lib.h
index 4fe5c8df9..81100d7d8 100644
--- a/src/include/gnunet_mq_lib.h
+++ b/src/include/gnunet_mq_lib.h
@@ -1043,6 +1043,8 @@ GNUNET_MQ_impl_current (struct GNUNET_MQ_Handle *mq);
1043 1043
1044/** 1044/**
1045 * Enum defining all known preference categories. 1045 * Enum defining all known preference categories.
1046 *
1047 * @deprecated will be replaced by `enum GNUNET_MQ_PriorityPreference`
1046 */ 1048 */
1047enum GNUNET_MQ_PreferenceKind 1049enum GNUNET_MQ_PreferenceKind
1048{ 1050{
@@ -1083,6 +1085,8 @@ enum GNUNET_MQ_PreferenceKind
1083 * 1085 *
1084 * @param type the preference type 1086 * @param type the preference type
1085 * @return a string or NULL if invalid 1087 * @return a string or NULL if invalid
1088 *
1089 * @deprecated will be replaced by `enum GNUNET_MQ_PriorityPreference`
1086 */ 1090 */
1087const char * 1091const char *
1088GNUNET_MQ_preference_to_string (enum GNUNET_MQ_PreferenceKind type); 1092GNUNET_MQ_preference_to_string (enum GNUNET_MQ_PreferenceKind type);
diff --git a/src/include/gnunet_transport_address_service.h b/src/include/gnunet_transport_address_service.h
index 9f0717d00..b33a11411 100644
--- a/src/include/gnunet_transport_address_service.h
+++ b/src/include/gnunet_transport_address_service.h
@@ -21,6 +21,9 @@
21/** 21/**
22 * @author Christian Grothoff 22 * @author Christian Grothoff
23 * 23 *
24 * @deprecated NOTE: we may want to drop this API and
25 * only keep the gnunet_transport_application_service.h in the future!
26 *
24 * @file 27 * @file
25 * Provide addresses to transport for validation 28 * Provide addresses to transport for validation
26 * 29 *
@@ -36,9 +39,8 @@
36#define GNUNET_TRANSPORT_ADDRESS_SERVICE_H 39#define GNUNET_TRANSPORT_ADDRESS_SERVICE_H
37 40
38#ifdef __cplusplus 41#ifdef __cplusplus
39extern "C" 42extern "C" {
40{ 43#if 0 /* keep Emacsens' auto-indent happy */
41#if 0 /* keep Emacsens' auto-indent happy */
42} 44}
43#endif 45#endif
44#endif 46#endif
@@ -65,7 +67,8 @@ struct GNUNET_TRANSPORT_AddressHandle;
65 * @return NULL on error 67 * @return NULL on error
66 */ 68 */
67struct GNUNET_TRANSPORT_AddressHandle * 69struct GNUNET_TRANSPORT_AddressHandle *
68GNUNET_TRANSPORT_address_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); 70GNUNET_TRANSPORT_address_connect (
71 const struct GNUNET_CONFIGURATION_Handle *cfg);
69 72
70 73
71/** 74/**
@@ -101,7 +104,7 @@ GNUNET_TRANSPORT_address_try (struct GNUNET_TRANSPORT_AddressHandle *ch,
101 const size_t raw_size); 104 const size_t raw_size);
102 105
103 106
104#if 0 /* keep Emacsens' auto-indent happy */ 107#if 0 /* keep Emacsens' auto-indent happy */
105{ 108{
106#endif 109#endif
107#ifdef __cplusplus 110#ifdef __cplusplus
@@ -111,6 +114,6 @@ GNUNET_TRANSPORT_address_try (struct GNUNET_TRANSPORT_AddressHandle *ch,
111/* ifndef GNUNET_TRANSPORT_ADDRESS_SERVICE_H */ 114/* ifndef GNUNET_TRANSPORT_ADDRESS_SERVICE_H */
112#endif 115#endif
113 116
114/** @} */ /* end of group */ 117/** @} */ /* end of group */
115 118
116/* end of gnunet_transport_address_service.h */ 119/* end of gnunet_transport_address_service.h */
diff --git a/src/include/gnunet_transport_application_service.h b/src/include/gnunet_transport_application_service.h
index 8c63a8234..c12bd7441 100644
--- a/src/include/gnunet_transport_application_service.h
+++ b/src/include/gnunet_transport_application_service.h
@@ -65,6 +65,34 @@ GNUNET_TRANSPORT_application_done (
65 65
66 66
67/** 67/**
68 * An application would like TRANSPORT to connect to a peer.
69 *
70 * @param ch handle
71 * @param peer identity of the peer we need an address for
72 * @param pk what kind of application will the application require (can be
73 * #GNUNET_MQ_PRIO_BACKGROUND, we will still try to connect)
74 * @param bw desired bandwith, can be zero (we will still try to connect)
75 * @return suggest handle, NULL if a request is already pending
76 */
77struct GNUNET_TRANSPORT_ApplicationSuggestHandle *
78GNUNET_TRANSPORT_application_suggest (
79 struct GNUNET_TRANSPORT_ApplicationHandle *ch,
80 const struct GNUNET_PeerIdentity *peer,
81 enum GNUNET_MQ_PriorityPreferences pk,
82 struct GNUNET_BANDWIDTH_Value32NBO bw);
83
84
85/**
86 * We no longer care about being connected to a peer.
87 *
88 * @param sh handle to stop
89 */
90void
91GNUNET_TRANSPORT_application_suggest_cancel (
92 struct GNUNET_TRANSPORT_ApplicationSuggestHandle *sh);
93
94
95/**
68 * An application (or a communicator) has received a HELLO (or other address 96 * An application (or a communicator) has received a HELLO (or other address
69 * data of another peer) and wants TRANSPORT to validate that the address is 97 * data of another peer) and wants TRANSPORT to validate that the address is
70 * correct. The result is NOT returned, in fact TRANSPORT may do nothing 98 * correct. The result is NOT returned, in fact TRANSPORT may do nothing
diff --git a/src/include/gnunet_transport_hello_service.h b/src/include/gnunet_transport_hello_service.h
index 58a1e9979..fe863c058 100644
--- a/src/include/gnunet_transport_hello_service.h
+++ b/src/include/gnunet_transport_hello_service.h
@@ -24,6 +24,8 @@
24 * @file 24 * @file
25 * obtain information about our current address 25 * obtain information about our current address
26 * 26 *
27 * @deprecated, in TNG applications should query PEERSTORE directly!
28 *
27 * @defgroup transport Transport service 29 * @defgroup transport Transport service
28 * address information 30 * address information
29 * 31 *
@@ -35,9 +37,8 @@
35#define GNUNET_TRANSPORT_HELLO_SERVICE_H 37#define GNUNET_TRANSPORT_HELLO_SERVICE_H
36 38
37#ifdef __cplusplus 39#ifdef __cplusplus
38extern "C" 40extern "C" {
39{ 41#if 0 /* keep Emacsens' auto-indent happy */
40#if 0 /* keep Emacsens' auto-indent happy */
41} 42}
42#endif 43#endif
43#endif 44#endif
@@ -118,9 +119,9 @@ enum GNUNET_TRANSPORT_AddressClass
118 * @param cls closure 119 * @param cls closure
119 * @param hello our updated HELLO 120 * @param hello our updated HELLO
120 */ 121 */
121typedef void 122typedef void (*GNUNET_TRANSPORT_HelloUpdateCallback) (
122(*GNUNET_TRANSPORT_HelloUpdateCallback) (void *cls, 123 void *cls,
123 const struct GNUNET_MessageHeader *hello); 124 const struct GNUNET_MessageHeader *hello);
124 125
125 126
126/** 127/**
@@ -164,12 +165,12 @@ GNUNET_TRANSPORT_hello_get_cancel (struct GNUNET_TRANSPORT_HelloGetHandle *ghh);
164 * @param nt network type of the address 165 * @param nt network type of the address
165 * @param expiration when does this address expire? 166 * @param expiration when does this address expire?
166 */ 167 */
167typedef void 168typedef void (*GNUNET_TRANSPORT_AddressCallback) (
168(*GNUNET_TRANSPORT_AddressCallback) (void *cls, 169 void *cls,
169 const struct GNUNET_PeerIdentity *peer, 170 const struct GNUNET_PeerIdentity *peer,
170 const char *address, 171 const char *address,
171 enum GNUNET_NetworkType nt, 172 enum GNUNET_NetworkType nt,
172 struct GNUNET_TIME_Absolute expiration); 173 struct GNUNET_TIME_Absolute expiration);
173 174
174 175
175/** 176/**
@@ -187,7 +188,7 @@ GNUNET_TRANSPORT_hello_parse (const struct GNUNET_MessageHeader *hello,
187 void *cb_cls); 188 void *cb_cls);
188 189
189 190
190#if 0 /* keep Emacsens' auto-indent happy */ 191#if 0 /* keep Emacsens' auto-indent happy */
191{ 192{
192#endif 193#endif
193#ifdef __cplusplus 194#ifdef __cplusplus
@@ -197,6 +198,6 @@ GNUNET_TRANSPORT_hello_parse (const struct GNUNET_MessageHeader *hello,
197/* ifndef GNUNET_TRANSPORT_HELLO_SERVICE_H */ 198/* ifndef GNUNET_TRANSPORT_HELLO_SERVICE_H */
198#endif 199#endif
199 200
200/** @} */ /* end of group */ 201/** @} */ /* end of group */
201 202
202/* end of gnunet_transport_hello_service.h */ 203/* end of gnunet_transport_hello_service.h */