Commit c8f2a6d2 authored by Nick Mathewson's avatar Nick Mathewson 🐻
Browse files

Extract the non-stats part of geoip into a new src/lib/geoip.

parent fa32574b
......@@ -173,6 +173,8 @@ uptime-*.json
/src/lib/libtor-fdio-testing.a
/src/lib/libtor-fs.a
/src/lib/libtor-fs-testing.a
/src/lib/libtor-geoip.a
/src/lib/libtor-geoip-testing.a
/src/lib/libtor-intmath.a
/src/lib/libtor-intmath-testing.a
/src/lib/libtor-lock.a
......
......@@ -40,6 +40,7 @@ endif
# "Common" libraries used to link tor's utility code.
TOR_UTIL_LIBS = \
src/lib/libtor-geoip.a \
src/lib/libtor-process.a \
src/lib/libtor-time.a \
src/lib/libtor-fs.a \
......@@ -68,6 +69,7 @@ TOR_UTIL_LIBS = \
# and tests)
if UNITTESTS_ENABLED
TOR_UTIL_TESTING_LIBS = \
src/lib/libtor-geoip-testing.a \
src/lib/libtor-process-testing.a \
src/lib/libtor-time-testing.a \
src/lib/libtor-fs-testing.a \
......
......@@ -103,7 +103,7 @@
#include "feature/relay/routermode.h"
#include "feature/rend/rendclient.h"
#include "feature/rend/rendservice.h"
#include "feature/stats/geoip.h"
#include "lib/geoip/geoip.h"
#include "feature/stats/geoip_stats.h"
#include "feature/stats/predict_ports.h"
#include "feature/stats/rephist.h"
......
......@@ -61,7 +61,7 @@
#include "feature/rend/rendcache.h"
#include "feature/rend/rendclient.h"
#include "feature/rend/rendservice.h"
#include "feature/stats/geoip.h"
#include "lib/geoip/geoip.h"
#include "feature/stats/geoip_stats.h"
#include "feature/stats/predict_ports.h"
#include "feature/stats/rephist.h"
......
......@@ -117,7 +117,6 @@ LIBTOR_APP_A_SOURCES = \
src/feature/rend/rendcommon.c \
src/feature/rend/rendmid.c \
src/feature/rend/rendservice.c \
src/feature/stats/geoip.c \
src/feature/stats/geoip_stats.c \
src/feature/stats/rephist.c \
src/feature/stats/predict_ports.c
......@@ -350,7 +349,6 @@ noinst_HEADERS += \
src/feature/rend/rendcommon.h \
src/feature/rend/rendmid.h \
src/feature/rend/rendservice.h \
src/feature/stats/geoip.h \
src/feature/stats/geoip_stats.h \
src/feature/stats/rephist.h \
src/feature/stats/predict_ports.h
......
......@@ -102,7 +102,7 @@
#include "feature/relay/routermode.h"
#include "feature/rend/rendclient.h"
#include "feature/rend/rendcommon.h"
#include "feature/stats/geoip.h"
#include "lib/geoip/geoip.h"
#include "feature/stats/rephist.h"
#include "lib/crypt_ops/crypto_util.h"
......
......@@ -43,7 +43,7 @@
#include "lib/crypt_ops/crypto_util.h"
#include "feature/dirauth/reachability.h"
#include "feature/client/entrynodes.h"
#include "feature/stats/geoip.h"
#include "lib/geoip/geoip.h"
#include "core/mainloop/mainloop.h"
#include "trunnel/link_handshake.h"
#include "feature/nodelist/microdesc.h"
......
......@@ -41,6 +41,7 @@
#include "lib/fs/mmap.h"
#include "lib/fs/path.h"
#include "lib/fs/userdb.h"
#include "lib/geoip/country.h"
#include "lib/intmath/addsub.h"
#include "lib/intmath/bits.h"
#include "lib/intmath/cmp.h"
......@@ -798,9 +799,6 @@ typedef struct download_status_t download_status_t;
typedef struct signed_descriptor_t signed_descriptor_t;
/** A signed integer representing a country code. */
typedef int16_t country_t;
/** Flags used to summarize the declared protocol versions of a relay,
* so we don't need to parse them again and again. */
typedef struct protover_summary_flags_t {
......
......@@ -27,7 +27,7 @@
#include "feature/relay/router.h"
#include "feature/relay/routermode.h"
#include "feature/nodelist/routerparse.h"
#include "feature/stats/geoip.h"
#include "lib/geoip/geoip.h"
#include "ht.h"
#include "lib/encoding/confline.h"
......
......@@ -3,7 +3,7 @@
#include "core/mainloop/connection.h"
#include "feature/control/control.h"
#include "feature/control/getinfo_geoip.h"
#include "feature/stats/geoip.h"
#include "lib/geoip/geoip.h"
/** Helper used to implement GETINFO ip-to-country/... controller command. */
int
......
......@@ -65,7 +65,7 @@
#include "feature/nodelist/routerset.h"
#include "feature/nodelist/torcert.h"
#include "feature/rend/rendservice.h"
#include "feature/stats/geoip.h"
#include "lib/geoip/geoip.h"
#include "lib/net/address.h"
#include <string.h>
......
......@@ -34,7 +34,7 @@ n * Copyright (c) 2001-2004, Roger Dingledine.
#include "feature/nodelist/nodelist.h"
#include "feature/nodelist/routerparse.h"
#include "feature/nodelist/routerset.h"
#include "feature/stats/geoip.h"
#include "lib/geoip/geoip.h"
#include "core/or/addr_policy_st.h"
#include "core/or/extend_info_st.h"
......
......@@ -36,7 +36,7 @@
#include "feature/relay/routerkeys.h"
#include "feature/relay/routermode.h"
#include "feature/relay/selftest.h"
#include "feature/stats/geoip.h"
#include "lib/geoip/geoip.h"
#include "feature/stats/geoip_stats.h"
#include "feature/stats/rephist.h"
#include "lib/crypt_ops/crypto_ed25519.h"
......
......@@ -35,7 +35,7 @@
#include "feature/control/control.h"
#include "feature/client/dnsserv.h"
#include "core/or/dos.h"
#include "feature/stats/geoip.h"
#include "lib/geoip/geoip.h"
#include "feature/stats/geoip_stats.h"
#include "feature/nodelist/routerlist.h"
......
......@@ -11,6 +11,7 @@ include src/lib/encoding/include.am
include src/lib/evloop/include.am
include src/lib/fdio/include.am
include src/lib/fs/include.am
include src/lib/geoip/include.am
include src/lib/include.libdonna.am
include src/lib/intmath/include.am
include src/lib/lock/include.am
......
lib/cc/*.h
lib/container/*.h
lib/crypt_ops/*.h
lib/ctime/*.h
lib/encoding/*.h
lib/fs/*.h
lib/geoip/*.h
lib/log/*.h
lib/malloc/*.h
lib/net/*.h
lib/string/*.h
lib/testsupport/*.h
/* Copyright (c) 2001 Matej Pfajfar.
* Copyright (c) 2001-2004, Roger Dingledine.
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
* Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
#ifndef TOR_COUNTRY_H
#define TOR_COUNTRY_H
#include "lib/cc/torint.h"
/** A signed integer representing a country code. */
typedef int16_t country_t;
#endif
......@@ -28,12 +28,7 @@
*/
#define GEOIP_PRIVATE
#include "lib/cc/torint.h"
/** A signed integer representing a country code. */
typedef int16_t country_t; // XXXX duplicate in or.h
#include "feature/stats/geoip.h"
#include "lib/geoip/geoip.h"
#include "lib/container/map.h"
#include "lib/container/order.h"
#include "lib/container/smartlist.h"
......@@ -49,7 +44,6 @@ typedef int16_t country_t; // XXXX duplicate in or.h
#include "lib/string/compat_string.h"
#include "lib/string/scanf.h"
#include "lib/string/util_string.h"
#include "lib/time/tvdiff.h"
#include <stdio.h>
#include <string.h>
......
......@@ -14,7 +14,7 @@
#include "lib/net/nettypes.h"
#include "lib/testsupport/testsupport.h"
#include "lib/cc/torint.h"
#include "lib/geoip/country.h"
#ifdef GEOIP_PRIVATE
STATIC int geoip_parse_entry(const char *line, sa_family_t family);
......
noinst_LIBRARIES += src/lib/libtor-geoip.a
if UNITTESTS_ENABLED
noinst_LIBRARIES += src/lib/libtor-geoip-testing.a
endif
src_lib_libtor_geoip_a_SOURCES = \
src/lib/geoip/geoip.c
src_lib_libtor_geoip_testing_a_SOURCES = \
$(src_lib_libtor_geoip_a_SOURCES)
src_lib_libtor_geoip_testing_a_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
src_lib_libtor_geoip_testing_a_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
noinst_HEADERS += \
src/lib/geoip/geoip.h \
src/lib/geoip/country.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