diff --git a/controller/SqliteNetworkController.cpp b/controller/SqliteNetworkController.cpp index 5dc055698..9bb1fa411 100644 --- a/controller/SqliteNetworkController.cpp +++ b/controller/SqliteNetworkController.cpp @@ -776,7 +776,7 @@ unsigned int SqliteNetworkController::handleControlPlaneHttpGET( return 200; } // else 404 - } + } // else 404 return 404; } @@ -793,6 +793,33 @@ unsigned int SqliteNetworkController::handleControlPlaneHttpPOST( return 404; Mutex::Lock _l(_lock); + if (path[0] == "network") { + + if ((path.size() >= 2)&&(path[1].length() == 16)) { + uint64_t nwid = Utils::hexStrToU64(path[1].c_str()); + char nwids[24]; + Utils::snprintf(nwids,sizeof(nwids),"%.16llx",(unsigned long long)nwid); + + if (path.size() >= 3) { + if ((path.size() == 4)&&(path[2] == "member")&&(path[3].length() == 10)) { + uint64_t address = Utils::hexStrToU64(path[3].c_str()); + char addrs[24]; + Utils::snprintf(addrs,sizeof(addrs),"%.10llx",address); + + } else if (path[2] == "rule") { + + + } else if (path[2] == "ipAssignmentPool") { + + } // else 404 + } else { + + } + + } // else 404 + + } // else 404 + return 404; } diff --git a/controller/schema.sql.c b/controller/schema.sql.c index a5d469736..1161451b1 100644 --- a/controller/schema.sql.c +++ b/controller/schema.sql.c @@ -72,9 +72,11 @@ "CREATE TABLE Relay (\n"\ " networkId char(16) NOT NULL,\n"\ " nodeId char(10) NOT NULL,\n"\ -" address varchar(64) NOT NULL\n"\ +" phyAddress varchar(64) NOT NULL\n"\ ");\n"\ "\n"\ +"CREATE INDEX Relay_networkId ON Relay (networkId);\n"\ +"\n"\ "CREATE UNIQUE INDEX Relay_networkId_nodeId ON Relay (networkId, nodeId);\n"\ "\n"\ "CREATE TABLE Node (\n"\ @@ -87,6 +89,7 @@ "\n"\ "CREATE TABLE Rule (\n"\ " networkId char(16) NOT NULL,\n"\ +" ordering integer NOT NULL DEFAULT(0),\n"\ " nodeId char(10),\n"\ " vlanId integer,\n"\ " vlanPcp integer,\n"\