/* * mdremote.h * * Summary: MD_Remote data structure, state constants, prototypes. * * Author: David Hardy */ #ifndef MD_REMOTE_H #define MD_REMOTE_H #include #include #include #include #include #include #include "mdextend.h" #ifdef __cplusplus extern "C" { #endif #define MAXMSGSZ 10 typedef struct MD_Remote_Tag { const char *name; MD_Sim *sim; MD_Int sendmsg[MAXMSGSZ]; MD_Int recvmsg[MAXMSGSZ]; MD_Int sockfd; } MD_Remote; MD_Errcode MD_remote_client_connect(MD_Remote *client, const char *serverhostname, MD_Int portnumber); MD_Errcode MD_remote_client_disconnect(MD_Remote *client); MD_Errcode MD_remote_send(MD_Remote *remote, const void *vbuf, MD_Int bufsz); MD_Int MD_remote_recv(MD_Remote *remote, void *vbuf, MD_Int bufsz, MD_Int sec); #define MSG_ERROR -1 #define MSG_NONE 0 #define MSG_CREATE 1 #define MSG_ENGNAME 2 #define MSG_CREATE_ACK 3 #define MSG_ERR 3 #define MSG_TYPE 4 #define MSG_DATA 5 #define MSG_HASHKEY 6 #define MSG_NAME 7 #define MSG_SETLEN 8 #define MSG_SETLEN_ACK 9 #define MSG_SETDATA 10 #define MSG_SETDATA_ACK 11 #define MSG_GETDATA 12 #define MSG_GETDATA_ACK 13 #define MSG_INIT 14 #define MSG_INITCB 15 #define MSG_INITFCB 16 #define MSG_INIT_ACK 17 #define MSG_RUN 18 #define MSG_RUN_ACK 12 #define MSG_CALLBACK 13 #define MSG_CALLBACK_ACK 14 #define MSG_FCALLBACK 15 #define MSG_FCALLBACK_ACK 16 #define MSG_DESTROY 17 #ifdef __cplusplus } #endif #endif /* MD_REMOTE_H */