Make getNetworkInterfaces() and getBestPublicIp() available via tools.h

Remove HTTP URL helper line - should be done in kiwix-serve
Add getters at server level - getAddress and getPort
This commit is contained in:
Nikhil Tanwar
2021-10-19 22:01:48 +05:30
parent 4b563e567e
commit 9554ab5db0
9 changed files with 145 additions and 194 deletions

View File

@ -60,7 +60,9 @@ namespace kiwix
{ m_withTaskbar = withTaskbar; m_withLibraryButton = withLibraryButton; }
void setBlockExternalLinks(bool blockExternalLinks)
{ m_blockExternalLinks = blockExternalLinks; }
int getPort();
std::string getAddress();
protected:
Library* mp_library;
NameMapper* mp_nameMapper;

View File

@ -22,6 +22,7 @@
#include <string>
#include <vector>
#include <map>
namespace kiwix {
@ -194,5 +195,17 @@ bool fileExists(const std::string& path);
* @return mimetype from filename in string format.
*/
std::string getMimeTypeForFile(const std::string& filename);
/** Provides all available network interfaces
*
* This function provides the available IPv4 network interfaces
*/
std::map<std::string, std::string> getNetworkInterfaces();
/** Provides the best IP address
* This function provides the best IP address from the list given by getNetworkInterfaces
*/
std::string getBestPublicIp();
}
#endif // KIWIX_TOOLS_H