MPDC: Multi Party Domain Cryptosystem 1.0.0.0b (A0)
MPDC Interior protocol
trust.h File Reference

The MPDC trust functions. More...

#include "common.h"
#include "mpdc.h"
#include "../../QSC/QSC/intutils.h"
#include "../../QSC/QSC/memutils.h"

Go to the source code of this file.

Data Structures

struct  mpdc_device_trust
 The MPDC topology device trust structure. More...
 

Macros

#define MPDC_TRUST_SIZE   (sizeof(mpdc_device_trust))
 The size of a device trust structure.
 

Typedefs

typedef MPDC_EXPORT_API struct mpdc_device_trust mpdc_device_trust
 

Functions

MPDC_EXPORT_API void mpdc_trust_clear (mpdc_device_trust *device)
 Remove a device trust from the database.
 
MPDC_EXPORT_API void mpdc_trust_deserialize (mpdc_device_trust *device, const uint8_t *input)
 Deserialize a device trust structure.
 
MPDC_EXPORT_API void mpdc_trust_serialize (uint8_t *output, size_t outlen, const mpdc_device_trust *device)
 Serialize a device trust structure.
 

Detailed Description

The MPDC trust functions.

Detailed Description: This header file declares the functions and data structures used to manage device trust within the MPDC system. Trust data is used to store network-related information (address, domain, name) along with associated metrics such as trust value, bandwidth, and flags indicating IPv6 support and local network status. The functions provided herein allow for the serialization and deserialization of trust data, as well as clearing a trust record.

Macro Definition Documentation

◆ MPDC_TRUST_SIZE

#define MPDC_TRUST_SIZE   (sizeof(mpdc_device_trust))

The size of a device trust structure.

This macro returns the size in bytes of the MPDC device trust structure.

Function Documentation

◆ mpdc_trust_clear()

MPDC_EXPORT_API void mpdc_trust_clear ( mpdc_device_trust * device)

Remove a device trust from the database.

This function clears all trust data in a given device trust structure.

Parameters
deviceA pointer to the device trust structure to clear.

◆ mpdc_trust_deserialize()

MPDC_EXPORT_API void mpdc_trust_deserialize ( mpdc_device_trust * device,
const uint8_t * input )

Deserialize a device trust structure.

This function converts a serialized device trust byte array into a mpdc_device_trust structure.

Parameters
deviceA pointer to the output device trust structure.
input[const] The serialized trust structure data.

◆ mpdc_trust_serialize()

MPDC_EXPORT_API void mpdc_trust_serialize ( uint8_t * output,
size_t outlen,
const mpdc_device_trust * device )

Serialize a device trust structure.

This function serializes a mpdc_device_trust structure into a byte array.

Parameters
outputThe output buffer to receive the serialized data.
outlenThe length of the output buffer.
device[const] A pointer to the device trust structure to serialize.