summaryrefslogtreecommitdiff
path: root/geoip.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2014-04-22 13:42:19 +0200
committerTobias Klauser <tklauser@distanz.ch>2014-04-22 13:46:53 +0200
commit0f86cd6c1dcc2129285e6081751bae3a53058aeb (patch)
treeca67e2a0f8233ed6f075b6c9535763d41135bd7c /geoip.c
parentb043dddbf0591e67c9c9e4e78df8b9e1c9cafd06 (diff)
conf: Use configuration file path from Makefile instead of hardcoded paths
Currently, the path to the configuration files is hardcoded to $PREFIX/etc/netsniff-ng. If we want to keep the configuration files outside of prefix (e.g. during development), we need to pass the complete path as specified in $ETCDIRE (and $ETCDIR respectively, which could e.g. be overriden on the command line during build install) as a preprocessor define. This way, we can e.g. install the configuration files to /etc while installing the binaries in /usr/local with: $ make PREFIX=/usr/local ETCDIR=/etc $ make PREFIX=/usr/local ETCDIR=/etc install Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'geoip.c')
-rw-r--r--geoip.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/geoip.c b/geoip.c
index 433dbbe..8d879a6 100644
--- a/geoip.c
+++ b/geoip.c
@@ -33,37 +33,37 @@ struct file {
static const struct file files[] = {
[GEOIP_CITY_EDITION_REV1] = {
.desc = "City IPv4",
- .local = PREFIX_STRING "/etc/netsniff-ng/city4.dat",
+ .local = ETCDIRE_STRING "/city4.dat",
.remote = "/GeoLiteCity.dat.gz",
.possible_prefix = PRE,
},
[GEOIP_CITY_EDITION_REV1_V6] = {
.desc = "City IPv6",
- .local = PREFIX_STRING "/etc/netsniff-ng/city6.dat",
+ .local = ETCDIRE_STRING "/city6.dat",
.remote = "/GeoLiteCityv6.dat.gz",
.possible_prefix = PRE "/GeoLiteCityv6-beta",
},
[GEOIP_COUNTRY_EDITION] = {
.desc = "Country IPv4",
- .local = PREFIX_STRING "/etc/netsniff-ng/country4.dat",
+ .local = ETCDIRE_STRING "/country4.dat",
.remote = "/GeoIP.dat.gz",
.possible_prefix = PRE "/GeoLiteCountry",
},
[GEOIP_COUNTRY_EDITION_V6] = {
.desc = "Country IPv6",
- .local = PREFIX_STRING "/etc/netsniff-ng/country6.dat",
+ .local = ETCDIRE_STRING "/country6.dat",
.remote = "/GeoIPv6.dat.gz",
.possible_prefix = PRE,
},
[GEOIP_ASNUM_EDITION] = {
.desc = "AS Numbers IPv4",
- .local = PREFIX_STRING "/etc/netsniff-ng/asname4.dat",
+ .local = ETCDIRE_STRING "/asname4.dat",
.remote = "/GeoIPASNum.dat.gz",
.possible_prefix = PRE "/asnum",
},
[GEOIP_ASNUM_EDITION_V6] = {
.desc = "AS Numbers IPv6",
- .local = PREFIX_STRING "/etc/netsniff-ng/asname6.dat",
+ .local = ETCDIRE_STRING "/asname6.dat",
.remote = "/GeoIPASNumv6.dat.gz",
.possible_prefix = PRE "/asnum",
},
@@ -526,7 +526,7 @@ static void init_mirrors(void)
FILE *fp;
char buff[256];
- fp = fopen(PREFIX_STRING "/etc/netsniff-ng/geoip.conf", "r");
+ fp = fopen(ETCDIRE_STRING "/geoip.conf", "r");
if (!fp)
panic("Cannot open geoip.conf!\n");