diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-10-03 20:48:58 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-10-03 20:48:58 +0000 |
commit | 5c043b7a736e72573376edc105b4add7c2cc5c04 (patch) | |
tree | 1636eea11265269584eb76e6ac12703eca3838ea /src/include | |
parent | 53504a47148826fc652e105baad5ead9fc289e63 (diff) | |
download | gnunet-5c043b7a736e72573376edc105b4add7c2cc5c04.tar.gz gnunet-5c043b7a736e72573376edc105b4add7c2cc5c04.zip |
-set socket to NULL on close to avoid double-close, do not cleanup on timeout, leave that to app
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_nat_lib.h | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/src/include/gnunet_nat_lib.h b/src/include/gnunet_nat_lib.h index b8822a94b..b11f1894e 100644 --- a/src/include/gnunet_nat_lib.h +++ b/src/include/gnunet_nat_lib.h | |||
@@ -73,120 +73,120 @@ struct GNUNET_NAT_Handle; | |||
73 | /** | 73 | /** |
74 | * Error Types for the NAT subsystem (which can then later be converted/resolved to a string) | 74 | * Error Types for the NAT subsystem (which can then later be converted/resolved to a string) |
75 | */ | 75 | */ |
76 | enum GNUNET_NAT_StatusCode | 76 | enum GNUNET_NAT_StatusCode |
77 | { | 77 | { |
78 | /** | 78 | /** |
79 | * Just the default | 79 | * Just the default |
80 | */ | 80 | */ |
81 | GNUNET_NAT_ERROR_SUCCESS = GNUNET_OK, | 81 | GNUNET_NAT_ERROR_SUCCESS = GNUNET_OK, |
82 | 82 | ||
83 | /** | 83 | /** |
84 | * IPC Failure | 84 | * IPC Failure |
85 | */ | 85 | */ |
86 | GNUNET_NAT_ERROR_IPC_FAILURE, | 86 | GNUNET_NAT_ERROR_IPC_FAILURE, |
87 | 87 | ||
88 | /** | 88 | /** |
89 | * Failure in network subsystem, check permissions | 89 | * Failure in network subsystem, check permissions |
90 | */ | 90 | */ |
91 | GNUNET_NAT_ERROR_INTERNAL_NETWORK_ERROR, | 91 | GNUNET_NAT_ERROR_INTERNAL_NETWORK_ERROR, |
92 | 92 | ||
93 | /** | 93 | /** |
94 | * test timed out | 94 | * test timed out |
95 | */ | 95 | */ |
96 | GNUNET_NAT_ERROR_TIMEOUT, | 96 | GNUNET_NAT_ERROR_TIMEOUT, |
97 | 97 | ||
98 | /** | 98 | /** |
99 | * detected that we are offline | 99 | * detected that we are offline |
100 | */ | 100 | */ |
101 | GNUNET_NAT_ERROR_NOT_ONLINE, | 101 | GNUNET_NAT_ERROR_NOT_ONLINE, |
102 | 102 | ||
103 | /** | 103 | /** |
104 | * `upnpc` command not found | 104 | * `upnpc` command not found |
105 | */ | 105 | */ |
106 | GNUNET_NAT_ERROR_UPNPC_NOT_FOUND, | 106 | GNUNET_NAT_ERROR_UPNPC_NOT_FOUND, |
107 | 107 | ||
108 | /** | 108 | /** |
109 | * Failed to run `upnpc` command | 109 | * Failed to run `upnpc` command |
110 | */ | 110 | */ |
111 | GNUNET_NAT_ERROR_UPNPC_FAILED, | 111 | GNUNET_NAT_ERROR_UPNPC_FAILED, |
112 | 112 | ||
113 | /** | 113 | /** |
114 | * `upnpc' command took too long, process killed | 114 | * `upnpc' command took too long, process killed |
115 | */ | 115 | */ |
116 | GNUNET_NAT_ERROR_UPNPC_TIMEOUT, | 116 | GNUNET_NAT_ERROR_UPNPC_TIMEOUT, |
117 | 117 | ||
118 | /** | 118 | /** |
119 | * `upnpc' command failed to establish port mapping | 119 | * `upnpc' command failed to establish port mapping |
120 | */ | 120 | */ |
121 | GNUNET_NAT_ERROR_UPNPC_PORTMAP_FAILED, | 121 | GNUNET_NAT_ERROR_UPNPC_PORTMAP_FAILED, |
122 | 122 | ||
123 | /** | 123 | /** |
124 | * `external-ip' command not found | 124 | * `external-ip' command not found |
125 | */ | 125 | */ |
126 | GNUNET_NAT_ERROR_EXTERNAL_IP_UTILITY_NOT_FOUND, | 126 | GNUNET_NAT_ERROR_EXTERNAL_IP_UTILITY_NOT_FOUND, |
127 | 127 | ||
128 | /** | 128 | /** |
129 | * Failed to run `external-ip` command | 129 | * Failed to run `external-ip` command |
130 | */ | 130 | */ |
131 | GNUNET_NAT_ERROR_EXTERNAL_IP_UTILITY_FAILED, | 131 | GNUNET_NAT_ERROR_EXTERNAL_IP_UTILITY_FAILED, |
132 | 132 | ||
133 | /** | 133 | /** |
134 | * `external-ip' command output invalid | 134 | * `external-ip' command output invalid |
135 | */ | 135 | */ |
136 | GNUNET_NAT_ERROR_EXTERNAL_IP_UTILITY_OUTPUT_INVALID, | 136 | GNUNET_NAT_ERROR_EXTERNAL_IP_UTILITY_OUTPUT_INVALID, |
137 | 137 | ||
138 | /** | 138 | /** |
139 | * "no valid address was returned by `external-ip'" | 139 | * "no valid address was returned by `external-ip'" |
140 | */ | 140 | */ |
141 | GNUNET_NAT_ERROR_EXTERNAL_IP_ADDRESS_INVALID, | 141 | GNUNET_NAT_ERROR_EXTERNAL_IP_ADDRESS_INVALID, |
142 | 142 | ||
143 | /** | 143 | /** |
144 | * Could not determine interface with internal/local network address | 144 | * Could not determine interface with internal/local network address |
145 | */ | 145 | */ |
146 | GNUNET_NAT_ERROR_NO_VALID_IF_IP_COMBO, | 146 | GNUNET_NAT_ERROR_NO_VALID_IF_IP_COMBO, |
147 | 147 | ||
148 | /** | 148 | /** |
149 | * No working gnunet-helper-nat-server found | 149 | * No working gnunet-helper-nat-server found |
150 | */ | 150 | */ |
151 | GNUNET_NAT_ERROR_HELPER_NAT_SERVER_NOT_FOUND, | 151 | GNUNET_NAT_ERROR_HELPER_NAT_SERVER_NOT_FOUND, |
152 | 152 | ||
153 | /** | 153 | /** |
154 | * NAT test could not be initialized | 154 | * NAT test could not be initialized |
155 | */ | 155 | */ |
156 | GNUNET_NAT_ERROR_NAT_TEST_START_FAILED, | 156 | GNUNET_NAT_ERROR_NAT_TEST_START_FAILED, |
157 | 157 | ||
158 | /** | 158 | /** |
159 | * NAT test timeout | 159 | * NAT test timeout |
160 | */ | 160 | */ |
161 | GNUNET_NAT_ERROR_NAT_TEST_TIMEOUT, | 161 | GNUNET_NAT_ERROR_NAT_TEST_TIMEOUT, |
162 | 162 | ||
163 | /** | 163 | /** |
164 | * NAT test failed to initiate | 164 | * NAT test failed to initiate |
165 | */ | 165 | */ |
166 | GNUNET_NAT_ERROR_NAT_REGISTER_FAILED, | 166 | GNUNET_NAT_ERROR_NAT_REGISTER_FAILED, |
167 | 167 | ||
168 | /** | 168 | /** |
169 | * | 169 | * |
170 | */ | 170 | */ |
171 | GNUNET_NAT_ERROR_HELPER_NAT_CLIENT_NOT_FOUND, | 171 | GNUNET_NAT_ERROR_HELPER_NAT_CLIENT_NOT_FOUND, |
172 | 172 | ||
173 | |||
174 | /** | 173 | /** |
175 | * | 174 | * |
176 | */ | 175 | */ |
177 | GNUNET_NAT_ERROR_ | 176 | GNUNET_NAT_ERROR_ |
178 | }; | 177 | }; |
179 | 178 | ||
180 | 179 | ||
181 | /** | 180 | /** |
182 | * Converts enum GNUNET_NAT_StatusCode to string | 181 | * Converts `enum GNUNET_NAT_StatusCode` to string |
183 | * | 182 | * |
184 | * @param err error code to resolve to a string | 183 | * @param err error code to resolve to a string |
185 | * @return point to a static string containing the error code | 184 | * @return point to a static string containing the error code |
186 | */ | 185 | */ |
187 | const char * | 186 | const char * |
188 | GNUNET_NAT_status2string (enum GNUNET_NAT_StatusCode err); | 187 | GNUNET_NAT_status2string (enum GNUNET_NAT_StatusCode err); |
189 | 188 | ||
189 | |||
190 | /** | 190 | /** |
191 | * Attempt to enable port redirection and detect public IP address | 191 | * Attempt to enable port redirection and detect public IP address |
192 | * contacting UPnP or NAT-PMP routers on the local network. Use addr | 192 | * contacting UPnP or NAT-PMP routers on the local network. Use addr |
@@ -289,7 +289,8 @@ typedef void (*GNUNET_NAT_TestCallback) (void *cls, | |||
289 | * @param bnd_port port to bind to, 0 for connection reversal | 289 | * @param bnd_port port to bind to, 0 for connection reversal |
290 | * @param adv_port externally advertised port to use | 290 | * @param adv_port externally advertised port to use |
291 | * @param timeout delay after which the test should be aborted | 291 | * @param timeout delay after which the test should be aborted |
292 | * @param report function to call with the result of the test | 292 | * @param report function to call with the result of the test; |
293 | * you still must call #GNUNET_NAT_test_stop(). | ||
293 | * @param report_cls closure for @a report | 294 | * @param report_cls closure for @a report |
294 | * @return handle to cancel NAT test | 295 | * @return handle to cancel NAT test |
295 | */ | 296 | */ |