btrack_orconn.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. #include "lib/pubsub/pubsub.h"
  10. #ifdef BTRACK_ORCONN_PRIVATE
  11. #include "ht.h"
  12. /**
  13. * Structure for tracking OR connection states
  14. *
  15. * This gets linked into two hash maps: one with connection IDs, and
  16. * another with channel IDs.
  17. **/
  18. typedef struct bt_orconn_t {
  19. HT_ENTRY(bt_orconn_t) node; /**< Hash map entry indexed by gid */
  20. HT_ENTRY(bt_orconn_t) chan_node; /**< Hash map entry indexed by channel ID */
  21. uint64_t gid; /**< Global ID of this ORCONN */
  22. uint64_t chan; /**< Channel ID, if known */
  23. int proxy_type; /**< Proxy type */
  24. uint8_t state; /**< State of this ORCONN */
  25. bool is_orig; /**< Does this carry an origin circuit? */
  26. bool is_onehop; /**< Is this for a one-hop circuit? */
  27. } bt_orconn_t;
  28. #endif /* defined(BTRACK_ORCONN_PRIVATE) */
  29. int btrack_orconn_init(void);
  30. int btrack_orconn_add_pubsub(pubsub_connector_t *);
  31. void btrack_orconn_fini(void);
  32. #endif /* defined(TOR_BTRACK_ORCONN_H) */