1 /* 2 * Copyright (c) 2023 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 CM_SECURITY_GUARD_REPORT_H 17 #define CM_SECURITY_GUARD_REPORT_H 18 19 #include "cm_type_inner.h" 20 21 #define CM_MAX_ACTION_LEN 100 22 23 struct CmReportSGInfo { 24 char action[CM_MAX_ACTION_LEN]; 25 uint32_t uid; 26 int32_t result; 27 char *name; 28 bool isSetGrantUid; 29 uint32_t grantUid; 30 bool isSetStatus; 31 bool status; 32 }; 33 34 struct SGEventContent { 35 int32_t type; 36 int32_t subType; 37 char *caller; 38 char *objectInfo; 39 char *bootTime; 40 char *wallTime; 41 char *outcome; 42 char *sourceInfo; 43 char *targetInfo; 44 char *extra; 45 }; 46 47 #ifdef __cplusplus 48 extern "C" { 49 #endif 50 51 uint32_t CmGetCallingUid(void); 52 53 void CmReportSGRecord(const struct CmReportSGInfo *info); 54 55 #ifdef __cplusplus 56 } 57 #endif 58 59 #endif 60