#pragma once
#include <fcntl.h>
#include <semaphore.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>

#define SHM_NAME "epic_drm"
#define CMD_SIZE (1024 * 1024)
#define SHM_SIZE (CMD_SIZE + 128)


/**
 * a struct describing the contents of the shared memory used to interact with epic_drm
 */
struct command_channel {
    sem_t sem_c2s;
    sem_t sem_s2c;

    enum { GET_CMD, EXECUTE_CMD, SUCCESS, ERROR } command;

    struct {
        uint8_t nonce[24];
        uint8_t exec_cmd[CMD_SIZE];
        uint8_t mac[16];
    } data;
};
