LibreOffice: osl/socket.h Source File

LibreOffice LibreOffice 7.1 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 "osl/time.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30/* error returns */
31#define OSL_INADDR_NONE 0xffffffff
32#define OSL_INVALID_PORT (-1)
33
40 typedef struct oslSocketAddrImpl * oslSocketAddr;
41
45 typedef enum {
46 osl_Socket_FamilyInet,
47 osl_Socket_FamilyIpx,
48 osl_Socket_FamilyInvalid,
49 osl_Socket_Family_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
50} oslAddrFamily;
51
55 typedef enum {
56 osl_Socket_ProtocolIp,
57 osl_Socket_ProtocolIpx,
58 osl_Socket_ProtocolSpx,
59 osl_Socket_ProtocolSpxII,
60 osl_Socket_ProtocolInvalid,
61 osl_Socket_Protocol_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
62} oslProtocol;
63
67 typedef enum {
68 osl_Socket_TypeStream,
69 osl_Socket_TypeDgram,
70 osl_Socket_TypeRaw,
71 osl_Socket_TypeRdm,
74 osl_Socket_TypeSeqPacket,
77 osl_Socket_TypeInvalid,
78 osl_Socket_Type_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
79} oslSocketType;
80
81
85 typedef enum {
86 osl_Socket_OptionDebug,
87 osl_Socket_OptionAcceptConn,
88 osl_Socket_OptionReuseAddr,
89 osl_Socket_OptionKeepAlive,
90 osl_Socket_OptionDontRoute,
92 osl_Socket_OptionBroadcast,
93 osl_Socket_OptionUseLoopback,
95 osl_Socket_OptionLinger,
98 osl_Socket_OptionOOBinLine,
100 osl_Socket_OptionSndBuf,
101 osl_Socket_OptionRcvBuf,
102 osl_Socket_OptionSndLowat,
105 osl_Socket_OptionRcvLowat,
108 osl_Socket_OptionSndTimeo,
109 osl_Socket_OptionRcvTimeo,
110 osl_Socket_OptionError,
111 osl_Socket_OptionType,
113 osl_Socket_OptionTcpNoDelay,
114 osl_Socket_OptionInvalid,
115 osl_Socket_Option_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
116} oslSocketOption;
117
121 typedef enum {
122 osl_Socket_LevelSocket,
123 osl_Socket_LevelTcp,
124 osl_Socket_LevelInvalid,
125 osl_Socket_Level_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
126} oslSocketOptionLevel;
127
131 typedef enum {
132 osl_Socket_MsgNormal,
133 osl_Socket_MsgOOB,
134 osl_Socket_MsgPeek,
135 osl_Socket_MsgDontRoute,
136 osl_Socket_MsgMaxIOVLen,
137 osl_Socket_MsgInvalid,
138 osl_Socket_Msg_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
139} oslSocketMsgFlag;
140
144 typedef enum {
145 osl_Socket_DirRead,
146 osl_Socket_DirWrite,
147 osl_Socket_DirReadWrite,
148 osl_Socket_DirInvalid,
149 osl_Socket_Dir_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
150} oslSocketDirection;
151
154 typedef enum {
155 osl_Socket_E_None,
156 osl_Socket_E_NotSocket,
157 osl_Socket_E_DestAddrReq,
158 osl_Socket_E_MsgSize,
159 osl_Socket_E_Prototype,
160 osl_Socket_E_NoProtocol,
161 osl_Socket_E_ProtocolNoSupport,
162 osl_Socket_E_TypeNoSupport,
163 osl_Socket_E_OpNotSupport,
164 osl_Socket_E_PfNoSupport,
165 osl_Socket_E_AfNoSupport,
167 osl_Socket_E_AddrInUse,
168 osl_Socket_E_AddrNotAvail,
169 osl_Socket_E_NetDown,
170 osl_Socket_E_NetUnreachable,
171 osl_Socket_E_NetReset,
173 osl_Socket_E_ConnAborted,
174 osl_Socket_E_ConnReset,
175 osl_Socket_E_NoBufferSpace,
176 osl_Socket_E_IsConnected,
177 osl_Socket_E_NotConnected,
178 osl_Socket_E_Shutdown,
179 osl_Socket_E_TooManyRefs,
180 osl_Socket_E_TimedOut,
181 osl_Socket_E_ConnRefused,
182 osl_Socket_E_HostDown,
183 osl_Socket_E_HostUnreachable,
184 osl_Socket_E_WouldBlock,
185 osl_Socket_E_Already,
186 osl_Socket_E_InProgress,
187 osl_Socket_E_InvalidError,
188 osl_Socket_E_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
189} oslSocketError;
190
193 typedef enum {
194 osl_Socket_Ok,
195 osl_Socket_Error,
197 osl_Socket_TimedOut,
198 osl_Socket_Interrupted,
199 osl_Socket_InProgress,
200 osl_Socket_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
201} oslSocketResult;
202
203 typedef sal_uInt8 oslSocketIpxNetNumber[4];
204 typedef sal_uInt8 oslSocketIpxNodeNumber[6];
205
212 typedef struct oslSocketImpl * oslSocket;
213
220 SAL_DLLPUBLIC oslSocket SAL_CALL osl_createSocket(
221 oslAddrFamily Family,
222 oslSocketType Type,
223 oslProtocol Protocol);
224
227 SAL_DLLPUBLIC void SAL_CALL osl_acquireSocket(oslSocket Socket);
228
234 SAL_DLLPUBLIC void SAL_CALL osl_releaseSocket(oslSocket Socket);
235
243 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_getLocalAddrOfSocket(oslSocket Socket);
244
251 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_getPeerAddrOfSocket(oslSocket Socket);
252
260 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_bindAddrToSocket(
261 oslSocket Socket,
262 oslSocketAddr Addr);
263
275 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_connectSocketTo(
276 oslSocket Socket,
277 oslSocketAddr Addr,
278 const TimeValue* pTimeout);
279
280
289 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_listenOnSocket(
290 oslSocket Socket,
291 sal_Int32 MaxPendingConnections);
292
293
301 SAL_DLLPUBLIC oslSocket SAL_CALL osl_acceptConnectionOnSocket(
302 oslSocket Socket,
303 oslSocketAddr* pAddr);
304
323 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_receiveSocket(
324 oslSocket Socket,
325 void* pBuffer,
326 sal_uInt32 BytesToRead,
327 oslSocketMsgFlag Flag);
328
349 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_receiveFromSocket(
350 oslSocket Socket,
351 oslSocketAddr SenderAddr,
352 void* pBuffer,
353 sal_uInt32 BufferSize,
354 oslSocketMsgFlag Flag);
355
372 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_sendSocket(
373 oslSocket Socket,
374 const void* pBuffer,
375 sal_uInt32 BytesToSend,
376 oslSocketMsgFlag Flag);
377
404 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_sendToSocket(
405 oslSocket Socket,
406 oslSocketAddr ReceiverAddr,
407 const void* pBuffer,
408 sal_uInt32 BytesToSend,
409 oslSocketMsgFlag Flag);
410
423 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isReceiveReady(
424 oslSocket Socket,
425 const TimeValue* pTimeout);
426
439 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isSendReady(
440 oslSocket Socket,
441 const TimeValue* pTimeout);
442
454 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isExceptionPending(
455 oslSocket Socket,
456 const TimeValue* pTimeout);
457
470 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_shutdownSocket(
471 oslSocket Socket,
472 oslSocketDirection Direction);
473
527 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_getSocketOption(
528 oslSocket Socket,
529 oslSocketOptionLevel Level,
530 oslSocketOption Option,
531 void* pBuffer,
532 sal_uInt32 BufferLen);
533
551 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_setSocketOption(
552 oslSocket Socket,
553 oslSocketOptionLevel Level,
554 oslSocketOption Option,
555 void* pBuffer,
556 sal_uInt32 BufferLen);
557
565 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_enableNonBlockingMode(
566 oslSocket Socket,
567 sal_Bool On);
568
569
576 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isNonBlockingMode(oslSocket Socket);
577
589 SAL_DLLPUBLIC oslSocketType SAL_CALL osl_getSocketType(oslSocket Socket);
590
596 SAL_DLLPUBLIC void SAL_CALL osl_getLastSocketErrorDescription(
597 oslSocket Socket,
598 rtl_uString **strError);
599
606 SAL_DLLPUBLIC oslSocketError SAL_CALL osl_getLastSocketError(
607 oslSocket Socket);
608
611 typedef struct oslSocketSetImpl * oslSocketSet;
612
617 SAL_DLLPUBLIC oslSocketSet SAL_CALL osl_createSocketSet(void);
618
621 SAL_DLLPUBLIC void SAL_CALL osl_destroySocketSet(oslSocketSet Set);
622
627 SAL_DLLPUBLIC void SAL_CALL osl_clearSocketSet(oslSocketSet Set);
628
629
635 SAL_DLLPUBLIC void SAL_CALL osl_addToSocketSet(oslSocketSet Set, oslSocket Socket);
636
642 SAL_DLLPUBLIC void SAL_CALL osl_removeFromSocketSet(oslSocketSet Set, oslSocket Socket);
643
651 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isInSocketSet(oslSocketSet Set, oslSocket Socket);
652
667 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_demultiplexSocketEvents(
668 oslSocketSet IncomingSet,
669 oslSocketSet OutgoingSet,
670 oslSocketSet OutOfBandSet,
671 const TimeValue* pTimeout);
672
677 SAL_DLLPUBLIC void SAL_CALL osl_closeSocket(oslSocket Socket);
678
679
691 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_readSocket(
692 oslSocket Socket,
693 void *pBuffer,
694 sal_Int32 nSize);
695
696
707 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_writeSocket(
708 oslSocket Socket,
709 const void *pBuffer,
710 sal_Int32 nSize);
711
722 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_createEmptySocketAddr(
723 oslAddrFamily Family);
724
725
728 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_copySocketAddr(
729 oslSocketAddr Addr);
730
735 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isEqualSocketAddr(
736 oslSocketAddr Addr1, oslSocketAddr Addr2);
737
743 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_resolveHostname(
744 rtl_uString *strHostname);
745
755 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_createInetBroadcastAddr(
756 rtl_uString *strDottedAddr, sal_Int32 Port);
757
758
766 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_createInetSocketAddr (
767 rtl_uString *strDottedAddr, sal_Int32 Port);
768
769
773 SAL_DLLPUBLIC void SAL_CALL osl_destroySocketAddr(
774 oslSocketAddr Addr);
775
780 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_getServicePort(
781 rtl_uString *strServicename, rtl_uString *strProtocol);
782
783
784
789 SAL_DLLPUBLIC oslAddrFamily SAL_CALL osl_getFamilyOfSocketAddr(
790 oslSocketAddr Addr);
791
792
797 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_getInetPortOfSocketAddr(
798 oslSocketAddr Addr);
799
800
806 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_setInetPortOfSocketAddr(
807 oslSocketAddr Addr, sal_Int32 Port);
808
809
815 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_getHostnameOfSocketAddr(
816 oslSocketAddr Addr, rtl_uString **strHostname);
817
818
829 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_getDottedInetAddrOfSocketAddr(
830 oslSocketAddr Addr, rtl_uString **strDottedInetAddr);
831
834 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_setAddrOfSocketAddr(
835 oslSocketAddr Addr, sal_Sequence *pByteSeq );
836
844 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_getAddrOfSocketAddr(
845 oslSocketAddr Addr, sal_Sequence **ppByteSeq );
846
847/*
848 Opaque datatype HostAddr.
849*/
850 typedef struct oslHostAddrImpl * oslHostAddr;
851
852
858 SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_createHostAddr(
859 rtl_uString *strHostname, const oslSocketAddr Addr);
860
861
869 SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_createHostAddrByName(rtl_uString *strHostname);
870
871
879 SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_createHostAddrByAddr(const oslSocketAddr Addr);
880
881
885 SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_copyHostAddr(const oslHostAddr Addr);
886
887
891 SAL_DLLPUBLIC void SAL_CALL osl_destroyHostAddr(oslHostAddr Addr);
892
893
897 SAL_DLLPUBLIC void SAL_CALL osl_getHostnameOfHostAddr(const oslHostAddr Addr, rtl_uString **strHostname);
898
899
903 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_getSocketAddrOfHostAddr(const oslHostAddr Addr);
904
911 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_getLocalHostname(rtl_uString **strLocalHostname);
912
913
917#ifdef __cplusplus
918}
919#endif
920
921#endif // INCLUDED_OSL_SOCKET_H
922
923/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DLLPUBLIC
#define SAL_DLLPUBLIC
Definition: saldllapi.h:30
SAL_MAX_ENUM
#define SAL_MAX_ENUM
Definition: types.h:201
sal_uInt8
unsigned char sal_uInt8
Definition: types.h:40
sal_Bool
unsigned char sal_Bool
Definition: types.h:34
ustring.h
oslSocketOption
oslSocketOption
Represents socket-options.
Definition: socket.h:85
osl_Socket_OptionSndBuf
@ osl_Socket_OptionSndBuf
Definition: socket.h:100
osl_Socket_OptionTcpNoDelay
@ osl_Socket_OptionTcpNoDelay
Definition: socket.h:113
osl_Socket_OptionSndLowat
@ osl_Socket_OptionSndLowat
Definition: socket.h:102
osl_Socket_OptionSndTimeo
@ osl_Socket_OptionSndTimeo
Definition: socket.h:108
osl_Socket_OptionDebug
@ osl_Socket_OptionDebug
Definition: socket.h:86
osl_Socket_OptionReuseAddr
@ osl_Socket_OptionReuseAddr
Definition: socket.h:88
osl_Socket_OptionDontRoute
@ osl_Socket_OptionDontRoute
Definition: socket.h:90
osl_Socket_OptionRcvLowat
@ osl_Socket_OptionRcvLowat
Definition: socket.h:105
osl_Socket_OptionRcvBuf
@ osl_Socket_OptionRcvBuf
Definition: socket.h:101
osl_Socket_OptionType
@ osl_Socket_OptionType
Definition: socket.h:111
osl_Socket_OptionError
@ osl_Socket_OptionError
Definition: socket.h:110
osl_Socket_OptionAcceptConn
@ osl_Socket_OptionAcceptConn
Definition: socket.h:87
osl_Socket_OptionInvalid
@ osl_Socket_OptionInvalid
Definition: socket.h:114
osl_Socket_OptionKeepAlive
@ osl_Socket_OptionKeepAlive
Definition: socket.h:89
osl_Socket_OptionOOBinLine
@ osl_Socket_OptionOOBinLine
Definition: socket.h:98
osl_Socket_Option_FORCE_EQUAL_SIZE
@ osl_Socket_Option_FORCE_EQUAL_SIZE
Definition: socket.h:115
osl_Socket_OptionBroadcast
@ osl_Socket_OptionBroadcast
Definition: socket.h:92
osl_Socket_OptionLinger
@ osl_Socket_OptionLinger
Definition: socket.h:95
osl_Socket_OptionUseLoopback
@ osl_Socket_OptionUseLoopback
Definition: socket.h:93
osl_Socket_OptionRcvTimeo
@ osl_Socket_OptionRcvTimeo
Definition: socket.h:109
osl_setInetPortOfSocketAddr
SAL_DLLPUBLIC sal_Bool osl_setInetPortOfSocketAddr(oslSocketAddr Addr, sal_Int32 Port)
Sets the Port of Addr.
oslSocketSet
struct oslSocketSetImpl * oslSocketSet
Type for the representation of socket sets.
Definition: socket.h:611
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_addToSocketSet
SAL_DLLPUBLIC void osl_addToSocketSet(oslSocketSet Set, oslSocket Socket)
Adds a socket to the set.
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.
osl_demultiplexSocketEvents
SAL_DLLPUBLIC sal_Int32 osl_demultiplexSocketEvents(oslSocketSet IncomingSet, oslSocketSet OutgoingSet, oslSocketSet OutOfBandSet, const TimeValue *pTimeout)
Checks multiple sockets for events.
oslSocketResult
oslSocketResult
Common return codes of socket related functions.
Definition: socket.h:193
osl_Socket_InProgress
@ osl_Socket_InProgress
Definition: socket.h:199
osl_Socket_Ok
@ osl_Socket_Ok
Definition: socket.h:194
osl_Socket_Error
@ osl_Socket_Error
Definition: socket.h:195
osl_Socket_FORCE_EQUAL_SIZE
@ osl_Socket_FORCE_EQUAL_SIZE
Definition: socket.h:200
osl_Socket_TimedOut
@ osl_Socket_TimedOut
Definition: socket.h:197
osl_Socket_Interrupted
@ osl_Socket_Interrupted
Definition: socket.h:198
oslSocketAddr
struct oslSocketAddrImpl * oslSocketAddr
Opaque datatype SocketAddr.
Definition: socket.h:40
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:850
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:67
osl_Socket_TypeStream
@ osl_Socket_TypeStream
Definition: socket.h:68
osl_Socket_TypeRdm
@ osl_Socket_TypeRdm
Definition: socket.h:71
osl_Socket_TypeSeqPacket
@ osl_Socket_TypeSeqPacket
Definition: socket.h:74
osl_Socket_Type_FORCE_EQUAL_SIZE
@ osl_Socket_Type_FORCE_EQUAL_SIZE
Definition: socket.h:78
osl_Socket_TypeInvalid
@ osl_Socket_TypeInvalid
Definition: socket.h:77
osl_Socket_TypeRaw
@ osl_Socket_TypeRaw
Definition: socket.h:70
osl_Socket_TypeDgram
@ osl_Socket_TypeDgram
Definition: socket.h:69
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:212
osl_destroySocketSet
SAL_DLLPUBLIC void osl_destroySocketSet(oslSocketSet Set)
Destroys an oslSocketSet.
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_removeFromSocketSet
SAL_DLLPUBLIC void osl_removeFromSocketSet(oslSocketSet Set, oslSocket Socket)
Removes a socket from the set.
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:121
osl_Socket_LevelTcp
@ osl_Socket_LevelTcp
Definition: socket.h:123
osl_Socket_LevelInvalid
@ osl_Socket_LevelInvalid
Definition: socket.h:124
osl_Socket_Level_FORCE_EQUAL_SIZE
@ osl_Socket_Level_FORCE_EQUAL_SIZE
Definition: socket.h:125
osl_Socket_LevelSocket
@ osl_Socket_LevelSocket
Definition: socket.h:122
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_isInSocketSet
SAL_DLLPUBLIC sal_Bool osl_isInSocketSet(oslSocketSet Set, oslSocket Socket)
Checks if socket is in the set.
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:144
osl_Socket_DirRead
@ osl_Socket_DirRead
Definition: socket.h:145
osl_Socket_DirWrite
@ osl_Socket_DirWrite
Definition: socket.h:146
osl_Socket_DirInvalid
@ osl_Socket_DirInvalid
Definition: socket.h:148
osl_Socket_Dir_FORCE_EQUAL_SIZE
@ osl_Socket_Dir_FORCE_EQUAL_SIZE
Definition: socket.h:149
osl_Socket_DirReadWrite
@ osl_Socket_DirReadWrite
Definition: socket.h:147
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:55
osl_Socket_ProtocolIpx
@ osl_Socket_ProtocolIpx
Definition: socket.h:57
osl_Socket_ProtocolInvalid
@ osl_Socket_ProtocolInvalid
Definition: socket.h:60
osl_Socket_ProtocolSpx
@ osl_Socket_ProtocolSpx
Definition: socket.h:58
osl_Socket_Protocol_FORCE_EQUAL_SIZE
@ osl_Socket_Protocol_FORCE_EQUAL_SIZE
Definition: socket.h:61
osl_Socket_ProtocolSpxII
@ osl_Socket_ProtocolSpxII
Definition: socket.h:59
osl_Socket_ProtocolIp
@ osl_Socket_ProtocolIp
Definition: socket.h:56
oslSocketError
oslSocketError
Describes the various error socket error conditions, which may occur.
Definition: socket.h:154
osl_Socket_E_ProtocolNoSupport
@ osl_Socket_E_ProtocolNoSupport
Definition: socket.h:161
osl_Socket_E_TimedOut
@ osl_Socket_E_TimedOut
Definition: socket.h:180
osl_Socket_E_WouldBlock
@ osl_Socket_E_WouldBlock
Definition: socket.h:184
osl_Socket_E_NetUnreachable
@ osl_Socket_E_NetUnreachable
Definition: socket.h:170
osl_Socket_E_DestAddrReq
@ osl_Socket_E_DestAddrReq
Definition: socket.h:157
osl_Socket_E_Already
@ osl_Socket_E_Already
Definition: socket.h:185
osl_Socket_E_HostUnreachable
@ osl_Socket_E_HostUnreachable
Definition: socket.h:183
osl_Socket_E_HostDown
@ osl_Socket_E_HostDown
Definition: socket.h:182
osl_Socket_E_NotSocket
@ osl_Socket_E_NotSocket
Definition: socket.h:156
osl_Socket_E_IsConnected
@ osl_Socket_E_IsConnected
Definition: socket.h:176
osl_Socket_E_Shutdown
@ osl_Socket_E_Shutdown
Definition: socket.h:178
osl_Socket_E_ConnAborted
@ osl_Socket_E_ConnAborted
Definition: socket.h:173
osl_Socket_E_TooManyRefs
@ osl_Socket_E_TooManyRefs
Definition: socket.h:179
osl_Socket_E_TypeNoSupport
@ osl_Socket_E_TypeNoSupport
Definition: socket.h:162
osl_Socket_E_MsgSize
@ osl_Socket_E_MsgSize
Definition: socket.h:158
osl_Socket_E_NetReset
@ osl_Socket_E_NetReset
Definition: socket.h:171
osl_Socket_E_PfNoSupport
@ osl_Socket_E_PfNoSupport
Definition: socket.h:164
osl_Socket_E_AfNoSupport
@ osl_Socket_E_AfNoSupport
Definition: socket.h:165
osl_Socket_E_None
@ osl_Socket_E_None
Definition: socket.h:155
osl_Socket_E_InProgress
@ osl_Socket_E_InProgress
Definition: socket.h:186
osl_Socket_E_AddrInUse
@ osl_Socket_E_AddrInUse
Definition: socket.h:167
osl_Socket_E_Prototype
@ osl_Socket_E_Prototype
Definition: socket.h:159
osl_Socket_E_ConnReset
@ osl_Socket_E_ConnReset
Definition: socket.h:174
osl_Socket_E_NotConnected
@ osl_Socket_E_NotConnected
Definition: socket.h:177
osl_Socket_E_NoBufferSpace
@ osl_Socket_E_NoBufferSpace
Definition: socket.h:175
osl_Socket_E_NoProtocol
@ osl_Socket_E_NoProtocol
Definition: socket.h:160
osl_Socket_E_OpNotSupport
@ osl_Socket_E_OpNotSupport
Definition: socket.h:163
osl_Socket_E_ConnRefused
@ osl_Socket_E_ConnRefused
Definition: socket.h:181
osl_Socket_E_FORCE_EQUAL_SIZE
@ osl_Socket_E_FORCE_EQUAL_SIZE
Definition: socket.h:188
osl_Socket_E_NetDown
@ osl_Socket_E_NetDown
Definition: socket.h:169
osl_Socket_E_InvalidError
@ osl_Socket_E_InvalidError
Definition: socket.h:187
osl_Socket_E_AddrNotAvail
@ osl_Socket_E_AddrNotAvail
Definition: socket.h:168
oslSocketIpxNetNumber
sal_uInt8 oslSocketIpxNetNumber[4]
Definition: socket.h:203
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:204
oslAddrFamily
oslAddrFamily
Represents the address-family of a socket.
Definition: socket.h:45
osl_Socket_FamilyInvalid
@ osl_Socket_FamilyInvalid
Definition: socket.h:48
osl_Socket_Family_FORCE_EQUAL_SIZE
@ osl_Socket_Family_FORCE_EQUAL_SIZE
Definition: socket.h:49
osl_Socket_FamilyInet
@ osl_Socket_FamilyInet
Definition: socket.h:46
osl_Socket_FamilyIpx
@ osl_Socket_FamilyIpx
Definition: socket.h:47
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.
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_clearSocketSet
SAL_DLLPUBLIC void osl_clearSocketSet(oslSocketSet Set)
Clears the set from all previously added sockets.
osl_createSocketSet
SAL_DLLPUBLIC oslSocketSet osl_createSocketSet(void)
Creates a set of sockets to be used with osl_demultiplexSocketEvents().
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:131
osl_Socket_MsgDontRoute
@ osl_Socket_MsgDontRoute
Definition: socket.h:135
osl_Socket_MsgNormal
@ osl_Socket_MsgNormal
Definition: socket.h:132
osl_Socket_Msg_FORCE_EQUAL_SIZE
@ osl_Socket_Msg_FORCE_EQUAL_SIZE
Definition: socket.h:138
osl_Socket_MsgInvalid
@ osl_Socket_MsgInvalid
Definition: socket.h:137
osl_Socket_MsgMaxIOVLen
@ osl_Socket_MsgMaxIOVLen
Definition: socket.h:136
osl_Socket_MsgPeek
@ osl_Socket_MsgPeek
Definition: socket.h:134
osl_Socket_MsgOOB
@ osl_Socket_MsgOOB
Definition: socket.h:133
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.
time.h
TimeValue
Definition: time.h:66
_sal_Sequence
This is the binary specification of a SAL sequence.
Definition: types.h:300