tor  0.4.2.0-alpha-dev
Data Structures | Typedefs | Enumerations | Functions
orconn_event.h File Reference
#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_TLS_CLIENT_RENEGOTIATING   4
 
#define OR_CONN_STATE_TLS_SERVER_RENEGOTIATING   5
 
#define OR_CONN_STATE_OR_HANDSHAKING_V2   6
 
#define OR_CONN_STATE_OR_HANDSHAKING_V3   7
 
#define OR_CONN_STATE_OPEN   8
 
#define OR_CONN_STATE_MAX_   8
 

Typedefs

typedef enum or_conn_status_event_t or_conn_status_event_t
 
typedef struct orconn_state_msg_t orconn_state_msg_t
 
typedef struct orconn_status_msg_t orconn_status_msg_t
 

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_OPEN

#define OR_CONN_STATE_OPEN   8

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

Definition at line 53 of file orconn_event.h.

◆ OR_CONN_STATE_OR_HANDSHAKING_V2

#define OR_CONN_STATE_OR_HANDSHAKING_V2   6

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

Definition at line 47 of file orconn_event.h.

◆ OR_CONN_STATE_OR_HANDSHAKING_V3

#define OR_CONN_STATE_OR_HANDSHAKING_V3   7

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 51 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_TLS_CLIENT_RENEGOTIATING

#define OR_CONN_STATE_TLS_CLIENT_RENEGOTIATING   4

State for a connection to an OR: We're doing a second SSL handshake for renegotiation purposes. (V2 handshake only.)

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.

◆ OR_CONN_STATE_TLS_SERVER_RENEGOTIATING

#define OR_CONN_STATE_TLS_SERVER_RENEGOTIATING   5

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

Definition at line 43 of file orconn_event.h.

Typedef 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

◆ orconn_state_msg_t

Message for orconn state update

This contains information about internal state changes of or_connection_t objects. The chan and proxy_type fields are additional information that a subscriber may need to make decisions.

◆ orconn_status_msg_t

Message for orconn status event

This contains information that ends up in ORCONN control protocol events.

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 59 of file orconn_event.h.