00001 #ifdef TEST 00002 00003 #include "headers.h" 00004 00005 string 00006 InterfaceCommand::getCommandString() { 00007 return interfaceCommandString; 00008 } 00009 00010 00011 void 00012 InterfaceCommand::run(std::ostream& s) { 00013 if (m_args[1] == showCommandString) { 00014 s << GlobalObjects::instance()->getInterfaces()->toString(); 00015 } 00016 else if (m_args[1] == publicIpCommandString) { 00017 IpAddress ip = GlobalObjects::instance()->getInterfaces()->getPublicIp(); 00018 s << ip; 00019 } 00020 } 00021 00022 00023 void 00024 InterfaceCommand::getHtmlInterface(std::ostream& s) { 00025 s << "<h2>Interfaces</h2>"; 00026 beginUl(s); 00027 generateHtmlSubcmd(s, showCommandString, "show"); 00028 generateHtmlSubcmd(s, publicIpCommandString, "Get Public IP"); 00029 endUl(s); 00030 } 00031 #endif 00032