Create doxygen

This commit is contained in:
Florian Hoss 2022-07-30 11:46:19 +02:00
parent 2e91cc1567
commit 7aec70244e
150 changed files with 15105 additions and 23 deletions

View file

@ -13,7 +13,7 @@
namespace fw
{
/**
* @brief The API to create, edit or remove firewall rules
* @brief The API to create, edit or remove Firewall rules
* @author Florian Hoss
*
*/

View file

@ -13,7 +13,7 @@
namespace fw
{
/**
* @brief The Firewall will handle rules as linked list
* @brief The Firewall will handle Firewall rules as linked list
*
*/
class Firewall : public Storage

View file

@ -10,10 +10,23 @@
namespace fw
{
/**
* @brief The Storage will handle Firewall rules in EEPROM
*
*/
class Storage
{
public:
/**
* @brief Construct a new Storage object
*
*/
Storage();
/**
* @brief Destroy the Storage object
*
*/
~Storage();
private:
@ -29,10 +42,40 @@ namespace fw
#endif
protected:
/**
* @brief retrieve the current amount of Firewall rules in the Storage
*
* @return uint8_t
*/
uint8_t retrieve_amount_of_rules();
/**
* @brief store a new amount of Firewall rules in the Storage
*
* @param new_amount
*/
void store_amount_of_rules(const uint8_t new_amount);
/**
* @brief retrieve a Firewall rule from Storage
*
* @param key
* @return firewall_rule_t*
*/
firewall_rule_t *retrieve_firewall_rule(const uint8_t key);
/**
* @brief store all Firewall rules in Storage
*
* @param rule_head
*/
void store_all_firewall_rules(firewall_rule_t *rule_head);
/**
* @brief store Firewall rule in Storage
*
* @param rule_ptr
*/
void store_firewall_rule(firewall_rule_t *rule_ptr);
};
}

View file

@ -6,12 +6,21 @@
namespace fw
{
static const uint8_t IPV4ADDRESS_LENGTH = 16;
static const uint8_t CREDENTIALS_LENGTH = 32;
static const uint8_t firewall_fields_amount = 6;
const char firewall_fields[firewall_fields_amount][10] = {"key", "ip", "port_from", "port_to", "protocol", "target"};
/*! \enum
*/
typedef enum firewall_targets : uint8_t
{
TARGET_DROP = 1,
TARGET_ACCEPT = 2,
} firewall_target_t;
/*! \enum
*/
typedef enum firewall_protocols : uint8_t
{
PROTOCOL_TCP = 6,
@ -19,6 +28,8 @@ namespace fw
PROTOCOL_ALL = 255,
} firewall_protocol_t;
/*! \enum
*/
typedef enum ok : uint8_t
{
SUCCESS = 0,
@ -26,17 +37,15 @@ namespace fw
NO_ACTION = 2,
} ok_t;
/*! \enum
*/
typedef enum auth : uint8_t
{
AUTHENTICATED = 0,
DENIED = 1,
} auth_t;
static const uint8_t IPV4ADDRESS_LENGTH = 16;
/**
* @brief the typedef to describe a Firewall rule
*
/*! \struct
*/
typedef struct firewall_rules
{
@ -49,9 +58,7 @@ namespace fw
struct firewall_rules *next;
} firewall_rule_t;
/**
* @brief the typedef to describe a network packet
*
/*! \struct
*/
typedef struct my_packet
{
@ -60,8 +67,8 @@ namespace fw
uint16_t port;
} my_packet_t;
static const uint8_t firewall_fields_amount = 6;
const char firewall_fields[firewall_fields_amount][10] = {"key", "ip", "port_from", "port_to", "protocol", "target"};
/*! \enum
*/
typedef enum firewall_fields : uint8_t
{
KEY,
@ -72,11 +79,7 @@ namespace fw
TARGET,
} firewall_fields_t;
static const uint8_t CREDENTIALS_LENGTH = 32;
/**
* @brief the typedef to describe credentials of the API
*
/*! \struct
*/
typedef struct credentials
{
@ -84,9 +87,7 @@ namespace fw
char username[CREDENTIALS_LENGTH];
} credential_t;
/**
* @brief the typedef to describe an API endpoint
*
/*! \struct
*/
typedef struct api_endpoints
{