diff --git a/daemon/configure.ac b/daemon/configure.ac index 0d8f075423e63d60892c2cfc9371533557d61bb9..3517cd2fa550e83a57a3651168bb0101c964b5c9 100644 --- a/daemon/configure.ac +++ b/daemon/configure.ac @@ -600,8 +600,8 @@ AC_CONFIG_FILES([Makefile \ src/sip/Makefile \ src/im/Makefile \ src/iax/Makefile \ - src/dht/Makefile \ - src/dht/dhtcpp/Makefile \ + src/ringdht/Makefile \ + src/ringdht/dhtcpp/Makefile \ src/audio/Makefile \ src/audio/audiortp/Makefile \ src/audio/pulseaudio/Makefile \ diff --git a/daemon/src/Makefile.am b/daemon/src/Makefile.am index 898270ca9be27146bf51fccb19169a141b52275e..ccb70182fb16e741de316102c89293a79400b990 100644 --- a/daemon/src/Makefile.am +++ b/daemon/src/Makefile.am @@ -21,9 +21,9 @@ IAX_LIB=-liax endif if USE_DHT -DHT_SUBDIR=dht -DHT_CXXFLAG=-DUSE_DHT -DHT_LIBA=./dht/libdht.la +RINGACC_SUBDIR=ringdht +RINGACC_CXXFLAG=-DUSE_DHT +RINGACC_LIBA=./ringdht/libringacc.la endif if USE_NETWORKMANAGER @@ -35,7 +35,7 @@ TLS_LIB = @GNUTLS_LIBS@ TLS_CFLAGS = @GNUTLS_CFLAGS@ endif -SUBDIRS = client audio config hooks history sip $(IAX_SUBDIR) $(DHT_SUBDIR) $(INSTANT_MESSAGING_SUBDIR) $(SFL_VIDEO_SUBDIR) +SUBDIRS = client audio config hooks history sip $(IAX_SUBDIR) $(RINGACC_SUBDIR) $(INSTANT_MESSAGING_SUBDIR) $(SFL_VIDEO_SUBDIR) # libsflphone @@ -48,7 +48,7 @@ libsflphone_la_LIBADD = \ ./config/libconfig.la \ ./hooks/libhooks.la \ ./history/libhistory.la \ - $(DHT_LIBA) \ + $(RINGACC_LIBA) \ $(IAX_LIBA) \ $(IM_LIBA) \ $(SFL_VIDEO_LIBS) diff --git a/daemon/src/account_factory.cpp b/daemon/src/account_factory.cpp index 15a94f3288f80bb16fc787743f84f5f6a36fc11d..1c2775e9957ab14447723be532b0c0e4a2072b6b 100644 --- a/daemon/src/account_factory.cpp +++ b/daemon/src/account_factory.cpp @@ -39,7 +39,7 @@ #include "iax/iaxaccount.h" #endif #if HAVE_DHT -#include "dht/dhtaccount.h" +#include "ringdht/ringaccount.h" #endif #include "sip/sipvoiplink.h" // for SIPVoIPLink::loadIP2IPSettings @@ -59,9 +59,9 @@ AccountFactory::AccountFactory() SFL_DBG("registered %s account", IAXAccount::ACCOUNT_TYPE); #endif #if HAVE_DHT - auto dhtfunc = [](const std::string& id){ return std::make_shared<DHTAccount>(id, false); }; - generators_.insert(std::make_pair(DHTAccount::ACCOUNT_TYPE, dhtfunc)); - SFL_DBG("registered %s account", DHTAccount::ACCOUNT_TYPE); + auto dhtfunc = [](const std::string& id){ return std::make_shared<RingAccount>(id, false); }; + generators_.insert(std::make_pair(RingAccount::ACCOUNT_TYPE, dhtfunc)); + SFL_DBG("registered %s account", RingAccount::ACCOUNT_TYPE); #endif } diff --git a/daemon/src/dht/Makefile.am b/daemon/src/dht/Makefile.am deleted file mode 100644 index b748335c8e0e3aa45975db983daa6b3e3316f93d..0000000000000000000000000000000000000000 --- a/daemon/src/dht/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -include $(top_srcdir)/globals.mak - -if USE_DHT - -noinst_LTLIBRARIES = libdht.la -libdht_la_CXXFLAGS = @CXXFLAGS@ - -SUBDIRS = dhtcpp - -libdht_la_LIBADD = \ - dhtcpp/libdhtcpp.la - -libdht_la_SOURCES = \ - dhtaccount.cpp \ - dhtaccount.h - -endif diff --git a/daemon/src/managerimpl.cpp b/daemon/src/managerimpl.cpp index b3f9cd35791fc354da0dd4cd9bd46638bd2448ab..8cad50c924032bb3fa5cff3622a4705c867cfc49 100644 --- a/daemon/src/managerimpl.cpp +++ b/daemon/src/managerimpl.cpp @@ -47,7 +47,7 @@ #include "map_utils.h" #include "account.h" #if HAVE_DHT -#include "dht/dhtaccount.h" +#include "ringdht/ringaccount.h" #endif #include "call_factory.h" @@ -2766,9 +2766,9 @@ ManagerImpl::newOutgoingCall(const std::string& id, std::string finalToUrl = toUrl; #if HAVE_DHT - if (toUrl.find("dht:") != std::string::npos) { - SFL_WARN("DHT call detected"); - auto dhtAcc = getAllAccounts<DHTAccount>(); + if (toUrl.find("ring:") != std::string::npos) { + SFL_WARN("Ring DHT call detected"); + auto dhtAcc = getAllAccounts<RingAccount>(); if (not dhtAcc.empty()) return dhtAcc.front()->newOutgoingCall(id, finalToUrl); } diff --git a/daemon/src/ringdht/Makefile.am b/daemon/src/ringdht/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..1cf4735900386fe33195283b0fd02eeea19b65c5 --- /dev/null +++ b/daemon/src/ringdht/Makefile.am @@ -0,0 +1,17 @@ +include $(top_srcdir)/globals.mak + +if USE_DHT + +noinst_LTLIBRARIES = libringacc.la +libringacc_la_CXXFLAGS = @CXXFLAGS@ + +SUBDIRS = dhtcpp + +libringacc_la_LIBADD = \ + dhtcpp/libdhtcpp.la + +libringacc_la_SOURCES = \ + ringaccount.cpp \ + ringaccount.h + +endif diff --git a/daemon/src/dht/dhtcpp/Makefile.am b/daemon/src/ringdht/dhtcpp/Makefile.am similarity index 100% rename from daemon/src/dht/dhtcpp/Makefile.am rename to daemon/src/ringdht/dhtcpp/Makefile.am diff --git a/daemon/src/dht/dhtcpp/crypto.cpp b/daemon/src/ringdht/dhtcpp/crypto.cpp similarity index 100% rename from daemon/src/dht/dhtcpp/crypto.cpp rename to daemon/src/ringdht/dhtcpp/crypto.cpp diff --git a/daemon/src/dht/dhtcpp/crypto.h b/daemon/src/ringdht/dhtcpp/crypto.h similarity index 100% rename from daemon/src/dht/dhtcpp/crypto.h rename to daemon/src/ringdht/dhtcpp/crypto.h diff --git a/daemon/src/dht/dhtcpp/dht.cpp b/daemon/src/ringdht/dhtcpp/dht.cpp similarity index 100% rename from daemon/src/dht/dhtcpp/dht.cpp rename to daemon/src/ringdht/dhtcpp/dht.cpp diff --git a/daemon/src/dht/dhtcpp/dht.h b/daemon/src/ringdht/dhtcpp/dht.h similarity index 100% rename from daemon/src/dht/dhtcpp/dht.h rename to daemon/src/ringdht/dhtcpp/dht.h diff --git a/daemon/src/dht/dhtcpp/dhtrunner.cpp b/daemon/src/ringdht/dhtcpp/dhtrunner.cpp similarity index 100% rename from daemon/src/dht/dhtcpp/dhtrunner.cpp rename to daemon/src/ringdht/dhtcpp/dhtrunner.cpp diff --git a/daemon/src/dht/dhtcpp/dhtrunner.h b/daemon/src/ringdht/dhtcpp/dhtrunner.h similarity index 100% rename from daemon/src/dht/dhtcpp/dhtrunner.h rename to daemon/src/ringdht/dhtcpp/dhtrunner.h diff --git a/daemon/src/dht/dhtcpp/infohash.cpp b/daemon/src/ringdht/dhtcpp/infohash.cpp similarity index 100% rename from daemon/src/dht/dhtcpp/infohash.cpp rename to daemon/src/ringdht/dhtcpp/infohash.cpp diff --git a/daemon/src/dht/dhtcpp/infohash.h b/daemon/src/ringdht/dhtcpp/infohash.h similarity index 100% rename from daemon/src/dht/dhtcpp/infohash.h rename to daemon/src/ringdht/dhtcpp/infohash.h diff --git a/daemon/src/dht/dhtcpp/securedht.cpp b/daemon/src/ringdht/dhtcpp/securedht.cpp similarity index 100% rename from daemon/src/dht/dhtcpp/securedht.cpp rename to daemon/src/ringdht/dhtcpp/securedht.cpp diff --git a/daemon/src/dht/dhtcpp/securedht.h b/daemon/src/ringdht/dhtcpp/securedht.h similarity index 100% rename from daemon/src/dht/dhtcpp/securedht.h rename to daemon/src/ringdht/dhtcpp/securedht.h diff --git a/daemon/src/dht/dhtcpp/serialize.h b/daemon/src/ringdht/dhtcpp/serialize.h similarity index 100% rename from daemon/src/dht/dhtcpp/serialize.h rename to daemon/src/ringdht/dhtcpp/serialize.h diff --git a/daemon/src/dht/dhtcpp/value.cpp b/daemon/src/ringdht/dhtcpp/value.cpp similarity index 100% rename from daemon/src/dht/dhtcpp/value.cpp rename to daemon/src/ringdht/dhtcpp/value.cpp diff --git a/daemon/src/dht/dhtcpp/value.h b/daemon/src/ringdht/dhtcpp/value.h similarity index 100% rename from daemon/src/dht/dhtcpp/value.h rename to daemon/src/ringdht/dhtcpp/value.h diff --git a/daemon/src/dht/dhtaccount.cpp b/daemon/src/ringdht/ringaccount.cpp similarity index 90% rename from daemon/src/dht/dhtaccount.cpp rename to daemon/src/ringdht/ringaccount.cpp index 8551e2e630c98c0502dcbba9387dd95d5f477462..9a3c101288d6c53ae7dd7099f0c1871abb79b5ec 100644 --- a/daemon/src/dht/dhtaccount.cpp +++ b/daemon/src/ringdht/ringaccount.cpp @@ -29,7 +29,7 @@ * as that of the covered work. */ -#include "dhtaccount.h" +#include "ringaccount.h" #ifdef HAVE_CONFIG_H #include "config.h" @@ -72,9 +72,9 @@ #include <sstream> #include <cstdlib> -constexpr const char * const DHTAccount::ACCOUNT_TYPE; +constexpr const char * const RingAccount::ACCOUNT_TYPE; -DHTAccount::DHTAccount(const std::string& accountID, bool /* presenceEnabled */) +RingAccount::RingAccount(const std::string& accountID, bool /* presenceEnabled */) : SIPAccountBase(accountID) { fileutils::check_dir(fileutils::get_cache_dir().c_str()); @@ -96,7 +96,7 @@ DHTAccount::DHTAccount(const std::string& accountID, bool /* presenceEnabled */) } } -DHTAccount::~DHTAccount() +RingAccount::~RingAccount() { Manager::instance().unregisterEventHandler((uintptr_t)this); setTransport(); @@ -105,18 +105,18 @@ DHTAccount::~DHTAccount() } std::shared_ptr<SIPCall> -DHTAccount::newIncomingCall(const std::string& id) +RingAccount::newIncomingCall(const std::string& id) { - return Manager::instance().callFactory.newCall<SIPCall, DHTAccount>(*this, id, Call::INCOMING); + return Manager::instance().callFactory.newCall<SIPCall, RingAccount>(*this, id, Call::INCOMING); } template <> std::shared_ptr<SIPCall> -DHTAccount::newOutgoingCall(const std::string& id, const std::string& toUrl) +RingAccount::newOutgoingCall(const std::string& id, const std::string& toUrl) { - auto call = Manager::instance().callFactory.newCall<SIPCall, DHTAccount>(*this, id, Call::OUTGOING); - auto dhtf = toUrl.find("dht:"); - dhtf = (dhtf == std::string::npos) ? 0 : dhtf+4; + auto call = Manager::instance().callFactory.newCall<SIPCall, RingAccount>(*this, id, Call::OUTGOING); + auto dhtf = toUrl.find("ring:"); + dhtf = (dhtf == std::string::npos) ? 0 : dhtf+5; const std::string toUri = toUrl.substr(dhtf, 40); SFL_DBG("Calling DHT peer %s", toUri.c_str()); call->setIPToIP(true); @@ -154,9 +154,9 @@ DHTAccount::newOutgoingCall(const std::string& id, const std::string& toUrl) } void -DHTAccount::createOutgoingCall(const std::shared_ptr<SIPCall>& call, const std::string& to, const std::string& toUri, const IpAddr& peer) +RingAccount::createOutgoingCall(const std::shared_ptr<SIPCall>& call, const std::string& to, const std::string& toUri, const IpAddr& peer) { - SFL_WARN("DHTAccount::createOutgoingCall to: %s toUri: %s tlsListener: %d", to.c_str(), toUri.c_str(), tlsListener_?1:0); + SFL_WARN("RingAccount::createOutgoingCall to: %s toUri: %s tlsListener: %d", to.c_str(), toUri.c_str(), tlsListener_?1:0); std::shared_ptr<SipTransport> t = link_->sipTransport->getTlsTransport(tlsListener_, getToUri(peer.toString(true, true))); setTransport(t); call->setTransport(t); @@ -209,13 +209,13 @@ DHTAccount::createOutgoingCall(const std::shared_ptr<SIPCall>& call, const std:: } std::shared_ptr<Call> -DHTAccount::newOutgoingCall(const std::string& id, const std::string& toUrl) +RingAccount::newOutgoingCall(const std::string& id, const std::string& toUrl) { return newOutgoingCall<SIPCall>(id, toUrl); } bool -DHTAccount::SIPStartCall(const std::shared_ptr<SIPCall>& call) +RingAccount::SIPStartCall(const std::shared_ptr<SIPCall>& call) { std::string toUri(call->getPeerNumber()); // expecting a fully well formed sip uri @@ -293,7 +293,7 @@ DHTAccount::SIPStartCall(const std::shared_ptr<SIPCall>& call) return true; } -void DHTAccount::serialize(YAML::Emitter &out) +void RingAccount::serialize(YAML::Emitter &out) { using namespace Conf; @@ -312,7 +312,7 @@ void DHTAccount::serialize(YAML::Emitter &out) out << YAML::EndMap; } -void DHTAccount::unserialize(const YAML::Node &node) +void RingAccount::unserialize(const YAML::Node &node) { using namespace yaml_utils; SIPAccountBase::unserialize(node); @@ -326,7 +326,7 @@ void DHTAccount::unserialize(const YAML::Node &node) } void -DHTAccount::checkIdentityPath() +RingAccount::checkIdentityPath() { if (not privkeyPath_.empty() and not dataPath_.empty()) return; @@ -367,7 +367,7 @@ saveFile(const std::string& path, const std::vector<uint8_t>& data) } dht::crypto::Identity -DHTAccount::loadIdentity() +RingAccount::loadIdentity() { dht::crypto::Certificate ca_cert; @@ -406,7 +406,7 @@ DHTAccount::loadIdentity() } void -DHTAccount::saveIdentity(const dht::crypto::Identity id, const std::string& path) const +RingAccount::saveIdentity(const dht::crypto::Identity id, const std::string& path) const { if (id.first) fileutils::saveFile(path + ".pem", id.first->serialize()); @@ -426,7 +426,7 @@ parseInt(const std::map<std::string, std::string> &details, const char *key, T & i = atoi(iter->second.c_str()); } -void DHTAccount::setAccountDetails(const std::map<std::string, std::string> &details) +void RingAccount::setAccountDetails(const std::map<std::string, std::string> &details) { SIPAccountBase::setAccountDetails(details); parseInt(details, CONFIG_DHT_PORT, dhtPort_); @@ -437,7 +437,7 @@ void DHTAccount::setAccountDetails(const std::map<std::string, std::string> &det checkIdentityPath(); } -std::map<std::string, std::string> DHTAccount::getAccountDetails() const +std::map<std::string, std::string> RingAccount::getAccountDetails() const { std::map<std::string, std::string> a = SIPAccountBase::getAccountDetails(); @@ -449,7 +449,7 @@ std::map<std::string, std::string> DHTAccount::getAccountDetails() const return a; } -void DHTAccount::doRegister() +void RingAccount::doRegister() { if (not isEnabled()) { SFL_WARN("Account must be enabled to register, ignoring"); @@ -520,7 +520,7 @@ void DHTAccount::doRegister() } -void DHTAccount::doUnregister(std::function<void(bool)> released_cb) +void RingAccount::doUnregister(std::function<void(bool)> released_cb) { Manager::instance().unregisterEventHandler((uintptr_t)this); saveNodes(dht_.exportNodes()); @@ -532,7 +532,7 @@ void DHTAccount::doUnregister(std::function<void(bool)> released_cb) released_cb(false); } -void DHTAccount::saveNodes(const std::vector<dht::Dht::NodeExport>& nodes) const +void RingAccount::saveNodes(const std::vector<dht::Dht::NodeExport>& nodes) const { if (nodes.empty()) return; @@ -549,7 +549,7 @@ void DHTAccount::saveNodes(const std::vector<dht::Dht::NodeExport>& nodes) const } } -void DHTAccount::saveValues(const std::vector<dht::Dht::ValuesExport>& values) const +void RingAccount::saveValues(const std::vector<dht::Dht::ValuesExport>& values) const { fileutils::check_dir(dataPath_.c_str()); for (const auto& v : values) { @@ -560,7 +560,7 @@ void DHTAccount::saveValues(const std::vector<dht::Dht::ValuesExport>& values) c } std::vector<dht::Dht::NodeExport> -DHTAccount::loadNodes() const +RingAccount::loadNodes() const { std::vector<dht::Dht::NodeExport> nodes; std::string nodesPath = nodePath_+DIR_SEPARATOR_STR "nodes"; @@ -585,7 +585,7 @@ DHTAccount::loadNodes() const } std::vector<dht::Dht::ValuesExport> -DHTAccount::loadValues() const +RingAccount::loadValues() const { std::vector<dht::Dht::ValuesExport> values; const auto dircontent(fileutils::readDirectory(dataPath_)); @@ -602,7 +602,7 @@ DHTAccount::loadValues() const return values; } -void DHTAccount::initTlsConfiguration() +void RingAccount::initTlsConfiguration() { // TLS listener is unique and should be only modified through IP2IP_PROFILE pjsip_tls_setting_default(&tlsSetting_); @@ -622,20 +622,20 @@ void DHTAccount::initTlsConfiguration() tlsSetting_.qos_ignore_error = PJ_TRUE; } -void DHTAccount::loadConfig() +void RingAccount::loadConfig() { - SFL_WARN("DHTAccount::loadConfig()"); + SFL_WARN("RingAccount::loadConfig()"); initTlsConfiguration(); transportType_ = PJSIP_TRANSPORT_TLS; } -bool DHTAccount::userMatch(const std::string& username) const +bool RingAccount::userMatch(const std::string& username) const { return !username.empty() and username == dht_.getId().toString(); } MatchRank -DHTAccount::matches(const std::string &userName, const std::string &server) const +RingAccount::matches(const std::string &userName, const std::string &server) const { if (userMatch(userName)) { SFL_DBG("Matching account id in request with username %s", userName.c_str()); @@ -645,19 +645,19 @@ DHTAccount::matches(const std::string &userName, const std::string &server) cons } } -std::string DHTAccount::getFromUri() const +std::string RingAccount::getFromUri() const { - return "dht:" + dht_.getId().toString() + "@dht.invalid"; + return "ring:" + dht_.getId().toString() + "@ring.dht"; } -std::string DHTAccount::getToUri(const std::string& to) const +std::string RingAccount::getToUri(const std::string& to) const { const std::string transport {pjsip_transport_get_type_name(transportType_)}; return "<sips:" + to + ";transport=" + transport + ">"; } pj_str_t -DHTAccount::getContactHeader(pjsip_transport* t) +RingAccount::getContactHeader(pjsip_transport* t) { if (!t && transport_) t = transport_->get(); @@ -671,7 +671,7 @@ DHTAccount::getContactHeader(pjsip_transport* t) transportType = PJSIP_TRANSPORT_UDP; // Else we determine this infor based on transport information - std::string address = "dht.invalid"; + std::string address = "ring.dht"; pj_uint16_t port = getTlsListenerPort(); link_->sipTransport->findLocalAddressFromTransport(t, transportType, hostname_, address, port); @@ -699,7 +699,7 @@ DHTAccount::getContactHeader(pjsip_transport* t) * Enable the presence module */ void -DHTAccount::enablePresence(const bool& /* enabled */) +RingAccount::enablePresence(const bool& /* enabled */) { } @@ -708,13 +708,13 @@ DHTAccount::enablePresence(const bool& /* enabled */) * and process the change. */ void -DHTAccount::supportPresence(int /* function */, bool /* enabled*/) +RingAccount::supportPresence(int /* function */, bool /* enabled*/) { } #endif /* -void DHTAccount::updateDialogViaSentBy(pjsip_dialog *dlg) +void RingAccount::updateDialogViaSentBy(pjsip_dialog *dlg) { if (allowViaRewrite_ && via_addr_.host.slen > 0) pjsip_dlg_set_via_sent_by(dlg, &via_addr_, via_tp_); diff --git a/daemon/src/dht/dhtaccount.h b/daemon/src/ringdht/ringaccount.h similarity index 97% rename from daemon/src/dht/dhtaccount.h rename to daemon/src/ringdht/ringaccount.h index b84927428776f3883a5432bfd0ad98aec2ce9418..9a7894794828a5811adb48c46714ab5ea5cd51da 100644 --- a/daemon/src/dht/dhtaccount.h +++ b/daemon/src/ringdht/ringaccount.h @@ -29,8 +29,8 @@ * as that of the covered work. */ -#ifndef DHTACCOUNT_H -#define DHTACCOUNT_H +#ifndef RINGACCOUNT_H +#define RINGACCOUNT_H #ifdef HAVE_CONFIG_H #include "config.h" @@ -68,9 +68,9 @@ namespace YAML { * @file sipaccount.h * @brief A SIP Account specify SIP specific functions and object = SIPCall/SIPVoIPLink) */ -class DHTAccount : public SIPAccountBase { +class RingAccount : public SIPAccountBase { public: - constexpr static const char * const ACCOUNT_TYPE = "DHT"; + constexpr static const char * const ACCOUNT_TYPE = "RING"; constexpr static const in_port_t DHT_DEFAULT_PORT = 4222; const char* getAccountType() const { @@ -81,9 +81,9 @@ class DHTAccount : public SIPAccountBase { * Constructor * @param accountID The account identifier */ - DHTAccount(const std::string& accountID, bool presenceEnabled); + RingAccount(const std::string& accountID, bool presenceEnabled); - ~DHTAccount(); + ~RingAccount(); /** * Serialize internal state of this account for configuration @@ -261,7 +261,7 @@ class DHTAccount : public SIPAccountBase { */ virtual void setAccountDetails(const std::map<std::string, std::string> &details); - NON_COPYABLE(DHTAccount); + NON_COPYABLE(RingAccount); /** * Start a SIP Call diff --git a/daemon/src/sip/sipvoiplink.cpp b/daemon/src/sip/sipvoiplink.cpp index 2e8d6c4b9f0099b5ce01dd1ecd699221eb9cb900..cc8a55d6e057345fa60d82bbe5ea91f4c320c54c 100644 --- a/daemon/src/sip/sipvoiplink.cpp +++ b/daemon/src/sip/sipvoiplink.cpp @@ -45,7 +45,7 @@ #include "string_utils.h" #if HAVE_DHT -#include "dht/dhtaccount.h" +#include "ringdht/ringaccount.h" #endif #include "call_factory.h" @@ -654,7 +654,7 @@ SIPVoIPLink::guessAccount(const std::string& userName, #if HAVE_DHT // DHT accounts - for (const auto& account : Manager::instance().getAllAccounts<DHTAccount>()) { + for (const auto& account : Manager::instance().getAllAccounts<RingAccount>()) { if (!account) continue; const MatchRank match(account->matches(userName, server)); diff --git a/daemon/tools/Makefile.am b/daemon/tools/Makefile.am index 9dcbaf0cbc78a7196da3f882c28c59ebcff271c7..a17ff725aad4c76859f8ca8f0939568cbc601c55 100644 --- a/daemon/tools/Makefile.am +++ b/daemon/tools/Makefile.am @@ -1,6 +1,6 @@ include ../globals.mak -libexecdir=$(libdir)/sflphone +libexecdir=$(libdir)/dht libexec_PROGRAMS = dhtnode dhtnode_SOURCES = \ @@ -8,8 +8,8 @@ dhtnode_SOURCES = \ $(top_srcdir)/src/logger.c \ dhtnode.cpp -dhtnode_CXXFLAGS=-I$(top_srcdir)/src/dht -DTOP_BUILDDIR=\"$$(cd "$(top_builddir)"; pwd)\" +dhtnode_CXXFLAGS=-I$(top_srcdir)/src/ringdht -DTOP_BUILDDIR=\"$$(cd "$(top_builddir)"; pwd)\" dhtnode_LDFLAGS = @GNUTLS_LIBS@ -lpthread -dhtnode_LDADD = $(top_builddir)/src/dht/dhtcpp/libdhtcpp.la +dhtnode_LDADD = $(top_builddir)/src/ringdht/dhtcpp/libdhtcpp.la diff --git a/gnome/src/accountlist.c b/gnome/src/accountlist.c index 233dff88d750f071b3afd71c3eff28db8bc801c4..772e2b7257300648fd39fe8ccbe29f1f69fd4096 100644 --- a/gnome/src/accountlist.c +++ b/gnome/src/accountlist.c @@ -366,7 +366,7 @@ gboolean account_is_IAX(const account_t *account) gboolean account_is_DHT(const account_t *account) { - return is_type(account, "DHT"); + return is_type(account, "RING"); } account_t *create_default_account() diff --git a/gnome/src/config/accountconfigdialog.c b/gnome/src/config/accountconfigdialog.c index f21b53ae1c3a70b406929e84140fd3a38b9ec740..bb1c56f69a9b18d3dba7069cbb6f0c5af1a76b3c 100644 --- a/gnome/src/config/accountconfigdialog.c +++ b/gnome/src/config/accountconfigdialog.c @@ -172,7 +172,7 @@ static void show_password_cb(G_GNUC_UNUSED GtkWidget *widget, gpointer data) static void hide_widget_for_dht(GtkComboBox *combo_box, gpointer widget) { gchar *type = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(combo_box)); - if (utf8_case_equal(type, "DHT")) { + if (utf8_case_equal(type, "RING")) { gtk_widget_hide(GTK_WIDGET(widget)); } else { gtk_widget_show(GTK_WIDGET(widget)); @@ -184,7 +184,7 @@ static void hide_widget_for_dht(GtkComboBox *combo_box, gpointer widget) static void show_widget_for_dht(GtkComboBox *combo_box, gpointer widget) { gchar *type = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(combo_box)); - if (utf8_case_equal(type, "DHT")) { + if (utf8_case_equal(type, "RING")) { gtk_widget_show(GTK_WIDGET(widget)); } else { gtk_widget_hide(GTK_WIDGET(widget)); @@ -218,7 +218,7 @@ static void change_type_cb(GtkComboBox *combo_box, gpointer data) if (utf8_case_equal(type, "IAX")) { gtk_widget_hide(security_tab); gtk_widget_hide(advanced_tab); - } else if (utf8_case_equal(type, "DHT")) { + } else if (utf8_case_equal(type, "RING")) { gtk_widget_hide(security_tab); gtk_widget_show(advanced_tab); } else if (utf8_case_equal(type, "SIP")) { @@ -329,7 +329,7 @@ create_accout_type_combo_box(const account_t *account, gboolean is_new) gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(account_combo), "SIP"); if (dbus_is_iax2_enabled()) gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(account_combo), "IAX"); - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(account_combo), "DHT"); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(account_combo), "RING"); if (account_is_SIP(account)) gtk_combo_box_set_active(GTK_COMBO_BOX(account_combo), 0); @@ -1528,9 +1528,9 @@ static void update_account_from_basic_tab(account_t *account) else proto = g_strdup("SIP"); - if (g_strcmp0(proto, "SIP") == 0 || g_strcmp0(proto, "DHT") == 0) { + if (g_strcmp0(proto, "SIP") == 0 || g_strcmp0(proto, "RING") == 0) { - if (!IS_IP2IP && g_strcmp0(proto, "DHT") != 0) { + if (!IS_IP2IP && g_strcmp0(proto, "RING") != 0) { account_replace(account, CONFIG_ACCOUNT_REGISTRATION_EXPIRE, gtk_entry_get_text(GTK_ENTRY(expire_spin_box))); @@ -1560,7 +1560,7 @@ static void update_account_from_basic_tab(account_t *account) #endif #ifdef SFL_PRESENCE - if (!IS_IP2IP && g_strcmp0(proto, "DHT") != 0) { + if (!IS_IP2IP && g_strcmp0(proto, "RING") != 0) { v = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(presence_check_box)); account_replace(account, CONFIG_PRESENCE_ENABLED, bool_to_string(v)); // TODO enable/disable the presence window view @@ -1607,7 +1607,7 @@ static void update_account_from_basic_tab(account_t *account) account_replace(account, CONFIG_ACCOUNT_ALIAS, gtk_entry_get_text(GTK_ENTRY(entry_alias))); account_replace(account, CONFIG_ACCOUNT_TYPE, proto); account_replace(account, CONFIG_ACCOUNT_HOSTNAME, gtk_entry_get_text(GTK_ENTRY(entry_hostname))); - if (g_strcmp0(proto, "DHT") != 0) { + if (g_strcmp0(proto, "RING") != 0) { account_replace(account, CONFIG_ACCOUNT_USERNAME, gtk_entry_get_text(GTK_ENTRY(entry_username))); account_replace(account, CONFIG_ACCOUNT_PASSWORD, gtk_entry_get_text(GTK_ENTRY(entry_password))); account_replace(account, CONFIG_ACCOUNT_MAILBOX, gtk_entry_get_text(GTK_ENTRY(entry_mailbox)));