AmendHub

Download

jcs

/

wallops

/

tcp.h

 

(View History)

jcs   tcp: Sync with upstream, add atexit destroyer Latest amendment: 51 on 2024-08-30

1 /*
2 * Copyright (c) 1990-1992 by the University of Illinois Board of Trustees
3 */
4
5 #include "MacTCP.h"
6 #include "dnr.h"
7
8 #ifndef __TCP_H__
9 #define __TCP_H__
10
11 typedef struct
12 {
13 Handle next;
14 struct hostInfo hi;
15 } HostInfoQ, *HostInfoQPtr, **HostInfoQHandle;
16
17 typedef ProcPtr TCPNotifyProc;
18 typedef ProcPtr UDPNotifyProc;
19 typedef void (*TCPIOCompletionProc)(struct TCPiopb *iopb);
20 typedef void (*UDPIOCompletionProc)(struct UDPiopb *iopb);
21
22 OSErr _TCPInit(void);
23 OSErr _TCPGetOurIP(ip_addr *ip, long *netMask);
24 OSErr _TCPCreate(TCPiopb *pb, StreamPtr *stream, Ptr rcvBufPtr,
25 long rcvBufLen, TCPNotifyProc aNotifyProc, Ptr userDataPtr,
26 TCPIOCompletionProc ioCompletion, Boolean async);
27 OSErr _TCPPassiveOpen(TCPiopb *pb, StreamPtr stream, ip_addr *remoteIP,
28 tcp_port *remotePort, ip_addr *localIP, tcp_port *localPort,
29 Ptr userData, TCPIOCompletionProc ioCompletion, Boolean async);
30 OSErr _TCPActiveOpen(TCPiopb *pb, StreamPtr stream, ip_addr remoteIP,
31 tcp_port remotePort, ip_addr *localIP, tcp_port *localPort,
32 Ptr userData, TCPIOCompletionProc ioCompletion, Boolean async);
33 OSErr _TCPSend(TCPiopb *pb, StreamPtr stream, wdsEntry *wdsPtr,
34 Ptr userData, TCPIOCompletionProc ioCompletion, Boolean async);
35 OSErr _TCPNoCopyRcv(TCPiopb *pb, StreamPtr stream, Ptr rdsPtr,
36 unsigned short rdsLength, Ptr userData, TCPIOCompletionProc ioCompletion,
37 Boolean async);
38 OSErr _TCPRcv(TCPiopb *pb, StreamPtr stream, Ptr rcvBufPtr,
39 unsigned short *rcvBufLen, Ptr userData, TCPIOCompletionProc ioCompletion,
40 Boolean async);
41 OSErr _TCPBfrReturn(TCPiopb *pb, StreamPtr stream, Ptr rdsPtr, Ptr userData,
42 TCPIOCompletionProc ioCompletion, Boolean async);
43 OSErr _TCPClose(TCPiopb *pb, StreamPtr stream, Ptr userData,
44 TCPIOCompletionProc ioCompletion, Boolean async);
45 OSErr _TCPAbort(TCPiopb *pb, StreamPtr stream, Ptr userData,
46 TCPIOCompletionProc ioCompletion, Boolean async);
47 OSErr _TCPStatus(TCPiopb *pb, StreamPtr stream, struct TCPStatusPB *status,
48 Ptr userData, TCPIOCompletionProc ioCompletion, Boolean async);
49 OSErr _TCPRelease(TCPiopb *pb, StreamPtr stream, Ptr userData,
50 TCPIOCompletionProc ioCompletion, Boolean async);
51
52 OSErr _UDPMaxMTUSize(UDPiopb *pb, short *mtu);
53 OSErr _UDPCreate(UDPiopb *pb, StreamPtr *stream, Ptr rcvBufPtr,
54 long rcvBufLen, UDPNotifyProc aNotifyProc, Ptr userDataPtr,
55 UDPIOCompletionProc ioCompletion, Boolean async);
56 OSErr _UDPSend(UDPiopb *pb, StreamPtr stream, wdsEntry *wdsPtr,
57 ip_addr remoteIP, udp_port remotePort, Ptr userData,
58 UDPIOCompletionProc ioCompletion, Boolean async);
59 OSErr _UDPRelease(UDPiopb *pb, StreamPtr stream, Ptr userData,
60 UDPIOCompletionProc ioCompletion, Boolean async);
61
62 OSErr DNSResolveName(char *name, unsigned long *ipAddress,
63 void (*yielder)(void));
64 pascal void StrToAddrMarkDone(struct hostInfo *hi, char *data);
65
66 unsigned long ip2long(char *ip);
67 void long2ip(unsigned long num, char *ip);
68
69 OSErr SOCKS5TCPActiveOpen(TCPiopb *pb, StreamPtr stream, ip_addr socks_ip,
70 tcp_port socks_port, char *remote_host, tcp_port remote_port,
71 ip_addr *local_ip, tcp_port *local_port, Ptr user_data,
72 TCPIOCompletionProc io_completion, Boolean async);
73
74 #endif