diff --git a/agent/src/beerocks/slave/agent_db.cpp b/agent/src/beerocks/slave/agent_db.cpp index c8341c9b2a..3e0104258a 100644 --- a/agent/src/beerocks/slave/agent_db.cpp +++ b/agent/src/beerocks/slave/agent_db.cpp @@ -114,4 +114,17 @@ bool AgentDB::get_mac_by_ssid(const sMacAddr &ruid, const std::string &ssid, sMa return false; } +bool AgentDB::get_bsta_mac_by_ruid(const sMacAddr &ruid, sMacAddr &value) +{ + value = net::network_utils::ZERO_MAC; + auto radio = get_radio_by_mac(ruid, AgentDB::eMacType::RADIO); + if (!radio) { + LOG(ERROR) << "No radio with ruid '" << ruid << "' found!"; + return false; + } + + value = radio->back.iface_mac; + return true; +} + } // namespace beerocks diff --git a/agent/src/beerocks/slave/agent_db.h b/agent/src/beerocks/slave/agent_db.h index 30893c248d..356e1fee1a 100644 --- a/agent/src/beerocks/slave/agent_db.h +++ b/agent/src/beerocks/slave/agent_db.h @@ -223,6 +223,15 @@ class AgentDB { */ bool get_mac_by_ssid(const sMacAddr &ruid, const std::string &ssid, sMacAddr &value); + /** + * @brief Get the MAC address of the backhaul sta based on the ruid. + * + * @param[in] ruid The Radio UID. + * @param[out] value The mac address of the backaul sta if found, else an invalid MAC (zero). + * @return true if the MAC address was found, false otherwise. + */ + bool get_bsta_mac_by_ruid(const sMacAddr &ruid, sMacAddr &value); + /** * @brief 1905.1 Neighbor device information * Information gathered from a neighbor device upon reception of a Topology Discovery message. diff --git a/agent/src/beerocks/slave/agent_ucc_listener.cpp b/agent/src/beerocks/slave/agent_ucc_listener.cpp index 6dbc52a352..229657445d 100644 --- a/agent/src/beerocks/slave/agent_ucc_listener.cpp +++ b/agent/src/beerocks/slave/agent_ucc_listener.cpp @@ -109,9 +109,13 @@ bool agent_ucc_listener::handle_dev_get_param(std::unordered_mapget_bsta_mac_by_ruid(ruid, mac_value)) { + LOG(ERROR) << " failed to find the backhaul sta MAC address for ruid '" << ruid_str; + value = "backhaul sta MAC not found for ruid '" + ruid_str + "'"; + return false; + } + value = tlvf::mac_to_string(mac_value); return true; } auto ssid = params["ssid"]; diff --git a/ci/easymesh_cert_version b/ci/easymesh_cert_version index a90fa08b78..ab20f5f387 100644 --- a/ci/easymesh_cert_version +++ b/ci/easymesh_cert_version @@ -1 +1 @@ -399a33ca960cece195c3605d08951b8766e6c90d +62af397ceba0f0c4d2e3ca19c66ca0a5d4ed1330