1
/* squeak socket support header file */
3
/* module initialization/shutdown */
4
sqInt socketInit(void);
5
sqInt socketShutdown(void);
10
int socketType; /* 0 = TCP, 1 = UDP */
11
void *privateSocketPtr;
12
} SQSocket, *SocketPtr;
14
/* networking primitives */
15
sqInt sqNetworkInit(sqInt resolverSemaIndex);
16
void sqNetworkShutdown(void);
17
void sqResolverAbort(void);
18
void sqResolverAddrLookupResult(char *nameForAddress, sqInt nameSize);
19
sqInt sqResolverAddrLookupResultSize(void);
20
sqInt sqResolverError(void);
21
sqInt sqResolverLocalAddress(void);
22
sqInt sqResolverNameLookupResult(void);
23
void sqResolverStartAddrLookup(sqInt address);
24
void sqResolverStartNameLookup(char *hostName, sqInt nameSize);
25
sqInt sqResolverStatus(void);
26
void sqSocketAbortConnection(SocketPtr s);
27
void sqSocketCloseConnection(SocketPtr s);
28
sqInt sqSocketConnectionStatus(SocketPtr s);
29
void sqSocketConnectToPort(SocketPtr s, sqInt addr, sqInt port);
30
void sqSocketCreateNetTypeSocketTypeRecvBytesSendBytesSemaID(SocketPtr s, sqInt netType, sqInt socketType, sqInt recvBufSize, sqInt sendBufSize, sqInt semaIndex);
31
void sqSocketCreateNetTypeSocketTypeRecvBytesSendBytesSemaIDReadSemaIDWriteSemaID(SocketPtr s, sqInt netType, sqInt socketType, sqInt recvBufSize, sqInt sendBufSize, sqInt semaIndex, sqInt readSemaIndex, sqInt writeSemaIndex);
32
void sqSocketDestroy(SocketPtr s);
33
sqInt sqSocketError(SocketPtr s);
34
void sqSocketListenOnPort(SocketPtr s, sqInt port);
35
sqInt sqSocketLocalAddress(SocketPtr s);
36
sqInt sqSocketLocalPort(SocketPtr s);
37
sqInt sqSocketReceiveDataAvailable(SocketPtr s);
38
sqInt sqSocketReceiveDataBufCount(SocketPtr s, char *buf, sqInt bufSize);
39
sqInt sqSocketRemoteAddress(SocketPtr s);
40
sqInt sqSocketRemotePort(SocketPtr s);
41
sqInt sqSocketSendDataBufCount(SocketPtr s, char *buf, sqInt bufSize);
42
sqInt sqSocketSendDone(SocketPtr s);
43
/* ar 7/16/1999: New primitives for accept(). Note: If accept() calls are not supported simply make the calls fail and the old connection style will be used. */
44
void sqSocketListenOnPortBacklogSize(SocketPtr s, sqInt port, sqInt backlogSize);
45
void sqSocketListenOnPortBacklogSizeInterface(SocketPtr s, sqInt port, sqInt backlogSize, sqInt addr);
46
void sqSocketAcceptFromRecvBytesSendBytesSemaID(SocketPtr s, SocketPtr serverSocket, sqInt recvBufSize, sqInt sendBufSize, sqInt semaIndex);
47
void sqSocketAcceptFromRecvBytesSendBytesSemaIDReadSemaIDWriteSemaID(SocketPtr s, SocketPtr serverSocket, sqInt recvBufSize, sqInt sendBufSize, sqInt semaIndex, sqInt readSemaIndex, sqInt writeSemaIndex);
48
sqInt sqSocketReceiveUDPDataBufCountaddressportmoreFlag(SocketPtr s, char *buf, sqInt bufSize, sqInt *address, sqInt *port, sqInt *moreFlag);
49
sqInt sqSockettoHostportSendDataBufCount(SocketPtr s, sqInt address, sqInt port, char *buf, sqInt bufSize);
50
sqInt sqSocketSetOptionsoptionNameStartoptionNameSizeoptionValueStartoptionValueSizereturnedValue(SocketPtr s, char *optionName, sqInt optionNameSize, char *optionValue, sqInt optionValueSize, sqInt *result);
51
sqInt sqSocketGetOptionsoptionNameStartoptionNameSizereturnedValue(SocketPtr s, char *optionName, sqInt optionNameSize, sqInt *result);
52
/* tpr 4/12/06 add declarations for two new socket routines */
53
void sqSocketBindToPort(SocketPtr s, int addr, int port);
54
void sqSocketSetReusable(SocketPtr s);
56
void sqResolverGetAddressInfoHostSizeServiceSizeFlagsFamilyTypeProtocol(char *hostName, sqInt hostSize, char *servName, sqInt servSize,
57
sqInt flags, sqInt family, sqInt type, sqInt protocol);
58
sqInt sqResolverGetAddressInfoSize(void);
59
void sqResolverGetAddressInfoResultSize(char *addr, sqInt addrSize);
60
sqInt sqResolverGetAddressInfoFamily(void);
61
sqInt sqResolverGetAddressInfoType(void);
62
sqInt sqResolverGetAddressInfoProtocol(void);
63
sqInt sqResolverGetAddressInfoNext(void);
65
sqInt sqSocketAddressSizeGetPort(char *addr, sqInt addrSize);
66
void sqSocketAddressSizeSetPort(char *addr, sqInt addrSize, sqInt port);
68
void sqResolverGetNameInfoSizeFlags(char *addr, sqInt addrSize, sqInt flags);
69
sqInt sqResolverGetNameInfoHostSize(void);
70
void sqResolverGetNameInfoHostResultSize(char *name, sqInt nameSize);
71
sqInt sqResolverGetNameInfoServiceSize(void);
72
void sqResolverGetNameInfoServiceResultSize(char *name, sqInt nameSize);
74
sqInt sqResolverHostNameSize(void);
75
void sqResolverHostNameResultSize(char *name, sqInt nameSize);
77
void sqSocketBindToAddressSize(SocketPtr s, char *addr, sqInt addrSize);
78
void sqSocketListenBacklog(SocketPtr s, sqInt backlogSize);
79
void sqSocketConnectToAddressSize(SocketPtr s, char *addr, sqInt addrSize);
81
sqInt sqSocketLocalAddressSize(SocketPtr s);
82
void sqSocketLocalAddressResultSize(SocketPtr s, char *addr, int addrSize);
83
sqInt sqSocketRemoteAddressSize(SocketPtr s);
84
void sqSocketRemoteAddressResultSize(SocketPtr s, char *addr, int addrSize);