From: Igor Kotrasinski Date: Thu, 7 Dec 2017 10:57:01 +0000 (+0100) Subject: Add port setting to TABinaryManager X-Git-Tag: submit/tizen/20180412.092951~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c1b895cc648ee26fad7805167fa96a9d514922c;p=platform%2Fcore%2Fsecurity%2Ftef-simulator.git Add port setting to TABinaryManager Change-Id: I713b7015f86a12b704209c64e7cda135d50f9153 Signed-off-by: Igor Kotrasinski --- diff --git a/simulatordaemon/src/TABinaryManager/TABinaryManager.cpp b/simulatordaemon/src/TABinaryManager/TABinaryManager.cpp index 7fbcb80..4ab2d1c 100644 --- a/simulatordaemon/src/TABinaryManager/TABinaryManager.cpp +++ b/simulatordaemon/src/TABinaryManager/TABinaryManager.cpp @@ -1,5 +1,5 @@ /** - * Copyright (c) 2015-2017 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2015-2018 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. @@ -417,6 +417,22 @@ string TABinaryManager::getPort(string uuid) { return returnValue; } +int TABinaryManager::setPort(string uuid, string port) { + int ret; + pthread_rwlock_wrlock(&binaryMapLock); + + map::iterator it = binaryMap.find(uuid); + if (it != binaryMap.end()) { + it->second.port = port; + ret = 0; + } else { + ret = 1; + } + + pthread_rwlock_unlock(&binaryMapLock); + return ret; +} + /** * Converts UUID from TEEC_UUID to a string * @return string of TEEC_UUID diff --git a/simulatordaemon/src/TABinaryManager/TABinaryManager.h b/simulatordaemon/src/TABinaryManager/TABinaryManager.h index b2b471d..4526a62 100644 --- a/simulatordaemon/src/TABinaryManager/TABinaryManager.h +++ b/simulatordaemon/src/TABinaryManager/TABinaryManager.h @@ -1,5 +1,5 @@ /** - * Copyright (c) 2015-2017 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2015-2018 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. @@ -98,6 +98,11 @@ public: string getPort(string uuid); int isKeepAlive(string uuid, bool &KeepAlive); + /* + * TA property setters + */ + int setPort(string uuid, string port); + virtual ~TABinaryManager(); };