diff options
author | Ratan Gupta <ratagupt@in.ibm.com> | 2017-08-13 05:49:43 +0530 |
---|---|---|
committer | Ratan Gupta <ratagupt@in.ibm.com> | 2017-08-13 05:49:43 +0530 |
commit | 8c31d237f67caa5698fca5aedd449f8c98f0b0c0 (patch) | |
tree | 2ce23f921c30cdb0f0102c7ba6862a932eff4f97 /types.hpp | |
parent | 01d4bd1a6301ebbd892b9c15cf4e5501e96da79b (diff) | |
download | phosphor-host-ipmid-8c31d237f67caa5698fca5aedd449f8c98f0b0c0.tar.gz phosphor-host-ipmid-8c31d237f67caa5698fca5aedd449f8c98f0b0c0.zip |
Move generic network constants to types.hpp
Change-Id: Ic6de2d3d82d6e55c6abf73bae2fc0a23a36286b9
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
Diffstat (limited to 'types.hpp')
-rw-r--r-- | types.hpp | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -24,6 +24,7 @@ using Value = sdbusplus::message::variant<bool, uint8_t, int16_t, using PropertyMap = std::map<DbusProperty, Value>; using ObjectTree = std::map<DbusObjectPath, std::map<DbusService, std::vector<DbusInterface>>>; + namespace sensor { @@ -89,5 +90,21 @@ using InventoryPath = std::string; using InvObjectIDMap = std::map<InventoryPath, SelData>; -}//namespce sensor +}// namespace sensor + +namespace network +{ + +constexpr auto MAC_ADDRESS_FORMAT = "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx"; +constexpr auto IP_ADDRESS_FORMAT = "%u.%u.%u.%u"; +constexpr auto PREFIX_FORMAT = "%hhd"; +constexpr auto ADDR_TYPE_FORMAT = "%hhx"; + +constexpr auto IPV4_ADDRESS_SIZE_BYTE = 4; +constexpr auto IPV6_ADDRESS_SIZE_BYTE = 16; + +constexpr auto DEFAULT_MAC_ADDRESS = "00:00:00:00:00:00"; +constexpr auto DEFAULT_ADDRESS = "0.0.0.0"; + +}//namespace network }//namespace ipmi |