File: README.GeoIP

package info (click to toggle)
pmacct 1.7.8-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,904 kB
  • sloc: ansic: 110,430; sh: 4,794; cpp: 4,375; python: 3,632; makefile: 525
file content (37 lines) | stat: -rw-r--r-- 1,822 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
This document doesn't replace documentation relevant to the database software you are
using, ie. README.mysql, README.pgsql or README.sqlite3.

The 'country_ip_src' and 'country_ip_dst', 'pocode_ip_src', 'pocode_ip_dst',
'lat_ip_src', 'lon_ip_src', 'lat_ip_dst' and 'lon_ip_dst' fields.
Such fields are being introduced to natively support source/destination GeoIP lookups
against a defined database or map. The guidelines below (typically in MySQL format)
are to add such primitives to the SQL schema:

* country_ip_src field:
  - "country_ip_src CHAR(2) NOT NULL," to declare the field itself
  - "PRIMARY KEY (..., country_ip_src, ...)" to put it in the primary key 

* country_ip_dst field:
  - "country_ip_dst CHAR(2) NOT NULL," to declare the field itself
  - "PRIMARY KEY (..., country_ip_dst, ...)" to put it in the primary key 

* pocode_ip_src field:
  - "country_ip_src CHAR(12) NOT NULL," to declare the field itself
  - "PRIMARY KEY (..., pocode_ip_src, ...)" to put it in the primary key

* pocode_ip_dst field:
  - "country_ip_dst CHAR(12) NOT NULL," to declare the field itself
  - "PRIMARY KEY (..., pocode_ip_dst, ...)" to put it in the primary key

* lat_ip_src and lon_ip_src fields:
  - "lat_ip_src FLOAT NOT NULL," to declare the field itself
  - "lon_ip_src FLOAT NOT NULL," to declare the field itself
  - "PRIMARY KEY (..., lat_ip_src, lon_ip_src ...)" to put them in the primary key

* lat_ip_dst and lon_ip_dst fields:
  - "lat_ip_dst FLOAT NOT NULL," to declare the field itself
  - "lon_ip_dst FLOAT NOT NULL," to declare the field itself
  - "PRIMARY KEY (..., lat_ip_dst, lon_ip_dst ...)" to put them in the primary key

The primitives are not declared as part of any default table version; yet will not
fail version checks which are enabled when 'sql_optimize_clauses' feature is disabled.