1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef SECURITY_GUARD_UEVENT_LISTENER_IMPL_H 17 #define SECURITY_GUARD_UEVENT_LISTENER_IMPL_H 18 19 #include "kernel_interface_adapter.h" 20 #include "model_cfg_marshalling.h" 21 #include "security_guard_define.h" 22 23 namespace OHOS::Security::SecurityGuard { 24 using SgUeventFiled = enum { 25 SG_UEVENT_INDEX_EVENT_ID, 26 SG_UEVENT_INDEX_VERSION, 27 SG_UEVENT_INDEX_CONTENT_LEN, 28 SG_UEVENT_INDEX_CONTENT, 29 }; 30 31 class UeventListenerImpl { 32 public: UeventListenerImpl(KernelInterfaceAdapter & adapter)33 explicit UeventListenerImpl(KernelInterfaceAdapter &adapter) {}; 34 virtual ~UeventListenerImpl() = default; InitUevent()35 virtual bool InitUevent() { return true; }; UeventListen(char * buffer,size_t length)36 virtual int UeventListen(char *buffer, size_t length) { return 0; }; ParseEvent(char * buffer,size_t length)37 virtual void ParseEvent(char *buffer, size_t length) { return; }; 38 }; 39 } // namespace OHOS::Security::SecurityGuard 40 41 #endif // SECURITY_GUARD_UEVENT_LISTENER_IMPL_H 42