Update of /cvsroot/syncml-ctoolkit/toolkit/src/xpt/bindings/common/all In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10631/src/xpt/bindings/common/all Modified Files: digcalc.c digcalc.h global.h md5.h xpt-auth.c xpt-auth.h xpt-b64.c xpt-b64.h xptmutex.h Log Message: Modified comments to doxygen-readable Removed duplicated comments Index: digcalc.h =================================================================== RCS file: /cvsroot/syncml-ctoolkit/toolkit/src/xpt/bindings/common/all/digcalc.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** digcalc.h 6 Aug 2002 21:02:58 -0000 1.1 --- digcalc.h 24 May 2004 01:33:39 -0000 1.2 *************** *** 36,46 **** /* - The following code implements the calculations of H(A1), H(A2), request-digest and response-digest, and a test program which computes the values used in the example of section 3.5. It uses the MD5 implementation from RFC 1321. - - File "digcalc.h": */ --- 36,43 ---- Index: xptmutex.h =================================================================== RCS file: /cvsroot/syncml-ctoolkit/toolkit/src/xpt/bindings/common/all/xptmutex.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** xptmutex.h 6 Aug 2002 21:02:58 -0000 1.1 --- xptmutex.h 24 May 2004 01:33:39 -0000 1.2 *************** *** 1,8 **** ! /*************************************************************************/ ! /* module: SyncML HTTP protocol driver */ ! /* file: src/xpt/bindings/common/all/xptmutex.h */ ! /* target system: all */ ! /* target OS: all */ ! /*************************************************************************/ /* --- 1,9 ---- ! /** ! * @file ! * SyncML HTTP protocol driver ! * ! * @target_system all ! * @target_os all ! */ /* Index: xpt-auth.h =================================================================== RCS file: /cvsroot/syncml-ctoolkit/toolkit/src/xpt/bindings/common/all/xpt-auth.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** xpt-auth.h 6 Aug 2002 21:02:58 -0000 1.1 --- xpt-auth.h 24 May 2004 01:33:39 -0000 1.2 *************** *** 53,56 **** --- 53,57 ---- /* Authentication info, Basic and Digest authentication */ /********************************************************/ + /** required authentication */ typedef enum { *************** *** 58,63 **** AUTH_BASIC = 1, AUTH_DIGEST = 2 ! } HttpAuthenticationType_t; // required authentication ! typedef enum { --- 59,65 ---- AUTH_BASIC = 1, AUTH_DIGEST = 2 ! } HttpAuthenticationType_t; ! ! /** authentication destination */ typedef enum { *************** *** 65,69 **** DEST_SERVER = 1, DEST_PROXY = 2 ! } HttpAuthenticationDest_t; // authentication destination typedef struct --- 67,71 ---- DEST_SERVER = 1, DEST_PROXY = 2 ! } HttpAuthenticationDest_t; typedef struct Index: xpt-b64.h =================================================================== RCS file: /cvsroot/syncml-ctoolkit/toolkit/src/xpt/bindings/common/all/xpt-b64.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** xpt-b64.h 6 Aug 2002 21:02:58 -0000 1.1 --- xpt-b64.h 24 May 2004 01:33:39 -0000 1.2 *************** *** 1,8 **** ! /*************************************************************************/ ! /* module: Communication Services, base64 encoding/decoding fns.*/ ! /* file: /src/xpt/all/xpt-b64.h */ ! /* target system: all */ ! /* target OS: all */ ! /*************************************************************************/ --- 1,11 ---- ! /** ! * @file ! * Communication Services, base64 encoding/decoding fns. ! * ! * @target_system all ! * @target_os all ! * @description function prototypes and return codes ! * for base64 encoding/ decoding functions. ! */ *************** *** 43,52 **** */ - /** - * function prototypes and return codes - * for base64 encoding/ decoding functions. - * - */ - #ifndef XPT_B64_H #define XPT_B64_H --- 46,49 ---- *************** *** 55,122 **** /** ! * FUNCTION: base64GetSize ! * ! * Precalculates the size of an encoded document with the given size ! * ! * PRE-Condition: ! * The function is called to get the size of the document that ! * will be encoded with the base64Encode() service. ! * ! * POST-Condition: ! * ! * IN: cbRealDataSize, the size of the non-encoded document. ! * ! * RETURN: BufferSize_t, the size of the encoded document that will be ! * generated using the base64Encode() service. * */ - BufferSize_t base64GetSize (BufferSize_t cbRealDataSize); /** ! * FUNCTION: base64Encode ! * ! * Encodes a chunk of data according to the base64 encoding rules ! * ! * PRE-Condition: ! * A chunk of data os copied to the source data buffer pbData, and the ! * length of the data chunk is specified in *pcbDataLength; ! * ! * POST-Condition: ! * A block of encoded data is available in the specified target buffer. ! * The length of the encoded data is returned by the function. ! * ! * ! * IN: pbTarget, pointer to an allocated chunk of memory that receives the ! * encoded data block. ! * cbTargetSize, size of the data buffer above. ! * bLast, flag that indicates if the specified block is the last ! * part of the document. If the value is 0, the funciton expects ! * that other blocks will follow, a value of 1 indicates that ! * the data block that is presented in the input buffer is the ! * last data block to be encoded. ! * pbSaveBytes, pointer to a block of at least 3 Bytes. When this function ! * is invoked the first time, the first byte of this buffer MUST ! * be set to 0. ! * IN/OUT: ! * pbData, pointer to a data block that contains the clear data that ! * are to be encoded. On return, the remaining piece of the ! * input data block that could not be encoded is copied to ! * the memory that pbData points at. ! * pcbDataLength, pointer to a variable that denotes the length of ! * the data block that is to be encoded, The function updates ! * this value with the size of the data block that could not ! * be processed. If all data were able to be encoded, the ! * value will be 0. ! * pcbOffset, pointer to a variable that is internally used by the ! * function. before the first call of base64encode() for a ! * certain document is made, the variable that pcbOffset points ! * at must be set to 0. The variable will be updated by the ! * function, and should not be modified by the caller. ! * RETURN: BufferSize_t, the size of the data block that are available in ! * pbTarget. * */ - BufferSize_t base64Encode (DataBuffer_t pbTarget, BufferSize_t cbTargetSize, --- 52,103 ---- /** ! * Precalculates the size of an encoded document with the given size * + * @pre The function is called to get the size of the document that + * will be encoded with the base64Encode() service. + * @param cbRealDataSize (IN) + * the size of the non-encoded document. + * @return the size of the encoded document that will be generated + * using the base64Encode() service. */ BufferSize_t base64GetSize (BufferSize_t cbRealDataSize); /** ! * Encodes a chunk of data according to the base64 encoding rules * + * @pre A chunk of data os copied to the source data buffer pbData, and the + * length of the data chunk is specified in *pcbDataLength; + * @post A block of encoded data is available in the specified target buffer. + * The length of the encoded data is returned by the function. + * @param pbTarget (IN) + * pointer to an allocated chunk of memory that receives the + * encoded data block. + * @param cbTargetSize (IN) + * size of the data buffer above. + * @param bLast (IN) + * flag that indicates if the specified block is the last part of the + * document. If the value is 0, the funciton expects that other blocks + * will follow, a value of 1 indicates that the data block that is + * presented in the input buffer is the last data block to be encoded. + * @param pbSavebytes (IN) + * pointer to a block of at least 3 Bytes. When this function is invoked + * the first time, the first byte of this buffer MUST be set to 0. + * @param pbData (IN/OUT) + * pointer to a data block that contains the clear data that are to be + * encoded. On return, the remaining piece of the input data block that + * could not be encoded is copied to the memory that pbData points at. + * @param pcbDataLength (IN/OUT) + * pointer to a variable that denotes the length of the data block + * that is to be encoded, The function updates this value + * with the size of the data block that could not be processed. + * If all data were able to be encoded, the value will be 0. + * @param pcbOffset (IN/OUT) + * pointer to a variable that is internally used by the function. + * before the first call of base64encode() for a certain document is + * made, the variable that pcbOffset points at must be set to 0. + * The variable will be updated by the function, and should not be + * modified by the caller. + * @return the size of the data block that are available in pbTarget. */ BufferSize_t base64Encode (DataBuffer_t pbTarget, BufferSize_t cbTargetSize, *************** *** 127,164 **** unsigned char *pbSavebytes); /** ! * FUNCTION: base64Decode ! * ! * Decodes a chunk of data according to the base64 encoding rules ! * ! * PRE-Condition: ! * A chunk of data os copied to the source data buffer pbData, and the ! * length of the data chunk is specified in *pcbDataLength; ! * ! * POST-Condition: ! * A block of decoded data is available in the specified target buffer. ! * The length of the decoded data is returned by the function. ! * ! * ! * IN: pbTarget, pointer to an allocated chunk of memory that receives the ! * decoded data block. ! * cbTargetSize, size of the data buffer above. ! * IN/OUT: ! * pbData, pointer to a data block that contains the clear data that ! * are to be decoded. On return, the remaining piece of the ! * input data block that could not be decoded is copied to ! * the memory that pbData points at. ! * pcbDataLength, pointer to a variable that denotes the length of ! * the data block that is to be decoded, The function updates ! * this value with the size of the data block that could not ! * be processed. If all data were able to be decoded, the ! * value will be 0. ! * RETURN: BufferSize_t, the size of the data block that are available in ! * pbTarget. If some invalid data were detected in the input ! * data buffer, or if cbTargetSize is less than 3, ! * the function returns 0. The caller should treat this as an ! * error condition. * */ - BufferSize_t base64Decode (DataBuffer_t pbTarget, BufferSize_t cbTargetSize, --- 108,137 ---- unsigned char *pbSavebytes); /** ! * Decodes a chunk of data according to the base64 encoding rules * + * @pre A chunk of data os copied to the source data buffer pbData, and the + * length of the data chunk is specified in *pcbDataLength; + * @post A block of decoded data is available in the specified target buffer. + * The length of the decoded data is returned by the function. + * @param pbTarget (IN) + * pointer to an allocated chunk of memory + * that receives the decoded data block. + * @param cbTargetSize (IN) + * size of the data buffer above. + * @param pbData (IN/OUT) + * pointer to a data block that contains the clear data that are to be + * decoded. On return, the remaining piece of the input data block + * that could not be decoded is copied to the memory + * that pbData points at. + * @param pcbDataLength (IN/OUT) + * pointer to a variable that denotes the length of the data block + * that is to be decoded, The function updates this value with + * the size of the data block that could not be processed. + * If all data were able to be decoded, the value will be 0. + * @return the size of the data block that are available in pbTarget. + * If some invalid data were detected in the input data buffer, + * or if cbTargetSize is less than 3, the function returns 0. + * The caller should treat this as an error condition. */ BufferSize_t base64Decode (DataBuffer_t pbTarget, BufferSize_t cbTargetSize, *************** *** 168,169 **** --- 141,143 ---- #endif + Index: xpt-auth.c =================================================================== RCS file: /cvsroot/syncml-ctoolkit/toolkit/src/xpt/bindings/common/all/xpt-auth.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** xpt-auth.c 7 Apr 2004 06:51:06 -0000 1.3 --- xpt-auth.c 24 May 2004 01:33:39 -0000 1.4 *************** *** 46,75 **** typedef struct _HttpDigest { ! int cbSize; // size of this structure ! HttpAuthenticationType_t fType; // type of authorization, set by server ! HttpAuthenticationDest_t fDest; // destination: server or proxy? ! char achUser [MAX_USER_SIZE]; // user name ! char achPassword [MAX_PWD_SIZE]; // Password ! char achDigest [MAX_DIGEST_SIZE];// digest value ! char achRealm [MAX_REALM_SIZE]; // server realm value, set by server ! Bool_t bStale; // stale flag ! char achCNonce [MAX_CNONCE_SIZE];// Client Nonce. ! char achNonce [MAX_NONCE_SIZE]; // nonce value, ! char achQOp [MAX_QOP_SIZE]; // selected algorithm ! char achNC [MAX_NC_SIZE]; // incremented after each HTTP message. ! char achOpaque [MAX_OPAQUE_SIZE];// opaque value, set by server ! char achDomain [MAX_DOMAIN_SIZE];// domain Info } HttpDigest_t, *HttpDigestPtr_t; ! /***********************/ ! /* Authentication Info */ ! /***********************/ typedef struct { ! int rfu; // not used. ! int cbCount; // # of authentication structures ! HttpDigestPtr_t digest [1]; // array of digest structures } HttpAuthentication_t; --- 46,75 ---- typedef struct _HttpDigest { ! int cbSize; /**< size of this structure */ ! HttpAuthenticationType_t fType; /**< type of authorization, set by server */ ! HttpAuthenticationDest_t fDest; /**< destination: server or proxy? */ ! char achUser [MAX_USER_SIZE]; /**< user name */ ! char achPassword [MAX_PWD_SIZE]; /**< Password */ ! char achDigest [MAX_DIGEST_SIZE];/**< digest value */ ! char achRealm [MAX_REALM_SIZE]; /**< server realm value, set by server */ ! Bool_t bStale; /**< stale flag */ ! char achCNonce [MAX_CNONCE_SIZE];/**< Client Nonce. */ ! char achNonce [MAX_NONCE_SIZE]; /**< nonce value, */ ! char achQOp [MAX_QOP_SIZE]; /**< selected algorithm */ ! char achNC [MAX_NC_SIZE]; /**< incremented after each HTTP message. */ ! char achOpaque [MAX_OPAQUE_SIZE];/**< opaque value, set by server */ ! char achDomain [MAX_DOMAIN_SIZE];/**< domain Info */ } HttpDigest_t, *HttpDigestPtr_t; ! /** ! * Authentication Info ! */ typedef struct { ! int rfu; /**< not used. */ ! int cbCount; /**< # of authentication structures */ ! HttpDigestPtr_t digest [1]; /**< array of digest structures */ } HttpAuthentication_t; Index: digcalc.c =================================================================== RCS file: /cvsroot/syncml-ctoolkit/toolkit/src/xpt/bindings/common/all/digcalc.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** digcalc.c 2 May 2003 22:05:09 -0000 1.2 --- digcalc.c 24 May 2004 01:33:39 -0000 1.3 *************** *** 36,47 **** /* - The following code implements the calculations of H(A1), H(A2), request-digest and response-digest, and a test program which computes the values used in the example of section 3.5. It uses the MD5 implementation from RFC 1321. - - - File "digcalc.c": */ --- 36,43 ---- Index: global.h =================================================================== RCS file: /cvsroot/syncml-ctoolkit/toolkit/src/xpt/bindings/common/all/global.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** global.h 6 Aug 2002 21:02:58 -0000 1.1 --- global.h 24 May 2004 01:33:39 -0000 1.2 *************** *** 1,2 **** --- 1,10 ---- + /** + * @file + * RSAREF Types and Constants Definition + * + * @target_system all + * @target_os all + */ + /* * Copyright Notice *************** *** 36,42 **** - /* GLOBAL.H - RSAREF types and constants - */ - /* PROTOTYPES should be set to one if and only if the compiler supports function argument prototyping. --- 44,47 ---- Index: md5.h =================================================================== RCS file: /cvsroot/syncml-ctoolkit/toolkit/src/xpt/bindings/common/all/md5.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** md5.h 6 Aug 2002 21:02:58 -0000 1.1 --- md5.h 24 May 2004 01:33:39 -0000 1.2 *************** *** 60,68 **** */ ! /* MD5 context. */ typedef struct { ! UINT4 state[4]; /* state (ABCD) */ ! UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ ! unsigned char buffer[64]; /* input buffer */ } MD5_CTX; --- 60,68 ---- */ ! /** MD5 context. */ typedef struct { ! UINT4 state[4]; /**< state (ABCD) */ ! UINT4 count[2]; /**< number of bits, modulo 2^64 (lsb first) */ ! unsigned char buffer[64]; /**< input buffer */ } MD5_CTX; Index: xpt-b64.c =================================================================== RCS file: /cvsroot/syncml-ctoolkit/toolkit/src/xpt/bindings/common/all/xpt-b64.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** xpt-b64.c 2 May 2003 22:05:09 -0000 1.2 --- xpt-b64.c 24 May 2004 01:33:39 -0000 1.3 *************** *** 1,9 **** ! ! /*************************************************************************/ ! /* module: Communication Services, base64 encoding/decoding fns.*/ ! /* file: src/xpt/all/xpt-b64.c */ ! /* target system: all */ ! /* target OS: all */ ! /*************************************************************************/ --- 1,9 ---- ! /** ! * @file ! * Communication Services, base64 encoding/decoding fns. ! * ! * @target_system all ! * @target_os all ! */ |