Jack Jansen | edf5855 | 1994-12-14 13:36:34 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Prototypes for mactcpglue routines and includes/structures needed |
| 3 | * by those. |
| 4 | * |
| 5 | * Jack Jansen, CWI, 1994. |
| 6 | * |
| 7 | * Adapted from mac socket library, which has in turn adapted from ncsa telnet. |
| 8 | * Original authors: Tom Milligan, Charlie Reiman |
| 9 | */ |
| 10 | |
| 11 | #include <MacTCPCommonTypes.h> |
| 12 | #include <GetMyIPAddr.h> |
| 13 | #include <TCPPB.h> |
| 14 | #include <UDPPB.h> |
| 15 | #include <AddressXlation.h> |
| 16 | |
Jack Jansen | 75b6f1c | 1995-01-18 13:50:42 +0000 | [diff] [blame] | 17 | #ifndef __MWERKS__ |
| 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__ */ |
| 27 | |
| 28 | #if defined(powerc) || defined (__powerc) |
| 29 | #pragma options align=mac68k |
| 30 | #endif |
| 31 | |
Jack Jansen | edf5855 | 1994-12-14 13:36:34 +0000 | [diff] [blame] | 32 | typedef struct miniwds |
| 33 | { |
| 34 | unsigned short length; |
| 35 | char * ptr; |
| 36 | unsigned short terminus; /* must be zero'd for use */ |
| 37 | } miniwds; |
| 38 | |
Jack Jansen | 75b6f1c | 1995-01-18 13:50:42 +0000 | [diff] [blame] | 39 | #if defined(powerc) || defined(__powerc) |
| 40 | #pragma options align=reset |
| 41 | #endif |
| 42 | |
Jack Jansen | edf5855 | 1994-12-14 13:36:34 +0000 | [diff] [blame] | 43 | |
| 44 | OSErr xOpenDriver(void); |
Jack Jansen | 75b6f1c | 1995-01-18 13:50:42 +0000 | [diff] [blame] | 45 | OSErr xPBControl(TCPiopb *pb, TCPIOCompletionUPP completion); |
Jack Jansen | edf5855 | 1994-12-14 13:36:34 +0000 | [diff] [blame] | 46 | OSErr xPBControlSync(TCPiopb *pb); |
Jack Jansen | 75b6f1c | 1995-01-18 13:50:42 +0000 | [diff] [blame] | 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); |
Jack Jansen | edf5855 | 1994-12-14 13:36:34 +0000 | [diff] [blame] | 55 | OSErr xTCPAbort(TCPiopb *pb); |
| 56 | OSErr xTCPRelease(TCPiopb *pb); |
| 57 | |
Jack Jansen | 75b6f1c | 1995-01-18 13:50:42 +0000 | [diff] [blame] | 58 | OSErr xUDPCreate(UDPiopb *pb,int buflen,ip_port *port, UDPNotifyUPP asr, void *udp); |
| 59 | OSErr xUDPRead(UDPiopb *pb,int timeout, UDPIOCompletionUPP completion); |
Jack Jansen | edf5855 | 1994-12-14 13:36:34 +0000 | [diff] [blame] | 60 | OSErr xUDPBfrReturn(UDPiopb *pb, char *buff); |
| 61 | OSErr xUDPWrite(UDPiopb *pb,ip_addr host,ip_port port,miniwds *wds, |
Jack Jansen | 75b6f1c | 1995-01-18 13:50:42 +0000 | [diff] [blame] | 62 | UDPIOCompletionUPP completion); |
Jack Jansen | edf5855 | 1994-12-14 13:36:34 +0000 | [diff] [blame] | 63 | OSErr xUDPRelease(UDPiopb *pb); |
| 64 | |
| 65 | ip_addr xIPAddr(void); |
| 66 | long xNetMask(void); |
| 67 | unsigned short xMaxMTU(void); |
| 68 | |