-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
40 lines (28 loc) · 2.71 KB
/
README
File metadata and controls
40 lines (28 loc) · 2.71 KB
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
38
39
40
IP database Linux System only .
Drop ICE Using HTTP Stream instead .
cd IPMS/kernel_api_server/
make
./dnion_ipmsd [your port] ./
For Get View :
Notice: parameter must like "get/*-*-*-*"
Use your browser access location just like "http://ip:8888/get/china-jiangsu-nantong-dianxin" So that you can get output
Use tool wget command "wget http://ip:8888/get/china-jiangsu-nantong-dianxin" So that you can save a file named "china-jiangsu-nantong-dianxin" default
If you want to get china jiangsu dianxin you can use url like this "http://ip:8888/get/china-jiangsu-no-dianxin"
For Update IP:
Notice: You must put your data(UTF8 named like '2013-11-12') file in directory "data"
Initialization: put one data file
Update: two data file one is old another is new
For Init IP DB (OK)
A database with table named Odie_OK with no records , and need other tables
| viewinfo_isp |
| viewinfo_sheng |
| viewinfo_shi |
| viewinfo_view |
Access location "http://ip:8888/update" and the directory "data" must has one ip_data_file
目前支持的URL API 有初始化 更新 以及获取任意view
1.初始化IP数据库 kernel_api_server/data 目录下只能存放一个文本数据文件, 并且该文件的格式为UTF8 运行程序 指定端口 和服务目录 使用浏览器或者wget 等HTTP客户端请求工具 请求地址http://ip:port/update 即可初始化IP地址库 默认数据库为mysql 端口默认 数据库名称为odie 必须包含4张字典数据表 初始化过程为这样 首先 初始化中国IP地址 省,市,ISP的py 代码 程序读取数据文本每一行 解析其中的中文 解析其中的中文IP描述,比如优先解析包含“中国”,“江苏”,“南京”,"电信" 等字眼的数据,然后解析没有运营商完整信息的IP段,比如某个IP同属于中国江苏南京的 但是运营商信息不确定,该IP的前一个同区域的 和后一个同区域的IP ISP 都为电信 那么该IP根据这个规则 可以set 其IP的ISP PY 代码为dianxin .
2. 更新IP 数据库 保留之前的数据文件,此时kernel_api_server/data 目录下必须存放2个数据文件(注意:数据文件名格式为YYYY-MM-DD), 后来的文件名时间类型比前面的要大 所以程序会将大的作为将要更新的数据源 与旧的进行文本比对 以此来确定数据变动的范围(需要删除的和需要增加的 删除和增加的范围必定相同 因为0.0.0.0-255.255.255.255 IPV4的地址数量不变的) 更新操作采取的是原子操作,删除和增加的一对数据必定要么一起成功 要么一起失败回滚。
To Do list
1. 增加初始化数据库功能
2. 增加支持多种数据库功能
3. 前端页面采用Angular JS 渲染