/*
    Copyright (C) 1998, 1999 by Serguei 'Snaar' Narojnyi
    Copyright (C) 1998, 1999 by Jorrit Tyberghein
    Written by Serguei 'Snaar' Narojnyi

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public
    License along with this library; if not, write to the Free
    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifndef __NETMANDEFS_H__
#define __NETMANDEFS_H__

#define CS_NET_MAN_ERR_BASE	200

enum CS_NET_MAN_ERR
{
	CS_NET_MAN_ERR_ALREADY_LISTENING = CS_NET_MAN_ERR_BASE
};

/*typedef struct _CS_NET_ADDRESS
{
	char hostnm[512];
	int port;
} CS_NET_ADDRESS, *LPCS_NET_ADDRESS;

typedef struct _CS_NET_DRIVERCAPS
{
	DWORD dwConnTypesSupported;
} CS_NET_DRIVERCAPS, *LPCS_NET_DRIVERCAPS;*/

#define MAX_MSG_SIZE 255
//#define SAFE_MSG_SIZE 200

typedef struct _MSGHDR
{
	unsigned char type;
	unsigned short crc;
	unsigned short framenum;
	unsigned short lastframe;
	unsigned char msglength;
} MSGHDR, *LPMSGHDR;

typedef struct _PLAINMSGHDR
{
	unsigned short src;
	unsigned short dest;
} PLAINMSGHDR, *LPPLAINMSGHDR;

#define BROADCAST	(unsigned short)-1
#define SERVER		(unsigned short)-2

enum ClientMessages
{
	MSG_CLI_ERR = 0,
	MSG_CLI_NOOP,
	MSG_CLI_PLAIN,
	MSG_CLI_CONNREQ
};

enum ServerMessages
{
	MSG_SRV_ERR = 0,
	MSG_SRV_NOOP,
	MSG_SRV_PLAIN,
	MSG_SRV_CONNACK,
	MSG_SRV_CONNNACK
};

typedef struct _PLAINMESSAGE
{
	PLAINMSGHDR hdr;
	char body[512];
} PLAINMESSAGE, *LPPLAINMESSAGE;

#endif	//__NETMANDEFS_H__
