wip; wont build
This commit is contained in:
1 parent
4959429aee
commit
1c5ffa1dde
13 files changed
+64
-45
No files matched your search
@@ -1,3 +1,4 @@
|
|||||||
build/
|
build/
|
||||||
|
doc/
|
||||||
*.swp
|
*.swp
|
||||||
.vscode
|
.vscode
|
||||||
@@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
|
|||||||
# title of most generated pages and in a few other places.
|
# title of most generated pages and in a few other places.
|
||||||
# The default value is: My Project.
|
# The default value is: My Project.
|
||||||
|
|
||||||
PROJECT_NAME = DistriNS
|
PROJECT_NAME = Plains
|
||||||
|
|
||||||
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
|
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
|
||||||
# could be handy for archiving the generated documentation or if some version
|
# could be handy for archiving the generated documentation or if some version
|
||||||
@@ -58,7 +58,7 @@ PROJECT_LOGO =
|
|||||||
# entered, it will be relative to the location where doxygen was started. If
|
# entered, it will be relative to the location where doxygen was started. If
|
||||||
# left blank the current directory will be used.
|
# left blank the current directory will be used.
|
||||||
|
|
||||||
OUTPUT_DIRECTORY =
|
OUTPUT_DIRECTORY = doc
|
||||||
|
|
||||||
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
|
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
|
||||||
# directories (in 2 levels) under the output directory of each output format and
|
# directories (in 2 levels) under the output directory of each output format and
|
||||||
|
|||||||
@@ -35,6 +35,12 @@ inotifywait -m -q -r -e close_write --format %f ../src/ | grep --line-buffered "
|
|||||||
#### Header Files
|
#### Header Files
|
||||||
- LargeCamelCase.hpp
|
- LargeCamelCase.hpp
|
||||||
|
|
||||||
|
# TODOs
|
||||||
|
## Resolver
|
||||||
|
- DNSSec
|
||||||
|
- Dane Support
|
||||||
|
|
||||||
|
|
||||||
## Useful Links
|
## Useful Links
|
||||||
|
|
||||||
### DNS Protocol
|
### DNS Protocol
|
||||||
|
|||||||
@@ -1,12 +1,18 @@
|
|||||||
#include "Record.hpp"
|
#include "Record.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace Plains {
|
namespace Plains {
|
||||||
namespace Core {
|
namespace Core {
|
||||||
namespace DNS {
|
namespace DNS {
|
||||||
|
|
||||||
|
|
||||||
string Record::serialize() {
|
Record::Record(const uint16_t id) : _id(id) {
|
||||||
return "Nothing implemented";
|
_os = ostream(_sb);
|
||||||
|
_os << "NOT IMPLEMENTED";
|
||||||
|
}
|
||||||
|
|
||||||
|
ostream& Record::operator>>(Serializable& record) {
|
||||||
|
return _os;
|
||||||
}
|
}
|
||||||
|
|
||||||
ARecord::ARecord() : Record(1) {}
|
ARecord::ARecord() : Record(1) {}
|
||||||
|
|||||||
@@ -1,22 +1,28 @@
|
|||||||
#ifndef RECORD_HPP
|
#ifndef RECORD_HPP
|
||||||
#define RECORD_HPP
|
#define RECORD_HPP
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <string>
|
|
||||||
#include "Resource.hpp"
|
#include "Resource.hpp"
|
||||||
|
#include <iostream>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
namespace Plains {
|
namespace Plains {
|
||||||
namespace Core {
|
namespace Core {
|
||||||
namespace DNS {
|
namespace DNS {
|
||||||
|
|
||||||
using std::string;
|
using std::ostream;
|
||||||
|
using std::stringbuf;
|
||||||
|
|
||||||
// Provides an abstract class for dns records that may be stored in the database
|
// Provides an abstract class for dns records that may be stored in the database
|
||||||
class Record : public Resource
|
class Record : public Resource
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
const uint16_t _id;
|
const uint16_t _id;
|
||||||
string serialize();
|
ostream& operator>>(Serializable& object);
|
||||||
Record(const uint16_t id) : _id(id) {}
|
Record(const uint16_t id);
|
||||||
|
|
||||||
|
private:
|
||||||
|
stringbuf _sb;
|
||||||
|
ostream* _os;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ARecord : public Record { ARecord(); };
|
class ARecord : public Record { ARecord(); };
|
||||||
|
|||||||
@@ -4,5 +4,6 @@
|
|||||||
#include "Logger.hpp"
|
#include "Logger.hpp"
|
||||||
#include "ConfigManager.hpp"
|
#include "ConfigManager.hpp"
|
||||||
#include "Exception.hpp"
|
#include "Exception.hpp"
|
||||||
|
#include "Serializable.hpp"
|
||||||
//Include further classes here
|
//Include further classes here
|
||||||
#endif
|
#endif
|
||||||
@@ -1,19 +1,15 @@
|
|||||||
#ifndef RESOURCE_HPP
|
#ifndef RESOURCE_HPP
|
||||||
#define RESOURCE_HPP
|
#define RESOURCE_HPP
|
||||||
|
|
||||||
#include <string>
|
#include "Serializable.hpp"
|
||||||
#include "Serialize.hpp"
|
|
||||||
namespace Plains {
|
namespace Plains {
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
||||||
using std::string;
|
|
||||||
|
|
||||||
// Provides an abstract class for resources that may be stored in the ledger
|
// Provides an abstract class for resources that may be stored in the ledger
|
||||||
class Resource : public Serialize
|
class Resource : public Serializable {};
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual string serialize() const = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
#ifndef SERIALIZABLE_HPP
|
||||||
|
#define SERIALIZABLE_HPP
|
||||||
|
#include <string>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
namespace Plains {
|
||||||
|
namespace Core {
|
||||||
|
|
||||||
|
|
||||||
|
using std::ostream;
|
||||||
|
|
||||||
|
class Serializable {
|
||||||
|
public:
|
||||||
|
// Serialize
|
||||||
|
virtual ostream& operator>>(Serializable& object);
|
||||||
|
// Deserialize
|
||||||
|
//virtual Serializable& operator<<(ostream& os);
|
||||||
|
};
|
||||||
|
|
||||||
|
}}
|
||||||
|
#endif
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#ifndef SERIALIZE_HPP
|
|
||||||
#define SERIALIZE_HPP
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace Plains {
|
|
||||||
namespace Core {
|
|
||||||
|
|
||||||
|
|
||||||
using std::string;
|
|
||||||
|
|
||||||
class Serialize {
|
|
||||||
public:
|
|
||||||
virtual string serialize() const = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
}}
|
|
||||||
#endif
|
|
||||||
+3
-3
@@ -25,7 +25,7 @@ Resolver::Server* globalResolver;
|
|||||||
int main(int args, char **argv) {
|
int main(int args, char **argv) {
|
||||||
Logger logger(Logger::DEBUG);
|
Logger logger(Logger::DEBUG);
|
||||||
|
|
||||||
logger.info.ln ("Starting PLAINS...");
|
logger.info.ln ("Starting Plains...");
|
||||||
|
|
||||||
vector<string> arguments;
|
vector<string> arguments;
|
||||||
for ( unsigned index = 0; index < args; ++index ) {
|
for ( unsigned index = 0; index < args; ++index ) {
|
||||||
@@ -75,7 +75,7 @@ int main(int args, char **argv) {
|
|||||||
// End of Testcode
|
// End of Testcode
|
||||||
|
|
||||||
eventBus.run();
|
eventBus.run();
|
||||||
logger.info.ln ("PLAINS successfully started.");
|
logger.info.ln ("Plains successfully started.");
|
||||||
}
|
}
|
||||||
catch (Exception& e) {
|
catch (Exception& e) {
|
||||||
logger.fatal << "Uncaught Exception: " << e.what() << Logger::commit;
|
logger.fatal << "Uncaught Exception: " << e.what() << Logger::commit;
|
||||||
@@ -115,6 +115,6 @@ void shutdown() {
|
|||||||
globalUIServer->~Server();
|
globalUIServer->~Server();
|
||||||
globalEventBus->~EventBus();
|
globalEventBus->~EventBus();
|
||||||
globalConfigManager->~ConfigManager();
|
globalConfigManager->~ConfigManager();
|
||||||
globalLogger->info.ln ("PLAINS shut down.");
|
globalLogger->info.ln ("Plains shut down.");
|
||||||
globalLogger->~Logger();
|
globalLogger->~Logger();
|
||||||
}
|
}
|
||||||
@@ -28,13 +28,11 @@ Server::Server(Logger& logger, EventBus& eventBus)
|
|||||||
_eventBus(eventBus)
|
_eventBus(eventBus)
|
||||||
{
|
{
|
||||||
_logger.debug.ln ("Starting Resolver...");
|
_logger.debug.ln ("Starting Resolver...");
|
||||||
//throw Exception("Testi");
|
|
||||||
|
|
||||||
_logger.warn << "Testing some stuff..." << Logger::commit;
|
_logger.warn << "Testing some stuff..." << Logger::commit;
|
||||||
_logger.warn << "Message header overall size: " << sizeof(Message::Header) << Logger::commit;
|
_logger.warn << "Message header overall size: " << sizeof(Message::Header) << Logger::commit;
|
||||||
//_logger.debug << "Message::QR:RESPONSE Enum:" << Message::QR::RESPONSE << endl;
|
//_logger.debug << "Message::QR:RESPONSE Enum:" << Message::QR::RESPONSE << endl;
|
||||||
/*
|
/*
|
||||||
std::cerr << std::hex << 0xABCDEF
|
|
||||||
|
|
||||||
std::fstream myfile;
|
std::fstream myfile;
|
||||||
std::streampos beg,end;
|
std::streampos beg,end;
|
||||||
@@ -125,8 +123,9 @@ void Server::run() {
|
|||||||
//std::cout << "size: " << udpReadStatus << std::endl;
|
//std::cout << "size: " << udpReadStatus << std::endl;
|
||||||
for(int i=0; i<udpReadStatus; ++i) {
|
for(int i=0; i<udpReadStatus; ++i) {
|
||||||
//std::cout << std::hex << (char)buffer[i];
|
//std::cout << std::hex << (char)buffer[i];
|
||||||
std::cout << std::setw(2) << static_cast<unsigned>(buffer[i]);
|
std::cout << std::setw(2) << static_cast<unsigned>(buffer[i]) << " ";
|
||||||
}
|
}
|
||||||
|
std::cout << std::endl << std::endl;
|
||||||
|
|
||||||
if ( sendto(udpServerSocket, msg, strlen(msg), 0, (struct sockaddr*)&clientAddress, clientAddressLength) < 0 ) {
|
if ( sendto(udpServerSocket, msg, strlen(msg), 0, (struct sockaddr*)&clientAddress, clientAddressLength) < 0 ) {
|
||||||
close(udpServerSocket);
|
close(udpServerSocket);
|
||||||
|
|||||||
+2
-2
@@ -40,8 +40,8 @@ Server::~Server() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Server::run() {
|
void Server::run() {
|
||||||
_logger.info.ln ("UI Running Webserver on Port 8080");
|
_logger.info.ln ("UI available at http://localhost:3030");
|
||||||
_server->listen("0.0.0.0", 8080);
|
_server->listen("127.0.0.1", 3030);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>PLAINS Control Panel</title>
|
<title>Plains Control Panel</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="stylesheet" type="text/css" href="style.css" media="all" />
|
<link rel="stylesheet" type="text/css" href="style.css" media="all" />
|
||||||
</head>
|
</head>
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
<section id="nav_left">
|
<section id="nav_left">
|
||||||
<h1>PLAINS</h1>
|
<h1>PlAINS</h1>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a>About</a></li>
|
<li><a>About</a></li>
|
||||||
<li><a>Support</a></li>
|
<li><a>Support</a></li>
|
||||||
@@ -120,7 +120,7 @@
|
|||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="footer">
|
<section id="footer">
|
||||||
<p>PLAINS v0.04</p>
|
<p>Plains v0.04</p>
|
||||||
</section>
|
</section>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in new issue
Block a user