tor  0.4.2.1-alpha-dev
Data Fields
socks_request_t Struct Reference

#include <socks_request_st.h>

Data Fields

uint8_t socks_version
 
uint8_t auth_type
 
uint8_t command
 
uint8_t listener_type
 
size_t replylen
 
uint8_t reply [MAX_SOCKS_REPLY_LEN]
 
char address [MAX_SOCKS_ADDR_LEN]
 
uint16_t port
 
unsigned int has_finished: 1
 
unsigned int got_auth: 1
 
unsigned int socks_prefer_no_auth: 1
 
size_t usernamelen
 
uint8_t passwordlen
 
char * username
 
char * password
 
uint8_t socks5_atyp
 

Detailed Description

State of a SOCKS request from a user to an OP. Also used to encode other information for non-socks user request (such as those on TransPort and DNSPort)

Definition at line 30 of file socks_request_st.h.

Field Documentation

◆ address

char socks_request_t::address[MAX_SOCKS_ADDR_LEN]

What address did the client ask to connect to/resolve?

Definition at line 50 of file socks_request_st.h.

Referenced by adjust_exit_policy_from_exitpolicy_failure(), consider_recording_trackhost(), remap_event_helper(), and write_stream_target_to_buf().

◆ auth_type

uint8_t socks_request_t::auth_type

If using socks5 authentication, which authentication type did we negotiate? currently we support 0 (no authentication) and 2 (username/password).

Definition at line 38 of file socks_request_st.h.

◆ command

uint8_t socks_request_t::command

What is this stream's goal? One of the SOCKS_COMMAND_* values

Definition at line 40 of file socks_request_st.h.

Referenced by connection_ap_handshake_attach_chosen_circuit(), connection_ap_handshake_send_resolve(), connection_ap_process_transparent(), and MOCK_IMPL().

◆ got_auth

unsigned int socks_request_t::got_auth

Have we received any authentication data?

Definition at line 56 of file socks_request_st.h.

◆ has_finished

unsigned int socks_request_t::has_finished

Has the SOCKS handshake finished? Used to make sure we send back a socks reply for every connection.

Definition at line 53 of file socks_request_st.h.

Referenced by connection_ap_about_to_close(), connection_ap_process_transparent(), and MOCK_IMPL().

◆ listener_type

uint8_t socks_request_t::listener_type

Which kind of listener created this stream?

Definition at line 42 of file socks_request_st.h.

◆ password

char* socks_request_t::password

The negotiated password value if any (for socks5). This value is NOT nul-terminated; see passwordlen for its length.

Definition at line 72 of file socks_request_st.h.

◆ passwordlen

uint8_t socks_request_t::passwordlen

Number of bytes in password; 0 if password is NULL

Definition at line 65 of file socks_request_st.h.

Referenced by connection_ap_handshake_attach_chosen_circuit().

◆ port

uint16_t socks_request_t::port

What port did the client ask to connect to?

Definition at line 52 of file socks_request_st.h.

Referenced by circuit_stream_is_being_handled(), connection_ap_get_begincell_flags(), and write_stream_target_to_buf().

◆ reply

uint8_t socks_request_t::reply[MAX_SOCKS_REPLY_LEN]

Write an entry into this string if we want to specify our own socks reply, rather than using the default socks4 or socks5 socks reply. We use this for the two-stage socks5 handshake.

Definition at line 44 of file socks_request_st.h.

◆ replylen

size_t socks_request_t::replylen

Length of reply.

Definition at line 43 of file socks_request_st.h.

◆ socks_prefer_no_auth

unsigned int socks_request_t::socks_prefer_no_auth

If this is set, we will choose "no authentication" instead of "username/password" authentication if both are offered. Used as input to parse_socks.

Definition at line 60 of file socks_request_st.h.

◆ socks_version

uint8_t socks_request_t::socks_version

Which version of SOCKS did the client use? One of "0, 4, 5" – where 0 means that no socks handshake ever took place, and this is just a stub connection (e.g. see connection_ap_make_link()).

Definition at line 34 of file socks_request_st.h.

◆ username

char* socks_request_t::username

The negotiated username value if any (for socks5), or the entire authentication string (for socks4). This value is NOT nul-terminated; see usernamelen for its length.

Definition at line 69 of file socks_request_st.h.

◆ usernamelen

size_t socks_request_t::usernamelen

Number of bytes in username; 0 if username is NULL

Definition at line 63 of file socks_request_st.h.

Referenced by connection_ap_handshake_attach_chosen_circuit().


The documentation for this struct was generated from the following file: