ORE Studio 0.0.4
Loading...
Searching...
No Matches
Functions
ores::platform::net Namespace Reference

Network utilities and information. More...

Functions

std::string get_hostname ()
 Gets the hostname of the current machine.
 
std::optional< std::string > get_primary_mac_address ()
 Gets the primary MAC address of the machine.
 
std::optional< std::string > get_primary_mac_address_bytes ()
 Gets the primary MAC address as raw bytes.
 
std::string derive_machine_id ()
 Derives a stable machine identifier from hardware properties.
 
std::uint16_t derive_machine_id_hash ()
 Derives a 16-bit machine identifier suitable for embedding in IDs.
 
std::int64_t get_process_id ()
 Gets the current process ID.
 

Detailed Description

Network utilities and information.

Contains platform-agnostic network utilities including network interface information and hostname resolution.

Function Documentation

◆ get_hostname()

std::string get_hostname ( )

Gets the hostname of the current machine.

Returns
The hostname, or "unknown" if it cannot be determined.
Here is the caller graph for this function:

◆ get_primary_mac_address()

std::optional< std::string > get_primary_mac_address ( )

Gets the primary MAC address of the machine.

Returns the lexicographically first non-loopback MAC address to ensure stable ordering across reboots. The MAC address is formatted as a colon-separated hex string (e.g., "00:1a:2b:3c:4d:5e").

Returns
The MAC address if available, empty optional otherwise.
Here is the caller graph for this function:

◆ get_primary_mac_address_bytes()

std::optional< std::string > get_primary_mac_address_bytes ( )

Gets the primary MAC address as raw bytes.

Returns the lexicographically first non-loopback MAC address as a 6-byte string. This is useful for hashing without formatting overhead.

Returns
The MAC address bytes if available, empty optional otherwise.
Here is the caller graph for this function:

◆ derive_machine_id()

std::string derive_machine_id ( )

Derives a stable machine identifier from hardware properties.

Combines hostname and MAC address to create a unique identifier that remains stable across reboots. The result is a hex-encoded hash.

Returns
A hex string representing the machine ID.

◆ derive_machine_id_hash()

std::uint16_t derive_machine_id_hash ( )

Derives a 16-bit machine identifier suitable for embedding in IDs.

Returns
A 16-bit hash of the machine identity.

◆ get_process_id()

std::int64_t get_process_id ( )

Gets the current process ID.

Returns
The process ID, or 0 if it cannot be determined.