forked from JCMarques15/tor-hs-fetcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsqlite_database_create.sql
88 lines (78 loc) · 1.89 KB
/
sqlite_database_create.sql
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
PRAGMA foreign_keys = ON;
CREATE TABLE hidden_services (
id integer PRIMARY KEY AUTOINCREMENT,
link text,
reachable text,
classification text
);
CREATE TABLE descriptors (
link_id integer PRIMARY KEY,
rendezvous_service_descriptor text,
format_version text,
permanent_key text,
secret_id_part text,
publication_time text,
protocol_versions text,
introduction_points_count integer,
descriptor_signature text,
FOREIGN KEY(link_id) REFERENCES hidden_services(id)
);
CREATE TABLE descriptors_introduction_points (
id integer,
link_id integer,
introduction_point text,
ip_address text,
onion_port text,
onion_key text,
service_key text,
PRIMARY KEY (id, link_id),
FOREIGN KEY(link_id) REFERENCES hidden_services(id)
);
CREATE TABLE descriptors_snapshot (
id integer PRIMARY KEY AUTOINCREMENT,
link_id integer,
rendezvous_service_descriptor text,
format_version text,
permanent_key text,
secret_id_part text,
publication_time text,
protocol_versions text,
introduction_points text,
descriptor_signature text,
FOREIGN KEY(link_id) REFERENCES hidden_services(id)
);
CREATE TABLE v3_descriptors (
id integer PRIMARY KEY AUTOINCREMENT,
descriptor_cert text
);
CREATE TABLE extraction_stats (
v2 text,
v3 text,
extraction_date text,
pid integer,
PRIMARY KEY (extraction_date, pid)
);
-- CREATE TABLE service_info (
-- link_id integer,
-- service_type text,
-- service_description text,
-- service_state text check(name = "active" or name = "inactive" or name = "unknown")
-- );
-- CREATE TABLE device_info (
-- link_id integer,
-- os text,
-- port integer,
-- port_service_type text,
-- port_service_version text
-- );
-- CREATE TABLE device_info_snapshot (
-- link_id integer,
-- open_ports text,
-- snapshot_time timestamp
-- );
-- CREATE TABLE service_info_snapshot (
-- link_id integer,
-- descriptor_id integer,
-- introduction_points text,
-- snapshot_time timestamp
-- );