RTI Connext DDS Micro  Version 2.4.8
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cdr_md5.h
1 /*
2  * FILE: cdr_md5.h MD5 hash
3  *
4  * (c) Copyright, Real-Time Innovations, 2013-2015.
5  * All rights reserved.
6  *
7  * No duplications, whole or partial, manual or electronic, may be made
8  * without express written permission. Any such copies, or
9  * revisions thereof, must display this notice unaltered.
10  * This code contains trade secrets of Real-Time Innovations, Inc.
11  *
12  * Modification History
13  * --------------------
14  * 15sep2014,eh Updated documentation
15  */
16 
17 /*ci
18  * \file
19  * \defgroup CDRMD5Class CDR md5
20  * \ingroup CDRModule
21  * \brief MD5 hash of a CDR stream
22  *
23  * \details
24  * Compute an MD5 hash on the contents of a CDR stream.
25  */
26 
27 /*ci \addtogroup CDRMD5Class
28  * @{
29  */
30 
31 #ifndef cdr_md5_h
32 #define cdr_md5_h
33 
34 
35 
36 #ifndef cdr_dll_h
37 #include "cdr/cdr_dll.h"
38 #endif
39 #ifndef cdr_stream_h
40 #include "cdr/cdr_stream.h"
41 #endif
42 #ifndef osapi_types_h
43 #include "osapi/osapi_types.h"
44 #endif
45 
46 #ifdef __cplusplus
47 extern "C"
48 {
49 #endif
50 
51 /*ci
52  *\brief
53  * Compute the MD5 hash of a stream's buffer
54  *
55  *\details
56  * This function is used to compute the hash for keyed IDL data-types.
57  * The use of the MD5 algorithm is mandated by document
58  * "Real-time Publish-Subscribe Wire Protocol DDS Interoperability
59  * Wire Protocol" (OMG, formal/2009-01-05).
60  *
61  * This operation computes the MD5 of a CDR_Stream_t and stores the result in
62  * the specified output buffer.
63  * Arguments are assumed to be valid; verification of their validity is left up
64  * to the invoking context.
65  * The input CDR_Stream_t must have an allocated buffer (me->buffer != NULL)
66  * with some data to be hashed (as determined by a return value > 0 from
67  * CDR_Stream_GetCurrentPositionOffset).
68  * The specified output must point to a buffer of at least 16 bytes, in order
69  * to be able to store the result of the hashing.
70  *
71  * NOTE: this function is used only by PluginHelper_instance_to_keyhash; this
72  * is the default implementation of a FooTypePlugin's instance_to_keyhash;
73  * instance_to_keyhash is invoked only by the DataWriter and DataReader
74  * implementations, which use a dedicated internal CDR_Stream_t (md5_stream),
75  * always reset before being passed to instance_to_keyhash, and a stack-
76  * allocated DDS_KeyHash_t to store the output; PluginHelper_instance_to_keyhash
77  * first writes the serialized key to the CDR_Stream_t and then possibly uses
78  * NDDSCDR_Stream_computeMD5 to store its hash if the length exceeds
79  * RTPS_KEY_HASH_MAX_LENGTH (16 bytes)
80  *
81  * \param[in] me Stream
82  * \param[out] out Computed MD5 hash
83  *
84  */
85 CDRDllExport void
86 NDDSCDR_Stream_compute_MD5(struct CDR_Stream_t *me,RTI_UINT8 * out);
87 
88 #ifdef __cplusplus
89 } /* end extern "C" */
90 #endif
91 
92 
93 #endif /* cdr_md5_h */
94 
95 /*ci @} */

RTI Connext DDS Micro Version 2.4.8 Copyright © Tue Apr 12 2016 Real-Time Innovations, Inc