From 7f1d06d549da3ef717e1d30dc745173dcefd8dba Mon Sep 17 00:00:00 2001 From: Matthias Engelke Date: Mon, 23 Aug 2021 14:31:35 +0200 Subject: [PATCH 1/2] ADD: class for priority --- include/Whisper/Messages/Priority.hpp | 59 +++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 include/Whisper/Messages/Priority.hpp diff --git a/include/Whisper/Messages/Priority.hpp b/include/Whisper/Messages/Priority.hpp new file mode 100644 index 0000000..bb275eb --- /dev/null +++ b/include/Whisper/Messages/Priority.hpp @@ -0,0 +1,59 @@ +#pragma once +/* This Source Code Form is subject to the terms of the Mozilla Public +* License, v. 2.0. If a copy of the MPL was not distributed with this +* file, You can obtain one at https://mozilla.org/MPL/2.0/. +*/ +/** @file */ +/** @copyright 2021 MPLv2 */ +#include +#include + +/** +* @brief This is the main namespace for all whisper-com related datatypes and classed. +*/ +namespace Whisper +{ + + /** + * @brief namespace for all data related DataTypes, classes, etc. + */ + namespace Data + { + + /** + * \defgroup data_classifications Classification of Data within Messages + * Data in Message can be classified occording to the non-disclosure of its information. + * In whisper-com certain rules are enforced occording to data classification + * e.g. messages may be dropped or not routed through gateways. + * Furthermore, encryption of data may or may not be enforced. + */ + + + /** + * @brief Enumeration of different data classifications. + * \ingroup data_classifications + * Data classifications classify the data within the payload of a message + * according to six levels. We think six levels should be enough and + * fewer limits the flexibility of the user and more adds to the overall + * complexity. + */ + enum class classification : std::uint8_t + { + /// The data is public and may even be transmitted public to the Internet. + PUBLIC, + /// The data is classified open. Everyone with access to the network may read it + /// but the data is not allowed to be published to the internet or other non local networks. + OPEN, + /// The data is classified RESTRICTED + RESTRICTED, + /// the data is classified CONFIDENTIAL + CONFIDENTIAL, + /// The data is classified as SECRET + SECRET, + /// The data is classified as TOP SECRET. + TOP_SECRET + }; // enum class classification + + }; // namespace Data + +}; // namespace Whisper -- 2.45.2 From 6224f5b75e22c47723349af6577f0e546c6b68ee Mon Sep 17 00:00:00 2001 From: Matthias Engelke Date: Thu, 26 Aug 2021 17:53:36 +0200 Subject: [PATCH 2/2] Added Priorities in include/Whisper/Messages/Priority.hpp --- include/Whisper/Messages/Priority.hpp | 45 +++++++++++---------------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/include/Whisper/Messages/Priority.hpp b/include/Whisper/Messages/Priority.hpp index bb275eb..0c46846 100644 --- a/include/Whisper/Messages/Priority.hpp +++ b/include/Whisper/Messages/Priority.hpp @@ -17,42 +17,33 @@ namespace Whisper /** * @brief namespace for all data related DataTypes, classes, etc. */ - namespace Data + namespace Messages { /** - * \defgroup data_classifications Classification of Data within Messages - * Data in Message can be classified occording to the non-disclosure of its information. - * In whisper-com certain rules are enforced occording to data classification - * e.g. messages may be dropped or not routed through gateways. - * Furthermore, encryption of data may or may not be enforced. + * \defgroup data_priority Priority of Messages + * Messages can be priortisied according to their importants. + * In whisper-com certain rules are enforced according to message priority + * e.g. important messages may be transorted and processed faster */ /** - * @brief Enumeration of different data classifications. - * \ingroup data_classifications - * Data classifications classify the data within the payload of a message - * according to six levels. We think six levels should be enough and - * fewer limits the flexibility of the user and more adds to the overall - * complexity. + * @brief Enumeration of different message priorities. + * \ingroup message_priorities + * Message priorities divides messages into three levels. We think three + * levels should be enough and fewer limits the flexibility of the user + * and more adds to the overall complexity. */ - enum class classification : std::uint8_t + enum class priority : std::uint8_t { - /// The data is public and may even be transmitted public to the Internet. - PUBLIC, - /// The data is classified open. Everyone with access to the network may read it - /// but the data is not allowed to be published to the internet or other non local networks. - OPEN, - /// The data is classified RESTRICTED - RESTRICTED, - /// the data is classified CONFIDENTIAL - CONFIDENTIAL, - /// The data is classified as SECRET - SECRET, - /// The data is classified as TOP SECRET. - TOP_SECRET - }; // enum class classification + /// Messages of Priority low are additional information + LOW, + /// Messages of Priority medium are information for basic operation + MEDIUM, + /// Messages of Priority high are essential for survival + HIGH, + }; // enum class priority }; // namespace Data -- 2.45.2