/* Ben Adams (bwa3) Recitation: Ben Karas Thurs 1:15 ECES 338 Assignment #7 Header file for the TCP Mailbox program OS: Unix/Solaris */ #define MESSAGELENGTH 80 //buffer length of messages #define USERNAMELENGTH 50 //buffer length of user names #define MAXMESSAGES 20 //only allow 20 messages in mailbox #define SERVER_PORT 4301 //server port 4301 //this enum is used in both programs to define which function is being //passed to and from the client/server enum enumstruct {STARTID,QUITID,RETRIEVEID,INSERTID,LISTID,DELETEID,GETLOGSTATUSID,SHUTSERVERDOWN}; typedef enum enumstruct etype; //all querys contain functionid which is an enumeration for the function that t$ //query is being used in (data parsing on server side) //usertype contains the information for a user (name) typedef struct userstruct { etype functionid; char name[USERNAMELENGTH]; } usertype; //querytype contains the information for a query (user name and message id) typedef struct querystruct { etype functionid; usertype user; int mid; } querytype; //messagetype contains the information for a message (string of at most 80 chars) typedef struct messagestruct { etype functionid; usertype sender; usertype receiver; char contents[MESSAGELENGTH]; } messagetype; //this structure is for list all messages.. return type for that //function with a list of all the MID's belonging to that user typedef struct liststruct { etype functionid; int sent[MAXMESSAGES]; int received[MAXMESSAGES]; int sentsize; int receivedsize; } listtype;