Module Geoip

module Geoip: sig .. end

type t 
type charset = 
| GEOIP_CHARSET_ISO_8859_1
| GEOIP_CHARSET_UTF8
type flags = 
| GEOIP_STANDARD
| GEOIP_MEMORY_CACHE
| GEOIP_CHECK_CACHE
| GEOIP_INDEX_CACHE
| GEOIP_MMAP_CACHE
type db_type = 
| GEOIP_COUNTRY_EDITION
| GEOIP_REGION_EDITION_REV0
| GEOIP_CITY_EDITION_REV0
| GEOIP_ORG_EDITION
| GEOIP_ISP_EDITION
| GEOIP_CITY_EDITION_REV1
| GEOIP_REGION_EDITION_REV1
| GEOIP_PROXY_EDITION
| GEOIP_ASNUM_EDITION
| GEOIP_NETSPEED_EDITION
| GEOIP_DOMAIN_EDITION
| GEOIP_COUNTRY_EDITION_V6
| GEOIP_LOCATIONA_EDITION
| GEOIP_ACCURACYRADIUS_EDITION
| GEOIP_CITYCONFIDENCE_EDITION
| GEOIP_CITYCONFIDENCEDIST_EDITION
| GEOIP_LARGE_COUNTRY_EDITION
| GEOIP_LARGE_COUNTRY_EDITION_V6
type proxy_type = 
| GEOIP_ANON_PROXY
| GEOIP_HTTP_X_FORWARDED_FOR_PROXY
| GEOIP_HTTP_CLIENT_IP_PROXY
type netspeed = 
| GEOIP_UNKNOWN_SPEED
| GEOIP_DIALUP_SPEED
| GEOIP_CABLEDSL_SPEED
| GEOIP_CORPORATE_SPEED

GeoIP database library

val setup_custom_directory : string -> unit
val is_db_avail : db_type -> bool
val init_exn : ?path:string -> ?db:db_type -> flags -> t

Open GeoIP database specified by path if given, otherwise open database by db_type if given, otherwise open default database.

val close : t -> unit
val country_code_by_addr : t -> string -> string option
val country_code_by_name : t -> string -> string option
val country_code3_by_addr : t -> string -> string option
val country_code3_by_name : t -> string -> string option
val country_name_by_addr : t -> string -> string option
val country_name_by_name : t -> string -> string option
val country_name_by_ipnum : t -> int32 -> string option
val country_code_by_ipnum : t -> int32 -> string option
val country_code3_by_ipnum : t -> int32 -> string option
val country_code_by_addr_v6 : t -> string -> string option
val country_code_by_name_v6 : t -> string -> string option
val country_code3_by_addr_v6 : t -> string -> string option
val country_code3_by_name_v6 : t -> string -> string option
val country_name_by_addr_v6 : t -> string -> string option
val country_name_by_name_v6 : t -> string -> string option
val id_by_addr : t -> string -> int
val id_by_name : t -> string -> int
val id_by_ipnum : t -> int -> int
val id_by_addr_v6 : t -> string -> int
val id_by_name_v6 : t -> string -> int
val num_countries : unit -> int
val database_info : t -> string
val database_edition : t -> int
val charset : t -> charset
val set_charset : t -> charset -> charset