#define PID_ALARM  1            /* defines for packet ID */
#define PID_CHECK  2

#define ID_MACRO   1            /* defines for experiment ID */
#define ID_SUPERK  2
#define ID_SNO     3
#define ID_KIII    4
#define ID_LVD     5
#define NUM_EXP    10            /* How many experiments are there? */

/* This packet is what gets sent to the main computer for a SN alarm */
struct alarm_packet {           /* packet_id = 1 */
  u_short packet_id;            /* What type of packet? */  
  u_short experiment;           /* Which experiment? */
  u_short level;            /* Alarm level */
  u_short dummy;
  ULONG   sequence;             /* Counter to allow send/receive checks */
  LONG   datetime[3];          /* Time word : ddmmyy,hhmmss,ns */
  ULONG   signif;               /* The experiment's signif. estimate *10^6 */
};

/* This packet is sebt by main computer to see if the experiment is awake */
struct check_packet {           /* packet_id = 2 */
  u_short packet_id;            /* What type of packet? */  
  u_short experiment;           /* Which experiment? */
  LONG   datetime[3];          /* Time word : ddmmyy,hhmmss,ns */
  ULONG   sequence;             /* Counter to allow send/receive checks */
};

/* prototypes for packets functions */

int send_packet(int,struct sockaddr_in *,char *, int);
int pack_alarm(char *, int, struct alarm_packet *);
int pack_check(char *, int, struct check_packet *);
int get_packet(int, struct sockaddr_in *, char *);
void handle_alarm(char *, int, struct alarm_packet *);
void handle_check(char *, int, struct check_packet *);


#define	MAXLINE	512
