UPnPsdk 0.1
Universal Plug and Play +, Software Development Kit
 
Loading...
Searching...
No Matches
netadapter_platform.hpp
Go to the documentation of this file.
1#ifndef UPnPsdk_WIN32_NETADAPTER_HPP
2#define UPnPsdk_WIN32_NETADAPTER_HPP
3// Copyright (C) 2024+ GPL 3 and higher by Ingo Höft, <Ingo@Hoeft-online.de>
4// Redistribution only with this Copyright remark. Last modified: 2025-06-11
11
12
13namespace UPnPsdk {
14
18class UPnPsdk_VIS CNetadapter_platform : public INetadapter {
19 public:
20 // Constructor
21 CNetadapter_platform();
22
23 // Destructor
24 virtual ~CNetadapter_platform();
25
26 // methodes
27 void get_first() override;
28 bool get_next() override;
29 unsigned int index() const override;
30 std::string name() const override;
31 void sockaddr(SSockaddr& a_saddr) const override;
32 void socknetmask(SSockaddr& a_snetmask) const override;
33 unsigned int bitmask() const override;
34
35 private:
36 // Pointer to the first network adapter structure. This pointer must not be
37 // modified because it is needed to free the allocated memory space for the
38 // adapter list.
39 ::PIP_ADAPTER_ADDRESSES m_adapt_first{nullptr};
40
41 // Pointer to the current network adapter in work. It will be set to Next
42 // when its IP addresses are parsed.
43 ::PIP_ADAPTER_ADDRESSES m_adapt_current{nullptr};
44
45 // Pointer to the current IP address in work of a network adapter. It will
46 // be set to Next by parsing the address list.
47 ::PIP_ADAPTER_UNICAST_ADDRESS_LH m_unicastaddr_current{nullptr};
48
49 void free_adaptaddrs() noexcept;
50
53 inline void reset() noexcept;
54};
55
56} // namespace UPnPsdk
57
58#endif // UPnPsdk_WIN32_NETADAPTER_HPP
void sockaddr(SSockaddr &a_saddr) const override
Get socket address from current selected list entry.
void socknetmask(SSockaddr &a_snetmask) const override
Get socket address netmask from current selected list entry.
bool get_next() override
Select next entry from the network adapter list that was initial loaded with get_first().
std::string name() const override
Get network adapter name from current selected list entry.
unsigned int bitmask() const override
Get prefix length from the ip address of the current selected local network adapter.
void get_first() override
Load a list of network adapters from the operating system and select its first entry.
unsigned int index() const override
Get index number from current selected list entry.
Reengineered Object Oriented UPnP+ program code.
C++ interface to manage information from different platforms about network adapters.
Trivial ::sockaddr structures enhanced with methods.
Definition sockaddr.hpp:94
#define UPnPsdk_VIS
Prefix to export symbol for external use.