Module: sems Branch: master Commit: 45cf1372f1c94af2d461e5c3f8a82e4baeb6bf38 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=45cf1372f1c94af2d461e5c3f8a82e4baeb6bf38
Author: Raphael Coeffic <[email protected]> Committer: Raphael Coeffic <[email protected]> Date: Tue Sep 20 15:52:30 2011 +0200 renamed getLocalIP to a more useful name (fixIface2IP). Also made the function non-static to be accessed from other classes. --- core/AmConfig.cpp | 6 +++--- core/AmConfig.h | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/core/AmConfig.cpp b/core/AmConfig.cpp index cc25d01..2c5c428 100644 --- a/core/AmConfig.cpp +++ b/core/AmConfig.cpp @@ -699,7 +699,7 @@ static bool getInterfaceList(int sd, std::vector<std::pair<string,string> >& if_ } /** Get the PF_INET address associated with the network interface */ -static string getLocalIP(const string& dev_name) +string fixIface2IP(const string& dev_name) { string local_ip; struct ifreq ifr; @@ -773,7 +773,7 @@ int AmConfig::finalizeIPConfig() { for(int i=0; i < (int)AmConfig::Ifs.size(); i++) { - AmConfig::Ifs[i].LocalIP = getLocalIP(AmConfig::Ifs[i].LocalIP); + AmConfig::Ifs[i].LocalIP = fixIface2IP(AmConfig::Ifs[i].LocalIP); if (AmConfig::Ifs[i].LocalIP.empty()) { ERROR("Cannot determine proper local address for media advertising!\n" "Try using 'ifconfig -a' to find a proper interface and configure SEMS to use it.\n"); @@ -784,7 +784,7 @@ int AmConfig::finalizeIPConfig() AmConfig::Ifs[i].LocalSIPIP = AmConfig::Ifs[i].LocalIP; } else { - AmConfig::Ifs[i].LocalSIPIP = getLocalIP(AmConfig::Ifs[i].LocalSIPIP); + AmConfig::Ifs[i].LocalSIPIP = fixIface2IP(AmConfig::Ifs[i].LocalSIPIP); } AmConfig::LocalSIPIP2If.insert(std::make_pair(AmConfig::Ifs[i].LocalSIPIP,i)); diff --git a/core/AmConfig.h b/core/AmConfig.h index 5abf74f..ca2d8e0 100644 --- a/core/AmConfig.h +++ b/core/AmConfig.h @@ -229,6 +229,9 @@ struct AmConfig }; +/** Get the PF_INET address associated with the network interface */ +string fixIface2IP(const string& dev_name); + #endif // Local Variables: _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
