Tor 0.4.9.2-alpha-dev
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Data Structures | Enumerations | Functions
orconn_event.h File Reference

Header file for orconn_event.c. More...

#include "lib/pubsub/pubsub.h"

Go to the source code of this file.

Data Structures

struct  orconn_state_msg_t
 
struct  orconn_status_msg_t
 

Macros

States of OR connections

These must be in a partial ordering such that usually no OR connection will transition from a higher-numbered state to a lower-numbered one. Code such as bto_update_best() depends on this ordering to determine the best state it's seen so far.

#define OR_CONN_STATE_MIN_   1
 
#define OR_CONN_STATE_CONNECTING   1
 
#define OR_CONN_STATE_PROXY_HANDSHAKING   2
 
#define OR_CONN_STATE_TLS_HANDSHAKING   3
 
#define OR_CONN_STATE_SERVER_VERSIONS_WAIT   4
 
#define OR_CONN_STATE_OR_HANDSHAKING_V3   5
 
#define OR_CONN_STATE_OPEN   6
 
#define OR_CONN_STATE_MAX_   6
 

Enumerations

enum  or_conn_status_event_t {
  OR_CONN_EVENT_LAUNCHED = 0 , OR_CONN_EVENT_CONNECTED = 1 , OR_CONN_EVENT_FAILED = 2 , OR_CONN_EVENT_CLOSED = 3 ,
  OR_CONN_EVENT_NEW = 4
}
 

Functions

 DECLARE_MESSAGE (orconn_state, orconn_state, orconn_state_msg_t *)
 
 DECLARE_MESSAGE (orconn_status, orconn_status, orconn_status_msg_t *)
 

Detailed Description

Header file for orconn_event.c.

The OR_CONN_STATE_* symbols are here to make it easier for subscribers to make decisions based on the messages that they receive.

Definition in file orconn_event.h.

Macro Definition Documentation

◆ OR_CONN_STATE_CONNECTING

#define OR_CONN_STATE_CONNECTING   1

State for a connection to an OR: waiting for connect() to finish.

Definition at line 31 of file orconn_event.h.

◆ OR_CONN_STATE_MAX_

#define OR_CONN_STATE_MAX_   6

Definition at line 46 of file orconn_event.h.

◆ OR_CONN_STATE_MIN_

#define OR_CONN_STATE_MIN_   1

Definition at line 29 of file orconn_event.h.

◆ OR_CONN_STATE_OPEN

#define OR_CONN_STATE_OPEN   6

State for an OR connection: Ready to send/receive cells.

Definition at line 45 of file orconn_event.h.

◆ OR_CONN_STATE_OR_HANDSHAKING_V3

#define OR_CONN_STATE_OR_HANDSHAKING_V3   5

State for an OR connection: We're done with our SSL handshake, but we haven't yet negotiated link protocol versions, done a V3 handshake, and sent a netinfo cell.

Definition at line 43 of file orconn_event.h.

◆ OR_CONN_STATE_PROXY_HANDSHAKING

#define OR_CONN_STATE_PROXY_HANDSHAKING   2

State for a connection to an OR: waiting for proxy handshake to complete

Definition at line 33 of file orconn_event.h.

◆ OR_CONN_STATE_SERVER_VERSIONS_WAIT

#define OR_CONN_STATE_SERVER_VERSIONS_WAIT   4

State for a connection at an OR: We're waiting for the client to send a versions cell (to indicate a v3+ handshake)

Definition at line 39 of file orconn_event.h.

◆ OR_CONN_STATE_TLS_HANDSHAKING

#define OR_CONN_STATE_TLS_HANDSHAKING   3

State for an OR connection client: SSL is handshaking, not done yet.

Definition at line 36 of file orconn_event.h.

Enumeration Type Documentation

◆ or_conn_status_event_t

Used to indicate the type of an OR connection event passed to the controller. The various types are defined in control-spec.txt

Definition at line 51 of file orconn_event.h.