/****************************************************************
* Project TCAM2
* (c) copyright 2022
* Company Harman International(India) Pvt. Ltd.
* All rights reserved
* Secrecy Level STRICTLY CONFIDENTIAL
****************************************************************/
/**
* @file opendisk.h
* @ingroup Security & Intelligent Systems
* @author adarsh.adarsh.SSO@harman.com
* @brief Open Disk Header File
*
*/
#include <pthread.h>
#include <time.h>
#include <unistd.h>
#include <fcntl.h>
#include <ctype.h>
#include <SecCryptoMgrCommon.h>
#include <Log.h>
#include <stdlib.h>
#include <string.h>
#include<stdbool.h>
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <SecryptoIntf.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/mount.h>
#include <sys/param.h>
#include <dirent.h>
#include <blkid/blkid.h>
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
#include "ext4format.h"
#include "libcryptsetup.h"
#include <dlt/dlt.h>
#if defined(DLT_ENABLED)
#endif
#define OPEN_DISK_VERSION "1.0.0"
#define FMP_KEY_ID1 "rw.rpmb.security.fmp_key.key1"
#define FMP_KEY_ID2 "rw.rpmb.security.fmp_key.key2"
#define ENCRYPTED_MAPPER "/dev/mapper/encrypted"
#define ENCRYPTED_MOUNT_POINT "/mnt/encrypted_data"
#define ENCRYPTED_DISK "/dev/mmcblk0p36"
#define PRIVACY_MAPPER "/dev/mapper/privacy"
#define PRIVACY_MOUNT_POINT "/mnt/privacy_data"
#define PRIVACY_DISK "/dev/mmcblk0p37"
#define FMPCLIENTNAME "fmpclient"
#define ERROR_CODE -1
#define SUCCESS_CODE 0
#define RAND_DATA_SIZE 44
#define MAX_DATA_SIZE 32
#define Type_Size 20
#define Client_Size 64
#define CMD_USAGE 2
#define scanStart(scan) ((scan)->scanTos = -1)
#define scanUngetc(scan) ((scan)->scanPtr[(scan)->scanTos]--)
#define TEE_PATH "/dev/tee0"
#define USER_NAME "root"
#define GROUP_NAME "secmgr"
/* Un-comment this to enable debug logs */
//#define DEBUG_ENABLE
#define LOG_LEVEL LOG_INFO
/* Log Level */
enum log_level {
LOG_CRITICAL=0,
LOG_ALWAYS=0,
LOG_INFO,
LOG_SPEW,
};
/* If LOG_LEVEL is not defined, by default it will print all the logs. */
#ifndef LOG_LEVEL
#define LOG_LEVEL 2
#endif
#define dprintf(level, fmt, args...) (level <= LOG_LEVEL) ? fprintf(stderr, ""fmt"", ## args) : fprintf(stderr," ")
To embed this program on your website, copy the following code and paste it into your website's HTML: