|
@@ -27,13 +27,13 @@ void statistics_db::writeStatisticsIP(std::unordered_map<std::string, entry_ipSt
|
|
SQLite::Transaction transaction(*db);
|
|
SQLite::Transaction transaction(*db);
|
|
const char *createTable = "CREATE TABLE ip_statistics ( "
|
|
const char *createTable = "CREATE TABLE ip_statistics ( "
|
|
"ipAddress TEXT, "
|
|
"ipAddress TEXT, "
|
|
- "pktsReceived INTEGtimestampER, "
|
|
|
|
|
|
+ "pktsReceived INTEGER, "
|
|
"pktsSent INTEGER, "
|
|
"pktsSent INTEGER, "
|
|
"kbytesReceived REAL, "
|
|
"kbytesReceived REAL, "
|
|
"kbytesSent REAL, "
|
|
"kbytesSent REAL, "
|
|
"maxPktRate REAL,"
|
|
"maxPktRate REAL,"
|
|
"minPktRate REAL,"
|
|
"minPktRate REAL,"
|
|
- "ipClass TEXT, "
|
|
|
|
|
|
+ "ipClass TEXT COLLATE NOCASE, "
|
|
"PRIMARY KEY(ipAddress));";
|
|
"PRIMARY KEY(ipAddress));";
|
|
db->exec(createTable);
|
|
db->exec(createTable);
|
|
SQLite::Statement query(*db, "INSERT INTO ip_statistics VALUES (?, ?, ?, ?, ?, ?, ?, ?)");
|
|
SQLite::Statement query(*db, "INSERT INTO ip_statistics VALUES (?, ?, ?, ?, ?, ?, ?, ?)");
|
|
@@ -187,7 +187,7 @@ void statistics_db::writeStatisticsProtocols(std::unordered_map<ipAddress_protoc
|
|
SQLite::Transaction transaction(*db);
|
|
SQLite::Transaction transaction(*db);
|
|
const char *createTable = "CREATE TABLE ip_protocols ("
|
|
const char *createTable = "CREATE TABLE ip_protocols ("
|
|
"ipAddress TEXT,"
|
|
"ipAddress TEXT,"
|
|
- "protocolName TEXT,"
|
|
|
|
|
|
+ "protocolName TEXT COLLATE NOCASE,"
|
|
"protocolCount INTEGER,"
|
|
"protocolCount INTEGER,"
|
|
"PRIMARY KEY(ipAddress,protocolName));";
|
|
"PRIMARY KEY(ipAddress,protocolName));";
|
|
db->exec(createTable);
|
|
db->exec(createTable);
|
|
@@ -217,7 +217,7 @@ void statistics_db::writeStatisticsPorts(std::unordered_map<ipAddress_inOut_port
|
|
SQLite::Transaction transaction(*db);
|
|
SQLite::Transaction transaction(*db);
|
|
const char *createTable = "CREATE TABLE ip_ports ("
|
|
const char *createTable = "CREATE TABLE ip_ports ("
|
|
"ipAddress TEXT,"
|
|
"ipAddress TEXT,"
|
|
- "portDirection TEXT,"
|
|
|
|
|
|
+ "portDirection TEXT COLLATE NOCASE,"
|
|
"portNumber INTEGER,"
|
|
"portNumber INTEGER,"
|
|
"portCount INTEGER,"
|
|
"portCount INTEGER,"
|
|
"PRIMARY KEY(ipAddress,portDirection,portNumber));";
|
|
"PRIMARY KEY(ipAddress,portDirection,portNumber));";
|
|
@@ -249,7 +249,7 @@ void statistics_db::writeStatisticsIpMac(std::unordered_map<std::string, std::st
|
|
SQLite::Transaction transaction(*db);
|
|
SQLite::Transaction transaction(*db);
|
|
const char *createTable = "CREATE TABLE ip_mac ("
|
|
const char *createTable = "CREATE TABLE ip_mac ("
|
|
"ipAddress TEXT,"
|
|
"ipAddress TEXT,"
|
|
- "macAddress TEXT,"
|
|
|
|
|
|
+ "macAddress TEXT COLLATE NOCASE,"
|
|
"PRIMARY KEY(ipAddress));";
|
|
"PRIMARY KEY(ipAddress));";
|
|
db->exec(createTable);
|
|
db->exec(createTable);
|
|
SQLite::Statement query(*db, "INSERT INTO ip_mac VALUES (?, ?)");
|
|
SQLite::Statement query(*db, "INSERT INTO ip_mac VALUES (?, ?)");
|