#include <dos.h>
#include <io.h>

#include "../msdos/msdos.h"
#include "../../../net/generic/defs.h"

#ifndef NULL
#define NULL 0
#endif

#define NPORTS	32

#define	htons(s)	lswaps(s)
#define	ntohs(s)	lswaps(s)
#define	htonl(l)	lswapl(l)
#define	ntohl(l)	lswapl(l)

#define TCPCONN

#define MAXBUFSIZE	16384

typedef struct _connection ConnectionRec, *ConnectionPtr;

typedef struct _osComm {
    int fd;
    ConnectionPtr input;
    ConnectionPtr output;
    u_short flags;
    int client;
    unsigned long conn_time;
    unsigned long ipaddress;
    int priority;
} OsCommRec, *OsCommPtr;

#define MAXPRIORITY	200

#define OS_REUSE	0x0001		/* re-use the request in the buffer */
#define OS_REQUEST	0x0002		/* full request left in input buffer */
#define OS_BLOCKED	0x0004		/* output write-blocked */
#define OS_MORE		0x0008		/* there is more data left in buffer */
#define OS_OUTPUT	0x0010		/* client has output pending */
#define OS_CLOSED	0x0080		/* we have closed our side */
#define OS_FCLOSED	0x0100		/* other side has closed */
#define OS_CLOSING	0x0200		/* wait for output to drain first */

/* #define X_PRINT_PORT	5600 */
#define XDMCP
