UDIF: Universal Digital Identification Framework 1.0.0.0a (A1)
A quantum-secure cryptographic identification
topology.h File Reference

The UDIF topology functions. More...

#include "udif.h"
#include "certificate.h"
#include "ipinfo.h"
#include "list.h"
#include "timestamp.h"

Go to the source code of this file.

Data Structures

struct  udif_topology_node_state
 The UDIF topology node structure. More...
struct  udif_topology_list_state
 The UDIF topology list structure. More...

Macros

#define UDIF_TOPOLOGY_NODE_ENCODED_SIZE
 The size of an encoded node string.
#define UDIF_TOPOLOGY_NODE_MINIMUM_ISSUER_SIZE   3U
 The minimum size of an issuer string.
#define UDIF_TOPOLOGY_NODE_NOT_FOUND   -1
 The value returned when a node is not found.
#define UDIF_NETWORK_TOPOLOGY_MAX_SIZE   1024U
 The maximum size of the topology.
#define UDIF_NETWORK_TOPOLOGY_NODE_SIZE
 The size in bytes of a serialized topological node.

Typedefs

typedef UDIF_EXPORT_API struct udif_topology_node_state udif_topology_node_state
typedef UDIF_EXPORT_API struct udif_topology_list_state udif_topology_list_state

Functions

UDIF_EXPORT_API void udif_topology_address_from_issuer (char *address, const char *issuer, const udif_topology_list_state *list)
 Returns an IP address from an issuer string.
UDIF_EXPORT_API void udif_topology_node_add_alias (udif_topology_node_state *node, const char *alias)
 Add an alias string to an issuer path.
UDIF_EXPORT_API bool udif_topology_nodes_are_equal (const udif_topology_node_state *a, const udif_topology_node_state *b)
 Compare two topological nodes for equality.
UDIF_EXPORT_API uint8_t * udif_topology_child_add_empty_node (udif_topology_list_state *list)
 Get an empty node pointer from the topology list.
UDIF_EXPORT_API void udif_topology_child_add_item (udif_topology_list_state *list, const udif_topology_node_state *node)
 Add a node to the topology list.
UDIF_EXPORT_API bool udif_topology_canonical_to_issuer_name (char *issuer, size_t isslen, const char *domain, const char *cname)
 Translate a canonical name to an issuer name.
UDIF_EXPORT_API bool udif_topology_issuer_to_canonical_name (char *cname, size_t namelen, const char *issuer)
 Translate an issuer name to a canonical name.
UDIF_EXPORT_API void udif_topology_child_register (udif_topology_list_state *list, const udif_child_certificate *ccert, const char *address)
 Register a child to a topology list.
UDIF_EXPORT_API void udif_topology_list_clone (const udif_topology_list_state *tlist, udif_topology_list_state *tcopy)
 Clone a topology list.
UDIF_EXPORT_API void udif_topology_list_deserialize (udif_topology_list_state *list, const uint8_t *input, size_t inplen)
 Deserialize a topology list.
UDIF_EXPORT_API void udif_topology_list_dispose (udif_topology_list_state *list)
 Dispose of the topology list and release memory.
UDIF_EXPORT_API void udif_topology_list_initialize (udif_topology_list_state *list)
 Initialize the topology list.
UDIF_EXPORT_API bool udif_topology_list_item (const udif_topology_list_state *list, udif_topology_node_state *node, size_t index)
 Get a node from the index.
UDIF_EXPORT_API size_t udif_topology_list_remove_duplicates (udif_topology_list_state *list)
 Remove duplicate nodes from the topology.
UDIF_EXPORT_API size_t udif_topology_list_server_count (const udif_topology_list_state *list, udif_network_designations ntype)
 Get the count of a type of node in the database.
UDIF_EXPORT_API size_t udif_topology_list_serialize (uint8_t *output, const udif_topology_list_state *list)
 Serialize a topology list.
UDIF_EXPORT_API size_t udif_topology_list_size (const udif_topology_list_state *list)
 Get the byte size of the serialized list.
UDIF_EXPORT_API size_t udif_topology_list_to_string (const udif_topology_list_state *list, char *output, size_t outlen)
 Convert the topology list to a printable string.
UDIF_EXPORT_API size_t udif_topology_list_update_pack (uint8_t *output, const udif_topology_list_state *list, udif_network_designations ntype)
 Pack a node update set to an array.
UDIF_EXPORT_API size_t udif_topology_list_update_unpack (udif_topology_list_state *list, const uint8_t *input, size_t inplen)
 Unpack a node update set to the topology list.
UDIF_EXPORT_API size_t udif_topology_ordered_server_list (udif_topology_list_state *olist, const udif_topology_list_state *tlist, udif_network_designations ntype)
 Return a list of nodes of a type, sorted by serial number.
UDIF_EXPORT_API void udif_topology_node_clear (udif_topology_node_state *node)
 Erase a node structure.
UDIF_EXPORT_API void udif_topology_node_copy (const udif_topology_node_state *source, udif_topology_node_state *destination)
 Copy a source node to a destination node structure.
UDIF_EXPORT_API void udif_topology_node_deserialize (udif_topology_node_state *node, const uint8_t *input)
 Deserialize a topological node.
UDIF_EXPORT_API size_t udif_topology_node_encode (const udif_topology_node_state *node, char output[UDIF_TOPOLOGY_NODE_ENCODED_SIZE])
 Encode a topological node into a printable string.
UDIF_EXPORT_API bool udif_topology_node_exists (const udif_topology_list_state *list, const uint8_t *serial)
 Queries on the serial number if the node is in the database.
UDIF_EXPORT_API int32_t udif_topology_node_get_index (const udif_topology_list_state *list, const uint8_t *serial)
 Find the index number of a node in an array.
UDIF_EXPORT_API bool udif_topology_node_find (const udif_topology_list_state *list, udif_topology_node_state *node, const uint8_t *serial)
 Return the node pointer in the list matching the serial number.
UDIF_EXPORT_API bool udif_topology_node_find_address (const udif_topology_list_state *list, udif_topology_node_state *node, const char *address)
 Return the node pointer in the list matching the address string.
UDIF_EXPORT_API bool udif_topology_node_find_alias (const udif_topology_list_state *list, udif_topology_node_state *node, const char *alias)
 Return the node pointer in the list matching the alias string.
UDIF_EXPORT_API bool udif_topology_node_find_ads (const udif_topology_list_state *list, udif_topology_node_state *node)
 Return the ADC node from the list.
UDIF_EXPORT_API bool udif_topology_node_find_issuer (const udif_topology_list_state *list, udif_topology_node_state *node, const char *issuer)
 Return the node pointer in the list matching the name string.
UDIF_EXPORT_API bool udif_topology_node_find_root (const udif_topology_list_state *list, udif_topology_node_state *node)
 Return the ARS server node from the list.
UDIF_EXPORT_API void udif_topology_node_remove (udif_topology_list_state *list, const uint8_t *serial)
 Find and remove a node from the topology.
UDIF_EXPORT_API void udif_topology_node_remove_duplicate (udif_topology_list_state *list, const char *issuer)
 Remove a node from the topology with the same issuer name.
UDIF_EXPORT_API bool udif_topology_node_verify_ads (const udif_topology_list_state *list, const udif_child_certificate *ccert)
 Verify that the ADC certificate matches the hash stored in the topology.
UDIF_EXPORT_API bool udif_topology_node_verify_issuer (const udif_topology_list_state *list, const udif_child_certificate *ccert, const char *issuer)
 Verify that an issuing node's certificate matches the hash stored in the topology.
UDIF_EXPORT_API bool udif_topology_node_verify_root (const udif_topology_list_state *list, const udif_root_certificate *rcert)
 Verify that the root certificate matches the hash stored in the topology.
UDIF_EXPORT_API size_t udif_topology_node_serialize (uint8_t *output, const udif_topology_node_state *node)
 Serialize a topological node structure, including the mfk.
UDIF_EXPORT_API void udif_topology_root_register (udif_topology_list_state *list, const udif_root_certificate *rcert, const char *address)
 Register a root to a topology list.
UDIF_EXPORT_API void udif_topology_from_file (const char *fpath, udif_topology_list_state *list)
 Copy a topology list from a file.
UDIF_EXPORT_API void udif_topology_to_file (const udif_topology_list_state *list, const char *fpath)
 Copy a topology list to a file.

Detailed Description

The UDIF topology functions.

