geoip1.h (goaccess-1.6.5) | : | geoip1.h (goaccess-1.7) | ||
---|---|---|---|---|
skipping to change at line 42 | skipping to change at line 42 | |||
#endif | #endif | |||
#ifndef GEOIP_H_INCLUDED | #ifndef GEOIP_H_INCLUDED | |||
#define GEOIP_H_INCLUDED | #define GEOIP_H_INCLUDED | |||
#include "commons.h" | #include "commons.h" | |||
#define CITY_LEN 47 + 1 /* max string length for a city */ | #define CITY_LEN 47 + 1 /* max string length for a city */ | |||
#define CONTINENT_LEN 47 + 1 /* max string length for a country */ | #define CONTINENT_LEN 47 + 1 /* max string length for a country */ | |||
#define COUNTRY_LEN 48 + 3 /* Country + two-letter Code */ | #define COUNTRY_LEN 48 + 3 /* Country + two-letter Code */ | |||
#define ASN_LEN 64 + 6 /* ASN + 5 digit/16-bit number/code */ | ||||
/* Type of IP */ | ||||
typedef enum { | ||||
TYPE_COUNTRY, | ||||
TYPE_CITY, | ||||
TYPE_ASN | ||||
} GO_GEOIP_DB; | ||||
typedef struct GLocation_ { | typedef struct GLocation_ { | |||
char city[CITY_LEN]; | char city[CITY_LEN]; | |||
char continent[CONTINENT_LEN]; | char continent[CONTINENT_LEN]; | |||
int hits; | int hits; | |||
} GLocation; | } GLocation; | |||
int is_geoip_resource (void); | int is_geoip_resource (void); | |||
int set_geolocation (char *host, char *continent, char *country, char *city); | int set_geolocation (char *host, char *continent, char *country, char *city, cha | |||
r *asn); | ||||
void geoip_asn (char *host, char *asn); | ||||
void geoip_free (void); | void geoip_free (void); | |||
void geoip_get_city (const char *ip, char *location, GTypeIP type_ip); | ||||
void geoip_get_continent (const char *ip, char *location, GTypeIP type_ip); | void geoip_get_continent (const char *ip, char *location, GTypeIP type_ip); | |||
void geoip_get_country (const char *ip, char *location, GTypeIP type_ip); | void geoip_get_country (const char *ip, char *location, GTypeIP type_ip); | |||
void init_geoip (void); | void init_geoip (void); | |||
#endif // for #ifndef GEOIP_H | #endif // for #ifndef GEOIP_H | |||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 11 lines changed or added |