root/trunk/mysql.sql

Revision 2, 1.7 kB (checked in by ixs, 16 years ago)

Added Direction tracking to the database in order to workaround flowprobes who omit this value

Line 
1 CREATE TABLE `FlowSources` (
2   `FlowSrc` int(11) unsigned NOT NULL,
3   `ExportType` varchar(12) NOT NULL default 'NetFlow9',
4   `Hostname` varchar(255) default NULL,
5   `FlowSrcDesc` varchar(255) default NULL,
6   PRIMARY KEY  (`FlowSrc`)
7 ) ENGINE=InnoDB;
8
9 CREATE TABLE `Interfaces` (
10   `FlowSrc` int(11) unsigned NOT NULL,
11   `IntfDesc` varchar(120) default NULL,
12   `IntfIndex` int(11) unsigned NOT NULL,
13   KEY `FlowSrc` (`FlowSrc`),
14   KEY `DevIntfIndex` (`FlowSrc`,`IntfIndex`),
15   CONSTRAINT `FlowSrc` FOREIGN KEY (`FlowSrc`) REFERENCES `FlowSources` (`FlowSrc`) ON DELETE NO ACTION ON UPDATE NO ACTION
16 ) ENGINE=InnoDB;
17
18 CREATE TABLE `Flows` (
19   `FlowSrc` int(11) unsigned NOT NULL,
20   `IPProto` int(11) unsigned NOT NULL default '0',
21   `IPSrc` int(11) unsigned NOT NULL default '0',
22   `IPDst` int(11) unsigned NOT NULL default '0',
23   `IntIn` int(11) unsigned default '0',
24   `IntOut` int(11) unsigned default '0',
25   `PortSrc` smallint(11) unsigned default '0',
26   `PortDst` smallint(11) unsigned default '0',
27   `MaskSrc` int(11) unsigned default '0',
28   `MaskDst` int(11) unsigned default '0',
29   `TimeStart` int(11) unsigned NOT NULL default '0',
30   `TimeStop` int(11) unsigned NOT NULL default '0',
31   `Direction` smallint(11) unsigned NULL default NULL,
32   `Bytes` int(11) unsigned NOT NULL default '0',
33   `Pakets` int(11) unsigned NOT NULL default '0',
34   KEY `FlowSrc` (`FlowSrc`),
35   KEY `IntfInIndex` (`IntIn`,`FlowSrc`),
36   KEY `IntfOutIndex` (`FlowSrc`,`IntOut`),
37   KEY `TimeStartIndex` (`TimeStart`),
38   KEY `TimeStopIndex` (`TimeStop`),
39   KEY `IPProto` (`IPProto`),
40   KEY `IPSrc` (`IPSrc`),
41   KEY `IPDst` (`IPDst`),
42   CONSTRAINT `f_FlowSrc` FOREIGN KEY (`FlowSrc`) REFERENCES `FlowSources` (`FlowSrc`) ON DELETE NO ACTION ON UPDATE NO ACTION
43 ) ENGINE=InnoDB;
Note: See TracBrowser for help on using the browser.