summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Langesten <daniel.langest@gmail.com>2015-03-16 14:21:12 +0100
committerDaniel Langesten <daniel.langest@gmail.com>2015-03-16 14:21:12 +0100
commitfc0b970f30b1b542d1b72a4eed3fb19a1340c96d (patch)
treec8f7a48591f8fc8b44f28b5828f6579958e6e098
parentf8aa7ea1542a7061486a9cc740f03faa9542483d (diff)
updated setup to the new spec
-rw-r--r--dbsetup.sql35
1 files changed, 10 insertions, 25 deletions
diff --git a/dbsetup.sql b/dbsetup.sql
index 310db1c..1a42b2d 100644
--- a/dbsetup.sql
+++ b/dbsetup.sql
@@ -1,29 +1,14 @@
-DROP TABLE IF EXISTS asnip;
-
-CREATE TABLE asnip (
- asn INT,
- ip_block CHAR(18) -- Since a ip block consist of a maximum of 18 chars "255.255.255.255/32"
-);
-
DROP TABLE IF EXISTS clean_data;
CREATE TABLE clean_data (
- ipb_src CHAR(18),
- ipb_dst CHAR(18),
- time DATETIME,
- port INT,
- volume CHAR(10),
- occurences INT,
- UNIQUE idx (ipb_src, ipb_dst, time, port, volume)
-);
-
-DROP TABLE IF EXISTS raw_data;
-
-CREATE TABLE raw_data (
- ip_src CHAR(15), -- Since a ip consist of a maximum of 15 chars "255.255.255.255"
- ip_dst CHAR(15),
- time DATETIME,
- port INT,
- packet_size INT,
- process_time DATETIME
+ ipb_src CHAR(39) NOT NULL,
+ ipb_dst CHAR(39) NOT NULL,
+ as_src INT(4) UNSIGNED NOT NULL,
+ as_dst INT(4) UNSIGNED NOT NULL,
+ port_src INT(2) UNSIGNED NOT NULL,
+ port_dst INT(2) UNSIGNED NOT NULL,
+ occurences INT UNSIGNED NOT NULL,
+ volume CHAR(10) NOT NULL,
+ time DATETIME NOT NULL,
+ UNIQUE idx (ipb_src, ipb_dst, as_src, as_dst, port_src, port_dst, volume, time)
);