Detailed File Description: This header file defines the functions, macros, structures, and enumerations used by UDIF for managing the network topology. The topology functions handle the serialization and deserialization of network node information, conversion between canonical and issuer names, registration and removal of nodes from the topology list, and various lookup and verification operations.

Notes: The issuer parameter composition; network/host.ctype:alias The first segment of an issuer string consists of the network path, which is the network name, appended with a forward slash (network/host). A network name can contain subdomains, each ending in a forward slash, ex. domain/subdomain/host. The network portion of the issuer string represents the network and host names as a path string. The second segment is the host name, and an optional extension preceded by a period (host.type), ex. xyz/mas.ctype. There are three types of devices; root, intra-domain, and inter-domain, which correspond to UDIF device types of [root server], [ads, aps, mas, client], and [idg] inter-domain gateways. The third segment of the issuer string is the alias (path:alias), a readable domain alias name, always preceded by a colon. The network name and any subdomains are always preceded by a single forward slash (domain/subdomain). ex. network/sub-network/host. The host name is the network device name, and it is terminated with a colon (path:alias). The alias is a name that represents a compact path or string representation of the network\node path. Example: xyz/mas-1:www.xyz.com The entire issuer string cannot exceed 256 bytes. Periods, dashes, and most other symbols are legal with the exception of the reserved symbols: period, forward slash, and colon (. / :), as well as illegal symbols such as ! @ $ % ^ & * ( ) { } | ; " '. Name to address lookups can be performed by the ADC that can translate a network\node path, or an alias name, to an IP address (IPv4 or IPv6). Inverse lookups can also be performed, which return the issuer string from an IP address. Issuer network paths are mirrored in the storage subsystem and used as storage path substrings (e.g., C:\UDIF\xyz\mas), enabling file system certificate retrieval based on the issuer's topological path.

Macro Definition Documentation

◆ UDIF_NETWORK_TOPOLOGY_NODE_SIZE

#define UDIF_NETWORK_TOPOLOGY_NODE_SIZE
Value:
#define UDIF_CERTIFICATE_HASH_SIZE
The size of the certificate hash in bytes.
Definition udif.h:892
#define UDIF_CERTIFICATE_ADDRESS_SIZE
The maximum IP address length.
Definition udif.h:862
#define UDIF_CERTIFICATE_SERIAL_SIZE
The certificate serial number field length.
Definition udif.h:923
#define UDIF_CERTIFICATE_DESIGNATION_SIZE
The size of the child certificate designation field.
Definition udif.h:880
#define UDIF_CERTIFICATE_EXPIRATION_SIZE
The certificate expiration date length.
Definition udif.h:886
#define UDIF_CERTIFICATE_ISSUER_SIZE
The maximum certificate issuer string length. The last character must be a string terminator.
Definition udif.h:899

The size in bytes of a serialized topological node.

◆ UDIF_TOPOLOGY_NODE_ENCODED_SIZE

#define UDIF_TOPOLOGY_NODE_ENCODED_SIZE
Value:
(UDIF_CHILD_CERTIFICATE_ISSUER_PREFIX_SIZE + UDIF_CERTIFICATE_ISSUER_SIZE + UDIF_CERTIFICATE_SEPERATOR_SIZE + \
UDIF_CHILD_CERTIFICATE_ADDRESS_PREFIX_SIZE + QSC_IPINFO_IPV4_STRNLEN + UDIF_CERTIFICATE_SEPERATOR_SIZE + \
UDIF_ROOT_CERTIFICATE_HASH_PREFIX_SIZE + (UDIF_CERTIFICATE_HASH_SIZE * 2U) + UDIF_CERTIFICATE_SEPERATOR_SIZE + \
UDIF_CHILD_CERTIFICATE_SERIAL_PREFIX_SIZE + (UDIF_CERTIFICATE_SERIAL_SIZE * 2U) + UDIF_CERTIFICATE_SEPERATOR_SIZE + \
UDIF_CHILD_CERTIFICATE_DESIGNATION_PREFIX_SIZE + UDIF_NETWORK_DESIGNATION_SIZE + UDIF_CERTIFICATE_SEPERATOR_SIZE + \
UDIF_CHILD_CERTIFICATE_VALID_FROM_PREFIX_SIZE + QSC_TIMESTAMP_STRING_SIZE + UDIF_CERTIFICATE_SEPERATOR_SIZE + \
UDIF_CHILD_CERTIFICATE_EXPIRATION_TO_PREFIX_SIZE + QSC_TIMESTAMP_STRING_SIZE + UDIF_CERTIFICATE_SEPERATOR_SIZE)

The size of an encoded node string.

This macro defines the size of a printable, encoded node string. Its value depends on whether the network is IPv6 or IPv4.

Function Documentation

◆ udif_topology_address_from_issuer()

UDIF_EXPORT_API void udif_topology_address_from_issuer ( char * address,
const char * issuer,
const udif_topology_list_state * list )

Returns an IP address from an issuer string.

This function extracts and returns the network address associated with a given issuer string, using the topology list to resolve the address.

Parameters
addressThe output buffer to receive the node's network address (max UDIF_CERTIFICATE_ADDRESS_SIZE).
issuer[const] The issuer string.
list[const] A pointer to the topology list.

◆ udif_topology_canonical_to_issuer_name()

UDIF_EXPORT_API bool udif_topology_canonical_to_issuer_name ( char * issuer,
size_t isslen,
const char * domain,
const char * cname )

Translate a canonical name to an issuer name.

This function converts a device canonical name into its corresponding issuer name based on the domain.

Parameters
issuerThe output issuer string.
isslenThe length of the issuer buffer.
domainThe domain name.
cnameThe input device canonical name.
Returns
Returns false if the conversion fails.

◆ udif_topology_child_add_empty_node()

UDIF_EXPORT_API uint8_t * udif_topology_child_add_empty_node ( udif_topology_list_state * list)

Get an empty node pointer from the topology list.

This function returns a pointer to an empty node entry in the topology list.

Note
This function is not thread safe.
Parameters
listA pointer to the topology list.
Returns
Returns a pointer to the empty node entry or NULL if none is available.

◆ udif_topology_child_add_item()

UDIF_EXPORT_API void udif_topology_child_add_item ( udif_topology_list_state * list,
const udif_topology_node_state * node )

Add a node to the topology list.

This function adds a new node item to the topology list.

Parameters
listA pointer to the topology list.
node[const] The node to add.

◆ udif_topology_child_register()

UDIF_EXPORT_API void udif_topology_child_register ( udif_topology_list_state * list,
const udif_child_certificate * ccert,
const char * address )

Register a child to a topology list.

This function registers a new child node in the topology list based on its certificate.

Parameters
listA pointer to the topology list.
ccert[const] The node's child certificate.
address[const] The node's network address (max UDIF_CERTIFICATE_ADDRESS_SIZE).

◆ udif_topology_from_file()

UDIF_EXPORT_API void udif_topology_from_file ( const char * fpath,
udif_topology_list_state * list )

Copy a topology list from a file.

This function loads a topology list from a file.

Parameters
fpath[const] The full path to the topology list file.
listA pointer to the topology list state to populate.

◆ udif_topology_issuer_to_canonical_name()

UDIF_EXPORT_API bool udif_topology_issuer_to_canonical_name ( char * cname,
size_t namelen,
const char * issuer )

Translate an issuer name to a canonical name.

This function converts an issuer name back into its canonical form.

Parameters
cnameThe output canonical name.
namelenThe length of the canonical name buffer.
issuerThe input issuer name string.
Returns
Returns false if the conversion fails.

◆ udif_topology_list_clone()

UDIF_EXPORT_API void udif_topology_list_clone ( const udif_topology_list_state * tlist,
udif_topology_list_state * tcopy )

Clone a topology list.

This function creates a clone of the given topology list.

Parameters
tlist[const] A pointer to the source topology list.
tcopyA pointer to the destination topology list.

◆ udif_topology_list_deserialize()

UDIF_EXPORT_API void udif_topology_list_deserialize ( udif_topology_list_state * list,
const uint8_t * input,
size_t inplen )

Deserialize a topology list.

This function deserializes a topology list from a given input array.

Parameters
listA pointer to the topology list state to populate.
input[const] The serialized topology array.
inplenThe size of the input array.

◆ udif_topology_list_dispose()

UDIF_EXPORT_API void udif_topology_list_dispose ( udif_topology_list_state * list)

Dispose of the topology list and release memory.

This function releases all memory allocated for the topology list.

Parameters
listA pointer to the topology list state.

