diff options
author | irungentoo <irungentoo@gmail.com> | 2014-12-26 19:38:19 -0500 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2014-12-26 19:38:19 -0500 |
commit | fe57a72659a8a298d8c11f7355d15815dee10195 (patch) | |
tree | aa3064268b325cb1ceb145cb5a367d1df6c1c4f9 /toxcore/network.h | |
parent | a4f0b65ad72682e6ca2becf3081f7e5e72a0f7af (diff) | |
parent | 35602e12c007aec38f65c860cad5f03953c4596d (diff) |
Merge branch 'http-proxy-feature' of https://github.com/nurupo/InsertProjectNameHere
Diffstat (limited to 'toxcore/network.h')
-rw-r--r-- | toxcore/network.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/toxcore/network.h b/toxcore/network.h index ccda7ae9..5f9af490 100644 --- a/toxcore/network.h +++ b/toxcore/network.h | |||
@@ -180,10 +180,30 @@ IP_Port; | |||
180 | /* ip_ntoa | 180 | /* ip_ntoa |
181 | * converts ip into a string | 181 | * converts ip into a string |
182 | * uses a static buffer, so mustn't used multiple times in the same output | 182 | * uses a static buffer, so mustn't used multiple times in the same output |
183 | * | ||
184 | * IPv6 addresses are enclosed into square brackets, i.e. "[IPv6]" | ||
185 | * writes error message into the buffer on error | ||
183 | */ | 186 | */ |
184 | const char *ip_ntoa(const IP *ip); | 187 | const char *ip_ntoa(const IP *ip); |
185 | 188 | ||
186 | /* | 189 | /* |
190 | * ip_parse_addr | ||
191 | * parses IP structure into an address string | ||
192 | * | ||
193 | * input | ||
194 | * ip: ip of AF_INET or AF_INET6 families | ||
195 | * length: length of the address buffer | ||
196 | * Must be at least INET_ADDRSTRLEN for AF_INET | ||
197 | * and INET6_ADDRSTRLEN for AF_INET6 | ||
198 | * | ||
199 | * output | ||
200 | * address: dotted notation (IPv4: quad, IPv6: 16) or colon notation (IPv6) | ||
201 | * | ||
202 | * returns 1 on success, 0 on failure | ||
203 | */ | ||
204 | int ip_parse_addr(const IP *ip, char *address, size_t length); | ||
205 | |||
206 | /* | ||
187 | * addr_parse_ip | 207 | * addr_parse_ip |
188 | * directly parses the input into an IP structure | 208 | * directly parses the input into an IP structure |
189 | * tries IPv4 first, then IPv6 | 209 | * tries IPv4 first, then IPv6 |