control_connection_st.h 1.5 KB

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