Electroneum
Loading...
Searching...
No Matches
net::socks Namespace Reference

Classes

class  connect_handler
class  client
 Client support for socks connect and resolve commands. More...
class  connect_client
struct  connector
 Primarily for use with epee::net_utils::http_client. More...

Enumerations

enum class  version : std::uint8_t { v4 = 0 , v4a , v4a_tor }
 Supported socks variants. More...
enum class  error : int {
  rejected = 92 , identd_connection , identd_user , bad_read = 257 ,
  bad_write , unexpected_version
}
 Possible errors with socks communication. Defined in https://www.openssh.com/txt/socks4.protocol. More...

Functions

const boost::system::error_category & error_category () noexcept
boost::system::error_code make_error_code (error value) noexcept
template<typename Handler>
std::shared_ptr< clientmake_connect_client (client::stream_type::socket &&proxy, socks::version ver, Handler handler)

Enumeration Type Documentation

◆ error

enum class net::socks::error : int
strong

Possible errors with socks communication. Defined in https://www.openssh.com/txt/socks4.protocol.

Enumerator
rejected 
identd_connection 
identd_user 
bad_read 
bad_write 
unexpected_version 

Definition at line 65 of file socks.h.

66 {
67 // 0 is reserved for success value
68 // 1-256 -> reserved for error values from socks server (+1 from wire value).
69 rejected = 92,
72 // Specific to application
73 bad_read = 257,
76 };

◆ version

enum class net::socks::version : std::uint8_t
strong

Supported socks variants.

Enumerator
v4 
v4a 
v4a_tor 

Extensions defined in Tor codebase.

Definition at line 57 of file socks.h.

58 {
59 v4 = 0,
60 v4a,
61 v4a_tor
62 };
@ v4a_tor
Extensions defined in Tor codebase.
Definition socks.h:61

Function Documentation

◆ error_category()

const boost::system::error_category & net::socks::error_category ( )
noexcept
Returns
boost::system::error_category for net::socks namespace

Definition at line 143 of file socks.cpp.

144 {
145 static const socks_category instance{};
146 return instance;
147 }
Here is the caller graph for this function:

◆ make_connect_client()

template<typename Handler>
std::shared_ptr< client > net::socks::make_connect_client ( client::stream_type::socket && proxy,
socks::version ver,
Handler handler )
inline

Definition at line 226 of file socks.h.

227 {
228 return std::make_shared<connect_client<Handler>>(std::move(proxy), ver, std::move(handler));
229 }
Here is the caller graph for this function:

◆ make_error_code()

boost::system::error_code net::socks::make_error_code ( error value)
inlinenoexcept
Returns
net::socks::error as a boost::system::error_code.

Definition at line 87 of file socks.h.

88 {
89 return boost::system::error_code{int(value), socks::error_category()};
90 }
const boost::system::error_category & error_category() noexcept
Definition socks.cpp:143
const GenericPointer< typename T::ValueType > T2 value
Definition pointer.h:1225
Here is the call graph for this function:
Here is the caller graph for this function: