diff options
Diffstat (limited to 'tests/Network/EnumInterfaces.cpp')
-rw-r--r-- | tests/Network/EnumInterfaces.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/Network/EnumInterfaces.cpp b/tests/Network/EnumInterfaces.cpp new file mode 100644 index 000000000..0b716acff --- /dev/null +++ b/tests/Network/EnumInterfaces.cpp @@ -0,0 +1,39 @@ + +// EnumInterfaces.cpp + +// Implements the main app entrypoint for the EnumInterfaces network test +// Lists all network interfaces to the console + +#include "Globals.h" +#include "OSSupport/Network.h" +#include "OSSupport/NetworkSingleton.h" + + + + + +int main(int argc, char * argv[]) +{ + // Initialize the cNetwork subsystem: + LOGD("Initializing cNetwork..."); + cNetworkSingleton::Get().Initialise(); + + // Enumerate all the addresses: + printf("Enumerating all IP addresses...\n"); + auto IPs = cNetwork::EnumLocalIPAddresses(); + for (auto & ip: IPs) + { + LOGD(" %s", ip.c_str()); + } + LOGD("All addresses enumerated."); + + // Terminate the cNetwork subsystem: + cNetworkSingleton::Get().Terminate(); + + LOGD("Test finished."); + return 0; +} + + + + |