◆ udif_topology_list_initialize()

UDIF_EXPORT_API void udif_topology_list_initialize ( udif_topology_list_state * list)

Initialize the topology list.

This function initializes the topology list state.

Parameters
listThe topology list state to initialize.

◆ udif_topology_list_item()

UDIF_EXPORT_API bool udif_topology_list_item ( const udif_topology_list_state * list,
udif_topology_node_state * node,
size_t index )

Get a node from the index.

This function retrieves the node at the specified index in the topology list.

Parameters
listThe topology list state.
nodeA pointer to the node structure to populate.
indexThe index of the node.
Returns
Returns false if the node was not found.

◆ udif_topology_list_remove_duplicates()

UDIF_EXPORT_API size_t udif_topology_list_remove_duplicates ( udif_topology_list_state * list)

Remove duplicate nodes from the topology.

This function removes duplicate entries from the topology list.

Parameters
listThe topology list state.
Returns
Returns the number of items remaining in the list.

◆ udif_topology_list_serialize()

UDIF_EXPORT_API size_t udif_topology_list_serialize ( uint8_t * output,
const udif_topology_list_state * list )

Serialize a topology list.

This function serializes the topology list into a byte array.

Parameters
outputThe output buffer for the serialized topology.
list[const] The topology list state.
Returns
Returns the size of the serialized topology.

◆ udif_topology_list_server_count()

UDIF_EXPORT_API size_t udif_topology_list_server_count ( const udif_topology_list_state * list,
udif_network_designations ntype )

Get the count of a type of node in the database.

This function counts the number of nodes of a specific type in the topology list.

Parameters
list[const] The topology list state.
ntypeThe type of node entry to count.
Returns
Returns the number of nodes matching the given type.

◆ udif_topology_list_size()

UDIF_EXPORT_API size_t udif_topology_list_size ( const udif_topology_list_state * list)

Get the byte size of the serialized list.

This function returns the size in bytes of the serialized topology list.

Parameters
list[const] The topology list state.
Returns
Returns the byte size of the serialized topology.

◆ udif_topology_list_to_string()

UDIF_EXPORT_API size_t udif_topology_list_to_string ( const udif_topology_list_state * list,
char * output,
size_t outlen )

Convert the topology list to a printable string.

This function converts the topology list into a human?readable string.

Parameters
list[const] The topology list state.
outputThe output string buffer.
outlenThe length of the output buffer.
Returns
Returns the size of the resulting string.

◆ udif_topology_list_update_pack()

UDIF_EXPORT_API size_t udif_topology_list_update_pack ( uint8_t * output,
const udif_topology_list_state * list,
udif_network_designations ntype )

Pack a node update set to an array.

This function serializes a subset of nodes from the topology list (of a given type) into an array.

Parameters
outputThe output buffer for the serialized node update set.
list[const] The topology list state.
ntypeThe type of node entry to pack.
Returns
Returns the size of the serialized node update set.

◆ udif_topology_list_update_unpack()

UDIF_EXPORT_API size_t udif_topology_list_update_unpack ( udif_topology_list_state * list,
const uint8_t * input,
size_t inplen )

Unpack a node update set to the topology list.

This function deserializes an update set and adds the nodes to the topology list.

Parameters
listThe topology list state to update.
inputThe input serialized node update set.
inplenThe length of the input array.
Returns
Returns the number of bytes processed.

◆ udif_topology_node_add_alias()

UDIF_EXPORT_API void udif_topology_node_add_alias ( udif_topology_node_state * node,
const char * alias )

Add an alias string to an issuer path.

This function appends an alias to the issuer string of a node.

Parameters
nodeThe network node to update.
alias[const] The host alias to add.

◆ udif_topology_node_clear()

UDIF_EXPORT_API void udif_topology_node_clear ( udif_topology_node_state * node)

Erase a node structure.

This function clears all data in a topology node structure.

Parameters
nodeA pointer to the topology node structure to erase.

◆ udif_topology_node_copy()

UDIF_EXPORT_API void udif_topology_node_copy ( const udif_topology_node_state * source,
udif_topology_node_state * destination )

Copy a source node to a destination node structure.

This function copies the contents of one topology node structure to another.

Parameters
source[const] A pointer to the source node structure.
destinationA pointer to the destination node structure.

