Public Member Functions | |
NetworkManager () noexcept | |
Default constructor. | |
~NetworkManager () | |
Default destructor. | |
eError | Init (void) noexcept |
Initialize network code. | |
void | Shutdown (void) noexcept |
Shut down network code. | |
const char * | GetHostName (void) const noexcept |
Get the hostname. | |
uint_t | GetLocalAddressCount (void) const noexcept |
Get the number of local addresses. | |
const NetAddr_t * | GetLocalAddresses (void) const noexcept |
Get the base pointer of the array of local addresses. | |
uint_t | HasAddrType (NetAddr_t::eAddressType uType) const noexcept |
Test if a specific protocol is present. | |
eError | ResolveIPv4Address (NetAddr_t *pOutput, const char *pDNSName) noexcept |
Resolve a DNS address to IPv4. | |
eError | ResolveIPv6Address (NetAddr_t *pOutput, const char *pDNSName) noexcept |
Resolve a DNS address to IPv6. | |
eError | GetIPv4Address (NetAddr_t *pOutput) noexcept |
Return the IPv4 address of the current machine. | |
eError | GetIPv6Address (NetAddr_t *pOutput) noexcept |
Return the IPv6 address of the current machine. | |
eError | SendPacket (const NetAddr_t *pDestination, const void *pBuffer, uintptr_t uSize) noexcept |
Send a data packet to another network address. | |
eError | SendStream (const NetAddr_t *pDestination, const void *pBuffer, uintptr_t uSize) noexcept |
Send a data packet to another network address using guaranteed protocol. | |
eError | EnumerateLocalAddresses (void) noexcept |
Enumerate all local network addresses. | |
Static Public Member Functions | |
static NetworkManager * | New (void) noexcept |
Allocate a NetworkManager using the global memory manager. | |
Protected Attributes | |
String | m_HostName |
gethostname() of the current machineSi | |
uint_t | m_uStarted |
Number of times this was started up. | |
uint_t | m_uLocalAddressCount |
Number of local addresses found. | |
NetAddr_t * | m_pLocalAddresses |
Array of all local addresses for this machine. | |
uint_t | m_uProtocolsFound |
Which protocols were found. | |
uint_t | m_bWSAStarted |
TRUE if WSAStartup() called | |
uint_t | m_bOpenTransportStarted |
TRUE if Open Transport started | |
void * | m_pEventHandler |
(OTNotifyUPP) Open Transport callback | |
Private Member Functions | |
NetworkManager (const NetworkManager &)=delete | |
NetworkManager & | operator= (const NetworkManager &)=delete |
NetworkManager (NetworkManager &&)=delete | |
NetworkManager & | operator= (NetworkManager &&)=delete |
|
privatedelete |
|
privatedelete |
|
noexcept |
Burger::NetworkManager::~NetworkManager | ( | ) |
|
noexcept |
Enumerate all local network addresses.
Scan all the network adapters and collect all of the local addresses for this machine. Only addresses that are "DNS eligible" will be enumerated, so things like the loopback or other special purpose addresses are not placed in the list.
|
inlinenoexcept |
Get the hostname.
On machines with TCP/IP support, return the string that is returned by a call to gethostname().
|
noexcept |
Return the IPv4 address of the current machine.
Iterate over the IPv4 addresses associated with the host computer and return the most likely IP address that is active.
pOutput | Pointer to the NetAddr_t structure that will contain the resolved address |
|
noexcept |
Return the IPv6 address of the current machine.
Return the IPv6 address associated with the host computer.
pOutput | Pointer to the NetAddr_t structure that will contain the resolved address |
|
inlinenoexcept |
Get the number of local addresses.
On start up of this class, all local IP addresses were enumerated and the number of addresses found will be returned with this call. Call GetLocalAddresses() const to get the base address of the array of NetAddr_t structures that have the addresses.
|
inlinenoexcept |
Get the base pointer of the array of local addresses.
On start up of this class, all local IP addresses were enumerated and the base pointer to the array of addresses found will be returned with this call. Call GetLocalAddressCount() const to get the size of this array.
|
inlinenoexcept |
Test if a specific protocol is present.
On start up of this class, all available protocols are tested and flags are set which can be queried with this call.
uType | Type to test for. |
|
noexcept |
Initialize network code.
Start up the operating system's network layer and return any error code if it failed.
|
staticnoexcept |
Allocate a NetworkManager using the global memory manager.
Using the GlobalMemoryManager, allocate an instance of this class and return the pointer.
|
privatedelete |
|
privatedelete |
|
noexcept |
Resolve a DNS address to IPv4.
Given a DNS string with an optional port number, contact the connected DNS server to resolve the address.
pOutput | Pointer to the NetAddr_t structure that will contain the resolved address |
pDNSName | Pointer to a "C" string in UTF-8 encoding to pass to the DNS server |
|
noexcept |
Resolve a DNS address to IPv6.
Given a DNS string with an optional port number, contact the connected DNS server to resolve the address.
pOutput | Pointer to the NetAddr_t structure that will contain the resolved address |
pDNSName | Pointer to a "C" string in UTF-8 encoding to pass to the DNS server |
|
noexcept |
Send a data packet to another network address.
Send data to another machine using UDP or other non-guaranteed transport method.
pDestination | Pointer to the NetAddr_t that has the destination address |
pBuffer | Pointer to the data to transmit |
uBufferSize | Number of bytes to transmit |
|
noexcept |
Send a data packet to another network address using guaranteed protocol.
Send data to another machine using TCP or other guaranteed transport method.
pDestination | Pointer to the NetAddr_t that has the destination address |
pBuffer | Pointer to the data to transmit |
uBufferSize | Number of bytes to transmit |
|
noexcept |
Shut down network code.
Shut down the operating system's network layer and release all allocated resources
|
protected |
gethostname() of the current machineSi
|
protected |
(OTNotifyUPP) Open Transport callback
|
protected |
Array of all local addresses for this machine.
|
protected |
Number of local addresses found.
|
protected |
Which protocols were found.
|
protected |
Number of times this was started up.