Remove echo service.
authorBartlomiej Grzelewski <b.grzelewski@samsung.com>
Mon, 18 Aug 2014 09:04:24 +0000 (11:04 +0200)
committerBartlomiej Grzelewski <b.grzelewski@samsung.com>
Fri, 12 Sep 2014 12:59:27 +0000 (14:59 +0200)
Change-Id: I13a25e3b8d8ddaba6f07d37191644dc813301a03

packaging/key-manager.spec
src/CMakeLists.txt
src/include/ckm/ckm-echo.h [deleted file]
src/manager/client/client-echo.cpp [deleted file]
src/manager/main/key-manager-main.cpp
src/manager/service/echo.cpp [deleted file]
src/manager/service/echo.h [deleted file]
systemd/CMakeLists.txt
systemd/central-key-manager-echo.socket [deleted file]
systemd/central-key-manager.service

index f1ac51d..37a0de4 100755 (executable)
@@ -81,7 +81,6 @@ mkdir -p %{buildroot}/etc/security/
 mkdir -p %{buildroot}/usr/lib/systemd/system/multi-user.target.wants
 mkdir -p %{buildroot}/usr/lib/systemd/system/sockets.target.wants
 ln -s ../central-key-manager.service %{buildroot}/usr/lib/systemd/system/multi-user.target.wants/central-key-manager.service
-ln -s ../central-key-manager-echo.socket %{buildroot}/usr/lib/systemd/system/sockets.target.wants/central-key-manager-echo.socket
 ln -s ../central-key-manager-api-control.socket %{buildroot}/usr/lib/systemd/system/sockets.target.wants/central-key-manager-api-control.socket
 ln -s ../central-key-manager-api-storage.socket %{buildroot}/usr/lib/systemd/system/sockets.target.wants/central-key-manager-api-storage.socket
 ln -s ../central-key-manager-api-ocsp.socket %{buildroot}/usr/lib/systemd/system/sockets.target.wants/central-key-manager-api-ocsp.socket
@@ -131,8 +130,6 @@ fi
 %attr(-,root,root) /usr/lib/systemd/system/multi-user.target.wants/central-key-manager.service
 %attr(-,root,root) /usr/lib/systemd/system/central-key-manager.service
 %attr(-,root,root) /usr/lib/systemd/system/central-key-manager.target
-%attr(-,root,root) /usr/lib/systemd/system/sockets.target.wants/central-key-manager-echo.socket
-%attr(-,root,root) /usr/lib/systemd/system/central-key-manager-echo.socket
 %attr(-,root,root) /usr/lib/systemd/system/sockets.target.wants/central-key-manager-api-control.socket
 %attr(-,root,root) /usr/lib/systemd/system/central-key-manager-api-control.socket
 %attr(-,root,root) /usr/lib/systemd/system/sockets.target.wants/central-key-manager-api-storage.socket
@@ -159,7 +156,6 @@ fi
 %{_includedir}/ckm/ckm/ckm-certificate.h
 %{_includedir}/ckm/ckm/ckm-control.h
 %{_includedir}/ckm/ckm/ckm-error.h
-%{_includedir}/ckm/ckm/ckm-echo.h
 %{_includedir}/ckm/ckm/ckm-key.h
 %{_includedir}/ckm/ckm/ckm-password.h
 %{_includedir}/ckm/ckm/ckm-raw-buffer.h
