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-2021, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
8 * @file control_connection_st.h
9 * @brief Controller connection structure.
12 #ifndef CONTROL_CONNECTION_ST_H
13 #define CONTROL_CONNECTION_ST_H
15 #include "core/or/or.h"
16 #include "core/or/connection_st.h"
18 /** Subtype of connection_t for an connection to a controller. */
19 struct control_connection_t
{
22 uint64_t event_mask
; /**< Bitfield: which events does this controller
24 * EVENT_MAX_ is >31, so we need a 64 bit mask */
26 /** True if we have sent a protocolinfo reply on this connection. */
27 unsigned int have_sent_protocolinfo
:1;
28 /** True if we have received a takeownership command on this
30 unsigned int is_owning_control_connection
:1;
32 /** List of ephemeral onion services belonging to this connection. */
33 smartlist_t
*ephemeral_onion_services
;
35 /** If we have sent an AUTHCHALLENGE reply on this connection and
36 * have not received a successful AUTHENTICATE command, points to
37 * the value which the client must send to authenticate itself;
39 char *safecookie_client_hash
;
41 /** Amount of space allocated in incoming_cmd. */
42 uint32_t incoming_cmd_len
;
43 /** Number of bytes currently stored in incoming_cmd. */
44 uint32_t incoming_cmd_cur_len
;
45 /** A control command that we're reading from the inbuf, but which has not
46 * yet arrived completely. */
48 /** The control command that we are currently processing. */
52 #endif /* !defined(CONTROL_CONNECTION_ST_H) */