Tor 0.4.9.0-alpha-dev
btrack_orconn.h
Go to the documentation of this file.
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 **/
24typedef 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
37int btrack_orconn_init(void);
38int btrack_orconn_add_pubsub(pubsub_connector_t *);
39void btrack_orconn_fini(void);
40
41#endif /* !defined(TOR_BTRACK_ORCONN_H) */
int btrack_orconn_init(void)
void btrack_orconn_fini(void)
Header for OO publish-subscribe functionality.
struct pubsub_connector_t pubsub_connector_t