tor  master
Data Fields
socks_request_t Struct Reference

#include <or.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
 

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)

Field Documentation

◆ address

char address[MAX_SOCKS_ADDR_LEN]

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

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

◆ command

uint8_t command

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

◆ got_auth

unsigned int got_auth

Have we received any authentication data?

◆ has_finished

unsigned int has_finished

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

◆ listener_type

uint8_t listener_type

Which kind of listener created this stream?

◆ password

char* password

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

◆ passwordlen

uint8_t passwordlen

Number of bytes in password; 0 if password is NULL

◆ port

uint16_t port

What port did the client ask to connect to?

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

◆ replylen

size_t replylen

Length of reply.

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

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

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

◆ usernamelen

size_t usernamelen

Number of bytes in username; 0 if username is NULL


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