/*
	File:		ENET.h

	Copyright:	© 1984-1993 by Apple Computer, Inc., all rights reserved.

	WARNING
	This file was auto generated by the interfacer tool. Modifications
	must be made to the master file.

*/

#ifndef __ENET__
#define __ENET__

#ifndef __TYPES__
#include <MacTypes.H>
#endif

#ifndef __OSUTILS__
#include <OSUtils.H>
#endif

#define EAddrRType OST_eadr

#if PRAGMA_IMPORT
#pragma import on
#endif

#if PRAGMA_STRUCT_ALIGN
	#pragma options align=mac68k
#elif PRAGMA_STRUCT_PACKPUSH
	#pragma pack(push, 2)
#elif PRAGMA_STRUCT_PACK
	#pragma pack(2)
#endif
enum  {
	ENetSetGeneral			= 253,			/*Set "general" mode*/
	ENetGetInfo			= 252,			/*Get info*/
	ENetRdCancel			= 251,			/*Cancel read*/
	ENetRead			= 250,			/*Read*/
	ENetWrite			= 249,			/*Write*/
	ENetDetachPH			= 248,			/*Detach protocol handler*/
	ENetAttachPH			= 247,			/*Attach protocol handler*/
	ENetAddMulti			= 246,			/*Add a multicast address*/
	ENetDelMulti			= 245,			/*Delete a multicast address*/
	eLenErr			= -92,			/*Length error ddpLenErr*/
	eMultiErr			= -91			/*Multicast address error ddpSktErr*/
};

typedef union EParamBlock EParamBlock, *EParamBlkPtr;


/*
	ENETCompletionProcs cannot be written in or called from a high-level
	language without the help of mixed mode or assembly glue because they
	use the following parameter-passing convention:

	typedef pascal void (*ENETCompletionProcPtr)(EParamBlkPtr thePBPtr);

		In:
			=>	thePBPtr			A0.L
		Out:
			none
*/

enum  {
	uppENETCompletionProcInfo	= kRegisterBased|REGISTER_ROUTINE_PARAMETER(1,kRegisterA0,kFourByteCode)
};

#if USESROUTINEDESCRIPTORS
typedef void (pascal *ENETCompletionProcPtr)(EParamBlkPtr thePBPtr);

typedef UniversalProcPtr ENETCompletionUPP;

#define CallENETCompletionProc(userRoutine, thePBPtr)  \
	CallUniversalProc((UniversalProcPtr)(userRoutine), uppENETCompletionProcInfo, (thePBPtr))

#define NewENETCompletionProc(userRoutine)  \
	(ENETCompletionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine),  \
	uppENETCompletionProcInfo, GetCurrentISA())

#else
typedef ProcPtr ENETCompletionUPP;

#define NewENETCompletionProc(userRoutine)  \
	(ENETCompletionUPP)(userRoutine)

#endif

#define EParamHeader			\
	QElem *qLink;			\
	short qType;			\
	short ioTrap;			\
	Ptr ioCmdAddr;			\
	ENETCompletionUPP ioCompletion;	\
	OSErr ioResult;			\
	StringPtr ioNamePtr;			\
	short ioVRefNum;			\
	short ioRefNum;			\
	short csCode;

struct EParamMisc1 {
	QElem			*qLink;
	short			qType;
	short			ioTrap;
	Ptr			ioCmdAddr;
	ENETCompletionUPP			ioCompletion;
	OSErr			ioResult;
	StringPtr			ioNamePtr;
	short			ioVRefNum;
	short			ioRefNum;
	short			csCode;			/*General EParams*/
	short			eProtType;			/*Ethernet protocol type*/
	Ptr			ePointer;			/*No support for PowerPC code*/
	short			eBuffSize;			/*buffer size*/
	short			eDataSize;			/*number of bytes read*/
};
typedef struct EParamMisc1 EParamMisc1;

struct EParamMisc2 {
	EParamMisc1			EParms1;
	char			eMultiAddr[6];			/*Multicast Address*/
};
typedef struct EParamMisc2 EParamMisc2;

union EParamBlock {
	EParamMisc1			EParms1;
	EParamMisc2			EParms2;
};
#ifdef __cplusplus
extern "C" {
#endif

extern OSErr pascal EWrite(EParamBlkPtr thePBptr, Boolean async);
extern OSErr pascal EAttachPH(EParamBlkPtr thePBptr, Boolean async);
extern OSErr pascal EDetachPH(EParamBlkPtr thePBptr, Boolean async);
extern OSErr pascal ERead(EParamBlkPtr thePBptr, Boolean async);
extern OSErr pascal ERdCancel(EParamBlkPtr thePBptr, Boolean async);
extern OSErr pascal EGetInfo(EParamBlkPtr thePBptr, Boolean async);
extern OSErr pascal ESetGeneral(EParamBlkPtr thePBptr, Boolean async);
extern OSErr pascal EAddMulti(EParamBlkPtr thePBptr, Boolean async);
extern OSErr pascal EDelMulti(EParamBlkPtr thePBptr, Boolean async);
#if PRAGMA_STRUCT_ALIGN
	#pragma options align=reset
#elif PRAGMA_STRUCT_PACKPUSH
	#pragma pack(pop)
#elif PRAGMA_STRUCT_PACK
	#pragma pack()
#endif

#ifdef PRAGMA_IMPORT_OFF
#pragma import off
#elif PRAGMA_IMPORT
#pragma import reset
#endif
#ifdef __cplusplus
}
#endif

#endif


