Commit 471104ea authored by Nick Mathewson's avatar Nick Mathewson
Browse files

Remove needless includes from or.h

or.h should really include only the minimum of stuff from or/*,
common/*, and lib/*.
parent 7a61a928
......@@ -18,7 +18,7 @@
* GZIP_METHOD is guaranteed to be supported by the compress/uncompress
* functions here. Call tor_compress_supports_method() to check if a given
* compression schema is supported by Tor. */
typedef enum {
typedef enum compress_method_t {
NO_METHOD=0, // This method must be first.
GZIP_METHOD=1,
ZLIB_METHOD=2,
......@@ -32,7 +32,7 @@ typedef enum {
* BEST_COMPRESSION saves the most bandwidth; LOW_COMPRESSION saves the most
* memory.
**/
typedef enum {
typedef enum compression_level_t {
BEST_COMPRESSION, HIGH_COMPRESSION, MEDIUM_COMPRESSION, LOW_COMPRESSION
} compression_level_t;
......
......@@ -14,6 +14,7 @@
#define TOR_CRYPTO_DH_H
#include "orconfig.h"
#include "lib/cc/torint.h"
#include "lib/defs/dh_sizes.h"
typedef struct crypto_dh_t crypto_dh_t;
......
......@@ -15,13 +15,14 @@
#define ADDRESSMAP_PRIVATE
#include "lib/crypt_ops/crypto_rand.h"
#include "or/or.h"
#include "or/addressmap.h"
#include "or/circuituse.h"
#include "or/config.h"
#include "or/connection_edge.h"
#include "or/control.h"
#include "lib/crypt_ops/crypto_rand.h"
#include "or/dns.h"
#include "or/nodelist.h"
#include "or/routerset.h"
......@@ -1153,4 +1154,3 @@ addressmap_get_mappings(smartlist_t *sl, time_t min_expires,
iter = strmap_iter_next(addressmap,iter);
}
}
......@@ -7,6 +7,8 @@
#ifndef PACKED_CELL_ST_H
#define PACKED_CELL_ST_H
#include "tor_queue.h"
/** A cell as packed for writing to the network. */
struct packed_cell_t {
/** Next cell queued on this circuit. */
......@@ -25,4 +27,3 @@ struct cell_queue_t {
};
#endif
......@@ -14,6 +14,8 @@
#include "common/timers.h"
#include "common/handles.h"
#include "tor_queue.h"
/* Channel handler function pointer typedefs */
typedef void (*channel_listener_fn_ptr)(channel_listener_t *, channel_t *);
typedef void (*channel_cell_handler_fn_ptr)(channel_t *, cell_t *);
......@@ -637,4 +639,3 @@ HANDLE_DECL(channel, channel_s,)
FREE_AND_NULL(channel_handle_t, channel_handle_free_, (h))
#endif /* !defined(TOR_CHANNEL_H) */
......@@ -69,6 +69,8 @@
#include "or/routerinfo_st.h"
#include "or/var_cell_st.h"
#include "lib/tls/tortls.h"
/** How many CELL_PADDING cells have we received, ever? */
uint64_t stats_n_padding_cells_processed = 0;
/** How many CELL_VERSIONS cells have we received, ever? */
......@@ -2454,4 +2456,3 @@ channel_tls_process_authenticate_cell(var_cell_t *cell, channel_tls_t *chan)
#undef ERR
}
......@@ -11,6 +11,8 @@
#include "or/cell_queue_st.h"
struct hs_token_t;
/**
* A circuit is a path over the onion routing
* network. Applications can connect to one end of the circuit, and can
......@@ -162,11 +164,10 @@ struct circuit_t {
/** If set, points to an HS token that this circuit might be carrying.
* Used by the HS circuitmap. */
hs_token_t *hs_token;
struct hs_token_t *hs_token;
/** Hashtable node: used to look up the circuit by its HS token using the HS
circuitmap. */
HT_ENTRY(circuit_t) hs_circuitmap_node;
};
#endif
......@@ -67,6 +67,7 @@
#include "or/control.h"
#include "lib/crypt_ops/crypto_rand.h"
#include "lib/crypt_ops/crypto_util.h"
#include "lib/crypt_ops/crypto_dh.h"
#include "or/directory.h"
#include "or/entrynodes.h"
#include "or/main.h"
......@@ -86,6 +87,7 @@
#include "or/routerlist.h"
#include "or/routerset.h"
#include "or/channelpadding.h"
#include "lib/compress/compress.h"
#include "lib/compress/compress_lzma.h"
#include "lib/compress/compress_zlib.h"
#include "lib/compress/compress_zstd.h"
......@@ -2737,4 +2739,3 @@ assert_circuit_ok,(const circuit_t *c))
tor_assert(!or_circ || !or_circ->rend_splice);
}
}
......@@ -42,6 +42,7 @@
#include "or/circuituse.h"
#include "lib/math/fp.h"
#include "lib/time/tvdiff.h"
#include "lib/encoding/confline.h"
#include "or/crypt_path_st.h"
#include "or/origin_circuit_st.h"
......
......@@ -71,6 +71,7 @@
#include "or/circuitstats.h"
#include "lib/compress/compress.h"
#include "or/config.h"
#include "lib/encoding/confline.h"
#include "or/connection.h"
#include "or/connection_edge.h"
#include "or/connection_or.h"
......
......@@ -42,7 +42,7 @@ void init_protocol_warning_severity_level(void);
int get_protocol_warning_severity_level(void);
const char *get_version(void);
const char *get_short_version(void);
setopt_err_t options_trial_assign(config_line_t *list, unsigned flags,
setopt_err_t options_trial_assign(struct config_line_t *list, unsigned flags,
char **msg);
uint32_t get_last_resolved_addr(void);
......@@ -62,7 +62,7 @@ setopt_err_t options_init_from_string(const char *cf_defaults, const char *cf,
int command, const char *command_arg, char **msg);
int option_is_recognized(const char *key);
const char *option_get_canonical_name(const char *key);
config_line_t *option_get_assignment(const or_options_t *options,
struct config_line_t *option_get_assignment(const or_options_t *options,
const char *key);
int options_save_current(void);
const char *get_torrc_fname(int defaults_fname);
......@@ -180,8 +180,8 @@ int init_cookie_authentication(const char *fname, const char *header,
or_options_t *options_new(void);
int config_parse_commandline(int argc, char **argv, int ignore_errors,
config_line_t **result,
config_line_t **cmdline_result);
struct config_line_t **result,
struct config_line_t **cmdline_result);
void config_register_addressmaps(const or_options_t *options);
/* XXXX move to connection_edge.h */
......@@ -260,7 +260,7 @@ STATIC int parse_dir_fallback_line(const char *line, int validate_only);
STATIC int have_enough_mem_for_dircache(const or_options_t *options,
size_t total_mem, char **msg);
STATIC int parse_port_config(smartlist_t *out,
const config_line_t *ports,
const struct config_line_t *ports,
const char *portname,
int listener_type,
const char *defaultaddr,
......
......@@ -26,6 +26,7 @@
#include "or/routerset.h"
#include "lib/container/bitarray.h"
#include "lib/encoding/confline.h"
static uint64_t config_parse_memunit(const char *s, int *ok);
static int config_parse_msec_interval(const char *s, int *ok);
......
......@@ -65,9 +65,9 @@ typedef union {
time_t *ISOTIME;
smartlist_t **CSV;
int *CSV_INTERVAL;
config_line_t **LINELIST;
config_line_t **LINELIST_S;
config_line_t **LINELIST_V;
struct config_line_t **LINELIST;
struct config_line_t **LINELIST_S;
struct config_line_t **LINELIST_V;
routerset_t **ROUTERSET;
} confparse_dummy_values_t;
#endif /* defined(TOR_UNIT_TESTS) */
......@@ -185,7 +185,7 @@ void config_free_(const config_format_t *fmt, void *options);
(options) = NULL; \
} while (0)
config_line_t *config_get_assigned_option(const config_format_t *fmt,
struct config_line_t *config_get_assigned_option(const config_format_t *fmt,
const void *options, const char *key,
int escape_val);
int config_is_same(const config_format_t *fmt,
......@@ -197,7 +197,7 @@ char *config_dump(const config_format_t *fmt, const void *default_options,
const void *options, int minimal,
int comment_defaults);
int config_assign(const config_format_t *fmt, void *options,
config_line_t *list,
struct config_line_t *list,
unsigned flags, char **msg);
config_var_t *config_find_option_mutable(config_format_t *fmt,
const char *key);
......@@ -219,4 +219,3 @@ void warn_deprecated_option(const char *what, const char *why);
#define CFG_EQ_ROUTERSET(a,b,opt) routerset_equal((a)->opt, (b)->opt)
#endif /* !defined(TOR_CONFPARSE_H) */
......@@ -104,6 +104,9 @@
#include "or/routerparse.h"
#include "lib/sandbox/sandbox.h"
#include "lib/net/buffers_net.h"
#include "lib/tls/tortls.h"
#include "common/compat_libevent.h"
#include "lib/compress/compress.h"
#ifdef HAVE_PWD_H
#include <pwd.h>
......
......@@ -106,6 +106,7 @@
#include "or/or_circuit_st.h"
#include "or/origin_circuit_st.h"
#include "or/socks_request_st.h"
#include "common/compat_libevent.h"
#ifdef HAVE_LINUX_TYPES_H
#include <linux/types.h>
......@@ -4221,4 +4222,3 @@ connection_edge_free_all(void)
pending_entry_connections = NULL;
mainloop_event_free(attach_pending_entry_connections_ev);
}
......@@ -69,6 +69,8 @@
#include "or/routerinfo_st.h"
#include "or/var_cell_st.h"
#include "lib/tls/tortls.h"
static int connection_tls_finish_handshake(or_connection_t *conn);
static int connection_or_launch_v3_or_handshake(or_connection_t *conn);
static int connection_or_process_cells_from_inbuf(or_connection_t *conn);
......@@ -2990,4 +2992,3 @@ connection_or_send_authenticate_cell,(or_connection_t *conn, int authtype))
return 0;
}
......@@ -7,6 +7,7 @@
#include "or/conscache.h"
#include "lib/crypt_ops/crypto_util.h"
#include "lib/fs/storagedir.h"
#include "lib/encoding/confline.h"
#define CCE_MAGIC 0x17162253
......@@ -624,4 +625,3 @@ consensus_cache_entry_is_mapped(consensus_cache_entry_t *ent)
}
}
#endif /* defined(TOR_UNIT_TESTS) */
......@@ -27,9 +27,9 @@ void consensus_cache_delete_pending(consensus_cache_t *cache,
int force);
int consensus_cache_get_n_filenames_available(consensus_cache_t *cache);
consensus_cache_entry_t *consensus_cache_add(consensus_cache_t *cache,
const config_line_t *labels,
const uint8_t *data,
size_t datalen);
const struct config_line_t *labels,
const uint8_t *data,
size_t datalen);
consensus_cache_entry_t *consensus_cache_find_first(
consensus_cache_t *cache,
......@@ -46,7 +46,7 @@ void consensus_cache_filter_list(smartlist_t *lst,
const char *consensus_cache_entry_get_value(const consensus_cache_entry_t *ent,
const char *key);
const config_line_t *consensus_cache_entry_get_labels(
const struct config_line_t *consensus_cache_entry_get_labels(
const consensus_cache_entry_t *ent);
void consensus_cache_entry_incref(consensus_cache_entry_t *ent);
......@@ -64,4 +64,3 @@ int consensus_cache_entry_is_mapped(consensus_cache_entry_t *ent);
#endif
#endif /* !defined(TOR_CONSCACHE_H) */
......@@ -21,7 +21,10 @@
#include "or/cpuworker.h"
#include "or/networkstatus.h"
#include "or/routerparse.h"
#include "common/compat_libevent.h"
#include "common/workqueue.h"
#include "lib/compress/compress.h"
#include "lib/encoding/confline.h"
#include "or/networkstatus_st.h"
#include "or/networkstatus_voter_info_st.h"
......@@ -1940,4 +1943,3 @@ consensus_cache_entry_get_valid_after(const consensus_cache_entry_t *ent,
else
return 0;
}
......@@ -4,6 +4,8 @@
#ifndef TOR_CONSDIFFMGR_H
#define TOR_CONSDIFFMGR_H
enum compress_method_t;
/**
* Possible outcomes from trying to look up a given consensus diff.
*/
......@@ -25,7 +27,7 @@ int consdiffmgr_add_consensus(const char *consensus,
consdiff_status_t consdiffmgr_find_consensus(
struct consensus_cache_entry_t **entry_out,
consensus_flavor_t flavor,
compress_method_t method);
enum compress_method_t method);
consdiff_status_t consdiffmgr_find_diff_from(
struct consensus_cache_entry_t **entry_out,
......@@ -33,7 +35,7 @@ consdiff_status_t consdiffmgr_find_diff_from(
int digest_type,
const uint8_t *digest,
size_t digestlen,
compress_method_t method);
enum compress_method_t method);
int consensus_cache_entry_get_voter_id_digests(
const struct consensus_cache_entry_t *ent,
......@@ -71,4 +73,3 @@ STATIC int uncompress_or_copy(char **out, size_t *outlen,
#endif /* defined(CONSDIFFMGR_PRIVATE) */
#endif /* !defined(TOR_CONSDIFFMGR_H) */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment