2 * Prototypes for mactcpglue routines and includes/structures needed
5 * Jack Jansen, CWI, 1994.
7 * Adapted from mac socket library, which has in turn adapted from ncsa telnet.
8 * Original authors: Tom Milligan, Charlie Reiman
11 #include <MacTCPCommonTypes.h>
12 #include <GetMyIPAddr.h>
15 #include <AddressXlation.h>
18 #define TCPIOCompletionUPP TCPIOCompletionProc
19 #define TCPNotifyUPP TCPNotifyProc
20 #define UDPIOCompletionUPP UDPIOCompletionProc
21 #define UDPNotifyUPP UDPNotifyProc
22 #define NewTCPIOCompletionProc(x) (x)
23 #define NewTCPNotifyProc(x) (x)
24 #define NewUDPIOCompletionProc(x) (x)
25 #define NewUDPNotifyProc(x) (x)
26 #endif /* __MWERKS__ */
28 #if defined(powerc) || defined (__powerc)
29 #pragma options align=mac68k
32 typedef struct miniwds
34 unsigned short length
;
36 unsigned short terminus
; /* must be zero'd for use */
39 #if defined(powerc) || defined(__powerc)
40 #pragma options align=reset
44 OSErr
xOpenDriver(void);
45 OSErr
xPBControl(TCPiopb
*pb
, TCPIOCompletionUPP completion
);
46 OSErr
xPBControlSync(TCPiopb
*pb
);
47 OSErr
xTCPCreate(int buflen
, TCPNotifyUPP notify
, void *udp
, TCPiopb
*pb
);
48 OSErr
xTCPPassiveOpen(TCPiopb
*pb
, short port
, TCPIOCompletionUPP completion
, void *udp
);
49 OSErr
xTCPActiveOpen(TCPiopb
*pb
, short port
, long rhost
, short rport
, TCPIOCompletionUPP completion
);
50 OSErr
xTCPRcv(TCPiopb
*pb
, char *buf
, int buflen
, int timeout
, TCPIOCompletionUPP completion
);
51 OSErr
xTCPNoCopyRcv(TCPiopb
*,rdsEntry
*,int,int,TCPIOCompletionUPP
);
52 OSErr
xTCPBufReturn(TCPiopb
*pb
,rdsEntry
*rds
,TCPIOCompletionUPP completion
);
53 OSErr
xTCPSend(TCPiopb
*pb
, wdsEntry
*wds
, Boolean push
, Boolean urgent
, TCPIOCompletionUPP completion
);
54 OSErr
xTCPClose(TCPiopb
*pb
,TCPIOCompletionUPP completion
);
55 OSErr
xTCPAbort(TCPiopb
*pb
);
56 OSErr
xTCPRelease(TCPiopb
*pb
);
58 OSErr
xUDPCreate(UDPiopb
*pb
,int buflen
,ip_port
*port
, UDPNotifyUPP asr
, void *udp
);
59 OSErr
xUDPRead(UDPiopb
*pb
,int timeout
, UDPIOCompletionUPP completion
);
60 OSErr
xUDPBfrReturn(UDPiopb
*pb
, char *buff
);
61 OSErr
xUDPWrite(UDPiopb
*pb
,ip_addr host
,ip_port port
,miniwds
*wds
,
62 UDPIOCompletionUPP completion
);
63 OSErr
xUDPRelease(UDPiopb
*pb
);
65 ip_addr
xIPAddr(void);
67 unsigned short xMaxMTU(void);