LibreOffice LibreOffice 5.3 SDK C/C++ API Reference

socket.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20 #ifndef INCLUDED_OSL_SOCKET_H
21 #define INCLUDED_OSL_SOCKET_H
22
23 #include <rtl/ustring.h>
24 #include <rtl/byteseq.h>
25
26 #include <osl/time.h>
27 #include <rtl/tencinfo.h>
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 /* error returns */
34 #define OSL_INADDR_NONE 0xffffffff
35 #define OSL_INVALID_PORT (-1)
36
40 typedef struct oslSocketAddrImpl * oslSocketAddr;
41
42
46 typedef enum {
47 osl_Socket_FamilyInet, /* IP */
48 osl_Socket_FamilyIpx, /* Novell IPX/SPX */
49 osl_Socket_FamilyInvalid, /* always last entry in enum! */
50 osl_Socket_Family_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
51 } oslAddrFamily;
52
56 typedef enum {
57 osl_Socket_ProtocolIp, /* for all af_inet */
58 osl_Socket_ProtocolIpx, /* af_ipx datagram sockets (IPX) */
59 osl_Socket_ProtocolSpx, /* af_ipx seqpacket or stream for SPX */
60 osl_Socket_ProtocolSpxII, /* af_ipx seqpacket or stream for SPX II */
61 osl_Socket_ProtocolInvalid,
62 osl_Socket_Protocol_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
63 } oslProtocol;
64
65
69 typedef enum {
70 osl_Socket_TypeStream,
71 osl_Socket_TypeDgram,
72 osl_Socket_TypeRaw,
73 osl_Socket_TypeRdm,
74 osl_Socket_TypeSeqPacket,
75 osl_Socket_TypeInvalid, /* always last entry in enum! */
76 osl_Socket_Type_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
77 } oslSocketType;
78
79
83 typedef enum {
84 osl_Socket_OptionDebug,
85 osl_Socket_OptionAcceptConn,
86 osl_Socket_OptionReuseAddr,
87 osl_Socket_OptionKeepAlive,
88 osl_Socket_OptionDontRoute,
89 osl_Socket_OptionBroadcast,
90 osl_Socket_OptionUseLoopback,
91 osl_Socket_OptionLinger,
92 osl_Socket_OptionOOBinLine,
93 osl_Socket_OptionSndBuf,
94 osl_Socket_OptionRcvBuf,
95 osl_Socket_OptionSndLowat,
96 osl_Socket_OptionRcvLowat,
97 osl_Socket_OptionSndTimeo,
98 osl_Socket_OptionRcvTimeo,
99 osl_Socket_OptionError,
100 osl_Socket_OptionType,
101 osl_Socket_OptionTcpNoDelay,
102 osl_Socket_OptionInvalid, /* always last entry in enum! */
103 osl_Socket_Option_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
104 } oslSocketOption;
105
109 typedef enum {
110 osl_Socket_LevelSocket,
111 osl_Socket_LevelTcp,
112 osl_Socket_LevelInvalid, /* always last entry in enum! */
113 osl_Socket_Level_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
114 } oslSocketOptionLevel;
115
116
120 typedef enum {
121 osl_Socket_MsgNormal,
122 osl_Socket_MsgOOB,
123 osl_Socket_MsgPeek,
124 osl_Socket_MsgDontRoute,
125 osl_Socket_MsgMaxIOVLen,
126 osl_Socket_MsgInvalid, /* always last entry in enum! */
127 osl_Socket_Msg_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
128 } oslSocketMsgFlag;
129
133 typedef enum {
134 osl_Socket_DirRead,
135 osl_Socket_DirWrite,
136 osl_Socket_DirReadWrite,
137 osl_Socket_DirInvalid, /* always last entry in enum! */
138 osl_Socket_Dir_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
139 } oslSocketDirection;
140
143 typedef enum {
144 osl_Socket_E_None, /* no error */
145 osl_Socket_E_NotSocket, /* Socket operation on non-socket */
146 osl_Socket_E_DestAddrReq, /* Destination address required */
147 osl_Socket_E_MsgSize, /* Message too long */
148 osl_Socket_E_Prototype, /* Protocol wrong type for socket */
149 osl_Socket_E_NoProtocol, /* Protocol not available */
150 osl_Socket_E_ProtocolNoSupport, /* Protocol not supported */
151 osl_Socket_E_TypeNoSupport, /* Socket type not supported */
152 osl_Socket_E_OpNotSupport, /* Operation not supported on socket */
153 osl_Socket_E_PfNoSupport, /* Protocol family not supported */
154 osl_Socket_E_AfNoSupport, /* Address family not supported by */
155 /* protocol family */
156 osl_Socket_E_AddrInUse, /* Address already in use */
157 osl_Socket_E_AddrNotAvail, /* Can't assign requested address */
158 osl_Socket_E_NetDown, /* Network is down */
159 osl_Socket_E_NetUnreachable, /* Network is unreachable */
160 osl_Socket_E_NetReset, /* Network dropped connection because */
161 /* of reset */
162 osl_Socket_E_ConnAborted, /* Software caused connection abort */
163 osl_Socket_E_ConnReset, /* Connection reset by peer */
164 osl_Socket_E_NoBufferSpace, /* No buffer space available */
165 osl_Socket_E_IsConnected, /* Socket is already connected */
166 osl_Socket_E_NotConnected, /* Socket is not connected */
167 osl_Socket_E_Shutdown, /* Can't send after socket shutdown */
168 osl_Socket_E_TooManyRefs, /* Too many references: can't splice */
169 osl_Socket_E_TimedOut, /* Connection timed out */
170 osl_Socket_E_ConnRefused, /* Connection refused */
171 osl_Socket_E_HostDown, /* Host is down */
172 osl_Socket_E_HostUnreachable, /* No route to host */
173 osl_Socket_E_WouldBlock, /* call would block on non-blocking socket */
174 osl_Socket_E_Already, /* operation already in progress */
175 osl_Socket_E_InProgress, /* operation now in progress */
176 osl_Socket_E_InvalidError, /* unmapped error: always last entry in enum! */
177 osl_Socket_E_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
178 } oslSocketError;
179
182 typedef enum {
183 osl_Socket_Ok, /* successful completion */
184 osl_Socket_Error, /* error occurred, check osl_getLastSocketError() for details */
185 osl_Socket_TimedOut, /* blocking operation timed out */
186 osl_Socket_Interrupted, /* blocking operation was interrupted */
187 osl_Socket_InProgress, /* nonblocking operation is in progress */
188 osl_Socket_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
189 } oslSocketResult;
190
191 typedef sal_uInt8 oslSocketIpxNetNumber[4];
192 typedef sal_uInt8 oslSocketIpxNodeNumber[6];
193
205 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_createEmptySocketAddr(
206 oslAddrFamily Family);
207
208
211 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_copySocketAddr(
212 oslSocketAddr Addr);
213
218 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isEqualSocketAddr(
219 oslSocketAddr Addr1, oslSocketAddr Addr2);
220
226 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_resolveHostname(
227 rtl_uString *strHostname);
228
238 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_createInetBroadcastAddr (
239 rtl_uString *strDottedAddr, sal_Int32 Port);
240
241
249 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_createInetSocketAddr (
250 rtl_uString *strDottedAddr, sal_Int32 Port);
251
252
256 SAL_DLLPUBLIC void SAL_CALL osl_destroySocketAddr(
257 oslSocketAddr Addr);
258
263 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_getServicePort(
264 rtl_uString *strServicename, rtl_uString *strProtocol);
265
266
267
272 SAL_DLLPUBLIC oslAddrFamily SAL_CALL osl_getFamilyOfSocketAddr(
273 oslSocketAddr Addr);
274
275
280 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_getInetPortOfSocketAddr(
281 oslSocketAddr Addr);
282
283
289 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_setInetPortOfSocketAddr(
290 oslSocketAddr Addr, sal_Int32 Port);
291
292
298 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_getHostnameOfSocketAddr(
299 oslSocketAddr Addr, rtl_uString **strHostname);
300
301
310 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_getDottedInetAddrOfSocketAddr(
311 oslSocketAddr Addr, rtl_uString **strDottedInetAddr);
312
315 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_setAddrOfSocketAddr(
316 oslSocketAddr Addr, sal_Sequence *pByteSeq );
317
324 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_getAddrOfSocketAddr(
325 oslSocketAddr Addr, sal_Sequence **ppByteSeq );
326
327 /*
328 Opaque datatype HostAddr.
329 */
330 typedef struct oslHostAddrImpl * oslHostAddr;
331
332
338 SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_createHostAddr(
339 rtl_uString *strHostname, const oslSocketAddr Addr);
340
341
349 SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_createHostAddrByName(rtl_uString *strHostname);
350
351
359 SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_createHostAddrByAddr(const oslSocketAddr Addr);
360
361
365 SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_copyHostAddr(const oslHostAddr Addr);
366
367
371 SAL_DLLPUBLIC void SAL_CALL osl_destroyHostAddr(oslHostAddr Addr);
372
373
377 SAL_DLLPUBLIC void SAL_CALL osl_getHostnameOfHostAddr(const oslHostAddr Addr, rtl_uString **strHostname);
378
379
383 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_getSocketAddrOfHostAddr(const oslHostAddr Addr);
384
390 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_getLocalHostname(rtl_uString **strLocalHostname);
391
392
400 /*-***************************************************************************/
401 /* oslSocket */
402 /*-***************************************************************************/
403
404 typedef struct oslSocketImpl * oslSocket;
405
408 SAL_DLLPUBLIC void SAL_CALL osl_acquireSocket( oslSocket Socket );
409
415 SAL_DLLPUBLIC void SAL_CALL osl_releaseSocket( oslSocket Socket );
416
422 SAL_DLLPUBLIC oslSocket SAL_CALL osl_createSocket(
423 oslAddrFamily Family,
424 oslSocketType Type,
425 oslProtocol Protocol);
426
433 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_getLocalAddrOfSocket(oslSocket Socket);
434
441 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_getPeerAddrOfSocket(oslSocket Socket);
442
449 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_bindAddrToSocket(
450 oslSocket Socket,
451 oslSocketAddr Addr);
452
464 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_connectSocketTo(
465 oslSocket Socket,
466 oslSocketAddr Addr,
467 const TimeValue* pTimeout);
468
469
478 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_listenOnSocket(
479 oslSocket Socket,
480 sal_Int32 MaxPendingConnections);
481
482
490 SAL_DLLPUBLIC oslSocket SAL_CALL osl_acceptConnectionOnSocket
491 (oslSocket Socket,
492 oslSocketAddr* pAddr);
493
514 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_receiveSocket(
515 oslSocket Socket,
516 void* pBuffer,
517 sal_uInt32 BytesToRead,
518 oslSocketMsgFlag Flag);
519
542 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_receiveFromSocket(
543 oslSocket Socket,
544 oslSocketAddr SenderAddr,
545 void* pBuffer,
546 sal_uInt32 BufferSize,
547 oslSocketMsgFlag Flag);
548
567 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_sendSocket(
568 oslSocket Socket,
569 const void* pBuffer,
570 sal_uInt32 BytesToSend,
571 oslSocketMsgFlag Flag);
572
598 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_sendToSocket(
599 oslSocket Socket,
600 oslSocketAddr ReceiverAddr,
601 const void* pBuffer,
602 sal_uInt32 BytesToSend,
603 oslSocketMsgFlag Flag);
604
616 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isReceiveReady(
617 oslSocket Socket, const TimeValue* pTimeout);
618
629 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isSendReady(
630 oslSocket Socket, const TimeValue* pTimeout);
631
641 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isExceptionPending(
642 oslSocket Socket, const TimeValue* pTimeout);
643
655 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_shutdownSocket(oslSocket Socket,
656 oslSocketDirection Direction);
657
742 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_getSocketOption( oslSocket Socket,
743 oslSocketOptionLevel Level,
744 oslSocketOption Option,
745 void* pBuffer,
746 sal_uInt32 BufferLen);
747
768 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_setSocketOption( oslSocket Socket,
769 oslSocketOptionLevel Level,
770 oslSocketOption Option,
771 void* pBuffer,
772 sal_uInt32 BufferLen);
773
780 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_enableNonBlockingMode(
781 oslSocket Socket, sal_Bool On);
782
783
788 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isNonBlockingMode(
789 oslSocket Socket);
790
791
804 SAL_DLLPUBLIC oslSocketType SAL_CALL osl_getSocketType(
805 oslSocket Socket);
806
811 SAL_DLLPUBLIC void SAL_CALL osl_getLastSocketErrorDescription(
812 oslSocket Socket, rtl_uString **strError);
813
819 SAL_DLLPUBLIC oslSocketError SAL_CALL osl_getLastSocketError(
820 oslSocket Socket);
821
824 typedef struct oslSocketSetImpl * oslSocketSet;
825
829 SAL_DLLPUBLIC oslSocketSet SAL_CALL osl_createSocketSet(void);
830
833 SAL_DLLPUBLIC void SAL_CALL osl_destroySocketSet(oslSocketSet Set);
834
838 SAL_DLLPUBLIC void SAL_CALL osl_clearSocketSet(oslSocketSet Set);
839
840
845 SAL_DLLPUBLIC void SAL_CALL osl_addToSocketSet(oslSocketSet Set, oslSocket Socket);
846
851 SAL_DLLPUBLIC void SAL_CALL osl_removeFromSocketSet(oslSocketSet Set, oslSocket Socket);
852
858 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isInSocketSet(oslSocketSet Set, oslSocket Socket);
859
875 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_demultiplexSocketEvents(oslSocketSet IncomingSet,
876 oslSocketSet OutgoingSet,
877 oslSocketSet OutOfBandSet,
878 const TimeValue* pTimeout);
879
883 SAL_DLLPUBLIC void SAL_CALL osl_closeSocket(oslSocket Socket);
884
885
895 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_readSocket( oslSocket Socket, void *pBuffer, sal_Int32 nSize );
896
897
906 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_writeSocket( oslSocket Socket, const void *pBuffer, sal_Int32 nSize );
907
913 #ifdef __cplusplus
914 }
915 #endif
916
917 #endif // INCLUDED_OSL_SOCKET_H
918
919 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
osl_listenOnSocket
SAL_DLLPUBLIC sal_Bool osl_listenOnSocket(oslSocket Socket, sal_Int32 MaxPendingConnections)
Prepares the socket to act as an acceptor of incoming connections.
osl_demultiplexSocketEvents
SAL_DLLPUBLIC sal_Int32 osl_demultiplexSocketEvents(oslSocketSet IncomingSet, oslSocketSet OutgoingSet, oslSocketSet OutOfBandSet, const TimeValue *pTimeout)
Checks multiple sockets for events.
osl_createSocketSet
SAL_DLLPUBLIC oslSocketSet osl_createSocketSet(void)
Creates a set of sockets to be used with osl_demultiplexSocketEvents().
osl_Socket_TypeSeqPacket
Definition: socket.h:74
osl_Socket_E_NetReset
Definition: socket.h:160
osl_Socket_E_InProgress
Definition: socket.h:175
osl_Socket_OptionRcvLowat
Definition: socket.h:96
osl_Socket_E_HostUnreachable
Definition: socket.h:172
osl_Socket_E_NoBufferSpace
Definition: socket.h:164
osl_removeFromSocketSet
SAL_DLLPUBLIC void osl_removeFromSocketSet(oslSocketSet Set, oslSocket Socket)
Removes a socket from the set.
osl_Socket_FamilyInet
Definition: socket.h:47
osl_Socket_LevelInvalid
Definition: socket.h:112
osl_Socket_OptionSndLowat
Definition: socket.h:95
osl_shutdownSocket
SAL_DLLPUBLIC sal_Bool osl_shutdownSocket(oslSocket Socket, oslSocketDirection Direction)
Shuts down communication on a connected socket.
osl_createHostAddrByAddr
SAL_DLLPUBLIC oslHostAddr osl_createHostAddrByAddr(const oslSocketAddr Addr)
Create an oslHostAddr by reverse resolution of the given Addr.
TimeValue
Definition: time.h:70
osl_Socket_E_NoProtocol
Definition: socket.h:149
osl_Socket_Level_FORCE_EQUAL_SIZE
Definition: socket.h:113
osl_Socket_Msg_FORCE_EQUAL_SIZE
Definition: socket.h:127
osl_getHostnameOfSocketAddr
SAL_DLLPUBLIC oslSocketResult osl_getHostnameOfSocketAddr(oslSocketAddr Addr, rtl_uString **strHostname)
Returns the hostname represented by Addr.
oslSocketMsgFlag
oslSocketMsgFlag
Represents flags to be used with send/recv-calls.
Definition: socket.h:120
osl_Socket_InProgress
Definition: socket.h:187
osl_Socket_MsgDontRoute
Definition: socket.h:124
osl_Socket_Option_FORCE_EQUAL_SIZE
Definition: socket.h:103
osl_Socket_E_AddrNotAvail
Definition: socket.h:157
osl_Socket_Protocol_FORCE_EQUAL_SIZE
Definition: socket.h:62
osl_copyHostAddr
SAL_DLLPUBLIC oslHostAddr osl_copyHostAddr(const oslHostAddr Addr)
Create a copy of the given Addr.
SAL_DLLPUBLIC
#define SAL_DLLPUBLIC
Definition: saldllapi.h:30
osl_getLocalHostname
SAL_DLLPUBLIC oslSocketResult osl_getLocalHostname(rtl_uString **strLocalHostname)
Retrieve this machines hostname.
osl_Socket_OptionRcvTimeo
Definition: socket.h:98
osl_sendToSocket
SAL_DLLPUBLIC sal_Int32 osl_sendToSocket(oslSocket Socket, oslSocketAddr ReceiverAddr, const void *pBuffer, sal_uInt32 BytesToSend, oslSocketMsgFlag Flag)
Tries to send one datagram with BytesToSend data to the given ReceiverAddr via the (implicitly unconn...
osl_Socket_OptionSndTimeo
Definition: socket.h:97
osl_Socket_OptionSndBuf
Definition: socket.h:93
osl_Socket_E_ConnAborted
Definition: socket.h:162
oslSocketError
oslSocketError
Describes the various error socket error conditions, which may occur.
Definition: socket.h:143
osl_connectSocketTo
SAL_DLLPUBLIC oslSocketResult osl_connectSocketTo(oslSocket Socket, oslSocketAddr Addr, const TimeValue *pTimeout)
Connects the socket to the given address.
osl_sendSocket
SAL_DLLPUBLIC sal_Int32 osl_sendSocket(oslSocket Socket, const void *pBuffer, sal_uInt32 BytesToSend, oslSocketMsgFlag Flag)
Tries to send BytesToSend data from the connected socket, if no error occurs.
osl_bindAddrToSocket
SAL_DLLPUBLIC sal_Bool osl_bindAddrToSocket(oslSocket Socket, oslSocketAddr Addr)
Binds the given address to the socket.
osl_Socket_MsgNormal
Definition: socket.h:121
oslHostAddr
struct oslHostAddrImpl * oslHostAddr
Definition: socket.h:329
oslSocket
struct oslSocketImpl * oslSocket
Definition: socket.h:402
osl_destroyHostAddr
SAL_DLLPUBLIC void osl_destroyHostAddr(oslHostAddr Addr)
Frees all resources allocated by Addr.
osl_Socket_OptionAcceptConn
Definition: socket.h:85
osl_acquireSocket
SAL_DLLPUBLIC void osl_acquireSocket(oslSocket Socket)
increases the refcount of the socket handle by one
osl_Socket_E_WouldBlock
Definition: socket.h:173
osl_Socket_OptionRcvBuf
Definition: socket.h:94
osl_clearSocketSet
SAL_DLLPUBLIC void osl_clearSocketSet(oslSocketSet Set)
Clears the set from all previously added sockets.
osl_Socket_MsgOOB
Definition: socket.h:122
osl_isInSocketSet
SAL_DLLPUBLIC sal_Bool osl_isInSocketSet(oslSocketSet Set, oslSocket Socket)
Checks if socket is in the set.
osl_createEmptySocketAddr
SAL_DLLPUBLIC oslSocketAddr osl_createEmptySocketAddr(oslAddrFamily Family)
Creates a socket-address for the given family.
osl_Socket_OptionLinger
Definition: socket.h:91
osl_isEqualSocketAddr
SAL_DLLPUBLIC sal_Bool osl_isEqualSocketAddr(oslSocketAddr Addr1, oslSocketAddr Addr2)
Compares the values of two SocketAddresses.
oslSocketAddr
struct oslSocketAddrImpl * oslSocketAddr
Opaque datatype SocketAddr.
Definition: socket.h:40
osl_setInetPortOfSocketAddr
SAL_DLLPUBLIC sal_Bool osl_setInetPortOfSocketAddr(oslSocketAddr Addr, sal_Int32 Port)
Sets the Port of Addr.
osl_Socket_E_Prototype
Definition: socket.h:148
osl_Socket_OptionTcpNoDelay
Definition: socket.h:101
osl_Socket_OptionKeepAlive
Definition: socket.h:87
osl_Socket_E_ProtocolNoSupport
Definition: socket.h:150
osl_releaseSocket
SAL_DLLPUBLIC void osl_releaseSocket(oslSocket Socket)
decreases the refcount of the socket handle by one.
osl_Socket_FamilyInvalid
Definition: socket.h:49
osl_Socket_E_FORCE_EQUAL_SIZE
Definition: socket.h:177
osl_receiveSocket
SAL_DLLPUBLIC sal_Int32 osl_receiveSocket(oslSocket Socket, void *pBuffer, sal_uInt32 BytesToRead, oslSocketMsgFlag Flag)
Tries to receive BytesToRead data from the connected socket, if no error occurs.
osl_Socket_Dir_FORCE_EQUAL_SIZE
Definition: socket.h:138
osl_Socket_Error
Definition: socket.h:184
osl_Socket_E_TooManyRefs
Definition: socket.h:168
osl_Socket_E_NotSocket
Definition: socket.h:145
osl_getSocketAddrOfHostAddr
SAL_DLLPUBLIC oslSocketAddr osl_getSocketAddrOfHostAddr(const oslHostAddr Addr)
Get the socket address member of Addr.
osl_Socket_TypeDgram
Definition: socket.h:71
osl_Socket_OptionDebug
Definition: socket.h:84
osl_getLastSocketError
SAL_DLLPUBLIC oslSocketError osl_getLastSocketError(oslSocket Socket)
returns a constant describing the last error for the socket system.
osl_Socket_TypeRdm
Definition: socket.h:73
osl_getPeerAddrOfSocket
SAL_DLLPUBLIC oslSocketAddr osl_getPeerAddrOfSocket(oslSocket Socket)
Retrieves the Address of the remote end of the socket.
osl_getSocketType
SAL_DLLPUBLIC oslSocketType osl_getSocketType(oslSocket Socket)
Queries the socket for its type.
osl_Socket_DirWrite
Definition: socket.h:135
oslSocketDirection
oslSocketDirection
Used by shutdown to denote which end of the socket to "close".
Definition: socket.h:133
osl_Socket_ProtocolInvalid
Definition: socket.h:61
osl_createHostAddrByName
SAL_DLLPUBLIC oslHostAddr osl_createHostAddrByName(rtl_uString *strHostname)
Create an oslHostAddr by resolving the given strHostname.
osl_Socket_DirRead
Definition: socket.h:134
osl_Socket_E_IsConnected
Definition: socket.h:165
oslProtocol
oslProtocol
represent a specific protocol within a address-family
Definition: socket.h:56
osl_isNonBlockingMode
SAL_DLLPUBLIC sal_Bool osl_isNonBlockingMode(oslSocket Socket)
Query state of non-blocking-mode of the socket.
osl_Socket_TypeStream
Definition: socket.h:70
osl_Socket_E_PfNoSupport
Definition: socket.h:153
sal_Bool
unsigned char sal_Bool
Definition: types.h:48
osl_Socket_OptionType
Definition: socket.h:100
osl_setAddrOfSocketAddr
SAL_DLLPUBLIC oslSocketResult osl_setAddrOfSocketAddr(oslSocketAddr Addr, sal_Sequence *pByteSeq)
Sets the addr field in the struct sockaddr with pByteSeq.
osl_isReceiveReady
SAL_DLLPUBLIC sal_Bool osl_isReceiveReady(oslSocket Socket, const TimeValue *pTimeout)
Checks if read operations will block.
ustring.h
osl_destroySocketAddr
SAL_DLLPUBLIC void osl_destroySocketAddr(oslSocketAddr Addr)
Frees all resources allocated by Addr.
oslSocketOption
oslSocketOption
Represents socket-options.
Definition: socket.h:83
osl_readSocket
SAL_DLLPUBLIC sal_Int32 osl_readSocket(oslSocket Socket, void *pBuffer, sal_Int32 nSize)
Retrieves n bytes from the stream and copies them into pBuffer.
osl_Socket_E_NotConnected
Definition: socket.h:166
osl_Socket_OptionInvalid
Definition: socket.h:102
osl_closeSocket
SAL_DLLPUBLIC void osl_closeSocket(oslSocket Socket)
Closes the socket terminating any ongoing dataflow.
tencinfo.h
osl_resolveHostname
SAL_DLLPUBLIC oslSocketAddr osl_resolveHostname(rtl_uString *strHostname)
Uses the systems name-service interface to find an address for strHostname.
osl_Socket_ProtocolIp
Definition: socket.h:57
osl_getFamilyOfSocketAddr
SAL_DLLPUBLIC oslAddrFamily osl_getFamilyOfSocketAddr(oslSocketAddr Addr)
Retrieves the address-family from the Addr.
osl_receiveFromSocket
SAL_DLLPUBLIC sal_Int32 osl_receiveFromSocket(oslSocket Socket, oslSocketAddr SenderAddr, void *pBuffer, sal_uInt32 BufferSize, oslSocketMsgFlag Flag)
Tries to receives BufferSize data from the (usually unconnected) (datagram-)socket, if no error occurs.
osl_Socket_E_DestAddrReq
Definition: socket.h:146
osl_setSocketOption
SAL_DLLPUBLIC sal_Bool osl_setSocketOption(oslSocket Socket, oslSocketOptionLevel Level, oslSocketOption Option, void *pBuffer, sal_uInt32 BufferLen)
Sets the sockets attributes.
osl_Socket_LevelTcp
Definition: socket.h:111
osl_Socket_MsgInvalid
Definition: socket.h:126
oslSocketSet
struct oslSocketSetImpl * oslSocketSet
Type for the representation of socket sets.
Definition: socket.h:822
oslAddrFamily
oslAddrFamily
Represents the address-family of a socket.
Definition: socket.h:46
osl_Socket_E_AddrInUse
Definition: socket.h:156
osl_Socket_DirReadWrite
Definition: socket.h:136
osl_getAddrOfSocketAddr
SAL_DLLPUBLIC oslSocketResult osl_getAddrOfSocketAddr(oslSocketAddr Addr, sal_Sequence **ppByteSeq)
Returns the addr field in the struct sockaddr.
oslSocketIpxNetNumber
sal_uInt8 oslSocketIpxNetNumber[4]
Definition: socket.h:191
osl_getLastSocketErrorDescription
SAL_DLLPUBLIC void osl_getLastSocketErrorDescription(oslSocket Socket, rtl_uString **strError)
returns a string which describes the last socket error.
osl_Socket_DirInvalid
Definition: socket.h:137
osl_isExceptionPending
SAL_DLLPUBLIC sal_Bool osl_isExceptionPending(oslSocket Socket, const TimeValue *pTimeout)
Checks if a request for out-of-band data will block.
osl_Socket_ProtocolIpx
Definition: socket.h:58
osl_Socket_E_NetUnreachable
Definition: socket.h:159
osl_Socket_Ok
Definition: socket.h:183
osl_enableNonBlockingMode
SAL_DLLPUBLIC sal_Bool osl_enableNonBlockingMode(oslSocket Socket, sal_Bool On)
Enables/disables non-blocking-mode of the socket.
osl_Socket_MsgMaxIOVLen
Definition: socket.h:125
osl_Socket_LevelSocket
Definition: socket.h:110
osl_Socket_TypeInvalid
Definition: socket.h:75
osl_Socket_FORCE_EQUAL_SIZE
Definition: socket.h:188
osl_copySocketAddr
SAL_DLLPUBLIC oslSocketAddr osl_copySocketAddr(oslSocketAddr Addr)
Creates a new SocketAddress and fills it from Addr.
osl_Socket_E_OpNotSupport
Definition: socket.h:152
osl_Socket_E_ConnReset
Definition: socket.h:163
osl_getInetPortOfSocketAddr
SAL_DLLPUBLIC sal_Int32 osl_getInetPortOfSocketAddr(oslSocketAddr Addr)
Retrieves the internet port-number of Addr.
oslSocketOptionLevel
oslSocketOptionLevel
Represents the different socket-option levels.
Definition: socket.h:109
osl_Socket_E_MsgSize
Definition: socket.h:147
osl_Socket_OptionDontRoute
Definition: socket.h:88
osl_getServicePort
SAL_DLLPUBLIC sal_Int32 osl_getServicePort(rtl_uString *strServicename, rtl_uString *strProtocol)
Looks up the port-number designated to the specified service/protocol-pair.
byteseq.h
osl_Socket_Family_FORCE_EQUAL_SIZE
Definition: socket.h:50
osl_createInetBroadcastAddr
SAL_DLLPUBLIC oslSocketAddr osl_createInetBroadcastAddr(rtl_uString *strDottedAddr, sal_Int32 Port)
Create an internet address usable for sending broadcast datagrams.
_sal_Sequence
This is the binary specification of a SAL sequence.
Definition: types.h:345
osl_Socket_E_NetDown
Definition: socket.h:158
oslSocketResult
oslSocketResult
Common return codes of socket related functions.
Definition: socket.h:182
osl_Socket_E_HostDown
Definition: socket.h:171
osl_Socket_Interrupted
Definition: socket.h:186
osl_createSocket
SAL_DLLPUBLIC oslSocket osl_createSocket(oslAddrFamily Family, oslSocketType Type, oslProtocol Protocol)
Create a socket of the specified Family and Type.
osl_Socket_OptionUseLoopback
Definition: socket.h:90
osl_Socket_ProtocolSpxII
Definition: socket.h:60
osl_Socket_E_None
Definition: socket.h:144
osl_addToSocketSet
SAL_DLLPUBLIC void osl_addToSocketSet(oslSocketSet Set, oslSocket Socket)
Adds a socket to the set.
osl_destroySocketSet
SAL_DLLPUBLIC void osl_destroySocketSet(oslSocketSet Set)
Destroys a oslSocketSet.
osl_Socket_OptionOOBinLine
Definition: socket.h:92
osl_getLocalAddrOfSocket
SAL_DLLPUBLIC oslSocketAddr osl_getLocalAddrOfSocket(oslSocket Socket)
Retrieves the Address of the local end of the socket.
osl_getDottedInetAddrOfSocketAddr
SAL_DLLPUBLIC oslSocketResult osl_getDottedInetAddrOfSocketAddr(oslSocketAddr Addr, rtl_uString **strDottedInetAddr)
Gets the address in dotted decimal format.
osl_isSendReady
SAL_DLLPUBLIC sal_Bool osl_isSendReady(oslSocket Socket, const TimeValue *pTimeout)
Checks if send operations will block.
osl_Socket_E_AfNoSupport
Definition: socket.h:154
osl_Socket_ProtocolSpx
Definition: socket.h:59
osl_Socket_E_Shutdown
Definition: socket.h:167
osl_createHostAddr
SAL_DLLPUBLIC oslHostAddr osl_createHostAddr(rtl_uString *strHostname, const oslSocketAddr Addr)
Create an oslHostAddr from given hostname and socket address.
SAL_MAX_ENUM
#define SAL_MAX_ENUM
Definition: types.h:242
osl_Socket_Type_FORCE_EQUAL_SIZE
Definition: socket.h:76
osl_Socket_E_ConnRefused
Definition: socket.h:170
oslSocketIpxNodeNumber
sal_uInt8 oslSocketIpxNodeNumber[6]
Definition: socket.h:192
osl_Socket_OptionReuseAddr
Definition: socket.h:86
osl_acceptConnectionOnSocket
SAL_DLLPUBLIC oslSocket osl_acceptConnectionOnSocket(oslSocket Socket, oslSocketAddr *pAddr)
Waits for an ingoing connection on the socket.
osl_getSocketOption
SAL_DLLPUBLIC sal_Int32 osl_getSocketOption(oslSocket Socket, oslSocketOptionLevel Level, oslSocketOption Option, void *pBuffer, sal_uInt32 BufferLen)
Retrieves attributes associated with the socket.
osl_getHostnameOfHostAddr
SAL_DLLPUBLIC void osl_getHostnameOfHostAddr(const oslHostAddr Addr, rtl_uString **strHostname)
Get the hostname member of Addr.
osl_Socket_MsgPeek
Definition: socket.h:123
osl_Socket_FamilyIpx
Definition: socket.h:48
osl_Socket_E_InvalidError
Definition: socket.h:176
osl_Socket_E_TypeNoSupport
Definition: socket.h:151
osl_createInetSocketAddr
SAL_DLLPUBLIC oslSocketAddr osl_createInetSocketAddr(rtl_uString *strDottedAddr, sal_Int32 Port)
Create an internet-address, consisting of hostaddress and port.
osl_Socket_TimedOut
Definition: socket.h:185
osl_Socket_E_Already
Definition: socket.h:174
osl_Socket_E_TimedOut
Definition: socket.h:169
osl_writeSocket
SAL_DLLPUBLIC sal_Int32 osl_writeSocket(oslSocket Socket, const void *pBuffer, sal_Int32 nSize)
Writes n bytes from pBuffer to the stream.
osl_Socket_TypeRaw
Definition: socket.h:72
osl_Socket_OptionBroadcast
Definition: socket.h:89
time.h
oslSocketType
oslSocketType
Represents the type of a socket.
Definition: socket.h:69
sal_uInt8
unsigned char sal_uInt8
Definition: types.h:54
osl_Socket_OptionError
Definition: socket.h:99