/**
hsmCommunicator_submach.h
This file automatically generated by FSMLang
*/
#ifndef _HSMCOMMUNICATOR_SUBMACH_H_
#define _HSMCOMMUNICATOR_SUBMACH_H_
#include "hsmCommunicator.h"
#ifndef HSM_COMMUNICATOR_NATIVE_PROLOG
#define HSM_COMMUNICATOR_NATIVE_PROLOG
#ifndef DBG_PRINTF
#include <stdio.h>
#define DBG_PRINTF(...) printf(__VA_ARGS__); printf("\n");
#endif
typedef enum
{
msg_none
, msg_step0_response
, msg_step1_response
, msg_session_rejected
, msg_ack
} msg_e_t;
typedef struct _queue_str_
{
unsigned queue_count;
} queue_str_t;
#endif
typedef struct _hsmCommunicator_data_struct_ HSM_COMMUNICATOR_DATA, *pHSM_COMMUNICATOR_DATA;
/* Sub Machine Declarations */
typedef enum {
establishSession_e
, hsmCommunicator_firstSubMachine = establishSession_e
, sendMessage_e
, hsmCommunicator_numSubMachines
} HSM_COMMUNICATOR_SUB_MACHINES;
typedef HSM_COMMUNICATOR_EVENT_ENUM (*HSM_COMMUNICATOR_SUB_MACHINE_FN)(HSM_COMMUNICATOR_EVENT_ENUM);
typedef struct _hsmCommunicator_sub_fsm_if_ HSM_COMMUNICATOR_SUB_FSM_IF, *pHSM_COMMUNICATOR_SUB_FSM_IF;
struct _hsmCommunicator_sub_fsm_if_
{
HSM_COMMUNICATOR_EVENT_ENUM first_event;
HSM_COMMUNICATOR_EVENT_ENUM last_event;
HSM_COMMUNICATOR_SUB_MACHINE_FN subFSM;
};
typedef void (*HSM_COMMUNICATOR_DATA_TRANSLATION_FN)(pHSM_COMMUNICATOR_DATA);
/* Some sub-machines share parent events. */
typedef struct _hsmCommunicator_shared_event_str_ HSM_COMMUNICATOR_SHARED_EVENT_STR, *pHSM_COMMUNICATOR_SHARED_EVENT_STR;
struct _hsmCommunicator_shared_event_str_
{
HSM_COMMUNICATOR_EVENT_ENUM event;
HSM_COMMUNICATOR_DATA_TRANSLATION_FN data_translation_fn;
pHSM_COMMUNICATOR_SUB_FSM_IF psub_fsm_if;
};
extern HSM_COMMUNICATOR_EVENT_ENUM hsmCommunicator_pass_shared_event(pHSM_COMMUNICATOR,pHSM_COMMUNICATOR_SHARED_EVENT_STR[]);
extern HSM_COMMUNICATOR_SHARED_EVENT_STR sendMessage_share_hsmCommunicator_INIT_str;
extern pHSM_COMMUNICATOR_SHARED_EVENT_STR sharing_hsmCommunicator_INIT[];
extern HSM_COMMUNICATOR_SHARED_EVENT_STR establishSession_share_hsmCommunicator_MESSAGE_RECEIVED_str;
extern HSM_COMMUNICATOR_SHARED_EVENT_STR sendMessage_share_hsmCommunicator_MESSAGE_RECEIVED_str;
extern pHSM_COMMUNICATOR_SHARED_EVENT_STR sharing_hsmCommunicator_MESSAGE_RECEIVED[];
struct _hsmCommunicator_data_struct_ {
msg_e_t current_msg;
queue_str_t queue;
};
#endif