mirror of
https://github.com/g4klx/MMDVMHost.git
synced 2026-04-07 07:23:53 +00:00
add match(), isnone() utility function
match() checks address family, IP address and port between two sockaddr_storages. isnone() checks sockaddr_storage has INADDR_NONE IPv4 address. (sockaddr_storage has this address when lookup() failed)
This commit is contained in:
parent
022d1a768b
commit
5dccd5c5ce
2 changed files with 33 additions and 0 deletions
|
|
@ -49,6 +49,8 @@ public:
|
|||
void close();
|
||||
|
||||
static int lookup(const std::string& hostName, unsigned int port, sockaddr_storage &address, unsigned int &address_length);
|
||||
static bool match(const sockaddr_storage &addr1, const sockaddr_storage &addr2);
|
||||
static bool isnone(const sockaddr_storage &addr);
|
||||
|
||||
private:
|
||||
std::string m_address;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue