diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-08-26 11:27:19 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-08-26 11:27:19 -0400 |
commit | 707a6bd6595024e0b4a998e0a99eb284499a37e3 (patch) | |
tree | dd3230c44404c42b7fcab590466b0c2d3ad99c61 /src/or/reasons.c | |
parent | f1b5fd2aaa81daaa9065a7f0193be5855e7d4e32 (diff) | |
parent | 903f9ef50e418f6ec1a1ab7ae8146e9d6d2a7767 (diff) | |
download | tor-707a6bd6595024e0b4a998e0a99eb284499a37e3.tar.gz tor-707a6bd6595024e0b4a998e0a99eb284499a37e3.zip |
Merge commit 'public/socks-client'
Resolved conflict in:
src/or/or.h
Diffstat (limited to 'src/or/reasons.c')
-rw-r--r-- | src/or/reasons.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/or/reasons.c b/src/or/reasons.c index a252f83198..78a16af10e 100644 --- a/src/or/reasons.c +++ b/src/or/reasons.c @@ -326,3 +326,47 @@ circuit_end_reason_to_control_string(int reason) } } +const char * +socks4_response_code_to_string(uint8_t code) +{ + switch (code) { + case 0x5a: + return "connection accepted"; + case 0x5b: + return "server rejected connection"; + case 0x5c: + return "server cannot connect to identd on this client"; + case 0x5d: + return "user id does not match identd"; + default: + return "invalid SOCKS 4 response code"; + } +} + +const char * +socks5_response_code_to_string(uint8_t code) +{ + switch (code) { + case 0x00: + return "connection accepted"; + case 0x01: + return "general SOCKS server failure"; + case 0x02: + return "connection not allowed by ruleset"; + case 0x03: + return "Network unreachable"; + case 0x04: + return "Host unreachable"; + case 0x05: + return "Connection refused"; + case 0x06: + return "TTL expired"; + case 0x07: + return "Command not supported"; + case 0x08: + return "Address type not supported"; + default: + return "unknown reason"; + } +} + |