1 /* 2 * Copyright (C) 2021 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 NSTACKX_COMMON_HEADER_H 17 #define NSTACKX_COMMON_HEADER_H 18 19 #include "sys_common_header.h" 20 21 #include <sys/stat.h> 22 23 // C standard library header files 24 #include <errno.h> 25 #include <stdbool.h> 26 #include <stdarg.h> 27 #include <string.h> 28 29 #define PIPE_OUT 0 30 #define PIPE_IN 1 31 #define PIPE_FD_NUM 2 32 33 #define BYTE_BITS_NUM 8 34 #define TYPE_BITS_NUM(_type) (sizeof(_type) * BYTE_BITS_NUM) 35 36 typedef enum { 37 CIPHER_AES_GCM = 0, 38 CIPHER_CHACHA, 39 CIPHER_AES_NI, // hardware optimize 40 } DFileCipherType; 41 42 #endif // NSTACKX_COMMON_HEADER_H 43