btrack_orconn.h 1.1 KB

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