24 #ifndef INCLUDED_OSL_SOCKET_H 25 #define INCLUDED_OSL_SOCKET_H 35 #define OSL_INADDR_NONE 0xffffffff 36 #define OSL_INVALID_PORT (-1) 216 typedef struct oslSocketImpl *
oslSocket;
295 sal_Int32 MaxPendingConnections);
330 sal_uInt32 BytesToRead,
357 sal_uInt32 BufferSize,
379 sal_uInt32 BytesToSend,
412 sal_uInt32 BytesToSend,
536 sal_uInt32 BufferLen);
560 sal_uInt32 BufferLen);
602 rtl_uString **strError);
684 rtl_uString *strHostname);
696 rtl_uString *strDottedAddr, sal_Int32 Port);
707 rtl_uString *strDottedAddr, sal_Int32 Port);
721 rtl_uString *strServicename, rtl_uString *strProtocol);
861 #endif // INCLUDED_OSL_SOCKET_H
oslProtocol
represent a specific protocol within an address-family
Definition: socket.h:59
SAL_DLLPUBLIC void osl_getLastSocketErrorDescription(oslSocket Socket, rtl_uString **strError)
returns a string which describes the last socket error.
SAL_DLLPUBLIC oslSocketAddr osl_copySocketAddr(oslSocketAddr Addr)
Creates a new SocketAddress and fills it from Addr.
SAL_DLLPUBLIC sal_Bool osl_isReceiveReady(oslSocket Socket, const TimeValue *pTimeout)
Checks if read operations will block.
SAL_DLLPUBLIC void osl_destroySocketAddr(oslSocketAddr Addr)
Frees all resources allocated by Addr.
oslSocketOption
Represents socket-options.
Definition: socket.h:89
SAL_DLLPUBLIC sal_Int32 osl_readSocket(oslSocket Socket, void *pBuffer, sal_Int32 nSize)
Retrieves n bytes from the stream and copies them into pBuffer.
SAL_DLLPUBLIC sal_Int32 osl_getInetPortOfSocketAddr(oslSocketAddr Addr)
Retrieves the internet port-number of Addr.
SAL_DLLPUBLIC sal_Int32 osl_getServicePort(rtl_uString *strServicename, rtl_uString *strProtocol)
Looks up the port-number designated to the specified service/protocol-pair.
SAL_DLLPUBLIC oslAddrFamily osl_getFamilyOfSocketAddr(oslSocketAddr Addr)
Retrieves the address-family from the Addr.
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.
oslSocketResult
Common return codes of socket related functions.
Definition: socket.h:197
SAL_DLLPUBLIC sal_Bool osl_setSocketOption(oslSocket Socket, oslSocketOptionLevel Level, oslSocketOption Option, void *pBuffer, sal_uInt32 BufferLen)
Sets the sockets attributes.
SAL_DLLPUBLIC oslSocket osl_createSocket(oslAddrFamily Family, oslSocketType Type, oslProtocol Protocol)
Create a socket of the specified Family and Type.
#define SAL_DLLPUBLIC
Definition: saldllapi.h:34
oslAddrFamily
Represents the address-family of a socket.
Definition: socket.h:49
SAL_DLLPUBLIC oslSocketResult osl_getAddrOfSocketAddr(oslSocketAddr Addr, sal_Sequence **ppByteSeq)
Returns the addr field in the struct sockaddr.
sal_uInt8 oslSocketIpxNetNumber[4]
Definition: socket.h:207
This is the binary specification of a SAL sequence.
Definition: types.h:303
SAL_DLLPUBLIC sal_Bool osl_isExceptionPending(oslSocket Socket, const TimeValue *pTimeout)
Checks if a request for out-of-band data will block.
SAL_DLLPUBLIC sal_Bool osl_enableNonBlockingMode(oslSocket Socket, sal_Bool On)
Enables/disables non-blocking-mode of the socket.
SAL_DLLPUBLIC oslHostAddr osl_createHostAddr(rtl_uString *strHostname, const oslSocketAddr Addr)
Create an oslHostAddr from given hostname and socket address.
sal_uInt8 oslSocketIpxNodeNumber[6]
Definition: socket.h:208
oslSocketOptionLevel
Represents the different socket-option levels.
Definition: socket.h:125
SAL_DLLPUBLIC oslSocketAddr osl_createInetBroadcastAddr(rtl_uString *strDottedAddr, sal_Int32 Port)
Create an internet address usable for sending broadcast datagrams.
oslSocketType
Represents the type of a socket.
Definition: socket.h:71
SAL_DLLPUBLIC oslSocketAddr osl_getLocalAddrOfSocket(oslSocket Socket)
Retrieves the Address of the local end of the socket.
SAL_DLLPUBLIC oslSocketResult osl_getDottedInetAddrOfSocketAddr(oslSocketAddr Addr, rtl_uString **strDottedInetAddr)
Gets the address in dotted decimal format.
SAL_DLLPUBLIC sal_Bool osl_isSendReady(oslSocket Socket, const TimeValue *pTimeout)
Checks if send operations will block.
SAL_DLLPUBLIC oslSocket osl_acceptConnectionOnSocket(oslSocket Socket, oslSocketAddr *pAddr)
Waits for an ingoing connection on the socket.
unsigned char sal_Bool
Definition: types.h:38
SAL_DLLPUBLIC sal_Int32 osl_getSocketOption(oslSocket Socket, oslSocketOptionLevel Level, oslSocketOption Option, void *pBuffer, sal_uInt32 BufferLen)
Retrieves attributes associated with the socket.
SAL_DLLPUBLIC void osl_getHostnameOfHostAddr(const oslHostAddr Addr, rtl_uString **strHostname)
Get the hostname member of Addr.
SAL_DLLPUBLIC oslSocketAddr osl_createInetSocketAddr(rtl_uString *strDottedAddr, sal_Int32 Port)
Create an internet-address, consisting of host address and port.
SAL_DLLPUBLIC sal_Int32 osl_writeSocket(oslSocket Socket, const void *pBuffer, sal_Int32 nSize)
Writes n bytes from pBuffer to the stream.
SAL_DLLPUBLIC sal_Bool osl_listenOnSocket(oslSocket Socket, sal_Int32 MaxPendingConnections)
Prepares the socket to act as an acceptor of incoming connections.
oslSocketMsgFlag
Represents flags to be used with send/recv-calls.
Definition: socket.h:135
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...
oslSocketError
Describes the various error socket error conditions, which may occur.
Definition: socket.h:158
SAL_DLLPUBLIC oslSocketResult osl_connectSocketTo(oslSocket Socket, oslSocketAddr Addr, const TimeValue *pTimeout)
Connects the socket to the given address.
SAL_DLLPUBLIC void osl_acquireSocket(oslSocket Socket)
increases the refcount of the socket handle by one
SAL_DLLPUBLIC sal_Bool osl_shutdownSocket(oslSocket Socket, oslSocketDirection Direction)
Shuts down communication on a connected socket.
Time since Jan-01-1970.
Definition: time.h:76
SAL_DLLPUBLIC oslHostAddr osl_createHostAddrByAddr(const oslSocketAddr Addr)
Create an oslHostAddr by reverse resolution of the given Addr.
struct oslSocketAddrImpl * oslSocketAddr
Opaque datatype SocketAddr.
Definition: socket.h:44
SAL_DLLPUBLIC oslSocketResult osl_getHostnameOfSocketAddr(oslSocketAddr Addr, rtl_uString **strHostname)
Returns the hostname represented by Addr.
SAL_DLLPUBLIC void osl_releaseSocket(oslSocket Socket)
decreases the refcount of the socket handle by one.
SAL_DLLPUBLIC oslHostAddr osl_copyHostAddr(const oslHostAddr Addr)
Create a copy of the given Addr.
SAL_DLLPUBLIC oslSocketResult osl_getLocalHostname(rtl_uString **strLocalHostname)
Retrieve this machines hostname (NOT the FQDN)
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.
SAL_DLLPUBLIC oslSocketAddr osl_getSocketAddrOfHostAddr(const oslHostAddr Addr)
Get the socket address member of Addr.
SAL_DLLPUBLIC oslSocketError osl_getLastSocketError(oslSocket Socket)
Returns a constant describing the last error for the socket system.
SAL_DLLPUBLIC oslSocketAddr osl_getPeerAddrOfSocket(oslSocket Socket)
Retrieves the Address of the remote end of the socket.
SAL_DLLPUBLIC oslSocketType osl_getSocketType(oslSocket Socket)
Queries the socket for its type.
oslSocketDirection
Used by shutdown to denote which end of the socket to "close".
Definition: socket.h:148
SAL_DLLPUBLIC oslHostAddr osl_createHostAddrByName(rtl_uString *strHostname)
Create an oslHostAddr by resolving the given strHostname.
#define SAL_MAX_ENUM
Definition: types.h:205
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.
SAL_DLLPUBLIC sal_Bool osl_bindAddrToSocket(oslSocket Socket, oslSocketAddr Addr)
Binds the given address to the socket.
struct oslHostAddrImpl * oslHostAddr
Definition: socket.h:788
SAL_DLLPUBLIC sal_Bool osl_isNonBlockingMode(oslSocket Socket)
Query state of non-blocking-mode of the socket.
struct oslSocketImpl * oslSocket
Definition: socket.h:215
SAL_DLLPUBLIC void osl_destroyHostAddr(oslHostAddr Addr)
Frees all resources allocated by Addr.
SAL_DLLPUBLIC oslSocketResult osl_setAddrOfSocketAddr(oslSocketAddr Addr, sal_Sequence *pByteSeq)
Sets the addr field in the struct sockaddr with pByteSeq.
SAL_DLLPUBLIC oslSocketAddr osl_createEmptySocketAddr(oslAddrFamily Family)
Creates a socket-address for the given family.
SAL_DLLPUBLIC sal_Bool osl_isEqualSocketAddr(oslSocketAddr Addr1, oslSocketAddr Addr2)
Compares the values of two SocketAddresses.
SAL_DLLPUBLIC void osl_closeSocket(oslSocket Socket)
Closes the socket terminating any ongoing dataflow.
SAL_DLLPUBLIC sal_Bool osl_setInetPortOfSocketAddr(oslSocketAddr Addr, sal_Int32 Port)
Sets the Port of Addr.
SAL_DLLPUBLIC oslSocketAddr osl_resolveHostname(rtl_uString *strHostname)
Uses the systems name-service interface to find an address for strHostname.
unsigned char sal_uInt8
Definition: types.h:44