Back to index

tor  0.2.3.19-rc
control.h
Go to the documentation of this file.
00001 /* Copyright (c) 2001 Matej Pfajfar.
00002  * Copyright (c) 2001-2004, Roger Dingledine.
00003  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
00004  * Copyright (c) 2007-2012, The Tor Project, Inc. */
00005 /* See LICENSE for licensing information */
00006 
00012 #ifndef _TOR_CONTROL_H
00013 #define _TOR_CONTROL_H
00014 
00015 void control_update_global_event_mask(void);
00016 void control_adjust_event_log_severity(void);
00017 
00018 void control_ports_write_to_file(void);
00019 
00025 #define LOG_FN_CONN(conn, args)                 \
00026   CONN_LOG_PROTECT(conn, log_fn args)
00027 
00028 int connection_control_finished_flushing(control_connection_t *conn);
00029 int connection_control_reached_eof(control_connection_t *conn);
00030 void connection_control_closed(control_connection_t *conn);
00031 
00032 int connection_control_process_inbuf(control_connection_t *conn);
00033 
00034 #define EVENT_AUTHDIR_NEWDESCS 0x000D
00035 #define EVENT_NS 0x000F
00036 int control_event_is_interesting(int event);
00037 
00038 int control_event_circuit_status(origin_circuit_t *circ,
00039                                  circuit_status_event_t e, int reason);
00040 int control_event_circuit_purpose_changed(origin_circuit_t *circ,
00041                                           int old_purpose);
00042 int control_event_circuit_cannibalized(origin_circuit_t *circ,
00043                                        int old_purpose,
00044                                        const struct timeval *old_tv_created);
00045 int control_event_stream_status(entry_connection_t *conn,
00046                                 stream_status_event_t e,
00047                                 int reason);
00048 int control_event_or_conn_status(or_connection_t *conn,
00049                                  or_conn_status_event_t e, int reason);
00050 int control_event_bandwidth_used(uint32_t n_read, uint32_t n_written);
00051 int control_event_stream_bandwidth(edge_connection_t *edge_conn);
00052 int control_event_stream_bandwidth_used(void);
00053 void control_event_logmsg(int severity, uint32_t domain, const char *msg);
00054 int control_event_descriptors_changed(smartlist_t *routers);
00055 int control_event_address_mapped(const char *from, const char *to,
00056                                  time_t expires, const char *error);
00057 int control_event_or_authdir_new_descriptor(const char *action,
00058                                             const char *desc,
00059                                             size_t desclen,
00060                                             const char *msg);
00061 int control_event_my_descriptor_changed(void);
00062 int control_event_networkstatus_changed(smartlist_t *statuses);
00063 
00064 int control_event_newconsensus(const networkstatus_t *consensus);
00065 int control_event_networkstatus_changed_single(const routerstatus_t *rs);
00066 int control_event_general_status(int severity, const char *format, ...)
00067   CHECK_PRINTF(2,3);
00068 int control_event_client_status(int severity, const char *format, ...)
00069   CHECK_PRINTF(2,3);
00070 int control_event_server_status(int severity, const char *format, ...)
00071   CHECK_PRINTF(2,3);
00072 int control_event_guard(const char *nickname, const char *digest,
00073                         const char *status);
00074 int control_event_conf_changed(smartlist_t *elements);
00075 int control_event_buildtimeout_set(const circuit_build_times_t *cbt,
00076                                    buildtimeout_set_event_t type);
00077 int control_event_signal(uintptr_t signal);
00078 
00079 int init_cookie_authentication(int enabled);
00080 smartlist_t *decode_hashed_passwords(config_line_t *passwords);
00081 void disable_control_logging(void);
00082 void enable_control_logging(void);
00083 
00084 void monitor_owning_controller_process(const char *process_spec);
00085 
00086 void control_event_bootstrap(bootstrap_status_t status, int progress);
00087 void control_event_bootstrap_problem(const char *warn, int reason);
00088 
00089 void control_event_clients_seen(const char *controller_str);
00090 
00091 #ifdef CONTROL_PRIVATE
00092 /* Used only by control.c and test.c */
00093 size_t write_escaped_data(const char *data, size_t len, char **out);
00094 size_t read_escaped_data(const char *data, size_t len, char **out);
00095 #endif
00096 
00097 #endif
00098