◆ udif_topology_node_deserialize()

UDIF_EXPORT_API void udif_topology_node_deserialize ( udif_topology_node_state * node,
const uint8_t * input )

Deserialize a topological node.

This function converts a serialized topology node array into a topology node structure.

Parameters
nodeA pointer to the topology node structure to populate.
input[const] The input serialized topology node data.

◆ udif_topology_node_encode()

UDIF_EXPORT_API size_t udif_topology_node_encode ( const udif_topology_node_state * node,
char output[UDIF_TOPOLOGY_NODE_ENCODED_SIZE] )

Encode a topological node into a printable string.

This function encodes a topology node into a human?readable string format.

Parameters
nodeA pointer to the topology node structure.
outputThe output buffer for the encoded node string.
Returns
Returns the size of the encoded node string.

◆ udif_topology_node_exists()

UDIF_EXPORT_API bool udif_topology_node_exists ( const udif_topology_list_state * list,
const uint8_t * serial )

Queries on the serial number if the node is in the database.

This function checks whether a node with the specified serial number exists in the topology list.

Parameters
list[const] The topology list state.
serialThe serial number to search for.
Returns
Returns true if the node exists; false otherwise.

◆ udif_topology_node_find()

UDIF_EXPORT_API bool udif_topology_node_find ( const udif_topology_list_state * list,
udif_topology_node_state * node,
const uint8_t * serial )

Return the node pointer in the list matching the serial number.

This function finds a node in the topology list that matches the given serial number.

Parameters
list[const] The topology list state.
nodeA pointer to the destination node structure to populate.
serial[const] The certificate serial number to search for.
Returns
Returns true if the node was found; false otherwise.

◆ udif_topology_node_find_address()

UDIF_EXPORT_API bool udif_topology_node_find_address ( const udif_topology_list_state * list,
udif_topology_node_state * node,
const char * address )

Return the node pointer in the list matching the address string.

This function searches the topology list for a node that matches the given network address.

Parameters
list[const] The topology list state.
nodeA pointer to the destination node structure.
address[const] The network address to search for.
Returns
Returns true if the node was found; false otherwise.

◆ udif_topology_node_find_ads()

UDIF_EXPORT_API bool udif_topology_node_find_ads ( const udif_topology_list_state * list,
udif_topology_node_state * node )

Return the ADC node from the list.

This function finds the ADC node in the topology list.

Parameters
list[const] The topology list state.
nodeA pointer to the destination node structure.
Returns
Returns true if the ADC node was found; false otherwise.

◆ udif_topology_node_find_alias()

UDIF_EXPORT_API bool udif_topology_node_find_alias ( const udif_topology_list_state * list,
udif_topology_node_state * node,
const char * alias )

Return the node pointer in the list matching the alias string.

This function searches the topology list for a node that matches the given alias.

Parameters
list[const] The topology list state.
nodeA pointer to the destination node structure.
alias[const] The alias to search for.
Returns
Returns true if the node was found; false otherwise.

◆ udif_topology_node_find_issuer()

UDIF_EXPORT_API bool udif_topology_node_find_issuer ( const udif_topology_list_state * list,
udif_topology_node_state * node,
const char * issuer )

Return the node pointer in the list matching the name string.

This function finds a node in the topology list that matches the given issuer name.

Parameters
list[const] The topology list state.
nodeA pointer to the destination node structure.
issuer[const] The certificate issuer name.
Returns
Returns true if the node was found; false otherwise.

◆ udif_topology_node_find_root()

UDIF_EXPORT_API bool udif_topology_node_find_root ( const udif_topology_list_state * list,
udif_topology_node_state * node )

Return the ARS server node from the list.

This function retrieves the ARS server node from the topology list.

Parameters
list[const] The topology list state.
nodeA pointer to the destination node structure.
Returns
Returns true if the ARS server node was found; false otherwise.

◆ udif_topology_node_get_index()

UDIF_EXPORT_API int32_t udif_topology_node_get_index ( const udif_topology_list_state * list,
const uint8_t * serial )

Find the index number of a node in an array.

This function searches for a node by its serial number and returns its index in the topology list.

Parameters
list[const] The topology list state.
serialThe serial number to search for.
Returns
Returns the index of the node, or UDIF_TOPOLOGY_NODE_NOT_FOUND if not found.

