Back to index

tor  0.2.3.19-rc
geoip.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_GEOIP_H
00013 #define _TOR_GEOIP_H
00014 
00015 #ifdef GEOIP_PRIVATE
00016 int geoip_parse_entry(const char *line);
00017 #endif
00018 int should_record_bridge_info(const or_options_t *options);
00019 int geoip_load_file(const char *filename, const or_options_t *options);
00020 int geoip_get_country_by_ip(uint32_t ipaddr);
00021 int geoip_get_country_by_addr(const tor_addr_t *addr);
00022 int geoip_get_n_countries(void);
00023 const char *geoip_get_country_name(country_t num);
00024 int geoip_is_loaded(void);
00025 const char *geoip_db_digest(void);
00026 country_t geoip_get_country(const char *countrycode);
00027 
00028 void geoip_note_client_seen(geoip_client_action_t action,
00029                             const tor_addr_t *addr, time_t now);
00030 void geoip_remove_old_clients(time_t cutoff);
00031 
00032 void geoip_note_ns_response(geoip_client_action_t action,
00033                             geoip_ns_response_t response);
00034 char *geoip_get_client_history(geoip_client_action_t action);
00035 char *geoip_get_request_history(geoip_client_action_t action);
00036 int getinfo_helper_geoip(control_connection_t *control_conn,
00037                          const char *question, char **answer,
00038                          const char **errmsg);
00039 void geoip_free_all(void);
00040 
00041 void geoip_start_dirreq(uint64_t dirreq_id, size_t response_size,
00042                         geoip_client_action_t action, dirreq_type_t type);
00043 void geoip_change_dirreq_state(uint64_t dirreq_id, dirreq_type_t type,
00044                                dirreq_state_t new_state);
00045 
00046 void geoip_dirreq_stats_init(time_t now);
00047 void geoip_reset_dirreq_stats(time_t now);
00048 char *geoip_format_dirreq_stats(time_t now);
00049 time_t geoip_dirreq_stats_write(time_t now);
00050 void geoip_dirreq_stats_term(void);
00051 void geoip_entry_stats_init(time_t now);
00052 time_t geoip_entry_stats_write(time_t now);
00053 void geoip_entry_stats_term(void);
00054 void geoip_reset_entry_stats(time_t now);
00055 char *geoip_format_entry_stats(time_t now);
00056 void geoip_bridge_stats_init(time_t now);
00057 char *geoip_format_bridge_stats(time_t now);
00058 time_t geoip_bridge_stats_write(time_t now);
00059 void geoip_bridge_stats_term(void);
00060 const char *geoip_get_bridge_stats_extrainfo(time_t);
00061 char *geoip_get_bridge_stats_controller(time_t);
00062 
00063 #endif
00064