12#ifndef WSFCOMMADDRESS_HPP
13#define WSFCOMMADDRESS_HPP
15#include "wsf_export.h"
21#include "UtScriptAccessible.hpp"
39 static constexpr std::uint32_t
cMASK_MAX = 0xFFFFFFFF;
66 explicit Address(
size_t aSubnetMaskBitLength);
109 const std::string&
GetSubnet()
const {
return mSubnet; }
110 size_t GetNumHostAddresses()
const;
116 bool operator<(
const Address& aRhs)
const;
135 aBuff& mAddress& mRoutingPrefix& mSubnet& mSubnetMaskBitLength;
141 static size_t GetStringValue(
const std::string& aString);
147 static bool CheckInAddressRange(
const Address& aNetworkAddress,
const Address& aCheckAddress);
155 std::string GetBroadcastAddress()
const;
160 std::vector<size_t> TranslateIntegerIP(
size_t aIP_Value)
const;
162 static bool IsNumber(
const std::string& aString);
166 void PopulateAddressFromBytes();
169 std::string mRoutingPrefix{
""};
170 std::string mSubnet{
""};
171 uint32_t mSubnetIntegerValue{0};
172 size_t mSubnetMaskBitLength{IPv4::cDEFAULT_CIDR};
173 uint32_t mBinaryIntegerValue{0};
174 IPv4::ByteArray mBytes{{0, 0, 0, 0}};
175 std::string mAddressToken{
""};
187struct hash<
wsf::comm::Address>
wsf::comm::Address Address
Definition WsfScriptCommRouterClass.cpp:29
bool operator!=(int aId, const WsfStringInt &aRhs)
Not equal relational operator for the case of an integer on the LHS and a StringId on the RHS.
Definition WsfStringId.hpp:75
bool operator==(int aId, const WsfStringInt &aRhs)
Equal relational operator for the case of an integer on the LHS and a StringId on the RHS.
Definition WsfStringId.hpp:69
std::ostream & operator<<(std::ostream &aStream, const WsfTSPI &aTSPI)
Stream out operator (typically, to a file); units are converted on output.
Definition WsfTSPI.cpp:92
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
Definition WsfCommAddress.hpp:57
bool IsNull() const
Definition WsfCommAddress.hpp:111
const std::string & GetRoutingPrefix() const
Definition WsfCommAddress.hpp:108
static size_t GetCIDR_ValueFromString(std::string &aPossibleAddress)
Definition WsfCommAddress.cpp:383
virtual ~Address()=default
static Address ProcessInput(UtInput &aInput)
Definition WsfCommAddress.cpp:305
std::string GetGenerationToken() const
Definition WsfCommAddress.hpp:152
static bool IsValidAddress(const std::string &aPossibleAddress)
Definition WsfCommAddress.cpp:332
size_t GetSubnetMaskBitLength() const
Definition WsfCommAddress.hpp:107
void GenerateAddress(const std::string &aGenerationToken, size_t aSubnetBitLength=IPv4::cDEFAULT_CIDR)
Definition WsfCommAddress.cpp:255
void Serialize(T &aBuff)
For XIO usage.
Definition WsfCommAddress.hpp:133
size_t GetBinaryInteger() const
Definition WsfCommAddress.hpp:112
const std::string & GetSubnet() const
Definition WsfCommAddress.hpp:109
static size_t GetStringValue(const std::string &aString)
Definition WsfCommAddress.cpp:283
void SetAddress(const std::string &aAddress, size_t aSubnetBitLength=IPv4::cDEFAULT_CIDR)
Definition WsfCommAddress.cpp:44
const std::string & GetAddress() const
Definition WsfCommAddress.hpp:106
const char * GetScriptClassName() const override
Template specialization for wsf::comm::Address. Allows usage of Address in std::unordered_map/set.
Definition WsfCommAddress.hpp:185
Definition WsfComm.cpp:34
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
size_t operator()(const wsf::comm::Address &aRhs) const
Definition WsfCommAddress.hpp:189
Definition WsfCommAddress.hpp:35
static constexpr const char * cCIDR_DELIMITER
Definition WsfCommAddress.hpp:43
static constexpr std::uint32_t cMASK_MAX
Definition WsfCommAddress.hpp:39
static constexpr std::uint32_t cMASK_FIELD
Definition WsfCommAddress.hpp:40
static constexpr const char * cDELIMITER
Definition WsfCommAddress.hpp:38
static constexpr size_t cNUM_FIELDS
Definition WsfCommAddress.hpp:37
static constexpr const char * cNULL_ADDRESS
Definition WsfCommAddress.hpp:41
static constexpr size_t cDEFAULT_CIDR
Definition WsfCommAddress.hpp:42
std::array< unsigned char, 4 > ByteArray
Definition WsfCommAddress.hpp:44
static constexpr size_t cBIT_SIZE
Definition WsfCommAddress.hpp:36