![]() |
Zero Trust IoT library
|
Logging utility for Zero Trust simulation modules in NS-3. More...
#include <zt-logger.h>
Static Public Member Functions | |
| static void | EnableTimestamps (bool enable) |
| Enables or disables timestamp logging. | |
| static void | Log (const std::string &tag, const std::string &message) |
| Logs a general message with a specified tag. | |
| static void | LogCertIssued (uint32_t nodeId, const std::string &role, time_t expiry) |
| Logs a certificate issuance event. | |
| static void | LogCertValidationResult (uint32_t nodeId, bool valid) |
| Logs the result of certificate validation. | |
| static void | LogCertRevoked (uint32_t nodeId) |
| Logs a certificate revocation event. | |
| static void | LogCertRejected (const std::string &reason) |
| Logs a rejected certificate attempt with a reason. | |
| static void | LogEncryption (const std::string &payload, const std::string &ivHex) |
| Logs an encryption event with payload and IV. | |
| static void | LogDecryption (const std::string &payload) |
| Logs a successful decryption event. | |
| static void | LogDecryptionFailure () |
| Logs a decryption failure event. | |
Static Private Attributes | |
| static bool | timestampsEnabled = true |
| Flag to indicate if timestamps are enabled in logs. | |
Logging utility for Zero Trust simulation modules in NS-3.
Provides logging functions for general events, certificate-related events, and encryption/decryption actions. Supports optional timestamps.
Definition at line 15 of file zt-logger.h.
|
static |
Enables or disables timestamp logging.
Enables or disables timestamps in log messages.
| enable | True to include timestamps in logs, false to omit them. |
| enable | If true, timestamps will be included in logs. |
Definition at line 16 of file zt-logger.cc.
|
static |
Logs a general message with a specified tag.
Logs a message with a given tag and optional timestamp.
| tag | Context label (e.g., "INFO", "ERROR"). |
| message | The message content. |
| tag | A short string indicating the type or source of the message. |
| message | The actual log message content. |
Definition at line 25 of file zt-logger.cc.
|
static |
Logs a certificate issuance event.
Logs the issuance of a certificate.
| nodeId | ID of the node receiving the certificate. |
| role | Assigned role for the node. |
| expiry | Expiry time of the certificate. |
| nodeId | The ID of the node receiving the certificate. |
| role | The assigned role in the certificate. |
| expiry | The expiration time of the certificate. |
Definition at line 46 of file zt-logger.cc.
|
static |
Logs a rejected certificate attempt with a reason.
Logs a rejection reason for a certificate.
| reason | Description of the rejection cause. |
| reason | The explanation for why the certificate was rejected. |
Definition at line 75 of file zt-logger.cc.
|
static |
Logs a certificate revocation event.
Logs the revocation of a certificate.
| nodeId | ID of the node whose certificate was revoked. |
| nodeId | The ID of the node whose certificate was revoked. |
Definition at line 67 of file zt-logger.cc.
|
static |
Logs the result of certificate validation.
Logs the result of a certificate validation attempt.
| nodeId | ID of the node whose certificate was validated. |
| valid | True if the certificate is valid, false otherwise. |
| nodeId | The node whose certificate was validated. |
| valid | True if the certificate is valid, false otherwise. |
Definition at line 58 of file zt-logger.cc.
|
static |
Logs a successful decryption event.
Logs a successful decryption result.
| payload | The decrypted plaintext data. |
| payload | The decrypted plaintext. |
Definition at line 94 of file zt-logger.cc.
|
static |
Logs a decryption failure event.
Logs a failure during decryption due to invalid session or corrupted data.
Definition at line 101 of file zt-logger.cc.
|
static |
Logs an encryption event with payload and IV.
Logs encryption activity with IV and encrypted data.
| payload | The encrypted data. |
| ivHex | Initialization Vector in hex string format. |
| payload | The encrypted data in hex or readable format. |
| ivHex | The IV used during encryption, in hex format. |
Definition at line 86 of file zt-logger.cc.
|
staticprivate |
Flag to indicate if timestamps are enabled in logs.
Static flag to control timestamp display.
Definition at line 76 of file zt-logger.h.