The cl-geoip Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-geoip Reference Manual

This is the cl-geoip Reference Manual, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 11:08:52 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

cl-geoip

A simple cffi-wrapper around some basic functionality of libGeoIP as provided by the debian package http://packages.debian.org/wheezy/libgeoip-dev (original source http://www.maxmind.com). I only implemented the functionality I actually need, and released it since it might be useful for other people. If anybody needs more functionality, patches are welcome!

I tested this under SBCL, Linux x64.

Copyright

Copyright (C) 2013 (let ((n "Christoph-Simon Senjak")) #| |#
 (format nil "~A <~C~C~C~C~A>" n (elt n 0) (elt n 10) (elt n 16)
 #\@ "uxul.de"))

This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
and/or modify it under the terms of the Do What The Fuck You Want
To Public License, Version 2, as published by Sam Hocevar. See
http://www.wtfpl.net/ for more details.

Usage

Under Debian/Ubuntu, the packages libgeoip-dev and geoip-database should provide the necessary files to get started.

Before we can use the databases, they have to be initialized using open-databases, which wants two file names, one for the IPv4 and one fore the IPv6 database. Under Debian/Ubuntu, the following should be correct:

(geoip:open-databases "/usr/share/GeoIP/GeoIP.dat"
                      "/usr/share/GeoIP/GeoIPv6.dat")

After that, you should be able to find Country-Codes for IP-Strings using get-country-code. If it is not found, NIL is returned:

  CL-USER> (geoip:get-country-code "188.40.170.99")
  "DE"
  CL-USER> (geoip:get-country-code "2a01:4f8:101:281:7ad5:1003:0:1")
  "DE"
  CL-USER> (geoip:get-country-code "some clusterfuck")
  NIL

Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 cl-geoip

Author

(let ((n "Christoph-Simon Senjak")) (format nil "~A ~ <~C~C~C~C~A>

License

WTFPL 2.0

Description

Wrapper around libGeoIP

Dependency

cffi

Source

cl-geoip.asd (file)

Component

geoip.lisp (file)


Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 cl-geoip.asd

Location

cl-geoip.asd

Systems

cl-geoip (system)


Previous: , Up: Lisp files   [Contents][Index]

3.1.2 cl-geoip/geoip.lisp

Parent

cl-geoip (system)

Location

geoip.lisp

Packages

geoip

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 geoip

Source

geoip.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Functions

Function: get-country-code IP
Package

geoip

Source

geoip.lisp (file)

Function: open-databases IP4 IP6
Package

geoip

Source

geoip.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *ip4-db*
Package

geoip

Source

geoip.lisp (file)

Special Variable: *ip6-db*
Package

geoip

Source

geoip.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: geoip-country-code-by-addr DATABASE IP-4
Package

geoip

Source

geoip.lisp (file)

Function: geoip-country-code-by-addr-v6 DATABASE IP-6
Package

geoip

Source

geoip.lisp (file)

Function: geoip-open FILENAME FLAGS
Package

geoip

Source

geoip.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   C   F   L  
Index Entry  Section

C
cl-geoip.asd: The cl-geoip<dot>asd file
cl-geoip/geoip.lisp: The cl-geoip/geoip<dot>lisp file

F
File, Lisp, cl-geoip.asd: The cl-geoip<dot>asd file
File, Lisp, cl-geoip/geoip.lisp: The cl-geoip/geoip<dot>lisp file

L
Lisp File, cl-geoip.asd: The cl-geoip<dot>asd file
Lisp File, cl-geoip/geoip.lisp: The cl-geoip/geoip<dot>lisp file

Jump to:   C   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   F   G   O  
Index Entry  Section

F
Function, geoip-country-code-by-addr: Internal functions
Function, geoip-country-code-by-addr-v6: Internal functions
Function, geoip-open: Internal functions
Function, get-country-code: Exported functions
Function, open-databases: Exported functions

G
geoip-country-code-by-addr: Internal functions
geoip-country-code-by-addr-v6: Internal functions
geoip-open: Internal functions
get-country-code: Exported functions

O
open-databases: Exported functions

Jump to:   F   G   O  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*ip4-db*: Internal special variables
*ip6-db*: Internal special variables

S
Special Variable, *ip4-db*: Internal special variables
Special Variable, *ip6-db*: Internal special variables

Jump to:   *  
S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   G   P   S  
Index Entry  Section

C
cl-geoip: The cl-geoip system

G
geoip: The geoip package

P
Package, geoip: The geoip package

S
System, cl-geoip: The cl-geoip system

Jump to:   C   G   P   S