index 86f1344..e3dabac 100644 (file)
@@ -17,7 +17,6 @@ SET(KEY_MANAGER_SOURCES
     ${KEY_MANAGER_PATH}/main/generic-socket-manager.cpp
     ${KEY_MANAGER_PATH}/main/socket-manager.cpp
     ${KEY_MANAGER_PATH}/main/key-manager-main.cpp
-    ${KEY_MANAGER_PATH}/service/echo.cpp
     ${KEY_MANAGER_PATH}/service/ckm-service.cpp
     ${KEY_MANAGER_PATH}/service/ckm-logic.cpp
     ${KEY_MANAGER_PATH}/service/key-provider.cpp
@@ -76,7 +75,6 @@ INCLUDE_DIRECTORIES(
 
 SET(KEY_MANAGER_CLIENT_SOURCES
     ${KEY_MANAGER_CLIENT_SRC_PATH}/client-common.cpp
-    ${KEY_MANAGER_CLIENT_SRC_PATH}/client-echo.cpp
     ${KEY_MANAGER_CLIENT_SRC_PATH}/client-error.cpp
     ${KEY_MANAGER_CLIENT_SRC_PATH}/client-manager-impl.cpp
     ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-type.cpp
@@ -190,7 +188,6 @@ INSTALL(FILES
     ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-certificate.h
     ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-control.h
     ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-error.h
-    ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-echo.h
     ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-key.h
     ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-password.h
     ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-raw-buffer.h
diff --git a/src/include/ckm/ckm-echo.h b/src/include/ckm/ckm-echo.h
deleted file mode 100644 (file)
index 643470a..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *  Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License
- *
- * @file    ckm-manager.h
- * @version 1.0
- * @brief   This file contains APIs of the Central Key Manager
-*/
-#ifndef KEY_MANAGER_ECHO_H
-#define KEY_MANAGER_ECHO_H
-/*
- * This function was created mainly for testing ckm-manager client/service
- * proper behaviour. It sends a message and returns message from service,
- * which should be a pure echo.
- *
- * \param[in] Message for service
- * \param[out] Response from service
- *
- * \return CKM_API_ERROR_INPUT_PARAM when trying to pass NULL message
- * \return CKM_API_SUCCESS on success
- */
-namespace CKM {
-
-int key_manager_echo(const char* echo, char** oche);
-
-} // namespace CKM
-
-#endif
-
diff --git a/src/manager/client/client-echo.cpp b/src/manager/client/client-echo.cpp
deleted file mode 100644 (file)
index d1f4611..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd All Rights Reserved
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License
- *
- *
- * @file        client-echo.cpp
- * @author      Zofia Abramowska (z.abramowska@samsung.com)
- * @version     1.0
- * @brief       This file contains example of ckm-manager client implementation
- */
-
-#include <dpl/log/log.h>
-#include <dpl/exception.h>
-
-#include <message-buffer.h>
-#include <client-common.h>
-#include <protocols.h>
-
-#include <ckm/ckm-error.h>
-#include <ckm/ckm-echo.h>
-
-KEY_MANAGER_API
-int key_manager_echo(const char *echo, char** oche) {
-    using namespace CKM;
-
-    if(echo == NULL){
-        LogDebug("Echo message is null");
-        return CKM_API_ERROR_INPUT_PARAM;
-    }
-
-    MessageBuffer send, recv;
-    Serialization::Serialize(send, std::string(echo));
-
-    int retCode = sendToServer(SERVICE_SOCKET_ECHO, send.Pop(), recv);
-
-    if(retCode != CKM_API_SUCCESS)
-        return retCode;
-
-    std::string response;
-    Deserialization::Deserialize(recv, response);
-
-    *oche = strdup(response.c_str());
-
-    return CKM_API_SUCCESS;
-}
index 00a81d5..86f1fb7 100644 (file)
@@ -33,7 +33,6 @@
 
 #include <socket-manager.h>
 
-#include <echo.h>
 #include <ckm-service.h>
 #include <ocsp-service.h>
 
@@ -100,7 +99,6 @@ int main(void) {
             LogInfo("Start!");
             CKM::SocketManager manager;
 
-            REGISTER_SOCKET_SERVICE(manager, CKM::EchoService);
             REGISTER_SOCKET_SERVICE(manager, CKM::CKMService);
             REGISTER_SOCKET_SERVICE(manager, CKM::OCSPService);
 
diff --git a/src/manager/service/echo.cpp b/src/manager/service/echo.cpp
deleted file mode 100644 (file)
index 2712afd..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- *  Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd All Rights Reserved
- *
- *  Contact: Bumjin Im <bj.im@samsung.com>
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License
- */
-/*
- * @file        server-main2.h
- * @author      Bartlomiej Grzelewski (b.grzelewski@samsung.com)
- * @version     1.0
- * @brief       Implementation of sample service.
- */
-
-#include <dpl/log/log.h>
-
-#include <protocols.h>
-#include <echo.h>
-
-namespace CKM {
-
-GenericSocketService::ServiceDescriptionVector EchoService::GetServiceDescription() {
-    return ServiceDescriptionVector {{SERVICE_SOCKET_ECHO, "*"}};
-}
-
-void EchoService::accept(const AcceptEvent &event) {
-    LogDebug("Accept event. ConnectionID: " << event.connectionID.sock
-        << " ServiceID: " << event.interfaceID);
-}
-
-void EchoService::write(const WriteEvent &event) {
-    LogDebug("WriteEvent. ConnectionID: " << event.connectionID.sock <<
-        " Size: " << event.size << " Left: " << event.left);
-    if (event.left == 0)
-        m_serviceManager->Close(event.connectionID);
-}
-
-void EchoService::process(const ReadEvent &event) {
-    LogDebug("ReadEvent. ConnectionID: " << event.connectionID.sock <<
-      " Buffer size: " << event.rawBuffer.size());
-    m_serviceManager->Write(event.connectionID, event.rawBuffer);
-    LogDebug("Write completed");
-}
-
-void EchoService::close(const CloseEvent &event) {
-    LogDebug("CloseEvent. ConnectionID: " << event.connectionID.sock);
-}
-
-} // namespace CKM
-
diff --git a/src/manager/service/echo.h b/src/manager/service/echo.h
deleted file mode 100644 (file)
index 99342c8..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- *  Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd All Rights Reserved
- *
- *  Contact: Bumjin Im <bj.im@samsung.com>
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License
- */
-/*
- * @file        echo.h
- * @author      Bartlomiej Grzelewski (b.grzelewski@samsung.com)
- * @version     1.0
- * @brief       Sample service implementation.
- */
-
-#ifndef _SECURITY_SERVER_ECHO_
-#define _SECURITY_SERVER_ECHO_
-
-#include <service-thread.h>
-#include <generic-socket-manager.h>
-
-#include <dpl/serialization.h>
-
-#include <message-buffer.h>
-
-namespace CKM {
-
-class EchoService
-  : public CKM::GenericSocketService
-  , public CKM::ServiceThread<EchoService>
-{
-public:
-    ServiceDescriptionVector GetServiceDescription();
-
-    DECLARE_THREAD_EVENT(AcceptEvent, accept)
-    DECLARE_THREAD_EVENT(WriteEvent, write)
-    DECLARE_THREAD_EVENT(ReadEvent, process)
-    DECLARE_THREAD_EVENT(CloseEvent, close)
-
-    void accept(const AcceptEvent &event);
-    void write(const WriteEvent &event);
-    void process(const ReadEvent &event);
-    void close(const CloseEvent &event);
-};
-
-} // namespace CKM
-
-#endif // _SECURITY_SERVER_ECHO_
index a0b8851..ac331a5 100644 (file)
@@ -4,7 +4,6 @@ INSTALL(FILES
     ${CMAKE_SOURCE_DIR}/systemd/central-key-manager-api-control.socket
     ${CMAKE_SOURCE_DIR}/systemd/central-key-manager-api-storage.socket
     ${CMAKE_SOURCE_DIR}/systemd/central-key-manager-api-ocsp.socket
-    ${CMAKE_SOURCE_DIR}/systemd/central-key-manager-echo.socket
     DESTINATION
     /usr/lib/systemd/system
 )
diff --git a/systemd/central-key-manager-echo.socket b/systemd/central-key-manager-echo.socket
deleted file mode 100644 (file)
index ea816ae..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-[Socket]
-ListenStream=/tmp/.central-key-manager-echo.sock
-SockMode=0777
-SmackLabelIPIn=*
-SmackLabelIPOut=@
-
-Service=central-key-manager.service
-
-[Unit]
-Wants=central-key-manager.target
-Before=central-key-manager.target
-
-[Install]
-WantedBy=sockets.target
index c08235a..6854b94 100644 (file)
@@ -4,7 +4,6 @@ Description=Start the Central Key Manager
 [Service]
 Type=notify
 ExecStart=/usr/bin/key-manager
-Sockets=central-key-manager-echo.socket
 Sockets=central-key-manager-api-storage.socket
 Sockets=central-key-manager-api-control.socket
 Sockets=central-key-manager-api-ocsp.socket