RMM API 2.0.0
Loading...
Searching...
No Matches
RMMUDPCore Class Reference

Class to manage UDP core functionality including ARP configuration and data handling. More...

#include <RMMUDPCore.h>

Collaboration diagram for RMMUDPCore:

Public Member Functions

 RMMUDPCore (RMMRegisterAccess &RMMRegs)
 Constructor for the RMMUDPCore class.
 
void configUDPCore ()
 Configure the UDP Core with the configuration storaged into udpCore struct.
 
rmmStatus arpStatus (const int index, std::unordered_map< std::string, int > *status)
 Get the ARP status.
 
rmmStatus getUdpCoreData (UDPCoreData *result)
 Retrieve the UDP core configuration data.
 
void processMap ()
 Initializes mutexes for each known UDP Core register.
 
bool fillUDPMutexes (uint8_t index)
 Initializes mutexes for each UDP core register related to LUT.
 
void fillUdpCoreFromJson (json &udpCoreCfg)
 Fills the UDP core data from a JSON configuration.
 

Public Attributes

RMMLog rmmLog
 Log handler for RMMUDPCore messages.
 

Detailed Description

Class to manage UDP core functionality including ARP configuration and data handling.

This class provides methods to configure and interact with the UDP core, manage ARP entries, and retrieve core data. It includes functions for reading and writing UDP core registers, as well as setting ARP timeouts and managing the ARP lookup table (LUT).

Constructor & Destructor Documentation

◆ RMMUDPCore()

RMMUDPCore::RMMUDPCore ( RMMRegisterAccess & RMMRegs)

Constructor for the RMMUDPCore class.

Parameters
[in]RMMRegsReference to an RMMRegisterAccess object for register access.

Member Function Documentation

◆ arpStatus()

rmmStatus RMMUDPCore::arpStatus ( const int index,
std::unordered_map< std::string, int > * status )

Get the ARP status.

Parameters
indexThe index of the ARP status entry.
statusPointer to std::unordered_map<std::string, int> to be populated with status info.
Returns
rmmStatus success

◆ fillUdpCoreFromJson()

void RMMUDPCore::fillUdpCoreFromJson ( json & udpCoreCfg)

Fills the UDP core data from a JSON configuration.

This method parses the provided JSON configuration (udpCoreCfg) and populates the RMMUDPCore's udpCore member with values for source MAC, source IP, source port, ARP refresh timeout, and ARP reply timeout. It also fills the destination lookup table (LUT) for ARP entries if the "lut" section is present in the configuration.

Parameters
udpCoreCfgA JSON object containing the UDP core configuration.

The expected structure of udpCoreCfg includes:

  • src_mac: Source MAC address (string).
  • src_ip: Source IP address (string).
  • src_port: Source port (integer).
  • arp_refresh_timeout: ARP refresh timeout value (float).
  • arp_reply_timeout: ARP reply timeout value (float).
  • lut: Object representing the lookup table (LUT) for ARP entries. Each entry in lut should include:
    • dst_ip: Destination IP address (string).
    • dst_port: Destination port (integer).
    • mac_str: Optional; if missing, ARP will be used to obtain the destination MAC address.

◆ fillUDPMutexes()

bool RMMUDPCore::fillUDPMutexes ( uint8_t index)

Initializes mutexes for each UDP core register related to LUT.

Returns
true if success in initializing all. false if not.

◆ getUdpCoreData()

rmmStatus RMMUDPCore::getUdpCoreData ( UDPCoreData * result)

Retrieve the UDP core configuration data.

This function reads the hardware registers to populate a UDPCoreData structure with the current configuration of the UDP core.

Parameters
[out]resultPointer to a UDPCoreData structure to store the retrieved data.
Returns
rmmStatus.

The documentation for this class was generated from the following files: