Electroneum
net::socks Namespace Reference

Classes

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

Enumerations

enum  version : std::uint8_t { version::v4 = 0, version::v4a, version::v4a_tor }
 Supported socks variants. More...
 
enum  error : int {
  error::rejected = 92, error::identd_connection, error::identd_user, error::bad_read = 257,
  error::bad_write, error::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 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.

65  : int
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,
74  bad_write,
76  };

◆ version

Supported socks variants.

Enumerator
v4 
v4a 
v4a_tor 

Extensions defined in Tor codebase.

Definition at line 57 of file socks.h.

57  : std::uint8_t
58  {
59  v4 = 0,
60  v4a,
61  v4a_tor
62  };
unsigned char uint8_t
Definition: stdint.h:124
Extensions defined in Tor codebase.

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  }
const T & move(const T &t)
Definition: gtest-port.h:1317
Here is the call graph for this function:
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  }
std::error_category const & error_category() noexcept
Definition: error.cpp:92
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1225
Here is the call graph for this function: