From 4fbcba4ee19a49c05440861e1278bc97d29048e0 Mon Sep 17 00:00:00 2001 From: Matt Dew Date: Tue, 4 Oct 2011 23:32:02 -0600 Subject: Cleanup IDs and links in doc 1 - fix the capitalization of the ID attributes to match either the or <funcdef> string it goes with. 2 - fix any <linkend>'s that were affected by 1. 3 - any <function> in the docs that has an actual funcdef, will become an olink. Signed-off-by: Matt Dew <marcoz@osource.org> --- doc/ICElib.xml | 569 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 279 insertions(+), 290 deletions(-) (limited to 'doc') diff --git a/doc/ICElib.xml b/doc/ICElib.xml index d239bf2..694afcd 100644 --- a/doc/ICElib.xml +++ b/doc/ICElib.xml @@ -57,7 +57,7 @@ in this Software without prior written authorization from the X Consortium. </legalnotice> </bookinfo> -<chapter id='overview_of_ice'> +<chapter id='Overview_of_ICE'> <title>Overview of ICE @@ -70,7 +70,7 @@ mechanisms and to be multiplexed over a single transport connection. - + The ICE Library - C Language Interface to ICE @@ -107,7 +107,7 @@ particular message. - + Intended Audience This document is intended primarily for implementors of protocol libraries @@ -120,7 +120,7 @@ clients). But in general, protocol libraries should be designed to hide the inner details of ICE from applications. - + Header Files and Library Name @@ -138,7 +138,7 @@ the header file Applications should link against ICElib using -lICE. - + Note on Prefixes @@ -161,7 +161,7 @@ responds with a - + Protocol Registration @@ -200,12 +200,12 @@ condition. -The IceRegisterForProtocolSetup +The function should be called for the client that initiates a ProtocolSetup - + int IceRegisterForProtocolSetup char *protocol_name @@ -285,9 +285,9 @@ The list of authentication callbacks, one for each authentication method. -IceRegisterForProtocolSetup returns the major + returns the major opcode reserved or -1 if an error occurred. In order to actually activate -the protocol, the IceProtocolSetup +the protocol, the function needs to be called with this major opcode. Once the protocol is activated, all messages for the protocol should be sent using this major opcode. @@ -317,8 +317,8 @@ received by the client that initiated the ProtocolSetup For further information, see - -. + + Authentication may be required before the protocol can become active. The protocol library must register the authentication methods that it @@ -328,29 +328,27 @@ and callbacks that are prioritized in decreasing order of preference. For information on the IcePoAuthProc callback, see - - + The -IceIOErrorProc + callback is invoked if the ICE connection unexpectedly breaks. You should pass NULL for io_error_proc if not interested in being notified. For further information, - - + The -IceRegisterForProtocolReply + function should be called for the client that responds to a ProtocolSetup with a ProtocolReply - + Bool IceRegisterForProtocolReply char *host_name @@ -437,7 +435,7 @@ is sent. -IceRegisterForProtocolReply + returns the major opcode reserved or -1 if an error occurred. The major opcode should be used in all subsequent messages sent for this protocol. @@ -458,14 +456,13 @@ typedef struct { The -IcePaProcessMsgProc + callback is responsible for processing the set of messages that can be received by the client that accepted the ProtocolSetup For further information, see - - + Authentication may be required before the protocol can become active. @@ -476,8 +473,7 @@ and callbacks that are prioritized in decreasing order of preference. For information on the IcePaAuthProc, See - - + @@ -550,7 +546,7 @@ library intends to generate a message immediately following the You should pass NULL for protocol_activate_proc if not interested in this callback. - + Status ProtocolSetupProc IceConn ice_conn @@ -610,7 +606,7 @@ in this callback. The pointer stored in the client_data_ret argument will be passed to the -IcePaProcessMsgProc + callback whenever a message has arrived for this protocol on the ICE connection. @@ -628,7 +624,7 @@ The ICE library will be responsible for freeing this memory. IceProtocolActivateProc callback is defined as follows: - + void ProtocolActivateProc IceConn ice_conn @@ -653,29 +649,27 @@ The client data set in the IceProtocolSetupProc callback. The -IceIOErrorProc + callback is invoked if the ICE connection unexpectedly breaks. You should pass NULL for io_error_proc if not interested in being notified. For further information, see - - + - + Callbacks for Processing Messages When an application detects that there is new data to read on an ICE connection (via select it calls the -IceProcessMessages + function - -. + When -IceProcessMessages + reads an ICE message header with a major opcode other than zero (reserved for the ICE protocol), it needs to call a function that will read the rest of the message, unpack it, and process it accordingly. @@ -686,7 +680,7 @@ the IcePoProcessMsgProc callback is invoked. - + void PoProcessMsgProc IceConn ice_conn @@ -748,11 +742,11 @@ a reply is ready. If the message arrives at the client that accepted the ProtocolSetup the -IcePaProcessMsgProc + callback is invoked. - + void IcePaProcessMsgProc IceConn ice_conn @@ -797,8 +791,7 @@ callback is invoked. In order to read the message, both of these callbacks should use the macros defined for this purpose (see - -.). +.). Note that byte swapping may be necessary. As a convenience, the length field in the ICE header will be swapped by ICElib if necessary. @@ -810,9 +803,9 @@ time. In the case of IcePoProcessMsgProc the client data was set in the call to -IceProtocolSetup + In the case of -IcePaProcessMsgProc + the client data was set in the IceProtocolSetupProc callback. @@ -883,14 +876,14 @@ then care must be taken not to store any value in reply_ready_ret, because this pointer may also be NULL. The -IcePaProcessMsgProc + callback, on the other hand, should always pass the message to the client via a callback. For example, if this is a Session Management "Interact Request" message, this function should notify the client of the "Interact Request" via a callback. The reason the -IcePaProcessMsgProc + callback does not have a reply_wait, like IcePoProcessMsgProc does, is because a process that is acting as @@ -899,7 +892,7 @@ occur if the connecting client does not act properly, denying access to other clients). - + Authentication Methods As already stated, a protocol library must register the authentication @@ -926,7 +919,7 @@ to the initial "Authentication Required" message or subsequent "Authentication Next Phase" messages sent by the other client. - + IcePoAuthStatus IcePoAuthStatus IceConn ice_conn @@ -1053,7 +1046,7 @@ should return one of four values: is the callback invoked for the client that received the ProtocolSetup - + IcePoAuthStatus PoAuthStatus IceConn ice_conn @@ -1179,7 +1172,7 @@ The IcePaAuthProc should return one of four values: - + ICE Connections @@ -1188,16 +1181,16 @@ waiting for connections, and the other client has to initiate the connection. Most clients will initiate connections, so we discuss that first. - + Opening an ICE Connection To open an ICE connection with another client (that is, waiting -for connections), use IceOpenConnection +for connections), use - + IceConn IceOpenConnection char *network_ids_list @@ -1263,7 +1256,7 @@ are used. -IceOpenConnection + returns an opaque ICE connection object if it succeeds; otherwise, it returns NULL. @@ -1303,9 +1296,9 @@ Each network ID has the following format: Most protocol libraries will have some sort of open function that should internally make a call into -IceOpenConnection + When -IceOpenConnection + is called, it may be possible to use a previously opened ICE connection (if the target client is the same). However, there are cases in which shared ICE connections are not desired. @@ -1332,40 +1325,40 @@ Appendix A). After -IceOpenConnection + is called, the client is ready to send a ProtocolSetup (provided that -IceRegisterForProtocolSetup + was called) or receive a ProtocolSetup (provided that -IceRegisterForProtocolReply + was called). - + Listening for ICE Connections Clients wishing to accept ICE connections must first call -IceListenForConnections + or -IceListenForWellKnownConnections + so that they can listen for connections. A list of opaque "listen" objects are returned, one for each type of transport method that is available (for example, Unix Domain, TCP, DECnet, and so on). Normally clients will let ICElib allocate an available name in each transport and return listen objects. Such a client will then use -IceComposeNetworkIdList + to extract the chosen names and make them available to other clients for opening the connection. In certain cases it may be necessary for a client to listen for connections on pre-arranged transport object names. Such a client may use -IceListenForWellKnownConnections + to specify the names for the listen objects. - + Status IceListenForConnections int *count_ret @@ -1402,10 +1395,10 @@ No more than error_length bytes are used. The return value of -IceListenForConnections + is zero for failure and a positive value for success. - + Status IceListenForWellKnownConnections char *port_id @@ -1469,27 +1462,27 @@ points to user supplied memory. No more than error_length bytes are used. -IceListenForWellKnownConnections constructs a list + constructs a list of network IDs by prepending each known transport to port_id and then attempts to create listen objects for the result. Port_id is the portnumber, objname, or path portion of the ICE network ID. If a listen object for a particular network ID cannot be created the network ID is ignored. If no listen objects are created -IceListenForWellKnownConnections + returns failure. -The return value of IceListenForWellKnownConnections +The return value of is zero for failure and a positive value for success. To close and free the listen objects, use -IceFreeListenObjs + - + void IceFreeListenObjs int count @@ -1521,10 +1514,10 @@ the listen object. To obtain the descriptor, use -IceGetListenConnectionNumber + - + int IceGetListenConnectionNumber IceListenObj *listen_objs @@ -1542,11 +1535,11 @@ To obtain the descriptor, use To obtain the network ID string associated with a listen object, use -IceGetListenConnectionString + - + char IceGetListenConnectionString IceListenObj listen_obj @@ -1591,11 +1584,11 @@ To obtain the network ID string associated with a listen object, use To compose a string containing a list of network IDs separated by commas -(the format recognized by IceOpenConnection -use IceComposeNetworkIdList +(the format recognized by +use - + char IceComposeNetworkIdList int count @@ -1620,7 +1613,7 @@ use IceComposeNetworkIdList - + Host Based Authentication for ICE Connections @@ -1629,11 +1622,11 @@ ICE connection and the initiating client has not required authentication, a host based authentication procedure may be invoked to provide a last chance for the client to connect. Each listen object has such a callback associated with it, and this callback is set using the -IceSetHostBasedAuthProc + function. - + void IceSetHostBasedAuthProc IceListenObj listen_obj @@ -1664,7 +1657,7 @@ host based authentication if it was previously set. - + Bool HostBasedAuthProc char *host_name @@ -1704,25 +1697,24 @@ which always returns True Host based authentication is also allowed at ProtocolSetup time. The callback is specified in the -IceRegisterForProtocolReply + function (see - -). +). - + Accepting ICE Connections After a connection attempt is detected on a listen object returned by -IceListenForConnections -you should call IceAcceptConnection + +you should call This returns a new opaque ICE connection object. - + IceConn IceAcceptConnection IceListenObj listen_obj @@ -1770,9 +1762,9 @@ and the function returns a new connection object. select on the file descriptors associated with the listen objects. When a new connection is detected, the -IceAcceptConnection + function should be called. -IceAcceptConnection + may return a new ICE connection that is in a pending state. This is because before the connection can become valid, authentication may be necessary. Because the ICE library cannot block and wait for the connection to @@ -1833,31 +1825,31 @@ else After -IceAcceptConnection + is called and the connection has been validated, the client is ready to receive a ProtocolSetup (provided that -IceRegisterForProtocolReply + was called) or send a ProtocolSetup (provided that -IceRegisterForProtocolSetup + was called). - + Closing ICE Connections To close an ICE connection created with -IceOpenConnection + or -IceAcceptConnection + use -IceCloseConnection + - + IceCloseStatus IceCloseConnection IceConn ice_conn @@ -1880,17 +1872,17 @@ must be met: The open reference count must have reached zero on this ICE connection. When -IceOpenConnection + is called, it tries to use a previously opened ICE connection. If it is able to use an existing connection, it increments the open reference count on the connection by one. So, to close an ICE connection, each call to -IceOpenConnection + must be matched with a call to -IceCloseConnection + The connection can be closed only on the last call to -IceCloseConnection + The active protocol count must have reached zero. Each time a @@ -1898,18 +1890,17 @@ on the last call to succeeds on the connection, the active protocol count is incremented by one. When the client no longer expects to use the protocol on the connection, the -IceProtocolShutdown + function should be called, which decrements the active protocol count by one (see - -). +). If shutdown negotiation is enabled on the connection, the client on the other side of the ICE connection must agree to have the connection closed. -IceCloseConnection + returns one of the following values: @@ -1920,12 +1911,12 @@ invoked and the connection was freed. IceClosedASAP - an IO error had occurred on the connection, but -IceCloseConnection + is being called within a nested -IceProcessMessages + The watch procedures have been invoked at this time, but the connection will be freed as soon as possible (when the nesting level reaches zero and -IceProcessMessages + returns a status of IceProcessMessagesConnectionClosed @@ -1939,7 +1930,7 @@ other active protocols. - the connection was not closed at this time and shutdown negotiation started with the client on the other side of the ICE connection. When the connection is actually closed, -IceProcessMessages + will return a status of IceProcessMessagesConnectionClosed @@ -1947,12 +1938,12 @@ will return a status of When it is known that the client on the other side of the ICE connection has terminated the connection without initiating shutdown negotiation, the -IceSetShutdownNegotiation + function should be called to turn off shutdown negotiation. This will prevent -IceCloseConnection + from writing to a broken connection. - + void IceSetShutdownNegotiation IceConn ice_conn @@ -1978,9 +1969,9 @@ shutdown negotiating will be turned off. To check the shutdown negotiation status of an ICE connection, use -IceCheckShutdownNegotiation + - + Bool IceCheckShutdownNegotiation IceConn ice_conn @@ -1997,7 +1988,7 @@ shutdown negotiating will be turned off. -IceCheckShutdownNegotiation + returns True if shutdown negotiation will take place on the connection; @@ -2005,24 +1996,24 @@ otherwise, it returns False Negotiation is on by default for a connection. It can only be changed with the -IceSetShutdownNegotiation + function. - + Connection Watch Procedures To add a watch procedure that will be called each time ICElib opens a new connection via -IceOpenConnection + or -IceAcceptConnection + or closes a connection via -IceCloseConnection + use -IceAddConnectionWatch + - + Status IceAddConnectionWatch IceWatchProc watch_proc @@ -2049,16 +2040,16 @@ The watch procedure to invoke when ICElib opens or closes a connection. -The return value of IceAddConnectionWatch +The return value of is zero for failure, and a positive value for success. -Note that several calls to IceOpenConnection +Note that several calls to might share the same ICE connection. In such a case, the watch procedure is only invoked when the connection is first created (after authentication succeeds). Similarly, because connections might be shared, the -watch procedure is called only if IceCloseConnection +watch procedure is called only if actually closes the connection (right before the IceConn is freed). @@ -2087,7 +2078,7 @@ set to True The watch procedure is of type IceWatchProc - + void WatchProc IceConn ice_conn @@ -2113,7 +2104,7 @@ to get the file descriptor associated with this connection. Client data specified in the call to -IceAddConnectionWatch + @@ -2143,10 +2134,10 @@ is closed and the watch procedure is invoked again with opening set to To remove a watch procedure, use -IceRemoveConnectionWatch + - + void IceRemoveConnectionWatch IceWatchProc watch_proc @@ -2160,7 +2151,7 @@ To remove a watch procedure, use The watch procedure that was passed to -IceAddConnectionWatch + @@ -2169,7 +2160,7 @@ The watch procedure that was passed to The client_data pointer that was passed to -IceAddConnectionWatch + @@ -2178,15 +2169,15 @@ The client_data pointer that was passed to - + Protocol Setup and Shutdown To activate a protocol on a given ICE connection, use -IceProtocolSetup + - + IceProtocolSetupStatus IceProtocolSetup IceConn ice_conn @@ -2214,7 +2205,7 @@ To activate a protocol on a given ICE connection, use The major opcode of the protocol to be set up, as returned by -IceRegisterForProtocolSetup + @@ -2286,7 +2277,7 @@ The vendor_ret and release_ret strings should be freed with -IceProtocolSetup returns one of the following values: + returns one of the following values: @@ -2316,10 +2307,10 @@ are not set. To notify the ICE library when a given protocol will no longer be used -on an ICE connection, use IceProtocolShutdown +on an ICE connection, use - + Status IceProtocolShutdown IceConn ice_conn @@ -2344,7 +2335,7 @@ on an ICE connection, use IceProtocolShutdown -The return value of IceProtocolShutdown +The return value of is zero for failure and a positive value for success. @@ -2357,14 +2348,14 @@ protocol shutdown. - + Processing Messages To process incoming messages on an ICE connection, use -IceProcessMessages + - + IceProcessMessagesStatus IceProcessMessages IceConn ice_conn @@ -2397,19 +2388,19 @@ If set to True on return, a reply is ready. -IceProcessMessages is used in two ways: + is used in two ways: In the first, a client may generate a message and block by calling -IceProcessMessages repeatedly until it gets its reply. + repeatedly until it gets its reply. -In the second, a client calls IceProcessMessages +In the second, a client calls with reply_wait set to NULL in response to select showing that there is data to read on the ICE connection. The ICE library may process zero or more complete messages. @@ -2452,7 +2443,7 @@ typedef struct { If reply_wait is not NULL and -IceProcessMessages + has a reply or error to return in response to this reply_wait (that is, no callback was generated), then the reply_ready_ret argument will be set to True @@ -2465,7 +2456,7 @@ this pointer. -IceProcessMessages returns one of the following values: + returns one of the following values: @@ -2478,7 +2469,7 @@ this pointer. IceProcessMessagesIOError - an IO error occurred, and the caller must explicitly close the connection by calling -IceCloseConnection + @@ -2486,7 +2477,7 @@ and the caller must explicitly close the connection by calling IceProcessMessagesConnectionClosed - the ICE connection has been closed (closing of the connection was deferred because of shutdown negotiation, or because the -IceProcessMessages + nesting level was not zero). Do not attempt to access the ICE connection at this point, since it has been freed. @@ -2495,15 +2486,15 @@ to access the ICE connection at this point, since it has been freed. - + Ping To send a "Ping" message to the client on the other side of the -ICE connection, use IcePing +ICE connection, use - + Status IcePing IceConn ice_conn @@ -2529,7 +2520,7 @@ ICE connection, use IcePing client_data -This pointer will be passed to the IcePingReplyProc +This pointer will be passed to the IcePingReplyProc callback. @@ -2537,16 +2528,16 @@ callback. -IcePing + returns zero for failure and a positive value for success. When -IceProcessMessages + processes the Ping reply, it will invoke the -IcePingReplyProc +IcePingReplyProc callback. - + void PingReplyProc IceConn ice_conn @@ -2565,24 +2556,24 @@ callback. client_data The client data specified in the call to -IcePing + - + Using ICElib Informational Functions - + IceConnectStatus IceConnectionStatus IceConn ice_conn -IceConnectionStatus + returns the status of an ICE connection. The possible return values are: @@ -2590,19 +2581,19 @@ returns the status of an ICE connection. The possible return values are: IceConnectPending - the connection is not valid yet (that is, authentication is taking place). This is only relevant to connections created by -IceAcceptConnection + IceConnectAccepted - the connection has been accepted. This is only relevant to connections created by -IceAcceptConnection + IceConnectRejected - the connection had been rejected (that is, authentication failed). This is only relevant to connections created by -IceAcceptConnection + IceConnectIOError @@ -2610,7 +2601,7 @@ This is only relevant to connections created by - + char *IceVendor IceConn ice_conn @@ -2624,7 +2615,7 @@ The string should be freed with a call to free when no longer needed. - + char *IceRelease IceConn ice_conn @@ -2638,17 +2629,17 @@ The string should be freed with a call to free when no longer needed. - + int IceProtocolVersion IceConn ice_conn -IceProtocolVersion + returns the major version of the ICE protocol on this connection. - + int IceProtocolRevision IceConn ice_conn @@ -2656,7 +2647,7 @@ returns the major version of the ICE protocol on this connection. -IceProtocolRevision + returns the minor version of the ICE protocol on this connection. @@ -2670,7 +2661,7 @@ returns the minor version of the ICE protocol on this connection. IceConnectionNumber returns the file descriptor of this ICE connection. - + char *IceConnectionString IceConn ice_conn @@ -2683,7 +2674,7 @@ accepted this connection. The string should be freed with a call to free when no longer needed. - + unsigned long IceLastSentSequenceNumber IceConn ice_conn @@ -2691,7 +2682,7 @@ when no longer needed. -IceLastSentSequenceNumber + returns the sequence number of the last message sent on this ICE connection. @@ -2705,7 +2696,7 @@ returns the sequence number of the last message sent on this ICE connection. - + Bool IceSwapping IceConn ice_conn @@ -2713,24 +2704,24 @@ ICE connection. -IceSwapping + returns True if byte swapping is necessary when reading messages on the ICE connection. - + IcePointer IceGetContext IceConn ice_conn -IceGetContext + returns the context associated with a connection created by -IceOpenConnection + - + ICE Messages @@ -2751,7 +2742,7 @@ The 3rd and 4th bytes of the message header can be used as needed. The length field is specified in units of 8 bytes. - + Sending ICE Messages @@ -2763,17 +2754,16 @@ together and flush the output buffer at appropriate times. If an IO error has occurred on an ICE connection, all write operations will be ignored. For further information, see - -. +. To get the size of the ICE output buffer, use -IceGetOutBufSize + - + int IceGetOutBufSize IceConn ice_conn @@ -2791,10 +2781,10 @@ To get the size of the ICE output buffer, use -To flush the ICE output buffer, use IceFlush +To flush the ICE output buffer, use - + int IceFlush IceConn ice_conn @@ -2817,7 +2807,7 @@ insufficient space to generate a message. The following macros can be used to generate ICE messages: - + IceGetHeader IceConn ice_conn @@ -2872,7 +2862,7 @@ library can store data in the message header. -IceGetHeader + is used to set up a message header on an ICE connection. It sets the major and minor opcodes of the message, and initializes the message's length to the length of the header. If additional @@ -2881,7 +2871,7 @@ updated. - + IceGetHeaderExtra IceConn ice_conn @@ -2957,13 +2947,13 @@ in the ICE output buffer, pdata is set to NULL. -IceGetHeaderExtra + is used to generate a message with a fixed (and relatively small) amount of variable length data. The complete message must fit in the ICE output buffer. - + IceSimpleMessage IceConn ice_conn @@ -2994,12 +2984,12 @@ buffer. -IceSimpleMessage + is used to generate a message that is identical in size to the ICE header message, and has no additional data. - + IceErrorHeader IceConn ice_conn @@ -3069,7 +3059,7 @@ Length of data (in 8-byte units) to be written after the header. -IceErrorHeader sets up an error message header. + sets up an error message header. @@ -3115,18 +3105,18 @@ standard for more details. To write data to an ICE connection, use the -IceWriteData macro. If the data fits into the + macro. If the data fits into the ICE output buffer, it is copied there. Otherwise, the ICE output buffer is flushed and the data is directly sent. This macro is used in conjunction with -IceGetHeader and -IceErrorHeader + and + - + IceWriteData IceConn ice_conn @@ -3158,10 +3148,10 @@ This macro is used in conjunction with -To write data as 16-bit quantities, use IceWriteData16 +To write data as 16-bit quantities, use - + IceWriteData16 IceConn ice_conn @@ -3192,11 +3182,11 @@ To write data as 16-bit quantities, use IceWriteData16 -To write data as 32-bit quantities, use IceWriteData32 +To write data as 32-bit quantities, use - + IceWriteData32 IceConn ice_conn @@ -3227,16 +3217,16 @@ To write data as 32-bit quantities, use IceWriteData32 -To write data as 32-bit quantities, use IceWriteData32 +To write data as 32-bit quantities, use To bypass copying data to the ICE output buffer, use -IceSendData to directly send data over the network + to directly send data over the network connection. If necessary, the ICE output buffer is first flushed. - + IceSendData IceConn ice_conn @@ -3268,11 +3258,11 @@ connection. If necessary, the ICE output buffer is first flushed. -To force 32-bit or 64-bit alignment, use IceWritePad +To force 32-bit or 64-bit alignment, use A maximum of 7 pad bytes can be specified. - + IceWritePad IceConn ice_conn @@ -3304,7 +3294,7 @@ A maximum of 7 pad bytes can be specified. - + Reading ICE Messages @@ -3321,10 +3311,10 @@ the data is not already present in the input buffer. To get the size of the ICE input buffer, use -IceGetInBufSize + - + int IceGetInBufSize IceConn ice_conn @@ -3344,16 +3334,15 @@ To get the size of the ICE input buffer, use When reading messages, care must be taken to check for IO errors. If any IO error occurs in reading any part of a message, the message should be thrown out. After using any of the macros described below for reading -messages, the IceValidIO +messages, the macro can be used to check if an IO error occurred on the connection. After an IO error has occurred on an ICE connection, all read operations will be ignored. For further information, see - -. +. - + Bool IceValidIO IceConn ice_conn @@ -3371,7 +3360,7 @@ read operations will be ignored. For further information, see The following macros can be used to read ICE messages. - + IceReadSimpleMessage IceConn ice_conn @@ -3401,11 +3390,11 @@ read operations will be ignored. For further information, see -IceReadSimpleMessage + is used for messages that are identical in size to the 8-byte ICE header, but use the spare 2 bytes in the header to encode additional data. Note that the ICE library always reads in these first 8 bytes, so it can obtain the major -opcode of the message. IceReadSimpleMessage +opcode of the message. simply returns a pointer to these 8 bytes; it does not actually read any data into the input buffer. @@ -3413,16 +3402,16 @@ into the input buffer. For a message with variable length data, there are two ways of reading the message. One method involves reading the complete message in one -pass using IceReadCompleteMessage +pass using The second method involves reading the message header (note that this may be larger than the 8-byte ICE header), then reading the variable length data in chunks (see -IceReadMessageHeader and -IceReadData + and + - + IceReadCompleteMessage IceConn ice_conn @@ -3469,7 +3458,7 @@ This pointer is set to the variable length data of the message. If the ICE input buffer has sufficient space, -IceReadCompleteMessage + will read the complete message into the ICE input buffer. Otherwise, a buffer will be allocated to hold the variable length data. After the call, the pdata argument should @@ -3478,13 +3467,13 @@ to allocate the buffer. -After calling IceReadCompleteMessage -and processing the message, IceDisposeCompleteMessage +After calling +and processing the message, should be called. - + IceDisposeCompleteMessage IceConn ice_conn @@ -3504,7 +3493,7 @@ should be called. The pointer to the variable length data returned in -IceReadCompleteMessage + @@ -3516,7 +3505,7 @@ it did not fit in the ICE input buffer), it is freed here by ICElib. - + IceReadMessageHeader IceConn ice_conn @@ -3553,9 +3542,9 @@ it did not fit in the ICE input buffer), it is freed here by ICElib. -IceReadMessageHeader reads just the message header. + reads just the message header. The rest of the data should be read with the -IceReadData + family of macros. This method of reading a message should be used when the variable length data must be read in chunks. @@ -3563,10 +3552,10 @@ variable length data must be read in chunks. To read data directly into a user supplied buffer, use -IceReadData + - + IceReadData IceConn ice_conn @@ -3598,10 +3587,10 @@ To read data directly into a user supplied buffer, use -To read data as 16-bit quantities, use IceReadData16 +To read data as 16-bit quantities, use - + IceReadData16 IceConn ice_conn @@ -3642,10 +3631,10 @@ If True, the values will be byte swapped. -To read data as 32-bit quantities, use IceReadData32 +To read data as 32-bit quantities, use - + IceReadData32 IceConn ice_conn @@ -3685,10 +3674,10 @@ If True, the values will be byte swapped. To force 32-bit or 64-bit alignment, use -IceReadPad + A maximum of 7 pad bytes can be specified. - + IceReadPad IceConn ice_conn @@ -3714,7 +3703,7 @@ A maximum of 7 pad bytes can be specified. - + Error Handling @@ -3739,10 +3728,10 @@ prefer your own error handling and can be changed as often as you like. -To set the ICE error handler, use IceSetErrorHandler +To set the ICE error handler, use - + IceSetErrorHandler IceConn ice_conn @@ -3762,7 +3751,7 @@ The ICE error handler. You should pass NULL to restore the default handler. -IceSetErrorHandler returns the previous error handler. + returns the previous error handler. @@ -3783,10 +3772,10 @@ should have their own error handlers). -An ICE error handler has the type of IceErrorHandler +An ICE error handler has the type of - + void IceErrorHandler IceConn ice_conn @@ -3877,11 +3866,11 @@ the Inter-Client Exchange Protocol standard. -To handle fatal I/O errors, use IceSetIOErrorHandler +To handle fatal I/O errors, use - + IceIOErrorHandler IceSetIOErrorHandler IceIOErrorHandler handler @@ -3900,16 +3889,16 @@ The I/O error handler. You should pass NULL to restore the default handler. -IceSetIOErrorHandler returns the previous + returns the previous IO error handler. An ICE I/O error handler has the type of -IceIOErrorHandler + - + void IceIOErrorHandler IceConn ice_conn @@ -3931,20 +3920,20 @@ An ICE I/O error handler has the type of In the first, the IO error handler does whatever is necessary to respond to the IO error and then returns, but it does not call -IceCloseConnection + The ICE connection is given a "bad IO" status, and all future reads and writes to the connection are ignored. The next time -IceProcessMessages + is called it will return a status of IceProcessMessagesIOError At that time, the application should call -IceCloseConnection + In the second, the IO error handler does call -IceCloseConnection + and then uses the longjmp call to get back to the application's main event loop. The setjmp and @@ -3959,15 +3948,15 @@ Therefore, this second model is less desirable. Before the application I/O error handler is invoked, protocol libraries that were interested in being notified of I/O errors will have their -IceIOErrorProc + handlers invoked. This handler is set up in the protocol registration -functions (see IceRegisterForProtocolSetup and -IceRegisterForProtocolReply +functions (see and + and could be used to clean up state specific to the protocol. - + void IceIOErrorProc IceConn ice_conn @@ -3982,14 +3971,14 @@ and could be used to clean up state specific to the protocol. -Note that every IceIOErrorProc +Note that every callback must return. This is required because each active protocol must be notified of the broken connection, and the application IO error handler must be invoked afterwards. - + Multi-Threading Support @@ -4019,14 +4008,14 @@ sections of code that access an ICE connection (for example, when generating messages). Two calls, which are generally implemented as macros, are provided: - + void IceLockConn IceConn ice_conn - + void IceUnlockConn IceConn ice_conn @@ -4041,11 +4030,11 @@ macros, are provided: To keep an ICE connection locked across several ICElib calls, applications use -IceAppLockConn + and -IceAppUnlockConn + - + void IceAppLockConn IceConn ice_conn @@ -4061,18 +4050,18 @@ and The -IceAppLockConn + function completely locks out other threads using the connection until -IceAppUnlockConn + is called. Other threads attempting to use ICElib calls on the connection will block. If the program has not previously called IceInitThreads -IceAppLockConn + has no effect. - + void IceAppUnlockConn IceConn ice_conn @@ -4087,17 +4076,17 @@ has no effect. The -IceAppUnlockConn + function allows other threads to complete ICElib calls on the connection that were blocked by a previous call to -IceAppLockConn + from this thread. If the program has not previously called IceInitThreads -IceAppUnlockConn + has no effect. - + Miscellaneous Functions @@ -4112,7 +4101,7 @@ The contents of the scratch space is not guaranteed to be preserved after any ICElib function is called. - + char *IceAllocScratch IceConn ice_conn @@ -4137,7 +4126,7 @@ should not be freed by the caller. The ICE library will free the memory when the ICE connection is closed. - + Acknowledgements @@ -4286,13 +4275,13 @@ This name is statically allocated and should not be freed. To synchronously update the authorization file, the file must be locked with a call to -IceLockAuthFile + This function takes advantage of the fact that the link system call will fail if the name of the new link already exists. - + int IceLockAuthFile char *file_name @@ -4354,10 +4343,10 @@ retries failed. -To unlock an authorization file, use IceUnlockAuthFile +To unlock an authorization file, use - + int IceUnlockAuthFile char *file_name @@ -4376,7 +4365,7 @@ To read the next entry in an authorization file, use IceReadAuthFileEntry - + IceAuthFileEntry *IceReadAuthFileEntry FILE *auth_file @@ -4398,15 +4387,15 @@ or there are no more entries to read, NULL is returned. Entries should be free with a call to -IceFreeAuthFileEntry + To write an entry in an authorization file, use -IceWriteAuthFileEntry + - + Status IceWriteAuthFileEntry FILE *auth_file @@ -4438,7 +4427,7 @@ protocol_name/network_id/auth_name tuple, use IceGetAuthFileEntry - + IceAuthFileEntry *IceGetAuthFileEntry char *protocol_name @@ -4476,10 +4465,10 @@ fails to find such an entry, NULL is returned. To free an entry returned by IceReadAuthFileEntry or IceGetAuthFileEntry use -IceFreeAuthFileEntry + - + void IceFreeAuthFileEntry IceAuthFileEntry *entry @@ -4513,13 +4502,13 @@ magic cookie in the user's .ICEauthority file on a remote machine. In addition to storing the magic cookie in the .ICEauthority file, the application needs to call the -IceSetPaAuthData + function in order to store the magic cookie in memory. When it comes time for the MIT-MAGIC-COOKIE-1 authentication procedure to accept or reject the connection, it will compare the magic cookie presented by the requestor to the magic cookie in memory. - + char *IceGenerateMagicCookie int length @@ -4541,12 +4530,12 @@ Otherwise, the magic cookie should be freed with a call to To store the authentication data in memory, use -IceSetPaAuthData + Currently, this function is only used for MIT-MAGIC-COOKIE-1 authentication, but it may be used for additional authentication methods in the future. - + void IceSetPaAuthData int num_entries -- cgit v1.2.1