mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
- network_setup.cpp: little rework in output from network-test
This commit is contained in:
@@ -709,10 +709,14 @@ void CNetworkSetup::testNetworkSettings()
|
|||||||
char our_gateway[16];
|
char our_gateway[16];
|
||||||
char our_nameserver[16];
|
char our_nameserver[16];
|
||||||
|
|
||||||
std::string text, testsite;
|
std::string text, testsite, offset = " ";
|
||||||
|
|
||||||
//set default testdomain and wiki-IP
|
//set default testdomain
|
||||||
std::string defaultsite = "www.google.de", wiki_IP = "89.31.143.1";
|
std::string defaultsite = "www.google.de";
|
||||||
|
|
||||||
|
//set wiki-URL and wiki-IP
|
||||||
|
std::string wiki_URL = "wiki.neutrino-hd.de";
|
||||||
|
std::string wiki_IP = "89.31.143.1";
|
||||||
|
|
||||||
//get www-domain testsite from /.version
|
//get www-domain testsite from /.version
|
||||||
CConfigFile config('\t');
|
CConfigFile config('\t');
|
||||||
@@ -746,7 +750,7 @@ void CNetworkSetup::testNetworkSettings()
|
|||||||
printf("testNw Broadcast: %s\n", our_broadcast);
|
printf("testNw Broadcast: %s\n", our_broadcast);
|
||||||
printf("testNw Gateway: %s\n", our_gateway);
|
printf("testNw Gateway: %s\n", our_gateway);
|
||||||
printf("testNw Nameserver: %s\n", our_nameserver);
|
printf("testNw Nameserver: %s\n", our_nameserver);
|
||||||
printf("testNw Testsite %s\n", testsite.c_str());
|
printf("testNw Testsite: %s\n", testsite.c_str());
|
||||||
|
|
||||||
if (our_ip[0] == 0)
|
if (our_ip[0] == 0)
|
||||||
{
|
{
|
||||||
@@ -754,26 +758,24 @@ void CNetworkSetup::testNetworkSettings()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
text = "Box: " + old_mac_addr + "\n ";
|
//Box
|
||||||
text += (std::string)our_ip + " " + (std::string)mypinghost(our_ip);
|
text = "Box (" + old_mac_addr + "):\n";
|
||||||
text += "\n";
|
text += offset + (std::string)our_ip + " " + (std::string)mypinghost(our_ip) + "\n";
|
||||||
text += g_Locale->getText(LOCALE_NETWORKMENU_GATEWAY);
|
//Gateway
|
||||||
text += " (Router)\n ";
|
text += (std::string)g_Locale->getText(LOCALE_NETWORKMENU_GATEWAY) + " (Router):\n";
|
||||||
text += (std::string)our_gateway + " " +(std::string)mypinghost(our_gateway);
|
text += offset + (std::string)our_gateway + " " + (std::string)mypinghost(our_gateway) + "\n";
|
||||||
text += "\n";
|
//Nameserver
|
||||||
text += g_Locale->getText(LOCALE_NETWORKMENU_NAMESERVER);
|
text += (std::string)g_Locale->getText(LOCALE_NETWORKMENU_NAMESERVER) + ":\n";
|
||||||
text += "\n ";
|
text += offset + (std::string)our_nameserver + " " + (std::string)mypinghost(our_nameserver) + "\n";
|
||||||
text += (std::string)our_nameserver + " " + (std::string)mypinghost(our_nameserver);
|
//Wiki
|
||||||
text += "\n";
|
text += wiki_URL + ":\n";
|
||||||
text += "wiki.neutrino-hd.de:\n ";
|
text += offset + "via IP (" + wiki_IP + "): " + (std::string)mypinghost(wiki_IP.c_str()) + "\n";
|
||||||
text += "via IP (" + wiki_IP + "): " + (std::string)mypinghost(wiki_IP.c_str());
|
if (pinghost(our_nameserver) == 1)
|
||||||
text += ":\n ";
|
|
||||||
if (1 == pinghost(our_nameserver))
|
|
||||||
{
|
{
|
||||||
text += "via DNS: " + (std::string)mypinghost("wiki.neutrino-hd.de");
|
text += offset + "via DNS: " + (std::string)mypinghost(wiki_URL.c_str()) + "\n";
|
||||||
text += "\n";
|
//testsite (or defaultsite)
|
||||||
text += testsite + ":\n ";
|
text += testsite + ":\n";
|
||||||
text += "via DNS: " + (std::string)mypinghost(testsite.c_str()) + ":\n";
|
text += offset + "via DNS: " + (std::string)mypinghost(testsite.c_str()) + "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user