Tor  0.4.7.0-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
 
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.

◆ command

uint8_t command

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

Definition at line 47 of file socks_request_st.h.

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

◆ got_auth

unsigned int got_auth

Have we received any authentication data?

Definition at line 63 of file socks_request_st.h.

◆ has_finished

unsigned int has_finished

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

Definition at line 60 of file socks_request_st.h.

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

◆ listener_type

uint8_t listener_type

Which kind of listener created this stream?

Definition at line 49 of file socks_request_st.h.

Referenced by entry_connection_describe_status_for_controller().

◆ 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 entry_connection_describe_status_for_controller(), and socks_request_free_().

◆ passwordlen

uint8_t passwordlen

Number of bytes in password; 0 if password is NULL

Definition at line 77 of file socks_request_st.h.

Referenced by connection_ap_handshake_attach_chosen_circuit(), entry_connection_describe_status_for_controller(), and socks_request_free_().

◆ 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.

◆ replylen

size_t replylen

Length of reply.

Definition at line 50 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 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.

◆ 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.

◆ socks_version

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

Referenced by entry_connection_describe_status_for_controller().

◆ 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 entry_connection_describe_status_for_controller(), and socks_request_free_().

◆ usernamelen

size_t usernamelen

Number of bytes in username; 0 if username is NULL

Definition at line 75 of file socks_request_st.h.

Referenced by connection_ap_handshake_attach_chosen_circuit(), entry_connection_describe_status_for_controller(), and socks_request_free_().


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