diff options
Diffstat (limited to 'src/include/gnunet_nat_lib.h')
-rw-r--r-- | src/include/gnunet_nat_lib.h | 68 |
1 files changed, 31 insertions, 37 deletions
diff --git a/src/include/gnunet_nat_lib.h b/src/include/gnunet_nat_lib.h index 30eb50dd8..c521a560c 100644 --- a/src/include/gnunet_nat_lib.h +++ b/src/include/gnunet_nat_lib.h | |||
@@ -86,17 +86,13 @@ struct GNUNET_NAT_Handle; | |||
86 | * @param callback_cls closure for callback | 86 | * @param callback_cls closure for callback |
87 | * @return NULL on error, otherwise handle that can be used to unregister | 87 | * @return NULL on error, otherwise handle that can be used to unregister |
88 | */ | 88 | */ |
89 | struct GNUNET_NAT_Handle *GNUNET_NAT_register (const struct | 89 | struct GNUNET_NAT_Handle * |
90 | GNUNET_CONFIGURATION_Handle *cfg, | 90 | GNUNET_NAT_register (const struct GNUNET_CONFIGURATION_Handle *cfg, int is_tcp, |
91 | int is_tcp, uint16_t adv_port, | 91 | uint16_t adv_port, unsigned int num_addrs, |
92 | unsigned int num_addrs, | 92 | const struct sockaddr **addrs, const socklen_t * addrlens, |
93 | const struct sockaddr **addrs, | 93 | GNUNET_NAT_AddressCallback address_callback, |
94 | const socklen_t * addrlens, | 94 | GNUNET_NAT_ReversalCallback reversal_callback, |
95 | GNUNET_NAT_AddressCallback | 95 | void *callback_cls); |
96 | address_callback, | ||
97 | GNUNET_NAT_ReversalCallback | ||
98 | reversal_callback, | ||
99 | void *callback_cls); | ||
100 | 96 | ||
101 | 97 | ||
102 | /** | 98 | /** |
@@ -109,8 +105,9 @@ struct GNUNET_NAT_Handle *GNUNET_NAT_register (const struct | |||
109 | * GNUNET_NO if the address is not plausible, | 105 | * GNUNET_NO if the address is not plausible, |
110 | * GNUNET_SYSERR if the address is malformed | 106 | * GNUNET_SYSERR if the address is malformed |
111 | */ | 107 | */ |
112 | int GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h, const void *addr, | 108 | int |
113 | socklen_t addrlen); | 109 | GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h, const void *addr, |
110 | socklen_t addrlen); | ||
114 | 111 | ||
115 | 112 | ||
116 | /** | 113 | /** |
@@ -121,8 +118,9 @@ int GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h, const void *addr, | |||
121 | * @param h handle (used for configuration) | 118 | * @param h handle (used for configuration) |
122 | * @param sa the address of the peer (IPv4-only) | 119 | * @param sa the address of the peer (IPv4-only) |
123 | */ | 120 | */ |
124 | void GNUNET_NAT_run_client (struct GNUNET_NAT_Handle *h, | 121 | void |
125 | const struct sockaddr_in *sa); | 122 | GNUNET_NAT_run_client (struct GNUNET_NAT_Handle *h, |
123 | const struct sockaddr_in *sa); | ||
126 | 124 | ||
127 | 125 | ||
128 | 126 | ||
@@ -132,7 +130,8 @@ void GNUNET_NAT_run_client (struct GNUNET_NAT_Handle *h, | |||
132 | * | 130 | * |
133 | * @param h the handle to stop | 131 | * @param h the handle to stop |
134 | */ | 132 | */ |
135 | void GNUNET_NAT_unregister (struct GNUNET_NAT_Handle *h); | 133 | void |
134 | GNUNET_NAT_unregister (struct GNUNET_NAT_Handle *h); | ||
136 | 135 | ||
137 | 136 | ||
138 | /** | 137 | /** |
@@ -163,12 +162,10 @@ typedef void (*GNUNET_NAT_TestCallback) (void *cls, int success); | |||
163 | * @param report_cls closure for report | 162 | * @param report_cls closure for report |
164 | * @return handle to cancel NAT test | 163 | * @return handle to cancel NAT test |
165 | */ | 164 | */ |
166 | struct GNUNET_NAT_Test *GNUNET_NAT_test_start (const struct | 165 | struct GNUNET_NAT_Test * |
167 | GNUNET_CONFIGURATION_Handle *cfg, | 166 | GNUNET_NAT_test_start (const struct GNUNET_CONFIGURATION_Handle *cfg, |
168 | int is_tcp, uint16_t bnd_port, | 167 | int is_tcp, uint16_t bnd_port, uint16_t adv_port, |
169 | uint16_t adv_port, | 168 | GNUNET_NAT_TestCallback report, void *report_cls); |
170 | GNUNET_NAT_TestCallback report, | ||
171 | void *report_cls); | ||
172 | 169 | ||
173 | 170 | ||
174 | /** | 171 | /** |
@@ -176,7 +173,8 @@ struct GNUNET_NAT_Test *GNUNET_NAT_test_start (const struct | |||
176 | * | 173 | * |
177 | * @param tst test to stop. | 174 | * @param tst test to stop. |
178 | */ | 175 | */ |
179 | void GNUNET_NAT_test_stop (struct GNUNET_NAT_Test *tst); | 176 | void |
177 | GNUNET_NAT_test_stop (struct GNUNET_NAT_Test *tst); | ||
180 | 178 | ||
181 | 179 | ||
182 | /** | 180 | /** |
@@ -203,13 +201,9 @@ struct GNUNET_NAT_ExternalHandle; | |||
203 | * @param cb_cls closure for 'cb' | 201 | * @param cb_cls closure for 'cb' |
204 | * @return handle for cancellation (can only be used until 'cb' is called), NULL on error | 202 | * @return handle for cancellation (can only be used until 'cb' is called), NULL on error |
205 | */ | 203 | */ |
206 | struct GNUNET_NAT_ExternalHandle *GNUNET_NAT_mini_get_external_ipv4 (struct | 204 | struct GNUNET_NAT_ExternalHandle * |
207 | GNUNET_TIME_Relative | 205 | GNUNET_NAT_mini_get_external_ipv4 (struct GNUNET_TIME_Relative timeout, |
208 | timeout, | 206 | GNUNET_NAT_IPCallback cb, void *cb_cls); |
209 | GNUNET_NAT_IPCallback | ||
210 | cb, | ||
211 | void | ||
212 | *cb_cls); | ||
213 | 207 | ||
214 | 208 | ||
215 | /** | 209 | /** |
@@ -217,8 +211,8 @@ struct GNUNET_NAT_ExternalHandle *GNUNET_NAT_mini_get_external_ipv4 (struct | |||
217 | * | 211 | * |
218 | * @param eh operation to cancel | 212 | * @param eh operation to cancel |
219 | */ | 213 | */ |
220 | void GNUNET_NAT_mini_get_external_ipv4_cancel (struct GNUNET_NAT_ExternalHandle | 214 | void |
221 | *eh); | 215 | GNUNET_NAT_mini_get_external_ipv4_cancel (struct GNUNET_NAT_ExternalHandle *eh); |
222 | 216 | ||
223 | 217 | ||
224 | /** | 218 | /** |
@@ -240,10 +234,9 @@ struct GNUNET_NAT_MiniHandle; | |||
240 | * @param ac_cls closure for 'ac' | 234 | * @param ac_cls closure for 'ac' |
241 | * @return NULL on error | 235 | * @return NULL on error |
242 | */ | 236 | */ |
243 | struct GNUNET_NAT_MiniHandle *GNUNET_NAT_mini_map_start (uint16_t port, | 237 | struct GNUNET_NAT_MiniHandle * |
244 | int is_tcp, | 238 | GNUNET_NAT_mini_map_start (uint16_t port, int is_tcp, |
245 | GNUNET_NAT_AddressCallback | 239 | GNUNET_NAT_AddressCallback ac, void *ac_cls); |
246 | ac, void *ac_cls); | ||
247 | 240 | ||
248 | 241 | ||
249 | /** | 242 | /** |
@@ -254,7 +247,8 @@ struct GNUNET_NAT_MiniHandle *GNUNET_NAT_mini_map_start (uint16_t port, | |||
254 | * | 247 | * |
255 | * @param mini the handle | 248 | * @param mini the handle |
256 | */ | 249 | */ |
257 | void GNUNET_NAT_mini_map_stop (struct GNUNET_NAT_MiniHandle *mini); | 250 | void |
251 | GNUNET_NAT_mini_map_stop (struct GNUNET_NAT_MiniHandle *mini); | ||
258 | 252 | ||
259 | 253 | ||
260 | #endif | 254 | #endif |