From 13c52e373b371660c4b3b1f6e2db36ae24c3cae2 Mon Sep 17 00:00:00 2001 From: Adrien Beraud <adrien.beraud@savoirfairelinux.com> Date: Mon, 4 Sep 2017 17:51:55 +0200 Subject: [PATCH] ringaccount: move configuration keys to separate file Ongoing effort to make RingAccount smaller and cleaner. Configuration keys aren't used elsewhere so they don't need to be exposed publicly by RingAccount. Move them to a separate header. Change-Id: I5788d3ecb5ac7ede7e970d6a2db753ab991e64f0 --- src/ringdht/configkeys.h | 43 +++++++++++++++++++++++++++++++++++++ src/ringdht/ringaccount.cpp | 2 ++ src/ringdht/ringaccount.h | 21 ------------------ 3 files changed, 45 insertions(+), 21 deletions(-) create mode 100644 src/ringdht/configkeys.h diff --git a/src/ringdht/configkeys.h b/src/ringdht/configkeys.h new file mode 100644 index 0000000000..40650cade8 --- /dev/null +++ b/src/ringdht/configkeys.h @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2017 Savoir-faire Linux Inc. + * Author : Adrien Béraud <adrien.beraud@savoirfairelinux.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ +#pragma once + +namespace ring { + +namespace Conf { +constexpr const char* const DHT_PORT_KEY = "dhtPort"; +constexpr const char* const DHT_VALUES_PATH_KEY = "dhtValuesPath"; +constexpr const char* const DHT_CONTACTS = "dhtContacts"; +constexpr const char* const DHT_PUBLIC_PROFILE = "dhtPublicProfile"; +constexpr const char* const DHT_PUBLIC_IN_CALLS = "dhtPublicInCalls"; +constexpr const char* const DHT_ALLOW_PEERS_FROM_HISTORY = "allowPeersFromHistory"; +constexpr const char* const DHT_ALLOW_PEERS_FROM_CONTACT = "allowPeersFromContact"; +constexpr const char* const DHT_ALLOW_PEERS_FROM_TRUSTED = "allowPeersFromTrusted"; +constexpr const char* const ETH_KEY = "ethKey"; +constexpr const char* const ETH_PATH = "ethPath"; +constexpr const char* const ETH_ACCOUNT = "ethAccount"; +constexpr const char* const RING_CA_KEY = "ringCaKey"; +constexpr const char* const RING_ACCOUNT_KEY = "ringAccountKey"; +constexpr const char* const RING_ACCOUNT_CERT = "ringAccountCert"; +constexpr const char* const RING_ACCOUNT_RECEIPT = "ringAccountReceipt"; +constexpr const char* const RING_ACCOUNT_RECEIPT_SIG = "ringAccountReceiptSignature"; +constexpr const char* const RING_ACCOUNT_CRL = "ringAccountCRL"; +constexpr const char* const RING_ACCOUNT_CONTACTS = "ringAccountContacts"; +} + +} diff --git a/src/ringdht/ringaccount.cpp b/src/ringdht/ringaccount.cpp index 34d5cc763d..d42b640de1 100644 --- a/src/ringdht/ringaccount.cpp +++ b/src/ringdht/ringaccount.cpp @@ -27,6 +27,8 @@ #include "config.h" #endif +#include "configkeys.h" + #include "thread_pool.h" #include "sip/sdp.h" diff --git a/src/ringdht/ringaccount.h b/src/ringdht/ringaccount.h index 0892353147..6157347187 100644 --- a/src/ringdht/ringaccount.h +++ b/src/ringdht/ringaccount.h @@ -67,27 +67,6 @@ namespace dev namespace ring { -namespace Conf { -constexpr const char* const DHT_PORT_KEY = "dhtPort"; -constexpr const char* const DHT_VALUES_PATH_KEY = "dhtValuesPath"; -constexpr const char* const DHT_CONTACTS = "dhtContacts"; -constexpr const char* const DHT_PUBLIC_PROFILE = "dhtPublicProfile"; -constexpr const char* const DHT_PUBLIC_IN_CALLS = "dhtPublicInCalls"; -constexpr const char* const DHT_ALLOW_PEERS_FROM_HISTORY = "allowPeersFromHistory"; -constexpr const char* const DHT_ALLOW_PEERS_FROM_CONTACT = "allowPeersFromContact"; -constexpr const char* const DHT_ALLOW_PEERS_FROM_TRUSTED = "allowPeersFromTrusted"; -constexpr const char* const ETH_KEY = "ethKey"; -constexpr const char* const ETH_PATH = "ethPath"; -constexpr const char* const ETH_ACCOUNT = "ethAccount"; -constexpr const char* const RING_CA_KEY = "ringCaKey"; -constexpr const char* const RING_ACCOUNT_KEY = "ringAccountKey"; -constexpr const char* const RING_ACCOUNT_CERT = "ringAccountCert"; -constexpr const char* const RING_ACCOUNT_RECEIPT = "ringAccountReceipt"; -constexpr const char* const RING_ACCOUNT_RECEIPT_SIG = "ringAccountReceiptSignature"; -constexpr const char* const RING_ACCOUNT_CRL = "ringAccountCRL"; -constexpr const char* const RING_ACCOUNT_CONTACTS = "ringAccountContacts"; -} - class IceTransport; class RingAccount : public SIPAccountBase { -- GitLab