summaryrefslogtreecommitdiff
path: root/netconf/netconf-schema.sql
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-03-18 16:10:48 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-03-18 16:10:48 -0700
commita8a92c5b89b51f6786d6e5cb41a588197b6afabb (patch)
tree9004ad82f5660f889635e5ccf5ede58be0f4922d /netconf/netconf-schema.sql
parentcea3f2815589f956f699ad589a66c9d09f406ee9 (diff)
downloadinfinitytier-a8a92c5b89b51f6786d6e5cb41a588197b6afabb.tar.gz
infinitytier-a8a92c5b89b51f6786d6e5cb41a588197b6afabb.zip
A whole lot of Sqlite netconf master work, and some fixes elsewhere in the code.
Diffstat (limited to 'netconf/netconf-schema.sql')
-rw-r--r--netconf/netconf-schema.sql62
1 files changed, 32 insertions, 30 deletions
diff --git a/netconf/netconf-schema.sql b/netconf/netconf-schema.sql
index ccd6de65..f5981f1a 100644
--- a/netconf/netconf-schema.sql
+++ b/netconf/netconf-schema.sql
@@ -6,11 +6,12 @@ CREATE TABLE Config (
CREATE TABLE IpAssignment (
networkId char(16) NOT NULL,
nodeId char(10) NOT NULL,
- ip varchar(64) NOT NULL,
- ipNetmaskBits integer(4) NOT NULL DEFAULT(0)
+ ip blob(16) NOT NULL,
+ ipNetmaskBits integer NOT NULL DEFAULT(0),
+ ipVersion integer NOT NULL DEFAULT(4)
);
-CREATE UNIQUE INDEX IpAssignment_networkId_ip ON IpAssignment (networkId, ip);
+CREATE INDEX IpAssignment_networkId_ip ON IpAssignment (networkId, ip);
CREATE INDEX IpAssignment_networkId_nodeId ON IpAssignment (networkId, nodeId);
@@ -18,9 +19,10 @@ CREATE INDEX IpAssignment_networkId ON IpAssignment (networkId);
CREATE TABLE IpAssignmentPool (
networkId char(16) NOT NULL,
- ipNetwork varchar(64) NOT NULL,
- ipNetmaskBits integer(4) NOT NULL,
- active integer(1) NOT NULL DEFAULT(1)
+ ipNetwork blob(16) NOT NULL,
+ ipNetmaskBits integer NOT NULL,
+ ipVersion integer NOT NULL DEFAULT(4),
+ active integer NOT NULL DEFAULT(1)
);
CREATE INDEX IpAssignmentPool_networkId ON IpAssignmentPool (networkId);
@@ -29,10 +31,10 @@ CREATE TABLE Member (
networkId char(16) NOT NULL,
nodeId char(10) NOT NULL,
cachedNetconf blob(4096),
- cachedNetconfRevision integer(32),
- clientReportedRevision integer(32),
- authorized integer(1) NOT NULL DEFAULT(0),
- activeBridge integer(1) NOT NULL DEFAULT(0)
+ cachedNetconfRevision integer NOT NULL DEFAULT(0),
+ clientReportedRevision integer NOT NULL DEFAULT(0),
+ authorized integer NOT NULL DEFAULT(0),
+ activeBridge integer NOT NULL DEFAULT(0)
);
CREATE INDEX Member_networkId ON Member (networkId);
@@ -42,10 +44,10 @@ CREATE UNIQUE INDEX Member_networkId_nodeId ON Member (networkId, nodeId);
CREATE TABLE MulticastRate (
networkId char(16) NOT NULL,
mgMac char(12) NOT NULL,
- mgAdi integer(8) NOT NULL DEFAULT(0),
- preload integer(16) NOT NULL,
- maxBalance integer(16) NOT NULL,
- accrual integer(16) NOT NULL
+ mgAdi integer NOT NULL DEFAULT(0),
+ preload integer NOT NULL,
+ maxBalance integer NOT NULL,
+ accrual integer NOT NULL
);
CREATE INDEX MulticastRate_networkId ON MulticastRate (networkId);
@@ -53,39 +55,39 @@ CREATE INDEX MulticastRate_networkId ON MulticastRate (networkId);
CREATE TABLE Network (
id char(16) PRIMARY KEY NOT NULL,
name varchar(128) NOT NULL,
- private integer(1) NOT NULL DEFAULT(1),
- enableBroadcast integer(1) NOT NULL DEFAULT(1),
- allowPassiveBridging integer(1) NOT NULL DEFAULT(0),
+ private integer NOT NULL DEFAULT(1),
+ enableBroadcast integer NOT NULL DEFAULT(1),
+ allowPassiveBridging integer NOT NULL DEFAULT(0),
v4AssignMode varchar(8) NOT NULL DEFAULT('none'),
v6AssignMode varchar(8) NOT NULL DEFAULT('none'),
- multicastLimit integer(8) NOT NULL DEFAULT(32),
- creationTime integer(32) NOT NULL DEFAULT(0),
- revision integer(32) NOT NULL DEFAULT(0)
+ multicastLimit integer NOT NULL DEFAULT(32),
+ creationTime integer NOT NULL DEFAULT(0),
+ revision integer NOT NULL DEFAULT(1)
);
CREATE TABLE Node (
id char(10) PRIMARY KEY NOT NULL,
identity varchar(4096) NOT NULL,
lastAt varchar(64),
- lastSeen integer(32) NOT NULL DEFAULT(0),
- firstSeen integer(32) NOT NULL DEFAULT(0)
+ lastSeen integer NOT NULL DEFAULT(0),
+ firstSeen integer NOT NULL DEFAULT(0)
);
CREATE TABLE Rule (
networkId char(16) NOT NULL,
nodeId char(10),
- vlanId integer(4),
- vlanPcp integer(4),
- etherType integer(8),
+ vlanId integer,
+ vlanPcp integer,
+ etherType integer,
macSource char(12),
macDest char(12),
ipSource varchar(64),
ipDest varchar(64),
- ipTos integer(4),
- ipProtocol integer(4),
- ipSourcePort integer(8),
- ipDestPort integer(8),
+ ipTos integer,
+ ipProtocol integer,
+ ipSourcePort integer,
+ ipDestPort integer,
"action" varchar(4096) NOT NULL DEFAULT('accept')
);
-CREATE INDEX Rule_networkId ON Rule (networkId);
+CREATE INDEX Rule_networkId ON Rule (networkId); \ No newline at end of file