/* * Copyright (c) 2024 Real-Time Innovations, Inc. All rights reserved. * No duplications, whole or partial, manual or electronic, may be made * without express written permission. Any such copies, or revisions thereof, * must display this notice unaltered. * This code contains trade secrets of Real-Time Innovations, Inc. */ #ifndef mig_rtpsTrust_h #define mig_rtpsTrust_h #ifndef osapi_type_h #include "osapi/osapi_type.h" #endif #ifndef cdr_type_h #include "cdr/cdr_type.h" #endif #ifndef mig_dll_h #include "mig/mig_dll.h" #endif #ifndef mig_rtps_h #include "mig/mig_rtps.h" #endif #ifndef mig_interpreter_h #include "mig/mig_interpreter.h" #endif #define MIG_RTPS_INTERCEPTOR_TRANSFORM_PREFIX_SIZE 4 #ifdef __cplusplus extern "C" { #endif /* * The prefix is the 4-byte transformation kind. It is composed of: * - Three bytes of transformation_context. This can be used for the * KeyRevisionId, which indicates the specific revision of the TransformKeyId. * - One byte of transformation_algorithm id. * * TransformKind is not redundant because pre-shared key doesn't have the * InterceptorState. */ typedef RTICdrOctet MIGRtpsInterceptorTransformPrefix [MIG_RTPS_INTERCEPTOR_TRANSFORM_PREFIX_SIZE]; typedef RTICdrOctet MIGRtpsInterceptorTransformKeyId[4]; struct MIGRtpsInterceptorTransformIdentifier { MIGRtpsInterceptorTransformPrefix transformation_prefix; MIGRtpsInterceptorTransformKeyId transformation_key_id; }; extern MIGDllExport RTIBool MIGRtpsTrustSubmessage_serializePrefix( struct REDABuffer *buffer, struct REDABuffer *pluginSpecificHeader, MIGRtpsSubmessageFlag submessageFlags, RTI_UINT32 keyRevision, RTI_UINT8 transformKind, const MIGRtpsInterceptorTransformKeyId transformKeyId, RTI_INT32 pluginSpecificHeaderLength, RTICdrBoolean isRtpsMessage); extern MIGDllExport RTIBool MIGRtpsTrustSubmessage_serializePostfix( struct REDABuffer *buffer, struct REDABuffer *pluginTag, int pluginTagLength, RTICdrBoolean isRtpsMessage); extern MIGDllExport RTIBool MIGRtpsTrustSubmessage_serializeBody( struct REDABuffer *buffer, struct REDABuffer *pluginDataBody, int pluginDataBodyLength); extern MIGDllExport int MIGRtpsTrustSubmessage_deserializeSubMsgHeader( MIGRtpsSubmessageId *submessageId, MIGRtpsSubmessageFlag *submessageFlags, RTI_UINT16 *submessagePayloadLength, const struct REDABuffer *bufferIn); extern MIGDllExport int MIGRtpsTrustSubmessage_deserializePrefix( struct MIGRtpsInterceptorTransformIdentifier *transformId, MIGRtpsSubmessageFlag *flags, struct REDABuffer *pluginSpecificHeader, const struct REDABuffer *bufferIn, RTICdrBoolean isRtpsMessage); extern MIGDllExport int MIGRtpsTrustSubmessage_deserializePostfix( struct REDABuffer *pluginTag, const struct REDABuffer *bufferIn, RTICdrBoolean isRtpsMessage); extern MIGDllExport int MIGRtpsTrustSubmessage_skipToSubmessage( struct REDABuffer *bufferOut, const struct REDABuffer *bufferIn, MIGRtpsSubmessageId requestedSubmessageId); extern MIGDllExport int MIGRtpsTrustSubmessage_deserializeBody( struct REDABuffer *pluginData, const struct REDABuffer *bufferIn); extern MIGDllExport int MIGRtpsTrustSubmessage_serializeInfoSrcFromRtpsBuffer( char *buffer, char *rtpsBuffer); extern MIGDllExport RTICdrBoolean MIGRtpsTrustSubmessage_validateInfoSrc(char *buffer, char *rtpsBuffer); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* mig_rtpsTrust_h */