Commit e1392dde authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #6554: make some methods of sipvoiplink static

parent 1055619b
......@@ -425,17 +425,17 @@ void ConfigurationManager::setHistory (const std::vector<std::string>& entries)
std::string ConfigurationManager::getAddrFromInterfaceName (
const std::string& interface)
{
return SIPVoIPLink::instance()->getInterfaceAddrFromName (interface);
return SIPVoIPLink::getInterfaceAddrFromName (interface);
}
std::vector<std::string> ConfigurationManager::getAllIpInterface (void)
{
return SIPVoIPLink::instance()->getAllIpInterface();
return SIPVoIPLink::getAllIpInterface();
}
std::vector<std::string> ConfigurationManager::getAllIpInterfaceByName (void)
{
return SIPVoIPLink::instance()->getAllIpInterfaceByName();
return SIPVoIPLink::getAllIpInterfaceByName();
}
std::map<std::string, std::string> ConfigurationManager::getShortcuts()
......
......@@ -3398,7 +3398,7 @@ static int get_iface_list (struct ifconf *ifconf)
}
} // end anonymous namespace
std::vector<std::string> SIPVoIPLink::getAllIpInterfaceByName (void) const
std::vector<std::string> SIPVoIPLink::getAllIpInterfaceByName (void)
{
static ifreq ifreqs[20];
ifconf ifconf;
......@@ -3426,7 +3426,7 @@ std::vector<std::string> SIPVoIPLink::getAllIpInterfaceByName (void) const
return ifaceList;
}
std::string SIPVoIPLink::getInterfaceAddrFromName (const std::string &ifaceName) const
std::string SIPVoIPLink::getInterfaceAddrFromName (const std::string &ifaceName)
{
int fd = socket (AF_INET, SOCK_DGRAM,0);
if (fd < 0) {
......@@ -3435,8 +3435,8 @@ std::string SIPVoIPLink::getInterfaceAddrFromName (const std::string &ifaceName)
}
ifreq ifr;
memset (&ifr, 0, sizeof(ifreq));
strcpy (ifr.ifr_name, ifaceName.c_str());
memset(&ifr, 0, sizeof(ifreq));
strcpy(ifr.ifr_name, ifaceName.c_str());
ifr.ifr_addr.sa_family = AF_INET;
if (ioctl (fd, SIOCGIFADDR, &ifr) < 0)
......@@ -3450,7 +3450,7 @@ std::string SIPVoIPLink::getInterfaceAddrFromName (const std::string &ifaceName)
return addr;
}
std::vector<std::string> SIPVoIPLink::getAllIpInterface (void) const
std::vector<std::string> SIPVoIPLink::getAllIpInterface (void)
{
pj_sockaddr addrList[16];
unsigned int addrCnt = PJ_ARRAY_SIZE (addrList);
......
......@@ -254,7 +254,7 @@ class SIPVoIPLink : public VoIPLink
* of IPV4 address available on all of the interfaces on
* the system.
*/
std::vector<std::string> getAllIpInterface (void) const;
static std::vector<std::string> getAllIpInterface (void);
/**
* List all the interfaces on the system and return
......@@ -264,7 +264,7 @@ class SIPVoIPLink : public VoIPLink
* of interface name available on all of the interfaces on
* the system.
*/
std::vector<std::string> getAllIpInterfaceByName (void) const;
static std::vector<std::string> getAllIpInterfaceByName (void);
/**
* List all the interfaces on the system and return
......@@ -274,7 +274,7 @@ class SIPVoIPLink : public VoIPLink
* of interface name available on all of the interfaces on
* the system.
*/
std::string getInterfaceAddrFromName (const std::string &ifaceName) const;
static std::string getInterfaceAddrFromName (const std::string &ifaceName);
/**
* Initialize the transport selector
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment