/** Describes the various error socket error conditions, which may
occur */ typedefenum {
osl_Socket_E_None, /*!< no error */
osl_Socket_E_NotSocket, /*!< Socket operation on non-socket */
osl_Socket_E_DestAddrReq, /*!< Destination address required */
osl_Socket_E_MsgSize, /*!< Message too long */
osl_Socket_E_Prototype, /*!< Protocol wrong type for socket */
osl_Socket_E_NoProtocol, /*!< Protocol not available */
osl_Socket_E_ProtocolNoSupport, /*!< Protocol not supported */
osl_Socket_E_TypeNoSupport, /*!< Socket type not supported */
osl_Socket_E_OpNotSupport, /*!< Operation not supported on socket */
osl_Socket_E_PfNoSupport, /*!< Protocol family not supported */
osl_Socket_E_AfNoSupport, /*!< Address family not supported by */ /*!< protocol family */
osl_Socket_E_AddrInUse, /*!< Address already in use */
osl_Socket_E_AddrNotAvail, /*!< Can't assign requested address */
osl_Socket_E_NetDown, /*!< Network is down */
osl_Socket_E_NetUnreachable, /*!< Network is unreachable */
osl_Socket_E_NetReset, /*!< Network dropped connection because
of reset */
osl_Socket_E_ConnAborted, /*!< Software caused connection abort */
osl_Socket_E_ConnReset, /*!< Connection reset by peer */
osl_Socket_E_NoBufferSpace, /*!< No buffer space available */
osl_Socket_E_IsConnected, /*!< Socket is already connected */
osl_Socket_E_NotConnected, /*!< Socket is not connected */
osl_Socket_E_Shutdown, /*!< Can't send after socket shutdown */
osl_Socket_E_TooManyRefs, /*!< Too many references: can't splice */
osl_Socket_E_TimedOut, /*!< Connection timed out */
osl_Socket_E_ConnRefused, /*!< Connection refused */
osl_Socket_E_HostDown, /*!< Host is down */
osl_Socket_E_HostUnreachable, /*!< No route to host */
osl_Socket_E_WouldBlock, /*!< call would block on non-blocking socket */
osl_Socket_E_Already, /*!< operation already in progress */
osl_Socket_E_InProgress, /*!< operation now in progress */
osl_Socket_E_InvalidError, /*!< unmapped error: always last entry in enum */
osl_Socket_E_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
} oslSocketError;
/** Common return codes of socket related functions.
*/ typedefenum {
osl_Socket_Ok, /*!< successful completion */
osl_Socket_Error, /*!< error occurred, check
osl_getLastSocketError() for details */
osl_Socket_TimedOut, /*!< blocking operation timed out */
osl_Socket_Interrupted, /*!< blocking operation was interrupted */
osl_Socket_InProgress, /*!< nonblocking operation is in progress */
osl_Socket_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
} oslSocketResult;
/** Retrieves the Address of the remote end of the socket. Notethatasocketmustbeconnectedbefore avalidaddresscanbereturned. @retval0ifsocket-addresscouldnotbecreated,otherwiseyouget thecreatedSocket-Address.
*/
SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_getPeerAddrOfSocket(oslSocket Socket);
/** Binds the given address to the socket. @param[in]Socket @param[in]Addr @retvalsal_Falseifthebindfailed @retvalsal_Trueifbindissuccessful @seeosl_getLastSocketError()
*/
SAL_DLLPUBLIC sal_Bool SAL_CALL osl_bindAddrToSocket(
oslSocket Socket,
oslSocketAddr Addr);
/** Tries to send one datagram with BytesToSend data to the given ReceiverAddr viathe(implicitlyunconnected)datagram-socket. Sincethereisonlysentonepacket,thefunctionsendsthedataalwayscomplete evenwithincompletepacketboundaries.
/** Checks if send operations will block. Youcanspecifyatimeout-valueinseconds/microsecondsthatdenotes howlongtheoperationwillblockiftheSocketisnotready.
/** Checks if a request for out-of-band data will block. Youcanspecifyatimeout-valueinseconds/microsecondsthatdenotes howlongtheoperationwillblockiftheSockethasnopendingOOBdata.
/** Shuts down communication on a connected socket. @param[in]SockettheSockettoperformtheoperationon. @param[in]Direction @parblock Directiondenoteswhichendofthesocketshouldbeclosed: @liosl_Socket_DirRead-closesreadoperations. @liosl_Socket_DirReadWrite-closeswriteoperations. @liosl_Socket_DirWrite-closesreadandwriteoperations. @endparblock
/**@} end section oslSocket
*/ /**@{ begin section oslSocketAddr
*/
/** Creates a socket-address for the given family. @paramFamilyIffamily==osl_Socket_FamilyInettheaddressis settoINADDR_ANYport0. @return0ifaddresscouldnotbecreated.
*/
SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_createEmptySocketAddr(
oslAddrFamily Family);
/** Creates a new SocketAddress and fills it from Addr.
*/
SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_copySocketAddr(
oslSocketAddr Addr);
/** Compares the values of two SocketAddresses. @retvalsal_Trueifbothaddressesdenotethesamesocketaddress. @retvalsal_Falseifbothaddressesdonotdenotethesamesocketaddress.
*/
SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isEqualSocketAddr(
oslSocketAddr Addr1, oslSocketAddr Addr2);
/** Uses the systems name-service interface to find an address for strHostname. @param[in]strHostnameThenameforwhichyousearchforanaddress. @returnThedesiredaddressifonecouldbefound,otherwise0. Don'tforgettodestroytheaddressifyoudon'tneeditanylonger.
*/
SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_resolveHostname(
rtl_uString *strHostname);
/** Create an internet address usable for sending broadcast datagrams. Tolimitthebroadcasttoyoursubnet,passyourhostsIPaddress indotteddecimalnotationasfirstargument. @seeosl_sendToSocket() @seeoslSocketAddr @param[in]strDottedAddrdotteddecimalinternetaddress,maybe0. @param[in]Portportnumberinhostbyteorder. @retval0ifaddresscouldnotbecreated.
*/
SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_createInetBroadcastAddr(
rtl_uString *strDottedAddr, sal_Int32 Port);
/** Create an internet-address, consisting of host address and port. WeinterpretstrDottedAddrasadotted-decimalinet-addr (e.g."141.99.128.50"). @param[in]strDottedAddrStringwithdottedaddress. @param[in]Portportnumberinhostbyteorder. @retval0ifaddresscouldnotbecreated.
*/
SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_createInetSocketAddr (
rtl_uString *strDottedAddr, sal_Int32 Port);
/** Frees all resources allocated by Addr. The handle Addr must not beusedafterthecallanymore.
*/
SAL_DLLPUBLIC void SAL_CALL osl_destroySocketAddr(
oslSocketAddr Addr);
/** Looks up the port-number designated to the specified service/protocol-pair. (e.g."ftp""tcp"). @retvalOSL_INVALID_PORTifnoappropriateentrywasfound,otherwisetheport-number.
*/
SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_getServicePort(
rtl_uString *strServicename, rtl_uString *strProtocol);
/** Retrieves the address-family from the Addr. @returnthefamilyofthesocket-address. Incaseofanunknownfamilyyougetosl_Socket_FamilyInvalid.
*/
SAL_DLLPUBLIC oslAddrFamily SAL_CALL osl_getFamilyOfSocketAddr(
oslSocketAddr Addr);
/** Retrieves the internet port-number of Addr. @returntheport-numberoftheaddressinhost-byteorder.IfAddr isnotanaddressoftypeosl_Socket_FamilyInet,itreturnsOSL_INVALID_PORT
*/
SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_getInetPortOfSocketAddr(
oslSocketAddr Addr);
/** Sets the Port of Addr. @param[in]AddrtheSocketAddrtoperformtheoperationon. @param[in]Portisexpectedinhostbyte-order. @retvalsal_FalseifAddrisnotaninet-addr.
*/
SAL_DLLPUBLIC sal_Bool SAL_CALL osl_setInetPortOfSocketAddr(
oslSocketAddr Addr, sal_Int32 Port);
/** Returns the hostname represented by Addr. @param[in]AddrThesocketaddressfromwhichtoextractthehostname. @param[out]strHostnameThehostnamerepresentedbytheaddress.If thereisnohostnametobefound,itreturns0.
*/
SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_getHostnameOfSocketAddr(
oslSocketAddr Addr, rtl_uString **strHostname);
/** Sets the addr field in the struct sockaddr with pByteSeq. pByteSeq must be in network byte order.
*/
SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_setAddrOfSocketAddr(
oslSocketAddr Addr, sal_Sequence *pByteSeq );
/** Returns the addr field in the struct sockaddr. @param[in]AddrThesocketaddressfromwhichtoextracttheipaddress. @param[out]ppByteSeqAfterthecall,*ppByteSeqcontainstheipaddress innetworkbyteorder.*ppByteSeqmaybe0incaseofaninvalidsockethandle. @retvalosl_Socket_Ok @retvalosl_Socket_Error
*/
SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_getAddrOfSocketAddr(
oslSocketAddr Addr, sal_Sequence **ppByteSeq );
/** Create an oslHostAddr from given hostname and socket address. @param[in]strHostnameThehostnametobestored. @param[in]AddrThesocketaddresstobestored. @returnThecreatedaddressor0uponfailure.
*/
SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_createHostAddr(
rtl_uString *strHostname, const oslSocketAddr Addr);
/** Create an oslHostAddr by resolving the given strHostname. Successfulnameresolutionshouldresultinthefullyqualified domainname(FQDN)anditsaddressashostnameandsocketaddress membersoftheresultingoslHostAddr. @param[in]strHostnameThehostnametoberesolved. @returnTheresultingaddressor0uponfailure.
*/
SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_createHostAddrByName(rtl_uString *strHostname);
/** Create an oslHostAddr by reverse resolution of the given Addr. Successfulnameresolutionshouldresultinthefullyqualified domainname(FQDN)anditsaddressashostnameandsocketaddress membersoftheresultingoslHostAddr. @param[in]AddrThesocketaddresstobereverseresolved. @returnTheresultingaddressor0uponfailure.
*/
SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_createHostAddrByAddr(const oslSocketAddr Addr);
/** Create a copy of the given Addr. @returnThecopiedaddressor0uponfailure.
*/
SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_copyHostAddr(const oslHostAddr Addr);
/** Frees all resources allocated by Addr. The handle Addr must not beusedafterthecallanymore.
*/
SAL_DLLPUBLIC void SAL_CALL osl_destroyHostAddr(oslHostAddr Addr);
/** Get the hostname member of Addr. @paramAddraddressforhostname @paramstrHostnameThehostnameor0uponfailure.
*/
SAL_DLLPUBLIC void SAL_CALL osl_getHostnameOfHostAddr(const oslHostAddr Addr, rtl_uString **strHostname);
/** Get the socket address member of Addr. @returnThesocketaddressor0uponfailure.
*/
SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_getSocketAddrOfHostAddr(const oslHostAddr Addr);
/** Retrieve this machines hostname (NOT the FQDN) @paramstrLocalHostnameout-parameter.Thestringthatreceivesthelocalhostname. @retvalsal_Trueuponsuccess @retvalsal_False
*/
SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_getLocalHostname(rtl_uString **strLocalHostname);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.