◆ udif_topology_node_remove()

UDIF_EXPORT_API void udif_topology_node_remove ( udif_topology_list_state * list,
const uint8_t * serial )

Find and remove a node from the topology.

This function searches for a node by its serial number and removes it from the topology list.

Parameters
listThe topology list state.
serialThe serial number of the node to remove (UDIF_CERTIFICATE_SERIAL_SIZE bytes).

◆ udif_topology_node_remove_duplicate()

UDIF_EXPORT_API void udif_topology_node_remove_duplicate ( udif_topology_list_state * list,
const char * issuer )

Remove a node from the topology with the same issuer name.

This function removes duplicate nodes from the topology list that have the same issuer name.

Parameters
listThe topology list state.
issuerThe issuer name to match for removal.

◆ udif_topology_node_serialize()

UDIF_EXPORT_API size_t udif_topology_node_serialize ( uint8_t * output,
const udif_topology_node_state * node )

Serialize a topological node structure, including the mfk.

This function serializes the topology node structure into a byte array.

Parameters
outputThe output buffer to receive the serialized node.
node[const] A pointer to the topology node structure.
Returns
Returns the size of the serialized node.

◆ udif_topology_node_verify_ads()

UDIF_EXPORT_API bool udif_topology_node_verify_ads ( const udif_topology_list_state * list,
const udif_child_certificate * ccert )

Verify that the ADC certificate matches the hash stored in the topology.

This function verifies that the ADC certificate in the topology list matches the certificate hash.

Parameters
list[const] The topology list state.
ccert[const] The ADC certificate structure.
Returns
Returns true if the certificate matches the stored hash; false otherwise.

◆ udif_topology_node_verify_issuer()

UDIF_EXPORT_API bool udif_topology_node_verify_issuer ( const udif_topology_list_state * list,
const udif_child_certificate * ccert,
const char * issuer )

Verify that an issuing node's certificate matches the hash stored in the topology.

This function verifies that the certificate for a given issuer matches the stored hash in the topology list.

Parameters
list[const] The topology list state.
ccert[const] The node's certificate structure.
issuer[const] The certificate issuer name.
Returns
Returns true if the certificate is valid and matches; false otherwise.

◆ udif_topology_node_verify_root()

UDIF_EXPORT_API bool udif_topology_node_verify_root ( const udif_topology_list_state * list,
const udif_root_certificate * rcert )

Verify that the root certificate matches the hash stored in the topology.

This function verifies that the root certificate matches the hash stored in the topology list.

Parameters
list[const] The topology list state.
rcert[const] The root certificate structure.
Returns
Returns true if the root certificate is valid; false otherwise.

◆ udif_topology_nodes_are_equal()

UDIF_EXPORT_API bool udif_topology_nodes_are_equal ( const udif_topology_node_state * a,
const udif_topology_node_state * b )

Compare two topological nodes for equality.

This function compares two topology node structures and returns true if they are identical.

Parameters
a[const] The first node.
b[const] The second node.
Returns
Returns true if the nodes are identical; false otherwise.

◆ udif_topology_ordered_server_list()

UDIF_EXPORT_API size_t udif_topology_ordered_server_list ( udif_topology_list_state * olist,
const udif_topology_list_state * tlist,
udif_network_designations ntype )

Return a list of nodes of a type, sorted by serial number.

This function returns a new topology list containing nodes of a specific type, sorted by their serial number.

Note
The caller is responsible for disposing the output list.
Parameters
olistThe sorted output topology list.
tlistThe unsorted input topology list.
ntypeThe type of node to filter and sort.
Returns
Returns the number of nodes in the sorted list.

◆ udif_topology_root_register()

UDIF_EXPORT_API void udif_topology_root_register ( udif_topology_list_state * list,
const udif_root_certificate * rcert,
const char * address )

Register a root to a topology list.

This function registers a root certificate into the topology list.

Parameters
listA pointer to the topology list.
rcert[const] The root certificate.
address[const] The network address of the root.

◆ udif_topology_to_file()

UDIF_EXPORT_API void udif_topology_to_file ( const udif_topology_list_state * list,
const char * fpath )

Copy a topology list to a file.

This function writes the current topology list to a file.

Parameters
list[const] The topology list state.
fpath[const] The destination file path for the topology list.