1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-27 12:14:26 +01:00

Added Utils::gateway_from_ip function.(not tested yet).

This commit is contained in:
Matias Fontanini
2012-03-22 22:42:37 -03:00
parent fa9c260d85
commit 67eb7e355f
2 changed files with 37 additions and 0 deletions

View File

@@ -152,6 +152,20 @@ namespace Tins {
* \return The interface's name.
*/
std::string interface_from_ip(uint32_t ip);
/**
* \brief Finds the gateway's IP address for the given IP
* address.
*
* \param ip The IP address for which the default gateway will
* be searched.
* \param gw_addr This parameter will contain the gateway's IP
* address in case it is found.
*
* \return bool indicating wether the lookup was successfull.
*/
bool gateway_from_ip(uint32_t ip, uint32_t &gw_addr) ;
/** \brief Convert 16 bit integer into network byte order.
*