tor  0.4.2.0-alpha-dev
control.h
Go to the documentation of this file.
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-2019, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
12 #ifndef TOR_CONTROL_H
13 #define TOR_CONTROL_H
14 
16 
17 #define CONTROL_CONN_STATE_MIN_ 1
18 
19 #define CONTROL_CONN_STATE_OPEN 1
20 
22 #define CONTROL_CONN_STATE_NEEDAUTH 2
23 #define CONTROL_CONN_STATE_MAX_ 2
24 
26 
32 #define LOG_FN_CONN(conn, args) \
33  CONN_LOG_PROTECT(conn, log_fn args)
34 
35 #define CC_LOCAL_FD_IS_OWNER (1u<<0)
36 #define CC_LOCAL_FD_IS_AUTHENTICATED (1u<<1)
37 int control_connection_add_local_fd(tor_socket_t sock, unsigned flags);
38 
42 
44 
45 void disable_control_logging(void);
46 void enable_control_logging(void);
47 
48 void monitor_owning_controller_process(const char *process_spec);
49 
50 const char *rend_auth_type_to_string(rend_auth_type_t auth_type);
51 void control_free_all(void);
52 
53 #ifdef CONTROL_MODULE_PRIVATE
54 struct signal_name_t {
55  int sig;
56  const char *signal_name;
57 };
58 extern const struct signal_name_t signal_table[];
59 int get_cached_network_liveness(void);
60 void set_cached_network_liveness(int liveness);
61 #endif /* defined(CONTROL_MODULE_PRIVATE) */
62 
63 #ifdef CONTROL_PRIVATE
64 STATIC char *control_split_incoming_command(char *incoming_cmd,
65  size_t *data_len,
66  char **current_cmd_out);
67 #endif
68 
69 #endif /* !defined(TOR_CONTROL_H) */
int connection_control_finished_flushing(control_connection_t *conn)
Definition: control.c:181
int connection_control_reached_eof(control_connection_t *conn)
Definition: control.c:189
int control_connection_add_local_fd(tor_socket_t sock, unsigned flags)
Definition: control.c:79
void control_ports_write_to_file(void)
Definition: control.c:118
rend_auth_type_t
Definition: or.h:402
control_connection_t * TO_CONTROL_CONN(connection_t *)
Definition: control.c:67
void enable_control_logging(void)
void connection_control_closed(control_connection_t *conn)
Definition: control.c:211
STATIC char * control_split_incoming_command(char *incoming_cmd, size_t *data_len, char **current_cmd_out)
Definition: control.c:285
void disable_control_logging(void)
#define tor_socket_t
Definition: nettypes.h:36
int connection_control_process_inbuf(control_connection_t *conn)
Definition: control.c:346
const char * rend_auth_type_to_string(rend_auth_type_t auth_type)
void control_free_all(void)
Definition: control.c:571
void monitor_owning_controller_process(const char *process_spec)
Definition: control.c:522