LibreOffice: osl/socket.h Source File

LibreOffice LibreOffice 24.8 SDK C/C++ API Reference

Loading...
Searching...
No Matches
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/*
21 * This file is part of LibreOffice published API.
22 */
23
24#ifndef INCLUDED_OSL_SOCKET_H
25#define INCLUDED_OSL_SOCKET_H
26
27#include "rtl/ustring.h"
28#include "osl/time.h"
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34/* error returns */
35#define OSL_INADDR_NONE 0xffffffff
36#define OSL_INVALID_PORT (-1)
37
40
44 typedef struct oslSocketAddrImpl * oslSocketAddr;
45
49 typedef enum {
50 osl_Socket_FamilyInet,
51 osl_Socket_FamilyIpx,
52 osl_Socket_FamilyInvalid,
53 osl_Socket_Family_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
54} oslAddrFamily;
55
59 typedef enum {
60 osl_Socket_ProtocolIp,
61 osl_Socket_ProtocolIpx,
62 osl_Socket_ProtocolSpx,
63 osl_Socket_ProtocolSpxII,
64 osl_Socket_ProtocolInvalid,
65 osl_Socket_Protocol_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
66} oslProtocol;
67
71 typedef enum {
72 osl_Socket_TypeStream,
73 osl_Socket_TypeDgram,
74 osl_Socket_TypeRaw,
75 osl_Socket_TypeRdm,
78 osl_Socket_TypeSeqPacket,
81 osl_Socket_TypeInvalid,
82 osl_Socket_Type_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
83} oslSocketType;
84
85
89 typedef enum {
90 osl_Socket_OptionDebug,
91 osl_Socket_OptionAcceptConn,
92 osl_Socket_OptionReuseAddr,
93 osl_Socket_OptionKeepAlive,
94 osl_Socket_OptionDontRoute,
96 osl_Socket_OptionBroadcast,
97 osl_Socket_OptionUseLoopback,
99 osl_Socket_OptionLinger,
102 osl_Socket_OptionOOBinLine,
104 osl_Socket_OptionSndBuf,
105 osl_Socket_OptionRcvBuf,
106 osl_Socket_OptionSndLowat,
109 osl_Socket_OptionRcvLowat,
112 osl_Socket_OptionSndTimeo,
113 osl_Socket_OptionRcvTimeo,
114 osl_Socket_OptionError,
115 osl_Socket_OptionType,
117 osl_Socket_OptionTcpNoDelay,
118 osl_Socket_OptionInvalid,
119 osl_Socket_Option_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
120} oslSocketOption;
121
125 typedef enum {
126 osl_Socket_LevelSocket,
127 osl_Socket_LevelTcp,
128 osl_Socket_LevelInvalid,
129 osl_Socket_Level_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
130} oslSocketOptionLevel;
131
135 typedef enum {
136 osl_Socket_MsgNormal,
137 osl_Socket_MsgOOB,
138 osl_Socket_MsgPeek,
139 osl_Socket_MsgDontRoute,
140 osl_Socket_MsgMaxIOVLen,
141 osl_Socket_MsgInvalid,
142 osl_Socket_Msg_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
143} oslSocketMsgFlag;
144
148 typedef enum {
149 osl_Socket_DirRead,
150 osl_Socket_DirWrite,
151 osl_Socket_DirReadWrite,
152 osl_Socket_DirInvalid,
153 osl_Socket_Dir_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
154} oslSocketDirection;
155
158 typedef enum {
159 osl_Socket_E_None,
160 osl_Socket_E_NotSocket,
161 osl_Socket_E_DestAddrReq,
162 osl_Socket_E_MsgSize,
163 osl_Socket_E_Prototype,
164 osl_Socket_E_NoProtocol,
165 osl_Socket_E_ProtocolNoSupport,
166 osl_Socket_E_TypeNoSupport,
167 osl_Socket_E_OpNotSupport,
168 osl_Socket_E_PfNoSupport,
169 osl_Socket_E_AfNoSupport,
171 osl_Socket_E_AddrInUse,
172 osl_Socket_E_AddrNotAvail,
173 osl_Socket_E_NetDown,
174 osl_Socket_E_NetUnreachable,
175 osl_Socket_E_NetReset,
177 osl_Socket_E_ConnAborted,
178 osl_Socket_E_ConnReset,
179 osl_Socket_E_NoBufferSpace,
180 osl_Socket_E_IsConnected,
181 osl_Socket_E_NotConnected,
182 osl_Socket_E_Shutdown,
183 osl_Socket_E_TooManyRefs,
184 osl_Socket_E_TimedOut,
185 osl_Socket_E_ConnRefused,
186 osl_Socket_E_HostDown,
187 osl_Socket_E_HostUnreachable,
188 osl_Socket_E_WouldBlock,
189 osl_Socket_E_Already,
190 osl_Socket_E_InProgress,
191 osl_Socket_E_InvalidError,
192 osl_Socket_E_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
193} oslSocketError;
194
197 typedef enum {
198 osl_Socket_Ok,
199 osl_Socket_Error,
201 osl_Socket_TimedOut,
202 osl_Socket_Interrupted,
203 osl_Socket_InProgress,
204 osl_Socket_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
205} oslSocketResult;
206
207 typedef sal_uInt8 oslSocketIpxNetNumber[4];
208 typedef sal_uInt8 oslSocketIpxNodeNumber[6];
209
212
215
216 typedef struct oslSocketImpl * oslSocket;
217
224 SAL_DLLPUBLIC oslSocket SAL_CALL osl_createSocket(
225 oslAddrFamily Family,
226 oslSocketType Type,
227 oslProtocol Protocol);
228
231 SAL_DLLPUBLIC void SAL_CALL osl_acquireSocket(oslSocket Socket);
232
238 SAL_DLLPUBLIC void SAL_CALL osl_releaseSocket(oslSocket Socket);
239
247 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_getLocalAddrOfSocket(oslSocket Socket);
248
255 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_getPeerAddrOfSocket(oslSocket Socket);
256
264 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_bindAddrToSocket(
265 oslSocket Socket,
266 oslSocketAddr Addr);
267
279 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_connectSocketTo(
280 oslSocket Socket,
281 oslSocketAddr Addr,
282 const TimeValue* pTimeout);
283
284
293 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_listenOnSocket(
294 oslSocket Socket,
295 sal_Int32 MaxPendingConnections);
296
297
305 SAL_DLLPUBLIC oslSocket SAL_CALL osl_acceptConnectionOnSocket(
306 oslSocket Socket,
307 oslSocketAddr* pAddr);
308
327 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_receiveSocket(
328 oslSocket Socket,
329 void* pBuffer,
330 sal_uInt32 BytesToRead,
331 oslSocketMsgFlag Flag);
332
353 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_receiveFromSocket(
354 oslSocket Socket,
355 oslSocketAddr SenderAddr,
356 void* pBuffer,
357 sal_uInt32 BufferSize,
358 oslSocketMsgFlag Flag);
359
376 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_sendSocket(
377 oslSocket Socket,
378 const void* pBuffer,
379 sal_uInt32 BytesToSend,
380 oslSocketMsgFlag Flag);
381
408 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_sendToSocket(
409 oslSocket Socket,
410 oslSocketAddr ReceiverAddr,
411 const void* pBuffer,
412 sal_uInt32 BytesToSend,
413 oslSocketMsgFlag Flag);
414
427 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isReceiveReady(
428 oslSocket Socket,
429 const TimeValue* pTimeout);
430
443 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isSendReady(
444 oslSocket Socket,
445 const TimeValue* pTimeout);
446
458 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isExceptionPending(
459 oslSocket Socket,
460 const TimeValue* pTimeout);
461
474 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_shutdownSocket(
475 oslSocket Socket,
476 oslSocketDirection Direction);
477
531 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_getSocketOption(
532 oslSocket Socket,
533 oslSocketOptionLevel Level,
534 oslSocketOption Option,
535 void* pBuffer,
536 sal_uInt32 BufferLen);
537
555 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_setSocketOption(
556 oslSocket Socket,
557 oslSocketOptionLevel Level,
558 oslSocketOption Option,
559 void* pBuffer,
560 sal_uInt32 BufferLen);
561
569 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_enableNonBlockingMode(
570 oslSocket Socket,
571 sal_Bool On);
572
573
580 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isNonBlockingMode(oslSocket Socket);
581
593 SAL_DLLPUBLIC oslSocketType SAL_CALL osl_getSocketType(oslSocket Socket);
594
600 SAL_DLLPUBLIC void SAL_CALL osl_getLastSocketErrorDescription(
601 oslSocket Socket,
602 rtl_uString **strError);
603
610 SAL_DLLPUBLIC oslSocketError SAL_CALL osl_getLastSocketError(
611 oslSocket Socket);
612
617 SAL_DLLPUBLIC void SAL_CALL osl_closeSocket(oslSocket Socket);
618
619
631 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_readSocket(
632 oslSocket Socket,
633 void *pBuffer,
634 sal_Int32 nSize);
635
636
647 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_writeSocket(
648 oslSocket Socket,
649 const void *pBuffer,
650 sal_Int32 nSize);
651
656
662 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_createEmptySocketAddr(
663 oslAddrFamily Family);
664
665
668 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_copySocketAddr(
669 oslSocketAddr Addr);
670
675 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isEqualSocketAddr(
676 oslSocketAddr Addr1, oslSocketAddr Addr2);
677
683 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_resolveHostname(
684 rtl_uString *strHostname);
685
695 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_createInetBroadcastAddr(
696 rtl_uString *strDottedAddr, sal_Int32 Port);
697
698
706 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_createInetSocketAddr (
707 rtl_uString *strDottedAddr, sal_Int32 Port);
708
709
713 SAL_DLLPUBLIC void SAL_CALL osl_destroySocketAddr(
714 oslSocketAddr Addr);
715
720 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_getServicePort(
721 rtl_uString *strServicename, rtl_uString *strProtocol);
722
723
724
729 SAL_DLLPUBLIC oslAddrFamily SAL_CALL osl_getFamilyOfSocketAddr(
730 oslSocketAddr Addr);
731
732
737 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_getInetPortOfSocketAddr(
738 oslSocketAddr Addr);
739
740
746 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_setInetPortOfSocketAddr(
747 oslSocketAddr Addr, sal_Int32 Port);
748
749
755 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_getHostnameOfSocketAddr(
756 oslSocketAddr Addr, rtl_uString **strHostname);
757
758
769 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_getDottedInetAddrOfSocketAddr(
770 oslSocketAddr Addr, rtl_uString **strDottedInetAddr);
771
774 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_setAddrOfSocketAddr(
775 oslSocketAddr Addr, sal_Sequence *pByteSeq );
776
784 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_getAddrOfSocketAddr(
785 oslSocketAddr Addr, sal_Sequence **ppByteSeq );
786
787/*
788 Opaque datatype HostAddr.
789*/
790 typedef struct oslHostAddrImpl * oslHostAddr;
791
792
798 SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_createHostAddr(
799 rtl_uString *strHostname, const oslSocketAddr Addr);
800
801
809 SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_createHostAddrByName(rtl_uString *strHostname);
810
811
819 SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_createHostAddrByAddr(const oslSocketAddr Addr);
820
821
825 SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_copyHostAddr(const oslHostAddr Addr);
826
827
831 SAL_DLLPUBLIC void SAL_CALL osl_destroyHostAddr(oslHostAddr Addr);
832
833
838 SAL_DLLPUBLIC void SAL_CALL osl_getHostnameOfHostAddr(const oslHostAddr Addr, rtl_uString **strHostname);
839
840
844 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_getSocketAddrOfHostAddr(const oslHostAddr Addr);
845
851 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_getLocalHostname(rtl_uString **strLocalHostname);
852
853
856
857#ifdef __cplusplus
858}
859#endif
860
861#endif // INCLUDED_OSL_SOCKET_H
862
863/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DLLPUBLIC
#define SAL_DLLPUBLIC
Definition saldllapi.h:34
SAL_MAX_ENUM
#define SAL_MAX_ENUM
Definition types.h:205
sal_uInt8
unsigned char sal_uInt8
Definition types.h:44
sal_Sequence
struct _sal_Sequence sal_Sequence
This is the binary specification of a SAL sequence.
sal_Bool
unsigned char sal_Bool
Definition types.h:38
ustring.h
time.h
oslSocketOption
oslSocketOption
Represents socket-options.
Definition socket.h:89
osl_Socket_OptionSndBuf
@ osl_Socket_OptionSndBuf
Definition socket.h:104
osl_Socket_OptionTcpNoDelay
@ osl_Socket_OptionTcpNoDelay
Definition socket.h:117
osl_Socket_OptionSndLowat
@ osl_Socket_OptionSndLowat
Definition socket.h:106
osl_Socket_OptionSndTimeo
@ osl_Socket_OptionSndTimeo
Definition socket.h:112
osl_Socket_OptionDebug
@ osl_Socket_OptionDebug
Definition socket.h:90
osl_Socket_OptionReuseAddr
@ osl_Socket_OptionReuseAddr
Definition socket.h:92
osl_Socket_OptionDontRoute
@ osl_Socket_OptionDontRoute
Definition socket.h:94
osl_Socket_OptionRcvLowat
@ osl_Socket_OptionRcvLowat
Definition socket.h:109
osl_Socket_OptionRcvBuf
@ osl_Socket_OptionRcvBuf
Definition socket.h:105
osl_Socket_OptionType
@ osl_Socket_OptionType
Definition socket.h:115
osl_Socket_OptionError
@ osl_Socket_OptionError
Definition socket.h:114
osl_Socket_OptionAcceptConn
@ osl_Socket_OptionAcceptConn
Definition socket.h:91
osl_Socket_OptionInvalid
@ osl_Socket_OptionInvalid
Definition socket.h:118
osl_Socket_OptionKeepAlive
@ osl_Socket_OptionKeepAlive
Definition socket.h:93
osl_Socket_OptionOOBinLine
@ osl_Socket_OptionOOBinLine
Definition socket.h:102
osl_Socket_Option_FORCE_EQUAL_SIZE
@ osl_Socket_Option_FORCE_EQUAL_SIZE
Definition socket.h:119
osl_Socket_OptionBroadcast
@ osl_Socket_OptionBroadcast
Definition socket.h:96
osl_Socket_OptionLinger
@ osl_Socket_OptionLinger
Definition socket.h:99
osl_Socket_OptionUseLoopback
@ osl_Socket_OptionUseLoopback
Definition socket.h:97
osl_Socket_OptionRcvTimeo
@ osl_Socket_OptionRcvTimeo
Definition socket.h:113
osl_setInetPortOfSocketAddr
SAL_DLLPUBLIC sal_Bool osl_setInetPortOfSocketAddr(oslSocketAddr Addr, sal_Int32 Port)
Sets the Port of Addr.
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_getInetPortOfSocketAddr
SAL_DLLPUBLIC sal_Int32 osl_getInetPortOfSocketAddr(oslSocketAddr Addr)
Retrieves the internet port-number of Addr.
osl_getAddrOfSocketAddr
SAL_DLLPUBLIC oslSocketResult osl_getAddrOfSocketAddr(oslSocketAddr Addr, sal_Sequence **ppByteSeq)
Returns the addr field in the struct sockaddr.
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_createHostAddrByName
SAL_DLLPUBLIC oslHostAddr osl_createHostAddrByName(rtl_uString *strHostname)
Create an oslHostAddr by resolving the given strHostname.
osl_createHostAddrByAddr
SAL_DLLPUBLIC oslHostAddr osl_createHostAddrByAddr(const oslSocketAddr Addr)
Create an oslHostAddr by reverse resolution of the given Addr.
oslSocketResult
oslSocketResult
Common return codes of socket related functions.
Definition socket.h:197
osl_Socket_InProgress
@ osl_Socket_InProgress
Definition socket.h:203
osl_Socket_Ok
@ osl_Socket_Ok
Definition socket.h:198
osl_Socket_Error
@ osl_Socket_Error
Definition socket.h:199
osl_Socket_FORCE_EQUAL_SIZE
@ osl_Socket_FORCE_EQUAL_SIZE
Definition socket.h:204
osl_Socket_TimedOut
@ osl_Socket_TimedOut
Definition socket.h:201
osl_Socket_Interrupted
@ osl_Socket_Interrupted
Definition socket.h:202
oslSocketAddr
struct oslSocketAddrImpl * oslSocketAddr
Opaque datatype SocketAddr.
Definition socket.h:44
osl_bindAddrToSocket
SAL_DLLPUBLIC sal_Bool osl_bindAddrToSocket(oslSocket Socket, oslSocketAddr Addr)
Binds the given address to the socket.
osl_acceptConnectionOnSocket
SAL_DLLPUBLIC oslSocket osl_acceptConnectionOnSocket(oslSocket Socket, oslSocketAddr *pAddr)
Waits for an ingoing connection on the socket.
osl_getHostnameOfHostAddr
SAL_DLLPUBLIC void osl_getHostnameOfHostAddr(const oslHostAddr Addr, rtl_uString **strHostname)
Get the hostname member of Addr.
oslHostAddr
struct oslHostAddrImpl * oslHostAddr
Definition socket.h:790
osl_closeSocket
SAL_DLLPUBLIC void osl_closeSocket(oslSocket Socket)
Closes the socket terminating any ongoing dataflow.
osl_acquireSocket
SAL_DLLPUBLIC void osl_acquireSocket(oslSocket Socket)
increases the refcount of the socket handle by one
osl_createHostAddr
SAL_DLLPUBLIC oslHostAddr osl_createHostAddr(rtl_uString *strHostname, const oslSocketAddr Addr)
Create an oslHostAddr from given hostname and socket address.
osl_isSendReady
SAL_DLLPUBLIC sal_Bool osl_isSendReady(oslSocket Socket, const TimeValue *pTimeout)
Checks if send operations will block.
osl_setAddrOfSocketAddr
SAL_DLLPUBLIC oslSocketResult osl_setAddrOfSocketAddr(oslSocketAddr Addr, sal_Sequence *pByteSeq)
Sets the addr field in the struct sockaddr with pByteSeq.
osl_getDottedInetAddrOfSocketAddr
SAL_DLLPUBLIC oslSocketResult osl_getDottedInetAddrOfSocketAddr(oslSocketAddr Addr, rtl_uString **strDottedInetAddr)
Gets the address in dotted decimal format.
osl_releaseSocket
SAL_DLLPUBLIC void osl_releaseSocket(oslSocket Socket)
decreases the refcount of the socket handle by one.
oslSocketType
oslSocketType
Represents the type of a socket.
Definition socket.h:71
osl_Socket_TypeStream
@ osl_Socket_TypeStream
Definition socket.h:72
osl_Socket_TypeRdm
@ osl_Socket_TypeRdm
Definition socket.h:75
osl_Socket_TypeSeqPacket
@ osl_Socket_TypeSeqPacket
Definition socket.h:78
osl_Socket_Type_FORCE_EQUAL_SIZE
@ osl_Socket_Type_FORCE_EQUAL_SIZE
Definition socket.h:82
osl_Socket_TypeInvalid
@ osl_Socket_TypeInvalid
Definition socket.h:81
osl_Socket_TypeRaw
@ osl_Socket_TypeRaw
Definition socket.h:74
osl_Socket_TypeDgram
@ osl_Socket_TypeDgram
Definition socket.h:73
osl_getLastSocketError
SAL_DLLPUBLIC oslSocketError osl_getLastSocketError(oslSocket Socket)
Returns a constant describing the last error for the socket system.
osl_createInetBroadcastAddr
SAL_DLLPUBLIC oslSocketAddr osl_createInetBroadcastAddr(rtl_uString *strDottedAddr, sal_Int32 Port)
Create an internet address usable for sending broadcast datagrams.
osl_isNonBlockingMode
SAL_DLLPUBLIC sal_Bool osl_isNonBlockingMode(oslSocket Socket)
Query state of non-blocking-mode of the socket.
osl_destroySocketAddr
SAL_DLLPUBLIC void osl_destroySocketAddr(oslSocketAddr Addr)
Frees all resources allocated by Addr.
osl_getLocalAddrOfSocket
SAL_DLLPUBLIC oslSocketAddr osl_getLocalAddrOfSocket(oslSocket Socket)
Retrieves the Address of the local end of the socket.
osl_isReceiveReady
SAL_DLLPUBLIC sal_Bool osl_isReceiveReady(oslSocket Socket, const TimeValue *pTimeout)
Checks if read operations will block.
osl_getSocketType
SAL_DLLPUBLIC oslSocketType osl_getSocketType(oslSocket Socket)
Queries the socket for its type.
osl_setSocketOption
SAL_DLLPUBLIC sal_Bool osl_setSocketOption(oslSocket Socket, oslSocketOptionLevel Level, oslSocketOption Option, void *pBuffer, sal_uInt32 BufferLen)
Sets the sockets attributes.
oslSocket
struct oslSocketImpl * oslSocket
Definition socket.h:216
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_createSocket
SAL_DLLPUBLIC oslSocket osl_createSocket(oslAddrFamily Family, oslSocketType Type, oslProtocol Protocol)
Create a socket of the specified Family and Type.
osl_writeSocket
SAL_DLLPUBLIC sal_Int32 osl_writeSocket(oslSocket Socket, const void *pBuffer, sal_Int32 nSize)
Writes n bytes from pBuffer to the stream.
oslSocketOptionLevel
oslSocketOptionLevel
Represents the different socket-option levels.
Definition socket.h:125
osl_Socket_LevelTcp
@ osl_Socket_LevelTcp
Definition socket.h:127
osl_Socket_LevelInvalid
@ osl_Socket_LevelInvalid
Definition socket.h:128
osl_Socket_Level_FORCE_EQUAL_SIZE
@ osl_Socket_Level_FORCE_EQUAL_SIZE
Definition socket.h:129
osl_Socket_LevelSocket
@ osl_Socket_LevelSocket
Definition socket.h:126
osl_createInetSocketAddr
SAL_DLLPUBLIC oslSocketAddr osl_createInetSocketAddr(rtl_uString *strDottedAddr, sal_Int32 Port)
Create an internet-address, consisting of host address and port.
osl_copyHostAddr
SAL_DLLPUBLIC oslHostAddr osl_copyHostAddr(const oslHostAddr Addr)
Create a copy of the given Addr.
osl_createEmptySocketAddr
SAL_DLLPUBLIC oslSocketAddr osl_createEmptySocketAddr(oslAddrFamily Family)
Creates a socket-address for the given family.
osl_getPeerAddrOfSocket
SAL_DLLPUBLIC oslSocketAddr osl_getPeerAddrOfSocket(oslSocket Socket)
Retrieves the Address of the remote end of the socket.
oslSocketDirection
oslSocketDirection
Used by shutdown to denote which end of the socket to "close".
Definition socket.h:148
osl_Socket_DirRead
@ osl_Socket_DirRead
Definition socket.h:149
osl_Socket_DirWrite
@ osl_Socket_DirWrite
Definition socket.h:150
osl_Socket_DirInvalid
@ osl_Socket_DirInvalid
Definition socket.h:152
osl_Socket_Dir_FORCE_EQUAL_SIZE
@ osl_Socket_Dir_FORCE_EQUAL_SIZE
Definition socket.h:153
osl_Socket_DirReadWrite
@ osl_Socket_DirReadWrite
Definition socket.h:151
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_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_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_enableNonBlockingMode
SAL_DLLPUBLIC sal_Bool osl_enableNonBlockingMode(oslSocket Socket, sal_Bool On)
Enables/disables non-blocking-mode of the socket.
oslProtocol
oslProtocol
represent a specific protocol within an address-family
Definition socket.h:59
osl_Socket_ProtocolIpx
@ osl_Socket_ProtocolIpx
Definition socket.h:61
osl_Socket_ProtocolInvalid
@ osl_Socket_ProtocolInvalid
Definition socket.h:64
osl_Socket_ProtocolSpx
@ osl_Socket_ProtocolSpx
Definition socket.h:62
osl_Socket_Protocol_FORCE_EQUAL_SIZE
@ osl_Socket_Protocol_FORCE_EQUAL_SIZE
Definition socket.h:65
osl_Socket_ProtocolSpxII
@ osl_Socket_ProtocolSpxII
Definition socket.h:63
osl_Socket_ProtocolIp
@ osl_Socket_ProtocolIp
Definition socket.h:60
oslSocketError
oslSocketError
Describes the various error socket error conditions, which may occur.
Definition socket.h:158
osl_Socket_E_ProtocolNoSupport
@ osl_Socket_E_ProtocolNoSupport
Definition socket.h:165
osl_Socket_E_TimedOut
@ osl_Socket_E_TimedOut
Definition socket.h:184
osl_Socket_E_WouldBlock
@ osl_Socket_E_WouldBlock
Definition socket.h:188
osl_Socket_E_NetUnreachable
@ osl_Socket_E_NetUnreachable
Definition socket.h:174
osl_Socket_E_DestAddrReq
@ osl_Socket_E_DestAddrReq
Definition socket.h:161
osl_Socket_E_Already
@ osl_Socket_E_Already
Definition socket.h:189
osl_Socket_E_HostUnreachable
@ osl_Socket_E_HostUnreachable
Definition socket.h:187
osl_Socket_E_HostDown
@ osl_Socket_E_HostDown
Definition socket.h:186
osl_Socket_E_NotSocket
@ osl_Socket_E_NotSocket
Definition socket.h:160
osl_Socket_E_IsConnected
@ osl_Socket_E_IsConnected
Definition socket.h:180
osl_Socket_E_Shutdown
@ osl_Socket_E_Shutdown
Definition socket.h:182
osl_Socket_E_ConnAborted
@ osl_Socket_E_ConnAborted
Definition socket.h:177
osl_Socket_E_TooManyRefs
@ osl_Socket_E_TooManyRefs
Definition socket.h:183
osl_Socket_E_TypeNoSupport
@ osl_Socket_E_TypeNoSupport
Definition socket.h:166
osl_Socket_E_MsgSize
@ osl_Socket_E_MsgSize
Definition socket.h:162
osl_Socket_E_NetReset
@ osl_Socket_E_NetReset
Definition socket.h:175
osl_Socket_E_PfNoSupport
@ osl_Socket_E_PfNoSupport
Definition socket.h:168
osl_Socket_E_AfNoSupport
@ osl_Socket_E_AfNoSupport
Definition socket.h:169
osl_Socket_E_None
@ osl_Socket_E_None
Definition socket.h:159
osl_Socket_E_InProgress
@ osl_Socket_E_InProgress
Definition socket.h:190
osl_Socket_E_AddrInUse
@ osl_Socket_E_AddrInUse
Definition socket.h:171
osl_Socket_E_Prototype
@ osl_Socket_E_Prototype
Definition socket.h:163
osl_Socket_E_ConnReset
@ osl_Socket_E_ConnReset
Definition socket.h:178
osl_Socket_E_NotConnected
@ osl_Socket_E_NotConnected
Definition socket.h:181
osl_Socket_E_NoBufferSpace
@ osl_Socket_E_NoBufferSpace
Definition socket.h:179
osl_Socket_E_NoProtocol
@ osl_Socket_E_NoProtocol
Definition socket.h:164
osl_Socket_E_OpNotSupport
@ osl_Socket_E_OpNotSupport
Definition socket.h:167
osl_Socket_E_ConnRefused
@ osl_Socket_E_ConnRefused
Definition socket.h:185
osl_Socket_E_FORCE_EQUAL_SIZE
@ osl_Socket_E_FORCE_EQUAL_SIZE
Definition socket.h:192
osl_Socket_E_NetDown
@ osl_Socket_E_NetDown
Definition socket.h:173
osl_Socket_E_InvalidError
@ osl_Socket_E_InvalidError
Definition socket.h:191
osl_Socket_E_AddrNotAvail
@ osl_Socket_E_AddrNotAvail
Definition socket.h:172
oslSocketIpxNetNumber
sal_uInt8 oslSocketIpxNetNumber[4]
Definition socket.h:207
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,...
oslSocketIpxNodeNumber
sal_uInt8 oslSocketIpxNodeNumber[6]
Definition socket.h:208
oslAddrFamily
oslAddrFamily
Represents the address-family of a socket.
Definition socket.h:49
osl_Socket_FamilyInvalid
@ osl_Socket_FamilyInvalid
Definition socket.h:52
osl_Socket_Family_FORCE_EQUAL_SIZE
@ osl_Socket_Family_FORCE_EQUAL_SIZE
Definition socket.h:53
osl_Socket_FamilyInet
@ osl_Socket_FamilyInet
Definition socket.h:50
osl_Socket_FamilyIpx
@ osl_Socket_FamilyIpx
Definition socket.h:51
osl_connectSocketTo
SAL_DLLPUBLIC oslSocketResult osl_connectSocketTo(oslSocket Socket, oslSocketAddr Addr, const TimeValue *pTimeout)
Connects the socket to the given address.
osl_destroyHostAddr
SAL_DLLPUBLIC void osl_destroyHostAddr(oslHostAddr Addr)
Frees all resources allocated by Addr.
osl_getLocalHostname
SAL_DLLPUBLIC oslSocketResult osl_getLocalHostname(rtl_uString **strLocalHostname)
Retrieve this machines hostname (NOT the FQDN)
osl_getSocketAddrOfHostAddr
SAL_DLLPUBLIC oslSocketAddr osl_getSocketAddrOfHostAddr(const oslHostAddr Addr)
Get the socket address member of Addr.
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.
osl_resolveHostname
SAL_DLLPUBLIC oslSocketAddr osl_resolveHostname(rtl_uString *strHostname)
Uses the systems name-service interface to find an address for strHostname.
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:135
osl_Socket_MsgDontRoute
@ osl_Socket_MsgDontRoute
Definition socket.h:139
osl_Socket_MsgNormal
@ osl_Socket_MsgNormal
Definition socket.h:136
osl_Socket_Msg_FORCE_EQUAL_SIZE
@ osl_Socket_Msg_FORCE_EQUAL_SIZE
Definition socket.h:142
osl_Socket_MsgInvalid
@ osl_Socket_MsgInvalid
Definition socket.h:141
osl_Socket_MsgMaxIOVLen
@ osl_Socket_MsgMaxIOVLen
Definition socket.h:140
osl_Socket_MsgPeek
@ osl_Socket_MsgPeek
Definition socket.h:138
osl_Socket_MsgOOB
@ osl_Socket_MsgOOB
Definition socket.h:137
osl_copySocketAddr
SAL_DLLPUBLIC oslSocketAddr osl_copySocketAddr(oslSocketAddr Addr)
Creates a new SocketAddress and fills it from Addr.
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_getLastSocketErrorDescription
SAL_DLLPUBLIC void osl_getLastSocketErrorDescription(oslSocket Socket, rtl_uString **strError)
returns a string which describes the last socket error.
osl_isEqualSocketAddr
SAL_DLLPUBLIC sal_Bool osl_isEqualSocketAddr(oslSocketAddr Addr1, oslSocketAddr Addr2)
Compares the values of two SocketAddresses.
osl_shutdownSocket
SAL_DLLPUBLIC sal_Bool osl_shutdownSocket(oslSocket Socket, oslSocketDirection Direction)
Shuts down communication on a connected socket.
osl_getFamilyOfSocketAddr
SAL_DLLPUBLIC oslAddrFamily osl_getFamilyOfSocketAddr(oslSocketAddr Addr)
Retrieves the address-family from the Addr.
TimeValue
Time since Jan-01-1970.
Definition time.h:76