util.hpp (da0b1d4627d7b71fe24e962b383401b4ed63c5c9) util.hpp (1c77602280a0079f998e093a19d9160f60454c6e)
1#pragma once
2
3#include "config.h"
4
5#include "ethernet_interface.hpp"
6#include "types.hpp"
7
8#include <netinet/ether.h>

--- 30 unchanged lines hidden (view full) ---

39ether_addr getfromInventory(sdbusplus::bus::bus& bus,
40 const std::string& intfName);
41
42/** @brief Converts the given mac address into byte form
43 * @param[in] str - The mac address in human readable form
44 * @returns A mac address in network byte order
45 * @throws std::runtime_error for bad mac
46 */
1#pragma once
2
3#include "config.h"
4
5#include "ethernet_interface.hpp"
6#include "types.hpp"
7
8#include <netinet/ether.h>

--- 30 unchanged lines hidden (view full) ---

39ether_addr getfromInventory(sdbusplus::bus::bus& bus,
40 const std::string& intfName);
41
42/** @brief Converts the given mac address into byte form
43 * @param[in] str - The mac address in human readable form
44 * @returns A mac address in network byte order
45 * @throws std::runtime_error for bad mac
46 */
47ether_addr fromString(std::string_view str);
47ether_addr fromString(const char* str);
48inline ether_addr fromString(const std::string& str)
49{
50 return fromString(str.c_str());
51}
48
49/** @brief Converts the given mac address bytes into a string
50 * @param[in] mac - The mac address
51 * @returns A valid mac address string
52 */
53std::string toString(const ether_addr& mac);
54
55/** @brief Determines if the mac address is empty

--- 191 unchanged lines hidden ---
52
53/** @brief Converts the given mac address bytes into a string
54 * @param[in] mac - The mac address
55 * @returns A valid mac address string
56 */
57std::string toString(const ether_addr& mac);
58
59/** @brief Determines if the mac address is empty

--- 191 unchanged lines hidden ---