1994-12-14 09:36:34 -04:00
|
|
|
/*
|
|
|
|
* Prototypes for mactcpglue routines and includes/structures needed
|
|
|
|
* by those.
|
|
|
|
*
|
|
|
|
* Jack Jansen, CWI, 1994.
|
|
|
|
*
|
|
|
|
* Adapted from mac socket library, which has in turn adapted from ncsa telnet.
|
|
|
|
* Original authors: Tom Milligan, Charlie Reiman
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <MacTCPCommonTypes.h>
|
|
|
|
#include <GetMyIPAddr.h>
|
|
|
|
#include <TCPPB.h>
|
|
|
|
#include <UDPPB.h>
|
|
|
|
#include <AddressXlation.h>
|
|
|
|
|
1995-01-18 09:50:42 -04:00
|
|
|
#ifndef __MWERKS__
|
|
|
|
#define TCPIOCompletionUPP TCPIOCompletionProc
|
|
|
|
#define TCPNotifyUPP TCPNotifyProc
|
|
|
|
#define UDPIOCompletionUPP UDPIOCompletionProc
|
|
|
|
#define UDPNotifyUPP UDPNotifyProc
|
|
|
|
#define NewTCPIOCompletionProc(x) (x)
|
|
|
|
#define NewTCPNotifyProc(x) (x)
|
|
|
|
#define NewUDPIOCompletionProc(x) (x)
|
|
|
|
#define NewUDPNotifyProc(x) (x)
|
|
|
|
#endif /* __MWERKS__ */
|
|
|
|
|
|
|
|
#if defined(powerc) || defined (__powerc)
|
|
|
|
#pragma options align=mac68k
|
|
|
|
#endif
|
|
|
|
|
1994-12-14 09:36:34 -04:00
|
|
|
typedef struct miniwds
|
|
|
|
{
|
|
|
|
unsigned short length;
|
|
|
|
char * ptr;
|
|
|
|
unsigned short terminus; /* must be zero'd for use */
|
|
|
|
} miniwds;
|
|
|
|
|
1995-01-18 09:50:42 -04:00
|
|
|
#if defined(powerc) || defined(__powerc)
|
|
|
|
#pragma options align=reset
|
|
|
|
#endif
|
|
|
|
|
1994-12-14 09:36:34 -04:00
|
|
|
|
|
|
|
OSErr xOpenDriver(void);
|
1995-01-18 09:50:42 -04:00
|
|
|
OSErr xPBControl(TCPiopb *pb, TCPIOCompletionUPP completion);
|
1994-12-14 09:36:34 -04:00
|
|
|
OSErr xPBControlSync(TCPiopb *pb);
|
1995-01-18 09:50:42 -04:00
|
|
|
OSErr xTCPCreate(int buflen, TCPNotifyUPP notify, void *udp, TCPiopb *pb);
|
|
|
|
OSErr xTCPPassiveOpen(TCPiopb *pb, short port, TCPIOCompletionUPP completion, void *udp);
|
|
|
|
OSErr xTCPActiveOpen(TCPiopb *pb, short port, long rhost, short rport, TCPIOCompletionUPP completion);
|
|
|
|
OSErr xTCPRcv(TCPiopb *pb, char *buf, int buflen, int timeout, TCPIOCompletionUPP completion);
|
|
|
|
OSErr xTCPNoCopyRcv(TCPiopb *,rdsEntry *,int,int,TCPIOCompletionUPP);
|
|
|
|
OSErr xTCPBufReturn(TCPiopb *pb,rdsEntry *rds,TCPIOCompletionUPP completion);
|
|
|
|
OSErr xTCPSend(TCPiopb *pb, wdsEntry *wds, Boolean push, Boolean urgent, TCPIOCompletionUPP completion);
|
|
|
|
OSErr xTCPClose(TCPiopb *pb,TCPIOCompletionUPP completion);
|
1994-12-14 09:36:34 -04:00
|
|
|
OSErr xTCPAbort(TCPiopb *pb);
|
|
|
|
OSErr xTCPRelease(TCPiopb *pb);
|
|
|
|
|
1995-01-18 09:50:42 -04:00
|
|
|
OSErr xUDPCreate(UDPiopb *pb,int buflen,ip_port *port, UDPNotifyUPP asr, void *udp);
|
|
|
|
OSErr xUDPRead(UDPiopb *pb,int timeout, UDPIOCompletionUPP completion);
|
1994-12-14 09:36:34 -04:00
|
|
|
OSErr xUDPBfrReturn(UDPiopb *pb, char *buff);
|
|
|
|
OSErr xUDPWrite(UDPiopb *pb,ip_addr host,ip_port port,miniwds *wds,
|
1995-01-18 09:50:42 -04:00
|
|
|
UDPIOCompletionUPP completion);
|
1994-12-14 09:36:34 -04:00
|
|
|
OSErr xUDPRelease(UDPiopb *pb);
|
|
|
|
|
|
|
|
ip_addr xIPAddr(void);
|
|
|
|
long xNetMask(void);
|
|
|
|
unsigned short xMaxMTU(void);
|
|
|
|
|