tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

btrack_orconn.h (1253B)


      1 /* Copyright (c) 2007-2021, The Tor Project, Inc. */
      2 /* See LICENSE for licensing information */
      3 
      4 /**
      5 * \file btrack_orconn.h
      6 * \brief Header file for btrack_orconn.c
      7 **/
      8 
      9 #ifndef TOR_BTRACK_ORCONN_H
     10 #define TOR_BTRACK_ORCONN_H
     11 
     12 #include "lib/pubsub/pubsub.h"
     13 
     14 #ifdef BTRACK_ORCONN_PRIVATE
     15 
     16 #include "ht.h"
     17 
     18 /**
     19 * Structure for tracking OR connection states
     20 *
     21 * This gets linked into two hash maps: one with connection IDs, and
     22 * another with channel IDs.
     23 **/
     24 typedef struct bt_orconn_t {
     25  HT_ENTRY(bt_orconn_t) node;   /**< Hash map entry indexed by gid */
     26  HT_ENTRY(bt_orconn_t) chan_node; /**< Hash map entry indexed by channel ID */
     27  uint64_t gid;                    /**< Global ID of this ORCONN */
     28  uint64_t chan;                   /**< Channel ID, if known */
     29  int proxy_type;                  /**< Proxy type */
     30  uint8_t state;                   /**< State of this ORCONN */
     31  bool is_orig;             /**< Does this carry an origin circuit? */
     32  bool is_onehop;           /**< Is this for a one-hop circuit? */
     33 } bt_orconn_t;
     34 
     35 #endif /* defined(BTRACK_ORCONN_PRIVATE) */
     36 
     37 int btrack_orconn_init(void);
     38 int btrack_orconn_add_pubsub(pubsub_connector_t *);
     39 void btrack_orconn_fini(void);
     40 
     41 #endif /* !defined(TOR_BTRACK_ORCONN_H) */