#ifndef __CLIENTSERVER_H__
#define __CLIENTSERVER_H__

/* 
 * Copyright (C) 1994, 1995 under GPL: Wayne Meissner
 * 
 * $Author: wayne $
 * $Date: 1995/01/15 16:25:54 $
 * $Source: /home/wayne/src/dosemu/daemon/RCS/client_server.h,v $
 * $Revision: 1.4 $
 * 
 */

#include "daemon.h"
#include <linux/vm86.h>
#include <wm_lib/system.h>
#include <sys/ipc.h>

#define DAEMON_KEY 6660666
#define SOCKET_DIR "/tmp"
#define SOCKET_NAME "dosemu_daemon"


typedef struct data_header {
  uint32 len; /* length of data to follow */
  char buf[1]; /* data */
} DataHeader;

typedef struct  {
  uint16 seg;  /* starting segment */
  uint16 off;  /* starting offset */
} SegmentHdr;

typedef struct {
  SegmentHdr s;
  DataHeader data; /* data in the segment */
} DaemonSegment;

typedef struct  {
  SegmentHdr s;       /* seg:off of start */
  uint32     len;     /* length of memory */
  key_t      shm_key; /* key to a shm area (0 makes dosemu do the shmget()),
		       * and the key is returned in shm_key */
} DaemonMemInfo;

struct daemon_server {
  struct daemon_comms daemon_comm;
  struct vm86_regs regs;  /* the regs of the vm86 process */
  DataHeader data;  /* data to the end of the memory area */
};

#endif /* __CLIENTSERVER_H__ */
