MCPcopy Create free account
hub / github.com/ElementsProject/elements / Socks5ErrorString

Function Socks5ErrorString

src/netbase.cpp:343–365  ·  view source on GitHub ↗

Convert SOCKS5 reply to an error message */

Source from the content-addressed store, hash-verified

341
342/** Convert SOCKS5 reply to an error message */
343static std::string Socks5ErrorString(uint8_t err)
344{
345 switch(err) {
346 case SOCKS5Reply::GENFAILURE:
347 return "general failure";
348 case SOCKS5Reply::NOTALLOWED:
349 return "connection not allowed";
350 case SOCKS5Reply::NETUNREACHABLE:
351 return "network unreachable";
352 case SOCKS5Reply::HOSTUNREACHABLE:
353 return "host unreachable";
354 case SOCKS5Reply::CONNREFUSED:
355 return "connection refused";
356 case SOCKS5Reply::TTLEXPIRED:
357 return "TTL expired";
358 case SOCKS5Reply::CMDUNSUPPORTED:
359 return "protocol error";
360 case SOCKS5Reply::ATYPEUNSUPPORTED:
361 return "address type not supported";
362 default:
363 return "unknown";
364 }
365}
366
367bool Socks5(const std::string& strDest, uint16_t port, const ProxyCredentials* auth, const Sock& sock)
368{

Callers 1

Socks5Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected