public static String getReplyCodeAsString ( byte code ) { switch ( code ) { // v4 & v4a codes case V4_REPLY_REQUEST_GRANTED : return "Request granted" ; case V4_REPLY_REQUEST_REJECTED_OR_FAILED : return "Request rejected or failed" ; case V4_REPLY_REQUEST_FAILED_NO_IDENTD : return "Request failed because client is not running identd (or not reachable from the server)" ; case V4_REPLY_REQUEST_FAILED_ID_NOT_CONFIRMED : return "Request failed because client's identd could not confirm the user ID string in the request" ; // v5 codes case V5_REPLY_SUCCEEDED : return "Request succeeded" ; case V5_REPLY_GENERAL_FAILURE : return "Request failed: general SOCKS server failure" ; case V5_REPLY_NOT_ALLOWED : return "Request failed: connection not allowed by ruleset" ; case V5_REPLY_NETWORK_UNREACHABLE : return "Request failed: network unreachable" ; case V5_REPLY_HOST_UNREACHABLE : return "Request failed: host unreachable" ; case V5_REPLY_CONNECTION_REFUSED : return "Request failed: connection refused" ; case V5_REPLY_TTL_EXPIRED : return "Request failed: TTL expired" ; case V5_REPLY_COMMAND_NOT_SUPPORTED : return "Request failed: command not supported" ; case V5_REPLY_ADDRESS_TYPE_NOT_SUPPORTED : return "Request failed: address type not supported" ; default : return "Unknown reply code" ; } }
Return the string associated with the specified reply code .