diff --git a/common/include/ipc/model/ipc_register_listener_req.h b/common/include/ipc/model/ipc_register_listener_req.h index 07fd83cee94565a939e1777ae1fe4152feb25b7b..d727fbd71dbec8ad77b6589a74870e1dab0e0437 100644 --- a/common/include/ipc/model/ipc_register_listener_req.h +++ b/common/include/ipc/model/ipc_register_listener_req.h @@ -19,7 +19,7 @@ #include "ipc_req.h" #ifdef LITE_DEVICE -#include "liteipc_adapter.h" +#include "ipc_skeleton.h" #else #include "iremote_stub.h" #endif diff --git a/ext/pin_auth/BUILD.gn b/ext/pin_auth/BUILD.gn index 8816e0bd32e510b9e3f09303fa6058ccafbc3256..4482cc08c508a494d9ea564edef555b14c45fcb7 100644 --- a/ext/pin_auth/BUILD.gn +++ b/ext/pin_auth/BUILD.gn @@ -72,7 +72,7 @@ if (defined(ohos_lite)) { "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", "//base/security/deviceauth/services:deviceauth_sdk", "//foundation/communication/dsoftbus/sdk:softbus_client", - "//foundation/communication/ipc_lite:liteipc_adapter", + "//foundation/communication/ipc/interfaces/innerkits/c/ipc:ipc_single", "//foundation/distributedschedule/samgr_lite/samgr:samgr", "//third_party/bounds_checking_function:libsec_shared", "//third_party/mbedtls:mbedtls_shared", diff --git a/interfaces/inner_kits/native_cpp/BUILD.gn b/interfaces/inner_kits/native_cpp/BUILD.gn index 7e888d5dde50461a61717a3bd0dcfccceca97d6b..593cd5823976bcd95fa21df95260d768e5ef22ca 100644 --- a/interfaces/inner_kits/native_cpp/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/BUILD.gn @@ -76,7 +76,7 @@ if (defined(ohos_lite)) { "//utils/native/lite/include", "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits/hilog", "//third_party/bounds_checking_function/include", - "//foundation/communication/ipc_lite/interfaces/kits", + "//foundation/communication/ipc/interfaces/innerkits/c/ipc/include", "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", "//third_party/json/include", @@ -95,7 +95,7 @@ if (defined(ohos_lite)) { deps = [ "${utils_path}:devicemanagerutils", "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", + "//foundation/communication/ipc/interfaces/innerkits/c/ipc:ipc_single", "//foundation/distributedschedule/samgr_lite/samgr:samgr", "//third_party/bounds_checking_function:libsec_shared", "//utils/native/lite:utils", diff --git a/interfaces/inner_kits/native_cpp/include/ipc/lite/ipc_client_server_proxy.h b/interfaces/inner_kits/native_cpp/include/ipc/lite/ipc_client_server_proxy.h index 943920175829dc72e287267e0109760fec575b7b..1fec5b05fde8a76cd229657e233fe8537e110434 100644 --- a/interfaces/inner_kits/native_cpp/include/ipc/lite/ipc_client_server_proxy.h +++ b/interfaces/inner_kits/native_cpp/include/ipc/lite/ipc_client_server_proxy.h @@ -23,7 +23,7 @@ #include "ipc_req.h" #include "ipc_rsp.h" #include "iproxy_client.h" -#include "liteipc_adapter.h" +#include "ipc_skeleton.h" #include "samgr_lite.h" namespace OHOS { diff --git a/interfaces/inner_kits/native_cpp/include/ipc/lite/ipc_client_stub.h b/interfaces/inner_kits/native_cpp/include/ipc/lite/ipc_client_stub.h index df713909418846c8fb61d671b41e06f0c715327f..f5ccc7fa286663c40090b36a74921076dd7109f5 100644 --- a/interfaces/inner_kits/native_cpp/include/ipc/lite/ipc_client_stub.h +++ b/interfaces/inner_kits/native_cpp/include/ipc/lite/ipc_client_stub.h @@ -19,7 +19,7 @@ #include #include -#include "liteipc_adapter.h" +#include "ipc_skeleton.h" #include "single_instance.h" namespace OHOS { @@ -43,6 +43,7 @@ private: std::mutex lock_; bool bInit { false }; SvcIdentity clientIdentity_; + IpcObjectStub objectStub_; }; } // namespace DistributedHardware } // namespace OHOS diff --git a/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_client_server_proxy.cpp b/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_client_server_proxy.cpp index 191c579864908ba57b5fc8a498caa55cae89b9f4..c9782aed9bbf26636f688d3960978e8528af0a2c 100644 --- a/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_client_server_proxy.cpp +++ b/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_client_server_proxy.cpp @@ -34,20 +34,15 @@ void __attribute__((weak)) HOS_SystemInit(void) return; } -int32_t DmDeathCallback(const IpcContext *ctx, void *ipcMsg, IpcIo *data, void *arg) +void DmDeathCallback(void *arg) { - (void)ctx; - (void)ipcMsg; - (void)data; (void)arg; - LOGI("ATTENTION SERVICE (%s) DEAD !!!\n", DEVICE_MANAGER_SERVICE_NAME); - UnregisterDeathCallback(g_svcIdentity, g_deathCbId); + LOGI("ATTENTION SERVICE (%s) DEAD !!!\n", DEVICE_MANAGER_SERVICE_NAME); g_deathCbId = INVALID_CB_ID; g_svcIdentity.handle = 0; g_svcIdentity.token = 0; g_svcIdentity.cookie = 0; DeviceManagerNotify::GetInstance().OnRemoteDied(); - return DM_OK; } static int32_t SendCmdResultCb(IOwner owner, int32_t code, IpcIo *reply) @@ -80,7 +75,7 @@ int IpcClientServerProxy::RegisterServerDeathCb(void) { g_svcIdentity = SAMGR_GetRemoteIdentity(DEVICE_MANAGER_SERVICE_NAME, nullptr); g_deathCbId = INVALID_CB_ID; - if (RegisterDeathCallback(nullptr, g_svcIdentity, DmDeathCallback, nullptr, &g_deathCbId) != EC_SUCCESS) { + if (AddDeathRecipient(g_svcIdentity, DmDeathCallback, nullptr, &g_deathCbId) != EC_SUCCESS) { LOGE("reg death callback failed"); return DM_FAILED; } diff --git a/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_client_stub.cpp b/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_client_stub.cpp index d692823eaf1121d998c3e5899cd457135f9675b9..28153a3d61122f1c8dd8c4718fdfa1d80d695f22 100644 --- a/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_client_stub.cpp +++ b/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_client_stub.cpp @@ -25,19 +25,15 @@ namespace OHOS { namespace DistributedHardware { IMPLEMENT_SINGLE_INSTANCE(IpcClientStub); -static int32_t ClientIpcInterfaceMsgHandle(const IpcContext *ctx, void *ipcMsg, IpcIo *io, void *arg) +static int32_t ClientIpcInterfaceMsgHandle(uint32_t code, IpcIo *data, IpcIo *reply, MessageOption option) { - (void)arg; - if (ipcMsg == nullptr || io == nullptr) { + if (data== nullptr) { LOGE("invalid param"); return DM_INPUT_PARA_EMPTY; } - uint32_t code = 0; - GetCode(ipcMsg, &code); - int32_t errCode = IpcCmdRegister::GetInstance().OnIpcCmd(code, *io); + int32_t errCode = IpcCmdRegister::GetInstance().OnIpcCmd(code, *data); LOGI("receive ipc transact code:%u, retCode=%d", code, errCode); - FreeBuffer(ctx, ipcMsg); return errCode; } @@ -47,10 +43,14 @@ int32_t IpcClientStub::Init() if (bInit) { return DM_OK; } - if (RegisterIpcCallback(ClientIpcInterfaceMsgHandle, 0, IPC_WAIT_FOREVER, &clientIdentity_, nullptr) != 0) { - LOGE("register ipc cb failed"); - return DM_FAILED; - } + + objectStub_.func = ClientIpcInterfaceMsgHandle; + objectStub_.args = nullptr; + objectStub_.isRemote = false; + clientIdentity_.handle = IPC_INVALID_HANDLE; + clientIdentity_.token = 0; + clientIdentity_.cookie = (uintptr_t)&objectStub_; + bInit = true; return DM_OK; } diff --git a/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_cmd_parser.cpp b/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_cmd_parser.cpp index 35643d54c6bf415b8b3df547b13d5e28b4087ca4..53153ecf14113854d9ebec0d5ad4a29d223570ee 100644 --- a/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_cmd_parser.cpp +++ b/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_cmd_parser.cpp @@ -41,8 +41,11 @@ ON_IPC_SET_REQUEST(REGISTER_DEVICE_MANAGER_LISTENER, std::shared_ptr pBa SvcIdentity svcIdentity = pReq->GetSvcIdentity(); IpcIoInit(&request, buffer, buffLen, 1); - IpcIoPushString(&request, pkgName.c_str()); - IpcIoPushSvc(&request, &svcIdentity); + WriteString(&request, pkgName.c_str()); + bool ret = WriteRemoteObject(&request, &svcIdentity); + if (!ret) { + return DM_FAILED; + } return DM_OK; } @@ -52,7 +55,9 @@ ON_IPC_READ_RESPONSE(REGISTER_DEVICE_MANAGER_LISTENER, IpcIo &reply, std::shared LOGE("pBaseRsp is null"); return DM_FAILED; } - pBaseRsp->SetErrCode(IpcIoPopInt32(&reply)); + int32_t ret = 0; + ReadInt32(&reply, &ret); + pBaseRsp->SetErrCode(ret); return DM_OK; } @@ -62,13 +67,19 @@ ON_IPC_SET_REQUEST(UNREGISTER_DEVICE_MANAGER_LISTENER, std::shared_ptr p std::string pkgName = pBaseReq->GetPkgName(); IpcIoInit(&request, buffer, buffLen, 0); - IpcIoPushString(&request, pkgName.c_str()); + WriteString(&request, pkgName.c_str()); return DM_OK; } ON_IPC_READ_RESPONSE(UNREGISTER_DEVICE_MANAGER_LISTENER, IpcIo &reply, std::shared_ptr pBaseRsp) { - pBaseRsp->SetErrCode(IpcIoPopInt32(&reply)); + if (pBaseRsp == nullptr) { + LOGE("pBaseRsp is null"); + return DM_FAILED; + } + int32_t ret = 0; + ReadInt32(&reply, &ret); + pBaseRsp->SetErrCode(ret); return DM_OK; } @@ -80,20 +91,21 @@ ON_IPC_SET_REQUEST(GET_TRUST_DEVICE_LIST, std::shared_ptr pBaseReq, IpcI std::string extra = pReq->GetExtra(); IpcIoInit(&request, buffer, buffLen, 0); - IpcIoPushString(&request, pkgName.c_str()); - IpcIoPushString(&request, extra.c_str()); + WriteString(&request, pkgName.c_str()); + WriteString(&request, extra.c_str()); return DM_OK; } ON_IPC_READ_RESPONSE(GET_TRUST_DEVICE_LIST, IpcIo &reply, std::shared_ptr pBaseRsp) { std::shared_ptr pRsp = std::static_pointer_cast(pBaseRsp); - int32_t deviceNum = IpcIoPopInt32(&reply); + int32_t deviceNum = 0; + ReadInt32(&reply, &deviceNum); uint32_t deviceTotalSize = deviceNum * (int32_t)sizeof(DmDeviceInfo); if (deviceTotalSize > 0) { std::vector deviceInfoVec; - DmDeviceInfo *pDmDeviceinfo = (DmDeviceInfo *)IpcIoPopFlatObj(&reply, &deviceTotalSize); + DmDeviceInfo *pDmDeviceinfo = (DmDeviceInfo *)ReadRawData(&reply, deviceTotalSize); if (pDmDeviceinfo == nullptr) { LOGE("GetTrustedDeviceList read node info failed!"); pRsp->SetErrCode(DM_IPC_TRANSACTION_FAILED); @@ -105,7 +117,9 @@ ON_IPC_READ_RESPONSE(GET_TRUST_DEVICE_LIST, IpcIo &reply, std::shared_ptrSetDeviceVec(deviceInfoVec); } - pRsp->SetErrCode(IpcIoPopInt32(&reply)); + int32_t ret = 0; + ReadInt32(&reply, &ret); + pRsp->SetErrCode(ret); return DM_OK; } @@ -121,11 +135,13 @@ ON_IPC_READ_RESPONSE(GET_LOCAL_DEVICE_INFO, IpcIo &reply, std::shared_ptr pRsp = std::static_pointer_cast(pBaseRsp); uint32_t size = 0; - DmDeviceInfo *dmDeviceInfo = (DmDeviceInfo *)IpcIoPopFlatObj(&reply, &size); + DmDeviceInfo *dmDeviceInfo = (DmDeviceInfo *)ReadRawData(&reply, sizeof(DmDeviceInfo)); if (dmDeviceInfo != nullptr) { pRsp->SetLocalDeviceInfo(*dmDeviceInfo); } - pRsp->SetErrCode(IpcIoPopInt32(&reply)); + int32_t ret = 0; + ReadInt32(&reply, &ret); + pRsp->SetErrCode(ret); return DM_OK; } @@ -138,15 +154,24 @@ ON_IPC_SET_REQUEST(START_DEVICE_DISCOVER, std::shared_ptr pBaseReq, IpcI const DmSubscribeInfo dmSubscribeInfo = pReq->GetSubscribeInfo(); IpcIoInit(&request, buffer, buffLen, 0); - IpcIoPushString(&request, pkgName.c_str()); - IpcIoPushString(&request, extra.c_str()); - IpcIoPushFlatObj(&request, &dmSubscribeInfo, sizeof(DmSubscribeInfo)); + WriteString(&request, pkgName.c_str()); + WriteString(&request, extra.c_str()); + bool ret = WriteRawData(&request, &dmSubscribeInfo, sizeof(DmSubscribeInfo)); + if (!ret) { + return DM_FAILED; + } return DM_OK; } ON_IPC_READ_RESPONSE(START_DEVICE_DISCOVER, IpcIo &reply, std::shared_ptr pBaseRsp) { - pBaseRsp->SetErrCode(IpcIoPopInt32(&reply)); + if (pBaseRsp == nullptr) { + LOGE("pBaseRsp is null"); + return DM_FAILED; + } + int32_t ret = 0; + ReadInt32(&reply, &ret); + pBaseRsp->SetErrCode(ret); return DM_OK; } @@ -158,14 +183,20 @@ ON_IPC_SET_REQUEST(STOP_DEVICE_DISCOVER, std::shared_ptr pBaseReq, IpcIo uint16_t subscribeId = pReq->GetSubscribeId(); IpcIoInit(&request, buffer, buffLen, 0); - IpcIoPushString(&request, pkgName.c_str()); - IpcIoPushUint16(&request, subscribeId); + WriteString(&request, pkgName.c_str()); + WriteUint16(&request, subscribeId); return DM_OK; } ON_IPC_READ_RESPONSE(STOP_DEVICE_DISCOVER, IpcIo &reply, std::shared_ptr pBaseRsp) { - pBaseRsp->SetErrCode(IpcIoPopInt32(&reply)); + if (pBaseRsp == nullptr) { + LOGE("pBaseRsp is null"); + return DM_FAILED; + } + int32_t ret = 0; + ReadInt32(&reply, &ret); + pBaseRsp->SetErrCode(ret); return DM_OK; } @@ -178,16 +209,25 @@ ON_IPC_SET_REQUEST(AUTHENTICATE_DEVICE, std::shared_ptr pBaseReq, IpcIo DmDeviceInfo deviceInfo = pReq->GetDeviceInfo(); IpcIoInit(&request, buffer, buffLen, 0); - IpcIoPushString(&request, pkgName.c_str()); - IpcIoPushString(&request, extra.c_str()); - IpcIoPushFlatObj(&request, &deviceInfo, sizeof(DmDeviceInfo)); + WriteString(&request, pkgName.c_str()); + WriteString(&request, extra.c_str()); + bool ret = WriteRawData(&request, &deviceInfo, sizeof(DmDeviceInfo)); + if (!ret) { + return DM_FAILED; + } // L1 暂时没有考虑appimage校验(8k限制) return DM_OK; } ON_IPC_READ_RESPONSE(AUTHENTICATE_DEVICE, IpcIo &reply, std::shared_ptr pBaseRsp) { - pBaseRsp->SetErrCode(IpcIoPopInt32(&reply)); + if (pBaseRsp == nullptr) { + LOGE("pBaseRsp is null"); + return DM_FAILED; + } + int32_t ret = 0; + ReadInt32(&reply, &ret); + pBaseRsp->SetErrCode(ret); return DM_OK; } @@ -198,13 +238,19 @@ ON_IPC_SET_REQUEST(VERIFY_AUTHENTICATION, std::shared_ptr pBaseReq, IpcI std::string authPara = pReq->GetAuthPara(); IpcIoInit(&request, buffer, buffLen, 0); - IpcIoPushString(&request, authPara.c_str()); + WriteString(&request, authPara.c_str()); return DM_OK; } ON_IPC_READ_RESPONSE(VERIFY_AUTHENTICATION, IpcIo &reply, std::shared_ptr pBaseRsp) { - pBaseRsp->SetErrCode(IpcIoPopInt32(&reply)); + if (pBaseRsp == nullptr) { + LOGE("pBaseRsp is null"); + return DM_FAILED; + } + int32_t ret = 0; + ReadInt32(&reply, &ret); + pBaseRsp->SetErrCode(ret); return DM_OK; } @@ -216,24 +262,31 @@ ON_IPC_SET_REQUEST(SERVER_USER_AUTH_OPERATION, std::shared_ptr pBaseReq, int32_t action = pReq->GetOperation(); IpcIoInit(&request, buffer, buffLen, 0); - IpcIoPushString(&request, pkgName.c_str()); - IpcIoPushInt32(&request, action); + WriteString(&request, pkgName.c_str()); + WriteInt32(&request, action); return DM_OK; } ON_IPC_READ_RESPONSE(SERVER_USER_AUTH_OPERATION, IpcIo &reply, std::shared_ptr pBaseRsp) { - pBaseRsp->SetErrCode(IpcIoPopInt32(&reply)); + if (pBaseRsp == nullptr) { + LOGE("pBaseRsp is null"); + return DM_FAILED; + } + int32_t ret = 0; + ReadInt32(&reply, &ret); + pBaseRsp->SetErrCode(ret); return DM_OK; } ON_IPC_CMD(SERVER_DEVICE_STATE_NOTIFY, IpcIo &reply) { size_t len = 0; - std::string pkgName = (const char *)IpcIoPopString(&reply, &len); - DmDeviceState deviceState = static_cast(IpcIoPopInt32(&reply)); - uint32_t size; - const DmDeviceInfo *deviceInfo = (const DmDeviceInfo *)IpcIoPopFlatObj(&reply, &size); + std::string pkgName = (const char *)ReadString(&reply, &len); + int32_t ret = 0; + ReadInt32(&reply, &ret); + DmDeviceState deviceState = static_cast(ret); + const DmDeviceInfo *deviceInfo = (const DmDeviceInfo *)ReadRawData(&reply, sizeof(DmDeviceInfo)); if (pkgName == "" || len == 0 || deviceInfo == nullptr) { LOGE("OnDeviceOnline, get para failed"); return; @@ -257,10 +310,10 @@ ON_IPC_CMD(SERVER_DEVICE_STATE_NOTIFY, IpcIo &reply) ON_IPC_CMD(SERVER_DEVICE_FOUND, IpcIo &reply) { size_t len = 0; - std::string pkgName = (const char *)IpcIoPopString(&reply, &len); - uint16_t subscribeId = IpcIoPopUint16(&reply); - uint32_t size; - const DmDeviceInfo *deviceInfo = (const DmDeviceInfo *)IpcIoPopFlatObj(&reply, &size); + std::string pkgName = (const char *)ReadString(&reply, &len); + uint16_t subscribeId = 0; + ReadUint16(&reply, &subscribeId); + const DmDeviceInfo *deviceInfo = (const DmDeviceInfo *)ReadRawData(&reply, sizeof(DmDeviceInfo)); if (pkgName == "" || len == 0 || deviceInfo == nullptr) { LOGE("OnDeviceChanged, get para failed"); return; @@ -271,9 +324,11 @@ ON_IPC_CMD(SERVER_DEVICE_FOUND, IpcIo &reply) ON_IPC_CMD(SERVER_DISCOVER_FINISH, IpcIo &reply) { size_t len = 0; - std::string pkgName = (const char *)IpcIoPopString(&reply, &len); - uint16_t subscribeId = IpcIoPopUint16(&reply); - int32_t failedReason = IpcIoPopInt32(&reply); + std::string pkgName = (const char *)ReadString(&reply, &len); + uint16_t subscribeId = 0; + ReadUint16(&reply, &subscribeId); + int32_t failedReason = 0; + ReadInt32(&reply, &failedReason); if (pkgName == "" || len == 0) { LOGE("OnDiscoverySuccess, get para failed"); @@ -289,11 +344,13 @@ ON_IPC_CMD(SERVER_DISCOVER_FINISH, IpcIo &reply) ON_IPC_CMD(SERVER_AUTH_RESULT, IpcIo &reply) { size_t len = 0; - std::string pkgName = (const char *)IpcIoPopString(&reply, &len); + std::string pkgName = (const char *)ReadString(&reply, &len); size_t devIdLen = 0; - std::string deviceId = (const char *)IpcIoPopString(&reply, &devIdLen); - int32_t status = IpcIoPopInt32(&reply); - int32_t reason = IpcIoPopInt32(&reply); + std::string deviceId = (const char *)ReadString(&reply, &devIdLen); + int32_t status = 0; + ReadInt32(&reply, &status); + int32_t reason = 0; + ReadInt32(&reply, &reason); if (pkgName == "" || len == 0 || deviceId == "" || devIdLen == 0) { LOGE("OnAuthResult, get para failed"); @@ -306,11 +363,13 @@ ON_IPC_CMD(SERVER_AUTH_RESULT, IpcIo &reply) ON_IPC_CMD(SERVER_VERIFY_AUTH_RESULT, IpcIo &reply) { size_t len = 0; - std::string pkgName = (const char *)IpcIoPopString(&reply, &len); + std::string pkgName = (const char *)ReadString(&reply, &len); size_t devIdLen = 0; - std::string deviceId = (const char *)IpcIoPopString(&reply, &devIdLen); - int32_t resultCode = IpcIoPopInt32(&reply); - int32_t flag = IpcIoPopInt32(&reply); + std::string deviceId = (const char *)ReadString(&reply, &devIdLen); + int32_t resultCode = 0; + ReadInt32(&reply, &resultCode); + int32_t flag = 0; + ReadInt32(&reply, &flag); if (pkgName == "" || len == 0 || deviceId == "" || devIdLen == 0) { LOGE("OnAuthResult, get para failed"); @@ -322,9 +381,9 @@ ON_IPC_CMD(SERVER_VERIFY_AUTH_RESULT, IpcIo &reply) ON_IPC_CMD(SERVER_DEVICE_FA_NOTIFY, IpcIo &reply) { size_t len = 0; - std::string packagename = (const char *)IpcIoPopString(&reply, &len); + std::string packagename = (const char *)ReadString(&reply, &len); size_t jsonLen = 0; - std::string paramJson = (const char *)IpcIoPopString(&reply, &jsonLen); + std::string paramJson = (const char *)ReadString(&reply, &jsonLen); DeviceManagerNotify::GetInstance().OnFaCall(packagename, paramJson); } } // namespace DistributedHardware diff --git a/services/devicemanagerservice/BUILD.gn b/services/devicemanagerservice/BUILD.gn index e1ca6fc255f080928d1ee71742c0cd3d9a31dd69..eefef43904c2d47c356685a77ed44e226583b7b9 100755 --- a/services/devicemanagerservice/BUILD.gn +++ b/services/devicemanagerservice/BUILD.gn @@ -62,7 +62,7 @@ if (defined(ohos_lite)) { "//third_party/json/include", "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits/hilog", "//third_party/bounds_checking_function/include", - "//foundation/communication/ipc_lite/interfaces/kits", + "//foundation/communication/ipc/interfaces/innerkits/c/ipc/include", "//foundation/communication/dsoftbus/interfaces/kits/bus_center", "//foundation/communication/dsoftbus/interfaces/kits/common", "//foundation/communication/dsoftbus/interfaces/kits/discovery", @@ -164,7 +164,7 @@ if (defined(ohos_lite)) { "//third_party/json/include", "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits/hilog", "//third_party/bounds_checking_function/include", - "//foundation/communication/ipc_lite/interfaces/kits", + "//foundation/communication/ipc/interfaces/innerkits/c/ipc/include", "//foundation/communication/dsoftbus/interfaces/kits/bus_center", "//foundation/communication/dsoftbus/interfaces/kits/common", "//foundation/communication/dsoftbus/interfaces/kits/discovery", @@ -216,7 +216,7 @@ if (defined(ohos_lite)) { "//base/security/deviceauth/services:deviceauth_sdk", "//base/startup/syspara_lite/frameworks/parameter/src:sysparam", "//foundation/communication/dsoftbus/sdk:softbus_client", - "//foundation/communication/ipc_lite:liteipc_adapter", + "//foundation/communication/ipc/interfaces/innerkits/c/ipc:ipc_single", "//foundation/distributedschedule/samgr_lite/samgr:samgr", "//third_party/bounds_checking_function:libsec_shared", "//third_party/mbedtls:mbedtls_shared", diff --git a/services/devicemanagerservice/include/ipc/lite/ipc_server_listenermgr.h b/services/devicemanagerservice/include/ipc/lite/ipc_server_listenermgr.h index fce3e2b888d0d04d4b93394e7fce314f83dbe818..b89f2032a71c5a1c0148809bcc511af307caf3ec 100644 --- a/services/devicemanagerservice/include/ipc/lite/ipc_server_listenermgr.h +++ b/services/devicemanagerservice/include/ipc/lite/ipc_server_listenermgr.h @@ -21,7 +21,7 @@ #include #include -#include "liteipc_adapter.h" +#include "ipc_skeleton.h" #include "single_instance.h" namespace OHOS { @@ -30,7 +30,6 @@ typedef struct CommonSvcId { uint32_t handle; uint32_t token; uint32_t cookie; - IpcContext *ipcCtx; uint32_t cbId; } CommonSvcId; diff --git a/services/devicemanagerservice/include/ipc/lite/ipc_server_stub.h b/services/devicemanagerservice/include/ipc/lite/ipc_server_stub.h index f8473fdd020bd23dfdd71149caa481249659987f..d31a014829b555587488ff00579191407a2d05be 100644 --- a/services/devicemanagerservice/include/ipc/lite/ipc_server_stub.h +++ b/services/devicemanagerservice/include/ipc/lite/ipc_server_stub.h @@ -18,7 +18,7 @@ #include -#include "liteipc_adapter.h" +#include "ipc_skeleton.h" int32_t IpcServerStubInit(void); int32_t RegisterDeviceManagerListener(IpcIo *req, IpcIo *reply); diff --git a/services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp b/services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp index 595f3326c83c62ab49d4c5461b4fc9bf336ee679..1f32f133f47780c449097d79383453711f25d959 100644 --- a/services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp +++ b/services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp @@ -36,9 +36,12 @@ ON_IPC_SET_REQUEST(SERVER_DEVICE_STATE_NOTIFY, std::shared_ptr pBaseReq, DmDeviceInfo deviceInfo = pReq->GetDeviceInfo(); IpcIoInit(&request, buffer, buffLen, 0); - IpcIoPushString(&request, pkgName.c_str()); - IpcIoPushInt32(&request, deviceState); - IpcIoPushFlatObj(&request, &deviceInfo, sizeof(DmDeviceInfo)); + WriteString(&request, pkgName.c_str()); + WriteInt32(&request, deviceState); + bool ret = WriteRawData(&request, &deviceInfo, sizeof(DmDeviceInfo)); + if (!ret) { + return DM_FAILED; + } return DM_OK; } @@ -48,7 +51,9 @@ ON_IPC_READ_RESPONSE(SERVER_DEVICE_STATE_NOTIFY, IpcIo &reply, std::shared_ptrSetErrCode(IpcIoPopInt32(&reply)); + int32_t ret = 0; + ReadInt32(&reply, &ret); + pBaseRsp->SetErrCode(ret); return DM_OK; } @@ -61,9 +66,12 @@ ON_IPC_SET_REQUEST(SERVER_DEVICE_FOUND, std::shared_ptr pBaseReq, IpcIo DmDeviceInfo deviceInfo = pReq->GetDeviceInfo(); IpcIoInit(&request, buffer, buffLen, 0); - IpcIoPushString(&request, pkgName.c_str()); - IpcIoPushUint16(&request, subscribeId); - IpcIoPushFlatObj(&request, &deviceInfo, sizeof(DmDeviceInfo)); + WriteString(&request, pkgName.c_str()); + WriteUint16(&request, subscribeId); + bool ret = WriteRawData(&request, &deviceInfo, sizeof(DmDeviceInfo)); + if (!ret) { + return DM_FAILED; + } return DM_OK; } @@ -73,7 +81,9 @@ ON_IPC_READ_RESPONSE(SERVER_DEVICE_FOUND, IpcIo &reply, std::shared_ptr LOGE("pBaseRsp is null"); return DM_FAILED; } - pBaseRsp->SetErrCode(IpcIoPopInt32(&reply)); + int32_t ret = 0; + ReadInt32(&reply, &ret); + pBaseRsp->SetErrCode(ret); return DM_OK; } @@ -86,15 +96,21 @@ ON_IPC_SET_REQUEST(SERVER_DISCOVER_FINISH, std::shared_ptr pBaseReq, Ipc int32_t result = pReq->GetResult(); IpcIoInit(&request, buffer, buffLen, 0); - IpcIoPushString(&request, pkgName.c_str()); - IpcIoPushUint16(&request, subscribeId); - IpcIoPushInt32(&request, result); + WriteString(&request, pkgName.c_str()); + WriteUint16(&request, subscribeId); + WriteInt32(&request, result); return DM_OK; } ON_IPC_READ_RESPONSE(SERVER_DISCOVER_FINISH, IpcIo &reply, std::shared_ptr pBaseRsp) { - pBaseRsp->SetErrCode(IpcIoPopInt32(&reply)); + if (pBaseRsp == nullptr) { + LOGE("pBaseRsp is null"); + return DM_FAILED; + } + int32_t ret = 0; + ReadInt32(&reply, &ret); + pBaseRsp->SetErrCode(ret); return DM_OK; } @@ -109,17 +125,23 @@ ON_IPC_SET_REQUEST(SERVER_AUTH_RESULT, std::shared_ptr pBaseReq, IpcIo & int32_t reason = pReq->GetReason(); IpcIoInit(&request, buffer, buffLen, 0); - IpcIoPushString(&request, pkgName.c_str()); - IpcIoPushString(&request, deviceId.c_str()); - IpcIoPushString(&request, token.c_str()); - IpcIoPushInt32(&request, status); - IpcIoPushInt32(&request, reason); + WriteString(&request, pkgName.c_str()); + WriteString(&request, deviceId.c_str()); + WriteString(&request, token.c_str()); + WriteInt32(&request, status); + WriteInt32(&request, reason); return DM_OK; } ON_IPC_READ_RESPONSE(SERVER_AUTH_RESULT, IpcIo &reply, std::shared_ptr pBaseRsp) { - pBaseRsp->SetErrCode(IpcIoPopInt32(&reply)); + if (pBaseRsp == nullptr) { + LOGE("pBaseRsp is null"); + return DM_FAILED; + } + int32_t ret = 0; + ReadInt32(&reply, &ret); + pBaseRsp->SetErrCode(ret); return DM_OK; } @@ -134,44 +156,53 @@ ON_IPC_SET_REQUEST(SERVER_VERIFY_AUTH_RESULT, std::shared_ptr pBaseReq, int32_t flag = pReq->GetFlag(); IpcIoInit(&request, buffer, buffLen, 0); - IpcIoPushString(&request, pkgName.c_str()); - IpcIoPushString(&request, deviceId.c_str()); - IpcIoPushInt32(&request, result); - IpcIoPushInt32(&request, flag); + WriteString(&request, pkgName.c_str()); + WriteString(&request, deviceId.c_str()); + WriteInt32(&request, result); + WriteInt32(&request, flag); return DM_OK; } ON_IPC_READ_RESPONSE(SERVER_VERIFY_AUTH_RESULT, IpcIo &reply, std::shared_ptr pBaseRsp) { - pBaseRsp->SetErrCode(IpcIoPopInt32(&reply)); + if (pBaseRsp == nullptr) { + LOGE("pBaseRsp is null"); + return DM_FAILED; + } + int32_t ret = 0; + ReadInt32(&reply, &ret); + pBaseRsp->SetErrCode(ret); return DM_OK; } ON_IPC_SERVER_CMD(REGISTER_DEVICE_MANAGER_LISTENER, IpcIo &req, IpcIo &reply) { int32_t errCode = RegisterDeviceManagerListener(&req, &reply); - IpcIoPushInt32(&reply, errCode); + WriteInt32(&reply, errCode); } ON_IPC_SERVER_CMD(UNREGISTER_DEVICE_MANAGER_LISTENER, IpcIo &req, IpcIo &reply) { int32_t errCode = UnRegisterDeviceManagerListener(&req, &reply); - IpcIoPushInt32(&reply, errCode); + WriteInt32(&reply, errCode); } ON_IPC_SERVER_CMD(GET_TRUST_DEVICE_LIST, IpcIo &req, IpcIo &reply) { LOGI("enter GetTrustedDeviceList."); - std::string pkgName = (const char *)IpcIoPopString(&req, nullptr); - std::string extra = (const char *)IpcIoPopString(&req, nullptr); + std::string pkgName = (const char *)ReadString(&req, nullptr); + std::string extra = (const char *)ReadString(&req, nullptr); std::vector deviceList; int32_t ret = DeviceManagerService::GetInstance().GetTrustedDeviceList(pkgName, extra, deviceList); - IpcIoPushInt32(&reply, deviceList.size()); + WriteInt32(&reply, deviceList.size()); if (deviceList.size() > 0) { - IpcIoPushFlatObj(&reply, deviceList.data(), sizeof(DmDeviceInfo) * deviceList.size()); + bool value = WriteRawData(&reply, deviceList.data(), sizeof(DmDeviceInfo) * deviceList.size()); + if (!value) { + return; + } } - IpcIoPushInt32(&reply, ret); + WriteInt32(&reply, ret); } ON_IPC_SERVER_CMD(GET_LOCAL_DEVICE_INFO, IpcIo &req, IpcIo &reply) @@ -179,67 +210,71 @@ ON_IPC_SERVER_CMD(GET_LOCAL_DEVICE_INFO, IpcIo &req, IpcIo &reply) LOGI("enter GetLocalDeviceInfo."); DmDeviceInfo dmDeviceInfo; int32_t ret = DeviceManagerService::GetInstance().GetLocalDeviceInfo(dmDeviceInfo); - IpcIoPushFlatObj(&reply, &dmDeviceInfo, sizeof(DmDeviceInfo)); - IpcIoPushInt32(&reply, ret); + bool value = WriteRawData(&reply, &dmDeviceInfo, sizeof(DmDeviceInfo)); + if (!value) { + return; + } + WriteInt32(&reply, ret); } ON_IPC_SERVER_CMD(START_DEVICE_DISCOVER, IpcIo &req, IpcIo &reply) { LOGI("StartDeviceDiscovery service listener."); - std::string pkgName = (const char *)IpcIoPopString(&req, nullptr); - std::string extra = (const char *)IpcIoPopString(&req, nullptr); - - uint32_t size = 0; - DmSubscribeInfo *pDmSubscribeInfo = (DmSubscribeInfo *)IpcIoPopFlatObj(&req, &size); + std::string pkgName = (const char *)ReadString(&req, nullptr); + std::string extra = (const char *)ReadString(&req, nullptr); + DmSubscribeInfo *pDmSubscribeInfo = (DmSubscribeInfo *)ReadRawData(&req, sizeof(DmSubscribeInfo)); int32_t ret = DeviceManagerService::GetInstance().StartDeviceDiscovery(pkgName, *pDmSubscribeInfo, extra); - IpcIoPushInt32(&reply, ret); + WriteInt32(&reply, ret); } ON_IPC_SERVER_CMD(STOP_DEVICE_DISCOVER, IpcIo &req, IpcIo &reply) { LOGI("StopDeviceDiscovery service listener."); - std::string pkgName = (const char *)IpcIoPopString(&req, nullptr); - uint16_t subscribeId = IpcIoPopUint16(&req); + std::string pkgName = (const char *)ReadString(&req, nullptr); + uint16_t subscribeId = 0; + ReadUint16(&reply, &subscribeId); int32_t ret = DeviceManagerService::GetInstance().StopDeviceDiscovery(pkgName, subscribeId); - IpcIoPushInt32(&reply, ret); + WriteInt32(&reply, ret); } ON_IPC_SERVER_CMD(AUTHENTICATE_DEVICE, IpcIo &req, IpcIo &reply) { LOGI("AuthenticateDevice service listener."); - std::string pkgName = (const char *)IpcIoPopString(&req, nullptr); - std::string extra = (const char *)IpcIoPopString(&req, nullptr); - std::string deviceId = (const char *)IpcIoPopString(&req, nullptr); - int32_t authType = IpcIoPopInt32(&req); + std::string pkgName = (const char *)ReadString(&req, nullptr); + std::string extra = (const char *)ReadString(&req, nullptr); + std::string deviceId = (const char *)ReadString(&req, nullptr); + int32_t authType = 0; + ReadInt32(&reply, &authType); int32_t ret = DeviceManagerService::GetInstance().AuthenticateDevice(pkgName, authType, deviceId, extra); - IpcIoPushInt32(&reply, ret); + WriteInt32(&reply, ret); } ON_IPC_SERVER_CMD(UNAUTHENTICATE_DEVICE, IpcIo &req, IpcIo &reply) { LOGI("UnAuthenticateDevice service listener."); - std::string pkgName = (const char *)IpcIoPopString(&req, nullptr); - std::string deviceId = (const char *)IpcIoPopString(&req, nullptr); + std::string pkgName = (const char *)ReadString(&req, nullptr); + std::string deviceId = (const char *)ReadString(&req, nullptr); int32_t ret = DeviceManagerService::GetInstance().UnAuthenticateDevice(pkgName, deviceId); - IpcIoPushInt32(&reply, ret); + WriteInt32(&reply, ret); } ON_IPC_SERVER_CMD(VERIFY_AUTHENTICATION, IpcIo &req, IpcIo &reply) { LOGI("VerifyAuthentication service listener."); - std::string authParam = (const char *)IpcIoPopString(&req, nullptr); + std::string authParam = (const char *)ReadString(&req, nullptr); int32_t ret = DeviceManagerService::GetInstance().VerifyAuthentication(authParam); - IpcIoPushInt32(&reply, ret); + WriteInt32(&reply, ret); } ON_IPC_SERVER_CMD(SERVER_USER_AUTH_OPERATION, IpcIo &req, IpcIo &reply) { size_t len = 0; - std::string packName = (const char *)IpcIoPopString(&req, &len); - int32_t action = IpcIoPopInt32(&reply); + std::string packName = (const char *)ReadString(&req, &len); + int32_t action = 0; + ReadInt32(&reply, &action); DeviceManagerService::GetInstance().SetUserOperation(packName, action); - IpcIoPushInt32(&reply, action); + WriteInt32(&reply, action); } ON_IPC_SET_REQUEST(SERVER_DEVICE_FA_NOTIFY, std::shared_ptr pBaseReq, IpcIo &request, uint8_t *buffer, @@ -248,8 +283,8 @@ ON_IPC_SET_REQUEST(SERVER_DEVICE_FA_NOTIFY, std::shared_ptr pBaseReq, Ip std::shared_ptr pReq = std::static_pointer_cast(pBaseReq); std::string packagname = pReq->GetPkgName(); std::string paramJson = pReq->GetJsonParam(); - IpcIoPushString(&request, packagname.c_str()); - IpcIoPushString(&request, paramJson.c_str()); + WriteString(&request, packagname.c_str()); + WriteString(&request, paramJson.c_str()); return DM_OK; } } // namespace DistributedHardware diff --git a/services/devicemanagerservice/src/ipc/lite/ipc_server_listener.cpp b/services/devicemanagerservice/src/ipc/lite/ipc_server_listener.cpp index 5f29386cd0b973e096fabb371aed5ab9eb9cd1f5..bb938afcf4c614a1bf7ccd7dbfcf64f8ff718238 100644 --- a/services/devicemanagerservice/src/ipc/lite/ipc_server_listener.cpp +++ b/services/devicemanagerservice/src/ipc/lite/ipc_server_listener.cpp @@ -28,9 +28,6 @@ void IpcServerListener::CommonSvcToIdentity(CommonSvcId *svcId, SvcIdentity *ide identity->handle = svcId->handle; identity->token = svcId->token; identity->cookie = svcId->cookie; -#ifdef __LINUX__ - identity->ipcContext = svcId->ipcCtx; -#endif } int32_t IpcServerListener::GetIdentityByPkgName(std::string &name, SvcIdentity *svc) @@ -60,7 +57,10 @@ int32_t IpcServerListener::SendRequest(int32_t cmdCode, std::shared_ptr return DM_FAILED; } - if (::SendRequest(nullptr, svc, cmdCode, &io, nullptr, LITEIPC_FLAG_ONEWAY, nullptr) != DM_OK) { + MessageOption option; + MessageOptionInit(&option); + option.flags = TF_OP_ASYNC; + if (::SendRequest(svc, cmdCode, &io, nullptr, option, nullptr) != DM_OK) { LOGI("SendRequest failed cmdCode:%d", cmdCode); } return DM_OK; @@ -82,7 +82,10 @@ int32_t IpcServerListener::SendAll(int32_t cmdCode, std::shared_ptr req, } CommonSvcId svcId = kv.second; CommonSvcToIdentity(&svcId, &svc); - if (::SendRequest(nullptr, svc, cmdCode, &io, nullptr, LITEIPC_FLAG_ONEWAY, nullptr) != DM_OK) { + MessageOption option; + MessageOptionInit(&option); + option.flags = TF_OP_ASYNC; + if (::SendRequest(svc, cmdCode, &io, nullptr, option, nullptr) != DM_OK) { LOGI("SendRequest failed cmdCode:%d", cmdCode); } } diff --git a/services/devicemanagerservice/src/ipc/lite/ipc_server_stub.cpp b/services/devicemanagerservice/src/ipc/lite/ipc_server_stub.cpp index 23203801cd00406ab2720f81f58bc51d77e0dc4a..22f9bc587cf3840c97a5152e9e4141dfbb77cb87 100644 --- a/services/devicemanagerservice/src/ipc/lite/ipc_server_stub.cpp +++ b/services/devicemanagerservice/src/ipc/lite/ipc_server_stub.cpp @@ -22,7 +22,7 @@ #include "ipc_def.h" #include "ipc_server_listenermgr.h" #include "iproxy_server.h" -#include "liteipc_adapter.h" +#include "ipc_skeleton.h" #include "ohos_init.h" #include "samgr_lite.h" #include "securec.h" @@ -46,60 +46,45 @@ struct DeviceManagerSamgrService { Identity identity; }; -static int32_t DeathCb(const IpcContext *context, void *ipcMsg, IpcIo *data, void *arg) +static void DeathCb(void *arg) { - (void)context; - (void)ipcMsg; - (void)data; if (arg == nullptr) { LOGE("package name is NULL."); - return DM_INVALID_VALUE; + return; } CommonSvcId svcId = {0}; std::string pkgName = (const char *)arg; if (IpcServerListenermgr::GetInstance().GetListenerByPkgName(pkgName, &svcId) != DM_OK) { LOGE("not found client by package name."); free(arg); - arg = nullptr; - return DM_FAILED; + return; } IpcServerListenermgr::GetInstance().UnregisterListener(pkgName); free(arg); - arg = nullptr; -#ifdef __LINUX__ - BinderRelease(svcId.ipcCtx, svcId.handle); -#endif SvcIdentity sid = {0}; sid.handle = svcId.handle; sid.token = svcId.token; sid.cookie = svcId.cookie; - UnregisterDeathCallback(sid, svcId.cbId); - return DM_OK; + ReleaseSvc(sid); } int32_t RegisterDeviceManagerListener(IpcIo *req, IpcIo *reply) { LOGI("register service listener."); size_t len = 0; - uint8_t *name = IpcIoPopString(req, &len); - SvcIdentity *svc = IpcIoPopSvc(req); - if (name == nullptr || svc == nullptr || len == 0) { + uint8_t *name = ReadString(req, &len); + SvcIdentity svc; + bool ret = ReadRemoteObject(req, &svc); + if (!ret || name == NULL || len == 0) { LOGE("get para failed"); return DM_INVALID_VALUE; } CommonSvcId svcId = {0}; - svcId.handle = svc->handle; - svcId.token = svc->token; - svcId.cookie = svc->cookie; - - SvcIdentity sid = *svc; -#ifdef __LINUX__ - svcId.ipcCtx = svc->ipcContext; - BinderAcquire(svcId.ipcCtx, svcId.handle); - free(svc); - svc = nullptr; -#endif + svcId.handle = svc.handle; + svcId.token = svc.token; + svcId.cookie = svc.cookie; + if (len == 0 || len > MALLOC_MAX_LEN) { LOGE("malloc length invalid!"); return DM_MALLOC_ERROR; @@ -115,7 +100,7 @@ int32_t RegisterDeviceManagerListener(IpcIo *req, IpcIo *reply) return DM_COPY_FAILED; } uint32_t cbId = 0; - RegisterDeathCallback(NULL, sid, DeathCb, pkgName, &cbId); + AddDeathRecipient(svc, DeathCb, pkgName, &cbId); svcId.cbId = cbId; std::string strPkgName = (const char *)name; return IpcServerListenermgr::GetInstance().RegisterListener(strPkgName, &svcId); @@ -125,7 +110,7 @@ int32_t UnRegisterDeviceManagerListener(IpcIo *req, IpcIo *reply) { LOGI("unregister service listener."); size_t len = 0; - std::string pkgName = (const char *)IpcIoPopString(req, &len); + std::string pkgName = (const char *)ReadString(req, &len); if (pkgName == "" || len == 0) { LOGE("get para failed"); return DM_FAILED; @@ -137,14 +122,11 @@ int32_t UnRegisterDeviceManagerListener(IpcIo *req, IpcIo *reply) } int32_t ret = IpcServerListenermgr::GetInstance().UnregisterListener(pkgName); if (ret == DM_OK) { -#ifdef __LINUX__ - BinderRelease(svcId.ipcCtx, svcId.handle); -#endif SvcIdentity sid; sid.handle = svcId.handle; sid.token = svcId.token; sid.cookie = svcId.cookie; - ret = UnregisterDeathCallback(sid, svcId.cbId); + ReleaseSvc(sid); } return ret; } @@ -183,7 +165,7 @@ static TaskConfig GetTaskConfig(Service *service) return config; } -static int32_t OnRemoteRequest(IServerProxy *iProxy, int32_t funcId, void *origin, IpcIo *req, IpcIo *reply) +static int32_t OnRemoteRequestLite(IServerProxy *iProxy, int32_t funcId, void *origin, IpcIo *req, IpcIo *reply) { LOGI("Receive funcId:%d", funcId); (void)origin; @@ -211,7 +193,7 @@ static void DevMgrSvcInit(void) .MessageHandle = MessageHandle, .GetTaskConfig = GetTaskConfig, SERVER_IPROXY_IMPL_BEGIN, - .Invoke = OnRemoteRequest, + .Invoke = OnRemoteRequestLite, IPROXY_END, }; diff --git a/test/fuzztest/ipccmdregister_fuzzer/ipc_cmd_register_fuzzer.cpp b/test/fuzztest/ipccmdregister_fuzzer/ipc_cmd_register_fuzzer.cpp index b8fa8300c6efcae510fc3dcd5a3b2e946eecf6b9..bc14db54557cef92d46c5b6dceaf7b7e79bca331 100644 --- a/test/fuzztest/ipccmdregister_fuzzer/ipc_cmd_register_fuzzer.cpp +++ b/test/fuzztest/ipccmdregister_fuzzer/ipc_cmd_register_fuzzer.cpp @@ -39,7 +39,6 @@ #include "dm_constants.h" #include "ipc_def.h" #include "dm_log.h" -#include "ipc_server_listenermgr.h" #include "ipc_rsp.h" #include "ipc_cmd_register_fuzzer.h" diff --git a/test/unittest/BUILD.gn b/test/unittest/BUILD.gn index 93525f79717375b31fb80936ae38c59302df2d4a..5a4e555e1bd85b970ab320a933258873f7d09894 100644 --- a/test/unittest/BUILD.gn +++ b/test/unittest/BUILD.gn @@ -482,7 +482,7 @@ config("device_manager_test_common_public_config") { "${services_path}/include/devicestate", "//foundation/communication/dsoftbus/interfaces/kits/bus_center", "//foundation/communication/softbus_lite/interfaces/kits/transport", - "//foundation/communication/ipc_lite/interfaces/kits", + "//foundation/communication/ipc/interfaces/innerkits/c/ipc/include", "//foundation/communication/dsoftbus/interfaces/kits/common", "//foundation/communication/dsoftbus/interfaces/kits/discovery", "//foundation/communication/dsoftbus/interfaces/inner_kits/transport", @@ -566,7 +566,7 @@ config("device_manager_test_common_public") { "${services_path}/include/ability", "${services_path}/include/config", "//foundation/communication/dsoftbus/interfaces/kits/bus_center", - "//foundation/communication/ipc_lite/interfaces/kits", + "//foundation/communication/ipc/interfaces/innerkits/c/ipc/include", "//foundation/communication/dsoftbus/interfaces/kits/common", "//foundation/communication/dsoftbus/interfaces/kits/discovery", "//foundation/communication/dsoftbus/interfaces/inner_kits/transport", diff --git a/utils/BUILD.gn b/utils/BUILD.gn index 6a67f2ad89ba23147a1a59514c449ca99622a466..8c17c8782f217d583a3c025631b35f628a71c11d 100644 --- a/utils/BUILD.gn +++ b/utils/BUILD.gn @@ -81,7 +81,7 @@ if (defined(ohos_lite)) { "//third_party/json/include", "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", "//third_party/bounds_checking_function/include", - "//foundation/communication/ipc_lite/interfaces/kits", + "//foundation/communication/ipc/interfaces/innerkits/c/ipc/include", "//foundation/communication/dsoftbus/interfaces/kits/bus_center", "//foundation/communication/dsoftbus/interfaces/kits/common", "//foundation/communication/dsoftbus/interfaces/kits/discovery", @@ -106,7 +106,7 @@ if (defined(ohos_lite)) { "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", "//base/startup/syspara_lite/frameworks/parameter/src:sysparam", "//foundation/communication/dsoftbus/sdk:softbus_client", - "//foundation/communication/ipc_lite:liteipc_adapter", + "//foundation/communication/ipc/interfaces/innerkits/c/ipc:ipc_single", "//foundation/distributedschedule/samgr_lite/samgr:samgr", "//third_party/bounds_checking_function:libsec_shared", "//third_party/mbedtls:mbedtls_shared", diff --git a/utils/include/ipc/lite/ipc_cmd_register.h b/utils/include/ipc/lite/ipc_cmd_register.h index 5a00f03d7207ceeffdbf763cbb9f26c5cd167969..cf04d5f18b9de82fa3e302b8884435693d160515 100644 --- a/utils/include/ipc/lite/ipc_cmd_register.h +++ b/utils/include/ipc/lite/ipc_cmd_register.h @@ -22,7 +22,7 @@ #include "ipc_req.h" #include "ipc_rsp.h" -#include "liteipc_adapter.h" +#include "ipc_skeleton.h" #include "single_instance.h" namespace OHOS {