2015-03-12 21:03:53 +00:00
|
|
|
CREATE TABLE Config (
|
|
|
|
k varchar(16) PRIMARY KEY NOT NULL,
|
|
|
|
v varchar(1024) NOT NULL
|
2015-03-13 20:53:15 +00:00
|
|
|
);
|
2015-03-12 21:03:53 +00:00
|
|
|
|
|
|
|
CREATE TABLE IpAssignment (
|
|
|
|
networkId char(16) NOT NULL,
|
|
|
|
nodeId char(10) NOT NULL,
|
2015-03-18 23:10:48 +00:00
|
|
|
ip blob(16) NOT NULL,
|
|
|
|
ipNetmaskBits integer NOT NULL DEFAULT(0),
|
|
|
|
ipVersion integer NOT NULL DEFAULT(4)
|
2015-03-12 21:03:53 +00:00
|
|
|
);
|
|
|
|
|
2015-03-18 23:10:48 +00:00
|
|
|
CREATE INDEX IpAssignment_networkId_ip ON IpAssignment (networkId, ip);
|
2015-03-12 21:03:53 +00:00
|
|
|
|
|
|
|
CREATE INDEX IpAssignment_networkId_nodeId ON IpAssignment (networkId, nodeId);
|
|
|
|
|
2015-03-12 21:27:14 +00:00
|
|
|
CREATE INDEX IpAssignment_networkId ON IpAssignment (networkId);
|
2015-03-12 21:03:53 +00:00
|
|
|
|
|
|
|
CREATE TABLE IpAssignmentPool (
|
|
|
|
networkId char(16) NOT NULL,
|
2015-03-18 23:10:48 +00:00
|
|
|
ipNetwork blob(16) NOT NULL,
|
|
|
|
ipNetmaskBits integer NOT NULL,
|
|
|
|
ipVersion integer NOT NULL DEFAULT(4),
|
|
|
|
active integer NOT NULL DEFAULT(1)
|
2015-03-12 21:03:53 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE INDEX IpAssignmentPool_networkId ON IpAssignmentPool (networkId);
|
|
|
|
|
|
|
|
CREATE TABLE Member (
|
|
|
|
networkId char(16) NOT NULL,
|
|
|
|
nodeId char(10) NOT NULL,
|
|
|
|
cachedNetconf blob(4096),
|
2015-03-18 23:10:48 +00:00
|
|
|
cachedNetconfRevision integer NOT NULL DEFAULT(0),
|
2015-04-17 22:21:53 +00:00
|
|
|
cachedNetconfTimestamp integer NOT NULL DEFAULT(0),
|
2015-03-18 23:10:48 +00:00
|
|
|
clientReportedRevision integer NOT NULL DEFAULT(0),
|
|
|
|
authorized integer NOT NULL DEFAULT(0),
|
|
|
|
activeBridge integer NOT NULL DEFAULT(0)
|
2015-03-12 21:03:53 +00:00
|
|
|
);
|
|
|
|
|
2015-03-12 21:27:14 +00:00
|
|
|
CREATE INDEX Member_networkId ON Member (networkId);
|
|
|
|
|
2015-03-12 21:03:53 +00:00
|
|
|
CREATE UNIQUE INDEX Member_networkId_nodeId ON Member (networkId, nodeId);
|
|
|
|
|
2015-03-12 21:27:14 +00:00
|
|
|
CREATE TABLE MulticastRate (
|
|
|
|
networkId char(16) NOT NULL,
|
|
|
|
mgMac char(12) NOT NULL,
|
2015-03-18 23:10:48 +00:00
|
|
|
mgAdi integer NOT NULL DEFAULT(0),
|
|
|
|
preload integer NOT NULL,
|
|
|
|
maxBalance integer NOT NULL,
|
|
|
|
accrual integer NOT NULL
|
2015-03-12 21:27:14 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE INDEX MulticastRate_networkId ON MulticastRate (networkId);
|
2015-03-12 21:03:53 +00:00
|
|
|
|
|
|
|
CREATE TABLE Network (
|
|
|
|
id char(16) PRIMARY KEY NOT NULL,
|
|
|
|
name varchar(128) NOT NULL,
|
2015-03-18 23:10:48 +00:00
|
|
|
private integer NOT NULL DEFAULT(1),
|
|
|
|
enableBroadcast integer NOT NULL DEFAULT(1),
|
|
|
|
allowPassiveBridging integer NOT NULL DEFAULT(0),
|
2015-03-12 21:03:53 +00:00
|
|
|
v4AssignMode varchar(8) NOT NULL DEFAULT('none'),
|
|
|
|
v6AssignMode varchar(8) NOT NULL DEFAULT('none'),
|
2015-03-18 23:10:48 +00:00
|
|
|
multicastLimit integer NOT NULL DEFAULT(32),
|
|
|
|
creationTime integer NOT NULL DEFAULT(0),
|
|
|
|
revision integer NOT NULL DEFAULT(1)
|
2015-03-13 20:53:15 +00:00
|
|
|
);
|
2015-03-12 21:03:53 +00:00
|
|
|
|
2015-04-20 22:46:20 +00:00
|
|
|
CREATE TABLE Relay (
|
|
|
|
networkId char(16) NOT NULL,
|
|
|
|
nodeId char(10) NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE UNIQUE INDEX Relay_networkId_nodeId ON Relay (networkId, nodeId);
|
|
|
|
|
2015-03-12 21:03:53 +00:00
|
|
|
CREATE TABLE Node (
|
|
|
|
id char(10) PRIMARY KEY NOT NULL,
|
|
|
|
identity varchar(4096) NOT NULL,
|
|
|
|
lastAt varchar(64),
|
2015-03-18 23:10:48 +00:00
|
|
|
lastSeen integer NOT NULL DEFAULT(0),
|
|
|
|
firstSeen integer NOT NULL DEFAULT(0)
|
2015-03-13 20:53:15 +00:00
|
|
|
);
|
2015-03-12 21:03:53 +00:00
|
|
|
|
|
|
|
CREATE TABLE Rule (
|
|
|
|
networkId char(16) NOT NULL,
|
|
|
|
nodeId char(10),
|
2015-03-18 23:10:48 +00:00
|
|
|
vlanId integer,
|
|
|
|
vlanPcp integer,
|
|
|
|
etherType integer,
|
2015-03-12 21:03:53 +00:00
|
|
|
macSource char(12),
|
|
|
|
macDest char(12),
|
|
|
|
ipSource varchar(64),
|
|
|
|
ipDest varchar(64),
|
2015-03-18 23:10:48 +00:00
|
|
|
ipTos integer,
|
|
|
|
ipProtocol integer,
|
|
|
|
ipSourcePort integer,
|
|
|
|
ipDestPort integer,
|
2015-03-12 21:03:53 +00:00
|
|
|
"action" varchar(4096) NOT NULL DEFAULT('accept')
|
|
|
|
);
|
|
|
|
|
2015-03-18 23:10:48 +00:00
|
|
|
CREATE INDEX Rule_networkId ON Rule (networkId);
|