control_connection_st.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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-2018, The Tor Project, Inc. */
  5. /* See LICENSE for licensing information */
  6. #ifndef CONTROL_CONNECTION_ST_H
  7. #define CONTROL_CONNECTION_ST_H
  8. #include "core/or/or.h"
  9. #include "core/or/connection_st.h"
  10. /** Subtype of connection_t for an connection to a controller. */
  11. struct control_connection_t {
  12. connection_t base_;
  13. uint64_t event_mask; /**< Bitfield: which events does this controller
  14. * care about?
  15. * EVENT_MAX_ is >31, so we need a 64 bit mask */
  16. /** True if we have sent a protocolinfo reply on this connection. */
  17. unsigned int have_sent_protocolinfo:1;
  18. /** True if we have received a takeownership command on this
  19. * connection. */
  20. unsigned int is_owning_control_connection:1;
  21. /** List of ephemeral onion services belonging to this connection. */
  22. smartlist_t *ephemeral_onion_services;
  23. /** If we have sent an AUTHCHALLENGE reply on this connection and
  24. * have not received a successful AUTHENTICATE command, points to
  25. * the value which the client must send to authenticate itself;
  26. * otherwise, NULL. */
  27. char *safecookie_client_hash;
  28. /** Amount of space allocated in incoming_cmd. */
  29. uint32_t incoming_cmd_len;
  30. /** Number of bytes currently stored in incoming_cmd. */
  31. uint32_t incoming_cmd_cur_len;
  32. /** A control command that we're reading from the inbuf, but which has not
  33. * yet arrived completely. */
  34. char *incoming_cmd;
  35. };
  36. #endif