AmendHub

Download

vkoskiv

/

MacNTP

/

tcp.h

 

(View History)

vkoskiv   Large rewrite, restructure the project into an INIT Latest amendment: 11 on 2023-09-07

1 /*
2 * Copyright (c) 1990-1992 by the University of Illinois Board of Trustees
3 */
4
5 #include "MacTCP.h"
6 #include "AddressXlation.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 void mntp_memset(void *ptr, int c, long n);
23
24 OSErr _TCPInit(void);
25 OSErr _TCPGetOurIP(ip_addr *ip, long *netMask);
26 OSErr _TCPCreate(TCPiopb *pb, StreamPtr *stream, Ptr rcvBufPtr,
27 long rcvBufLen, TCPNotifyProc aNotifyProc, Ptr userDataPtr,
28 TCPIOCompletionProc ioCompletion, Boolean async);
29 OSErr _TCPPassiveOpen(TCPiopb *pb, StreamPtr stream, ip_addr *remoteIP,
30 tcp_port *remotePort, ip_addr *localIP, tcp_port *localPort,
31 Ptr userData, TCPIOCompletionProc ioCompletion, Boolean async);
32 OSErr _TCPActiveOpen(TCPiopb *pb, StreamPtr stream, ip_addr remoteIP,
33 tcp_port remotePort, ip_addr *localIP, tcp_port *localPort,
34 Ptr userData, TCPIOCompletionProc ioCompletion, Boolean async);
35 OSErr _TCPSend(TCPiopb *pb, StreamPtr stream, wdsEntry *wdsPtr,
36 Ptr userData, TCPIOCompletionProc ioCompletion, Boolean async);
37 OSErr _TCPNoCopyRcv(TCPiopb *pb, StreamPtr stream, Ptr rdsPtr,
38 unsigned short rdsLength, Ptr userData, TCPIOCompletionProc ioCompletion,
39 Boolean async);
40 OSErr _TCPRcv(TCPiopb *pb, StreamPtr stream, Ptr rcvBufPtr,
41 unsigned short *rcvBufLen, Ptr userData, TCPIOCompletionProc ioCompletion,
42 Boolean async);
43 OSErr _TCPBfrReturn(TCPiopb *pb, StreamPtr stream, Ptr rdsPtr, Ptr userData,
44 TCPIOCompletionProc ioCompletion, Boolean async);
45 OSErr _TCPClose(TCPiopb *pb, StreamPtr stream, Ptr userData,
46 TCPIOCompletionProc ioCompletion, Boolean async);
47 OSErr _TCPAbort(TCPiopb *pb, StreamPtr stream, Ptr userData,
48 TCPIOCompletionProc ioCompletion, Boolean async);
49 OSErr _TCPStatus(TCPiopb *pb, StreamPtr stream, struct TCPStatusPB *status,
50 Ptr userData, TCPIOCompletionProc ioCompletion, Boolean async);
51 OSErr _TCPRelease(TCPiopb *pb, StreamPtr stream, Ptr userData,
52 TCPIOCompletionProc ioCompletion, Boolean async);
53
54 OSErr _UDPMaxMTUSize(UDPiopb *pb, short *mtu);
55 OSErr _UDPCreate(UDPiopb *pb, StreamPtr *stream, Ptr rcvBufPtr,
56 long rcvBufLen, UDPNotifyProc aNotifyProc, Ptr userDataPtr,
57 UDPIOCompletionProc ioCompletion, Boolean async);
58 OSErr _UDPSend(UDPiopb *pb, StreamPtr stream, wdsEntry *wdsPtr,
59 ip_addr remoteIP, udp_port remotePort, Ptr userData,
60 UDPIOCompletionProc ioCompletion, Boolean async);
61 OSErr _UDPRcv(UDPiopb *pb, StreamPtr stream, Ptr rcvBufPtr,
62 unsigned short *rcvBufLen, ip_addr remoteHost, udp_port remotePort, Ptr userData, UDPIOCompletionProc ioCompletion,
63 Boolean async);
64 OSErr _UDPRelease(UDPiopb *pb, StreamPtr stream, Ptr userData,
65 UDPIOCompletionProc ioCompletion, Boolean async);
66
67 unsigned long ip2long(char *ip);
68 void long2ip(unsigned long num, char *ip);
69
70 OSErr SOCKS5TCPActiveOpen(TCPiopb *pb, StreamPtr stream, ip_addr socks_ip,
71 tcp_port socks_port, char *remote_host, tcp_port remote_port,
72 ip_addr *local_ip, tcp_port *local_port, Ptr user_data,
73 TCPIOCompletionProc io_completion, Boolean async);
74
75 #endif