tor  0.4.1.0-alpha-dev
crypt_path_st.h
1 /* Copyright (c) 2001 Matej Pfajfar.
2  * Copyright (c) 2001-2004, Roger Dingledine.
3  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
4  * Copyright (c) 2007-2019, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
7 #ifndef CRYPT_PATH_ST_H
8 #define CRYPT_PATH_ST_H
9 
10 #include "core/or/relay_crypto_st.h"
11 struct crypto_dh_t;
12 
13 #define CRYPT_PATH_MAGIC 0x70127012u
14 
16 struct ntor_handshake_state_t;
17 struct crypto_dh_t;
19  uint16_t tag;
20  union {
21  struct fast_handshake_state_t *fast;
22  struct crypto_dh_t *tap;
23  struct ntor_handshake_state_t *ntor;
24  } u;
25 };
26 
31 #define CRYPT_PATH_PRIV_FIELD(x) x ## _crypt_path_private_field
32 
33 #ifdef CRYPT_PATH_PRIVATE
34 
35 /* Helper macro to access private members of a struct. */
36 #define pvt_crypto CRYPT_PATH_PRIV_FIELD(crypto)
37 
38 #endif
39 
42 struct crypt_path_t {
43  uint32_t magic;
44 
51 
53  char rend_circ_nonce[DIGEST_LEN];/* KH in tor-spec.txt */
54 
57 
63  uint8_t state;
64 #define CPATH_STATE_CLOSED 0
65 #define CPATH_STATE_AWAITING_KEYS 1
66 #define CPATH_STATE_OPEN 2
67  struct crypt_path_t *next;
70  struct crypt_path_t *prev;
78  /*********************** Private members ****************************/
79 
83 };
84 
85 #endif
struct crypt_path_t * next
Definition: crypt_path_st.h:67
struct crypto_dh_t * rend_dh_handshake_state
Definition: crypt_path_st.h:50
relay_crypto_t CRYPT_PATH_PRIV_FIELD(crypto)
#define DIGEST_LEN
Definition: digest_sizes.h:20
char rend_circ_nonce[DIGEST_LEN]
Definition: crypt_path_st.h:53
struct crypt_path_t * prev
Definition: crypt_path_st.h:70
uint8_t state
Definition: crypt_path_st.h:63
onion_handshake_state_t handshake_state
Definition: crypt_path_st.h:47
extend_info_t * extend_info
Definition: crypt_path_st.h:56