Tor 0.4.9.3-alpha-dev
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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
 
unsigned int socks_use_extended_errors: 1
 
socks5_reply_status_t socks_extended_error_code
 
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 37 of file socks_request_st.h.

Field Documentation

◆ address

char address[MAX_SOCKS_ADDR_LEN]

◆ auth_type

uint8_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 45 of file socks_request_st.h.

Referenced by handle_socks_message(), process_socks5_methods_request(), and process_socks5_userpass_auth().

◆ command

uint8_t command

◆ got_auth

unsigned int got_auth

Have we received any authentication data?

Definition at line 63 of file socks_request_st.h.

Referenced by handle_socks_message(), parse_socks4_request(), and parse_socks5_userpass_auth().

◆ has_finished

unsigned int has_finished

◆ listener_type

uint8_t listener_type

◆ password

char* password

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

Definition at line 84 of file socks_request_st.h.

Referenced by connection_ap_process_http_connect(), connection_edge_compatible_with_circuit(), connection_edge_update_circuit_isolation(), entry_connection_describe_status_for_controller(), parse_socks5_userpass_auth(), and socks_request_free_().

◆ passwordlen

uint8_t passwordlen

◆ port

uint16_t port

◆ reply

uint8_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 51 of file socks_request_st.h.

Referenced by connection_ap_handshake_process_socks(), parse_socks(), process_socks5_methods_request(), process_socks5_userpass_auth(), and socks_request_set_socks5_error().

◆ replylen

size_t replylen

◆ socks5_atyp

uint8_t socks5_atyp

Definition at line 86 of file socks_request_st.h.

◆ socks_extended_error_code

socks5_reply_status_t socks_extended_error_code

If non zero, this contains the extended error code that should be used if the port was configured to use them.

Definition at line 72 of file socks_request_st.h.

Referenced by client_desc_missing_bad_client_auth(), client_dir_fetch_404(), connection_ap_handshake_rewrite_and_attach(), connection_ap_handshake_socks_reply(), socks_mark_introduction_failed(), and socks_mark_rend_circuit_timed_out().

◆ socks_prefer_no_auth

unsigned int 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 67 of file socks_request_st.h.

Referenced by connection_init_accepted_conn(), and process_socks5_methods_request().

◆ socks_use_extended_errors

unsigned int socks_use_extended_errors

If set, we can send back the extended error code in the reply.

Definition at line 69 of file socks_request_st.h.

Referenced by connection_ap_handshake_socks_reply(), and connection_init_accepted_conn().

◆ socks_version

uint8_t socks_version

◆ username

char* 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 81 of file socks_request_st.h.

Referenced by connection_ap_process_http_connect(), connection_edge_compatible_with_circuit(), connection_edge_update_circuit_isolation(), entry_connection_describe_status_for_controller(), parse_socks4_request(), parse_socks5_userpass_auth(), and socks_request_free_().

◆ usernamelen

size_t usernamelen

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